crossbar.master.mrealm¶
Submodules¶
Classes¶
Backend of user created management realms. |
Package Contents¶
- class MrealmController(config=None)[source]¶
Bases:
autobahn.twisted.wamp.ApplicationSessionBackend of user created management realms.
When a management realm is created, one instance of this component is started. This management realm component is then running continuously during the lifetime of the management realm.
- _arealm_manager¶
- _check_and_apply_in_progress = False¶
- _check_and_apply_loop = None¶
- _metadata_manager¶
- _mrealm_oid¶
- _node_oid_by_name = None¶
- _nodes = None¶
- async _on_node_heartbeat(node_authid, heartbeat, details: autobahn.wamp.types.CallDetails | None = None)[source]¶
- Receive heartbeats from CF nodes managed by this CFC instances. By default,
CF nodes will send one hearbeat every 10 seconds.
- Parameters:
node_authid (str) – The node WAMP auth ID.
heartbeat (dict) – Node heartbeat.
details (
autobahn.wamp.types.EventDetails) – Event details.
- async _on_node_ready(ready_info=None, details: autobahn.wamp.types.CallDetails | None = None)[source]¶
- async _on_node_shutdown(shutdown_info, details: autobahn.wamp.types.CallDetails | None = None)[source]¶
- async _on_session_shutdown(session_id, details: autobahn.wamp.types.CallDetails | None = None)[source]¶
- async _on_session_startup(session, details: autobahn.wamp.types.CallDetails | None = None)[source]¶
- async _on_worker_heartbeat(node_authid, worker_id, heartbeat, details: autobahn.wamp.types.CallDetails | None = None)[source]¶
- Receive heartbeats from workers run on CF nodes managed by this CFC instances. By default,
CF node workers will send one hearbeat every 10 seconds.
- Parameters:
node_authid (str) – The node ID (UUID in the master database).
worker_id (str) – The local worker ID on the remote CF node (_not_ the UUID of the worker in the master database)
heartbeat (dict) – Node heartbeat.
details (
autobahn.wamp.types.EventDetails) – Event details.
- _release_pubkey_hex¶
- _routercluster_manager¶
- _sessions = None¶
- _tick_loop = None¶
- _traces = None¶
- _uri_prefix = 'crossbarfabriccenter.mrealm.'¶
- _webcluster_manager¶
- create_trace(trace_id: str, traced_workers: List[Tuple[str, str]], trace_options: Dict | None = None, eligible_reader_roles: List[str] | None = None, exclude_reader_roles: List[str] | None = None, details: autobahn.wamp.types.CallDetails | None = None) dict[source]¶
Create a new trace.
- Parameters:
trace_id – The ID of the trace to create (must be unique within the management realm).
traced_workers – A list of pairs (node_id, worker_id) with node and (router) worker IDs on which the trace is to be run.
trace_options – Tracing options for the trace.
eligible_reader_roles – If given, allow read access to the trace only for callers authenticated under a WAMP authrole FROM this list - otherwise allow any role (=public)!
exclude_reader_roles – If given, allow read access to the trace only for callers authenticated under a WAMP authrole NOT FROM this list - otherwise allow any role (=public)!
- Returns:
Trace started information.
- db¶
- delete_trace(trace_id: str, details: autobahn.wamp.types.CallDetails | None = None) dict[source]¶
Delete a previously created (and currently stopped) trace.
- Parameters:
trace_id – The ID of the trace to delete.
- Returns:
Trace deletion information.
- gdb¶
- get_node(node_oid: str, details: autobahn.wamp.types.CallDetails | None = None) dict[source]¶
Return information about node. The procedure will raise an crossbar.error.no_such_object error when no node with the given authid can be found.
- Parameters:
node_oid – The object ID of the node to get information for, eg “5616c7cc-31b5-4021-8cd9-b7769d3f0dd3”.
- Returns:
Node information object.
- get_node_by_authid(node_authid: str, details: autobahn.wamp.types.CallDetails | None = None) dict[source]¶
Return node information by node (auth)id. The procedure will raise an crossbar.error.no_such_object error when no node with the given authid can be found.
- Parameters:
node_authid – The WAMP authid the node is authenticated under.
- Returns:
Node information object.
- get_nodes(status: str | None = None, return_names: bool | None = None, details: autobahn.wamp.types.CallDetails | None = None) List[str][source]¶
Returns list of nodes.
- Parameters:
status – Filter nodes for this status (
"online","offline").return_names – Return node names (
authid) instead of object IDs.
- Returns:
List of node IDs or node names.
- get_status(details: autobahn.wamp.types.CallDetails | None = None) dict[source]¶
Get management realm status.
- Returns:
Status information object.
- get_trace(trace_id: str, details: autobahn.wamp.types.CallDetails | None = None) dict | None[source]¶
Get detail information about a previously created trace. When the trace doesn’t exist, None is returned.
Note: The trace information is only returned when the caller has read-access (at least), otherwise None is returned (silently).
- Parameters:
trace_id – The ID of the trace to retrieve information for.
- Returns:
A trace information object.
- get_trace_data(trace_id: str, limit: int | None = None, details: autobahn.wamp.types.CallDetails | None = None) twisted.internet.defer.Deferred[source]¶
- get_traces(details: autobahn.wamp.types.CallDetails | None = None) List[str][source]¶
Get IDs of trace defined.
Note: Only IDs of traces to which the caller has read-access (at least) are returned.
- Returns:
List of trace IDs.
- gschema: cfxdb.globalschema.GlobalSchema¶
- log¶
- map_node_oid_to_authid(node_oid)[source]¶
Map node object ID to node authid. This referes to any node for which there is a run-time representation currently active, regardless of whether this node is currently online or not.
- Parameters:
node_oid
- Returns:
- node(node_authid)[source]¶
Get node by node authid (rather than oid).
- Parameters:
node_authid
- Returns:
- property nodes¶
Returns handle to map of currently connected nodes. The map is indexed by
node_id.- Returns:
Map of node object ID to
crossbar.master.mrealm.controller.Node- Return type:
- onJoin(details)[source]¶
Implements
autobahn.wamp.interfaces.ISession.onJoin()
- onLeave(details)[source]¶
Implements
autobahn.wamp.interfaces.ISession.onLeave()
- schema¶
- start_trace(trace_id: str, details: autobahn.wamp.types.CallDetails | None = None) twisted.internet.defer.Deferred[source]¶
Start a previously created trace.
- Parameters:
trace_id (str) – The ID of the trace to start.
- Returns:
dict: Trace started information.
- stop_trace(trace_id: str, details: autobahn.wamp.types.CallDetails | None = None) twisted.internet.defer.Deferred[source]¶
Stop a running trace.
- Parameters:
trace_id – The ID of the trace to stop.
- Returns:
Trace stopped information.