viam.resource.rpc_service_base
Classes
Base RPC service for a resource. |
Module Contents
- class viam.resource.rpc_service_base.ResourceRPCServiceBase(manager: viam.resource.manager.ResourceManager)[source]
Bases:
abc.ABC
,viam.rpc.types.RPCServiceBase
,Generic
[viam.resource.manager.ResourceType
]Base RPC service for a resource. All resource RPC services must inherit from this class.
- RESOURCE_TYPE
- get_resource(name: str) viam.resource.manager.ResourceType [source]
Return the resource with the given name if it exists in the registry. If the resource does not exist in the registry, this function will raise an error
- Parameters:
name (str) – Name of the resource
- Raises:
GRPCError with the status code Status.NOT_FOUND –
- Returns:
The resource
- Return type:
ResourceType