Telemetry subscriptions include a set of schema paths used to identify which data nodes are of interest to the collector.
The paths in Telemetry Subscribe RPC requests follow the conventions described in the OpenConfig gnmi-path-conventions.md published on github.com (version 0.4.0, published June 21, 2017).
A path consists of a set of path segments often shown with a ‟/” character as a delimiter; for example, /configure/router[router-instance=Base]/interface[interface-name=my-interface1]/description.
These paths are encoded as a set of individual string segments in gnmi.proto (without any ‟/” characters); for example, ["configure", "router[router-name=Base]", "interface[interface-name=my-interface1]", "description"].
A path selects an entire subtree of the data model and includes all descendants of the node indicated in the path. Table: Schema paths describes the types of schema paths that are supported in SR OS telemetry.
Path example | Description |
---|---|
/configure/router[router-name=Base]/interface[interface-name=abc] |
Selects all config leafs of interface abc and all descendants. |
/configure/router[router-name=Base]/interface[interface-name=abc]/description |
Selects only the description leaf of interface abc. |
/state/router[router-name=Base]/interface[interface-name=*] |
Selects all state information for all base router interfaces using a wildcard in a single segment of a path. |
/configure/router[router-name=Base]/interface[interface-name=*]/description |
Selects only the description leaf of all interfaces. |
/configure/router[router-name=Base]/interface/description |
Applies to all RPCs. Selects the entire list to account for absent list keys. It is equivalent to /configure/router[router-name=Base]/interface[interface-name=*]/description |
/ |
The root path. This selects all config and state data from all models (in all namespaces) supported on the router. Encoded as ‟” in gRPC/gPB. |
/state/... |
Not supported. Equivalent to /state/ |
/* |
Expands one level of a subtree schema. |
The following list describes the telemetry paths support in SR OS.
The following wildcards are supported in the schema:
Specifying ‟/…” wildcard expands to multiple element levels in a path.
Specifying ‟/*” wildcard expands to only one level in a path.
Wildcards for entire path segments are supported as follows:
For example: ‟/state/card/.../oper-state” expands to following paths
/state/card[slot-number=*]/hardware-data/oper-state
/state/card[slot-number=*]/mda[mda-slot=*]/hardware-data/oper-state
/state/card[slot-number=*]/mda[mda-slot=*]/flex[group-index=*]/oper-state
For example: ‟/state/card/*/oper-state” expands to following path
/state/card[slot-number=*]/hardware-data/oper-state
If a wildcard is used for any key of a list, a wildcard must be used for all the keys of that list. In a single path segment, all keys must either have specific values or all keys must have wildcards. A mix of wildcards and specific values for different parts of a list key is not supported. For example:
Supported:
/a/b[key1=*][key2=*]/c[key1=foo]
/a/b[key1=foo][key2=bar]/c[key1=*]
Not supported:
/a/b[key1=foo][key2=*]
Functions such as ‟current()”, ‟last()” and mathematical operators, such as stat<5 or octets>3 are not supported in paths. The ‟|” (OR operator, used to select multiple paths) is not supported.
Wildcards in multiple segments of a path are supported.
For example: /state/card[slot-number=*]/mda[mda-slot=*]
The paths with wildcards are expanded when a subscription is activated; this applies to dynamic and persistent subscriptions. In some cases, it is possible that a single path with wild cards can be expanded across both Nokia and Openconfig YANG models. However, this occurs only if both model types are enabled. If only one type is enabled, the path is expanded only within the enabled model. If the other type is enabled later, it is necessary to reset all subscriptions, which ensures that the expansion includes the newly enabled model type.