ironic_lib.json_rpc package

Submodules

ironic_lib.json_rpc.client module

A simple JSON RPC client.

This client is compatible with any JSON RPC 2.0 implementation, including ours.

class ironic_lib.json_rpc.client.Client(serializer, version_cap=None)[source]

Bases: object

JSON RPC client with ironic exception handling.

allowed_exception_namespaces = ['ironic_lib.exception.', 'ironic.common.exception.', 'ironic_inspector.utils.']
can_send_version(version)[source]
prepare(topic, version=None)[source]

Prepare the client to transmit a request.

Parameters:
  • topic – Topic which is being addressed. Typically this is the hostname of the remote json-rpc service.

  • version – The RPC API version to utilize.

ironic_lib.json_rpc.server module

Implementation of JSON RPC for communication between API and conductors.

This module implementa a subset of JSON RPC 2.0 as defined in https://www.jsonrpc.org/specification. Main differences: * No support for batched requests. * No support for positional arguments passing. * No JSON RPC 1.0 fallback.

class ironic_lib.json_rpc.server.EmptyContext(src)[source]

Bases: object

request_id = None
to_dict()[source]
exception ironic_lib.json_rpc.server.InvalidParams(message=None, **kwargs)[source]

Bases: JsonRpcError

code = -32602
exception ironic_lib.json_rpc.server.InvalidRequest(message=None, **kwargs)[source]

Bases: JsonRpcError

code = -32600
exception ironic_lib.json_rpc.server.JsonRpcError(message=None, **kwargs)[source]

Bases: IronicException

exception ironic_lib.json_rpc.server.MethodNotFound(message=None, **kwargs)[source]

Bases: JsonRpcError

code = -32601
exception ironic_lib.json_rpc.server.ParseError(message=None, **kwargs)[source]

Bases: JsonRpcError

code = -32700
class ironic_lib.json_rpc.server.WSGIService(manager, serializer, context_class=<class 'ironic_lib.json_rpc.server.EmptyContext'>)[source]

Bases: Service

Provides ability to launch JSON RPC as a WSGI application.

reset()[source]

Reset server greenpool size to default.

Returns:

None

start()[source]

Start serving this service using loaded configuration.

Returns:

None

stop()[source]

Stop serving this API.

Returns:

None

wait()[source]

Wait for the service to stop serving this API.

Returns:

None

Module contents

ironic_lib.json_rpc.auth_strategy()[source]
ironic_lib.json_rpc.list_opts()[source]
ironic_lib.json_rpc.register_opts(conf)[source]