glance.common.rpc module¶
RPC Controller
-
class
glance.common.rpc.
Controller
(raise_exc=False)[source]¶ Bases:
object
Base RPCController.
This is the base controller for RPC based APIs. Commands handled by this controller respect the following form:
[{ 'command': 'method_name', 'kwargs': {...} }]
The controller is capable of processing more than one command per request and will always return a list of results.
Parameters: raise_exc (bool) – Specifies whether to raise exceptions instead of “serializing” them. -
register
(resource, filtered=None, excluded=None, refiner=None)[source]¶ Exports methods through the RPC Api.
Parameters: - resource – Resource’s instance to register.
- filtered – List of methods that can be registered. Read as “Method must be in this list”.
- excluded – List of methods to exclude.
- refiner – Callable to use as filter for methods.
Raises: TypeError – If refiner is not callable.
-
-
class
glance.common.rpc.
RPCClient
(*args, **kwargs)[source]¶