SysDB and gNMI
Haylin Moore - 2024-01-20 - streaming EOS SysDB data over gNMI
Exploring Sysdb with TerminAttr and REST API
- Enable TerminAttr: Begin by enabling the TerminAttr daemon on your device. This can be done with the following configuration commands:
This configuration initializes the TerminAttr service, which provides a REST API to explore its data, including Sysdb.
- Access Sysdb via REST API: Once TerminAttr is running, use the REST API to explore Sysdb. Start by checking available paths:
{
}
This command will return a JSON structure with various Sysdb paths, each having a _ptr
reference.
- Browse Sysdb Paths: Use the REST API to navigate through the Sysdb paths. For example, to access network configuration data, you might use:
{
}
You will receive a JSON response with the relevant Sysdb data.
Streaming Sysdb Data Over gNMI
After identifying the desired Sysdb paths using TerminAttr and the REST API, you can proceed to stream this data over gNMI. For non-openconfig paths, use the eos_native
prefix and enable it on the device.
management api gnmi
transport grpc default
no shutdown
provider eos-native
If we try to get the hostname directly, we get an empty response:
This is because when pulling from Sysdb via gNMI, we need to use the closest _ptr
reference, as only entire objects can be pulled. In this case, we can use the last _ptr
we saw in the REST API output: