crossbar.worker.router¶
Classes¶
A native Crossbar.io worker that runs a WAMP router which can manage |
Module Contents¶
- class RouterController(config=None, reactor=None, personality=None)[source]¶
Bases:
crossbar.worker.transport.TransportControllerA native Crossbar.io worker that runs a WAMP router which can manage multiple realms, run multiple transports and links, as well as host multiple (embedded) application components.
- components: Dict[str, crossbar.worker.types.RouterComponent][source]¶
- get_router_component(component_id, details=None)[source]¶
Get details about a router component
- Parameters:
component_id (str) – The ID of the component to get
details (
autobahn.wamp.types.CallDetails) – Call details.
- Returns:
Details of component
- Return type:
- get_router_components(details=None)[source]¶
Get app components currently running in this router worker.
- Parameters:
details (
autobahn.wamp.types.CallDetails) – Call details.- Returns:
List of app components currently running.
- Return type:
- get_router_realm(realm_id, details=None)[source]¶
Return realm detail information.
- Parameters:
realm_id (str) – Realm ID within router worker.
details (
autobahn.wamp.types.CallDetails) – Call details.
- Returns:
realm information object
- Return type:
- get_router_realm_by_name(realm_name, details=None)[source]¶
Return realm detail information.
- Parameters:
realm_name (str) – Realm name.
details (
autobahn.wamp.types.CallDetails) – Call details.
- Returns:
realm information object
- Return type:
- get_router_realm_links(realm_id, details=None)[source]¶
Returns the currently running routing links to remote router realms.
- get_router_realm_role(realm_id, role_id, details=None)[source]¶
Return role detail information.
- Parameters:
realm_id (str) – The ID of the realm to get a role for.
role_id (str) – The ID of the role to get.
details (
autobahn.wamp.types.CallDetails) – Call details.
- Returns:
role information object
- Return type:
- get_router_realm_roles(realm_id, details=None)[source]¶
Get roles currently running on a realm running on this router worker.
- Parameters:
realm_id (str) – The ID of the realm to list roles for.
details (
autobahn.wamp.types.CallDetails) – Call details.
- Returns:
A list of roles.
- Return type:
- get_router_realm_stats(realm_id=None, details=None)[source]¶
Return realm messaging statistics.
- Parameters:
details (
autobahn.wamp.types.CallDetails) – Call details.- Returns:
realm statistics object
- Return type:
- get_router_realms(details=None)[source]¶
Get realms currently running on this router worker.
- Parameters:
details (
autobahn.wamp.types.CallDetails) – Call details.- Returns:
List of realms currently running.
- Return type:
- get_router_transport(transport_id, details=None)[source]¶
Get transports currently running in this router worker.
- Parameters:
details (
autobahn.wamp.types.CallDetails) – Call details.- Returns:
List of transports currently running.
- Return type:
- get_router_transports(details=None)[source]¶
Get transports currently running in this router worker.
- Parameters:
details (
autobahn.wamp.types.CallDetails) – Call details.- Returns:
List of transports currently running.
- Return type:
- has_role(realm: str, authrole: str) bool[source]¶
Check if a role with the given name is currently running in the given realm.
- onJoin(details, publish_ready=True)[source]¶
Called when worker process has joined the node’s management realm.
- onLeave(details)[source]¶
Implements
autobahn.wamp.interfaces.ISession.onLeave()
- realms: Dict[str, crossbar.worker.types.RouterRealm][source]¶
- property router_factory[source]¶
The router factory used for producing (per-realm) routers.
- Type:
return
- property router_session_factory[source]¶
The router session factory for producing router sessions.
- Type:
return
- start_router_component(component_id, config, details=None)[source]¶
Start an app component in this router worker.
- Parameters:
component_id (str) – The ID of the component to start.
config (dict) – The component configuration.
details (
autobahn.wamp.types.CallDetails) – Call details.
- start_router_realm(realm_id, realm_config, details=None)[source]¶
Starts a realm on this router worker. The minimum configuration must contain the realm name:
{ "name": "realm1" }
The configuration can also configure one or more roles, including configuration of role permissions:
{ "name": "realm1", "roles": [{ "name": "anonymous", "permissions": [{ "uri": "", "match": "prefix", "allow": { "call": True, "register": True, "publish": True, "subscribe": True }, "disclose": { "caller": True, "publisher": True }, "cache": True }] }] }
- Parameters:
realm_id (str) – The ID of the realm to start.
realm_config (dict) – The realm configuration.
details (
autobahn.wamp.types.CallDetails) – Call details.
- start_router_realm_link(realm_id, link_id, link_config, details=None)[source]¶
Start a new router link to a remote router on a (local) realm.
The link configuration (
link_config) must include the transport definition to the remote router. Here is an example:{ "realm": "realm1", "transport": { "type": "websocket", "endpoint": { "type": "tcp", "host": "localhost", "port": 8002 }, "url": "ws://localhost:8002/ws" } }
- start_router_realm_role(realm_id, role_id, role_config, details=None)[source]¶
Start a role on a realm running on this router worker.
- Parameters:
id (str) – The ID of the realm the role should be started on.
role_id (str) – The ID of the role to start under.
config (dict) – The role configuration.
details (
autobahn.wamp.types.CallDetails) – Call details.
- start_router_transport(transport_id, config, create_paths=False, details=None)[source]¶
Start a transport on this router worker.
- Parameters:
transport_id (str) – The ID of the transport to start.
config (dict) – The transport configuration.
create_paths (bool) – If set, start subservices defined in the configuration too. This currently only applies to Web services, which are part of a Web transport.
details (
autobahn.wamp.types.CallDetails) – Call details.
- stop_router_component(component_id, details=None)[source]¶
Stop an app component currently running in this router worker.
- Parameters:
component_id (str) – The ID of the component to stop.
details (
autobahn.wamp.types.CallDetails) – Call details.
- stop_router_realm(realm_id, details=None)[source]¶
Stop a realm currently running on this router worker.
When a realm has stopped, no new session will be allowed to attach to the realm. Optionally, close all sessions currently attached to the realm.
- Parameters:
id (str) – ID of the realm to stop.
details (
autobahn.wamp.types.CallDetails) – Call details.
- stop_router_realm_link(realm_id, link_id, details=None)[source]¶
Stop a currently running router link.
- stop_router_realm_role(realm_id, role_id, details=None)[source]¶
Stop a role currently running on a realm running on this router worker.
- Parameters:
realm_id (str) – The ID of the realm of the role to be stopped.
role_id (str) – The ID of the role to be stopped.
details (
autobahn.wamp.types.CallDetails) – Call details.
- stop_router_transport(transport_id, details=None)[source]¶
Stop a transport currently running in this router worker.
- Parameters:
transport_id (str) – The ID of the transport to stop.
details (
autobahn.wamp.types.CallDetails) – Call details.
- transports: Dict[str, crossbar.worker.transport.RouterTransport][source]¶