Previous
Base remote control
The discovery service API allows you to get a list of resources available to configure on a machine based on the hardware that is connected to or part of the machine. Discoverable resources can include components that are physically connected to the machine, as well as components that are available on the machine’s local network (depending on the implementation of the discovery service).
The discovery service supports the following methods:
Method Name | Description |
---|---|
DiscoverResources | Get a list of component configs of all resources available to configure on a machine based on the hardware that is connected to or part of the machine. |
Get a list of component configs of all resources available to configure on a machine based on the hardware that is connected to or part of the machine.
Parameters:
extra
(Mapping[str, Any]) (optional): Extra options to pass to the underlying RPC call.timeout
(float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.Returns:
Example:
my_discovery = DiscoveryClient.from_robot(machine, "my_discovery")
# Get the discovered resources
result = await my_discovery.discover_resources(
"my_discovery",
)
discoveries = result.discoveries
For more information, see the Python SDK Docs.
Parameters:
ctx
(Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.extra
(map[string]interface{}): Extra options to pass to the underlying RPC call.Returns:
Example:
// Get the discovered resources of a Discovery Service.
cfgs, err := myDiscoveryService.DiscoverResources(ctx, nil)
if err != nil {
logger.Fatal(err)
}
// Print out the discovered resources.
for _, cfg := range cfgs {
fmt.Printf("Name: %v\tModel: %v\tAPI: %v", cfg.Name, cfg.Model, cfg.API)
fmt.Printf("Attributes: ", cfg.Attributes)
}
For more information, see the Go SDK Docs.
Parameters:
extra
(None) (optional)callOptions
(CallOptions) (optional)Returns:
For more information, see the TypeScript SDK Docs.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!