Table of Contents
gNMI stands for gRPC Network Management Interface.
gNMI specifications are defined in this repository
The gNMI proto file is here
gNMI is the gRPC service. The Remote Procedure Calls (RPC) methods of the gNMI service are:
- CAPABILITIES: to discover the capabilities of the target
- SET: to modify the state of the target
- GET: to retrieve snapshots from the target for a specified set of paths
- SUBSCRIBE: to subscribe to updates from the target for a specified set of paths.
EOS supports the 4 gNMI RPCs described above.
The target is a network device. The gNMI server runs on the target.
The gNMI client, typically in a collector or in a network management system, sends the RPCs to the targets to modify and collect data.
Examples:
- https://github.com/ksator/arista_eos_gnmi_demo
- https://github.com/ksator/automation_and_telemetry_demo
CVP is the gNMI server.
Once we configured the devices to stream OpenConfig data to CVP, we can use gNMI to access to OpenConfig data on CVP.
CVP supports 2 gNMI RPCs:
- CAPABILITIES
- SUBSCRIBE
SUBSCRIBE has two modes:
- ONCE: Equivalent of a GET RPC. Returns all data matching the subscription path at the specified time
- STREAM: Returns the same as ONCE + subsequent updates until the client closes the subscription
This document describes how to access OpenConfig data streamed by the devices to CVP using gNMI.
Note: This is not yet fully supported by Arista so do not use it on production
Refer to the OpenConfig directory
To use gNMI with CVP, token based authentication is required. To enable token based authentication, refer to this directory and copy the token into an environment variable.
token=xxxxx
echo $token
We can now use gNMI to access device OpenConfig data on CVP.
- The default
arista-origin
isarista
arista-origin
isarista
for CVP data (inventory ...)arista-origin
isopenconfig
for the data streamed by devices to CVP
- The default
arista-target
is CVP.- To get the states of a device,
arista-target
must be the deviceID (SN of the switch).
- To get the states of a device,
The deviceID is the device SN.
on CVP GUI, go to Devices > Inventory to get the device SN.
Use the telemetry browser on CVP GUI (Settings and Tools > Developper Tools > Telemetry Browser) to view the OpenConfig data stored in CloudVision telemetry database. The paths in CVP are not exactly the OpenConfig paths. You will need to manipulate them to be able to use them with a gNMI client.
Refer to the YANG lab to understand how to generate paths and trees from YANG modules.
You will find in this directory examples using:
- The gNMI command-line client:
- gNMIc
- gnmi
- pygnmicli
- The pyGNMI Python library
- The gRPCurl command line tool
- Postman using gPRC