Discovery service | Services
Discovery service
A discovery service allows you to return a list of physical hardware available on a machine, and suggest configurations for those components to integrate the hardware into the machine. If you are creating a modular resource that depends on other resources that are discoverable in a systematic way, you can create a discovery service as part of your module to discover those resources.
Example usage
Imagine you are creating a vision service module that depends on a camera. To make it easier for users to configure the camera, you include a discovery service in your module. You implement the discovery service to report all the camera paths your computer or SBC finds. Users of your module can then:
- Configure both the vision service and the discovery service in their machine’s configuration.
- Click the Test panel in the discovery service configuration to see all cameras recognized by the machine, presented as a list of configuration snippets.
- Create a camera with the copy-pasteable configuration snippet for the camera they want to use, with the camera path already filled in.
- Use the configured camera in their vision service configuration.
To see this in action, see webcam discovery as an example.
To interact with a discovery service programmatically, use the discovery service API.
Configuration
To use a discovery service, you need to add it to your machine’s configuration.
Go to your machine’s CONFIGURE page, and add your discovery service.
The following list shows the available discovery service models. For additional configuration information, click on the model name:
17 results:
| Model | Description |
|---|---|
viam:viamrtsp:unifi |
A discovery service to find rtsp cameras connected to a UniFi Protect NVR. |
viam:viamrtsp:upnp |
A discovery service to find rtsp cameras that use the upnp interface. |
viam:viamrtsp:onvif |
A discovery service to find rtsp cameras that use the onvif interface. |
viam:find-webcams:webcam-discovery |
find webcam video device paths connected to your viam-server to configure webcams |
viam:realsense:discovery |
A discovery service to find connected RealSense cameras |
Add support for other models
If none of the existing models fit your use case, you can create a modular resource to add support for it.
API
The discovery service API 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. |
GetResourceName |
Get the ResourceName for this instance of the service. |
DoCommand |
Execute model-specific commands. |
Close |
Safely shut down the resource and prevent further use. |