Registries
ResourceNodeRegistry
find_custom_class_for_resource_node(service_name, node_name)
Try to find the ResourceNode's custom subclasses registered under the Service.
Returns:
Type | Description |
---|---|
Union[ResourceNode, bool]
|
Union["ResourceNode", bool] : False if no custom class is found, else the custom class |
register_class(cls, service_name=None, name=None)
Register a subclass of ResourceNode with the given service_name
and name
.
When a ResourceNode object is created, registered classes will be selected as the
ResourceNode class. This allows overriding ability to each service/resource.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cls |
ResourceNode
|
A subclass of ResourceNode |
required |
service_name |
str
|
ServiceNode name, must be provided. Defaults to None. |
None
|
name |
str
|
ResourceNode name, must be provided. Defaults to None. |
None
|
search_registry_for_service(service_name)
Returns services registered custom ResourceNode subclasses.
Returns:
Type | Description |
---|---|
Dict[str, ResourceNode]
|
Dict[str, 'ResourceNode']: ResourceNode name to custom Subclasses mapping for the service. |