Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

gNMI Genstate Subscription

Starting in Junos OS Evolved Release 24.2R1, Juniper Networks publishes the genstate YANG data models. The genstate models are subscribable YANG models for operational state data on Junos devices. gNMI clients can subscribe to resource paths defined in the models to retrieve specific state data.

View or download the models from the Juniper/yang GitHub repository or Juniper Networks.

Using the new models, gNMI clients in gRPC dial-in environments can subscribe to a genstate resource path and STREAM statistics in SAMPLE sub mode only to a collector. ON_CHANGE sub mode is not supported.

The subscription example that follows uses a target device configured for mutual authentication using X.509 certificates. The subscription request supplies the root CA certificate required to verify the target device's local certificate, and it also provides the client's key and certificate so that the target device can authenticate the client. The subscription uses STREAM mode and submode SAMPLE and requests data for the resource path genstate:/genstate/system-information/os-version. The telemetry data returned to the collector shows that the target device is operating with Junos OS version 24.2R1.12-EVO.

The subscription example that follows again uses a target device configured for mutual authentication using X.509 certificates. The subscription uses STREAM mode and submode SAMPLE and requests data for the resource path genstate:/genstate/interface-information/physical-interface[name=et-1/0/1]/admin-status. The admin-status (administrative status) indicates whether the interface is enabled (up) or disabled (down). The telemetry data returned to the collector shows that physical interface et-1/0/1 is up.