Skip to content

Instantly share code, notes, and snippets.

@hellt
Last active August 31, 2020 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellt/0020ce637da8288ebf3850f339b0051d to your computer and use it in GitHub Desktop.
Save hellt/0020ce637da8288ebf3850f339b0051d to your computer and use it in GitHub Desktop.
IOS-XR gNMI issue in MDT sandbox

IOS-XR gNMI list filtering issue in the devnetsandbox MDT lab

As of August 2020 The Model-Driven telemetry lab ships with IOS-XR 6.5.3

This XR version has some issue with the gNMI server that prevents it from accepting YANG list keys without extra quotes around key names.

Problem statement

If one would want to get the interfaces information using the openconfig models they would do this like:

gnmic -a 10.10.20.35:57400 -u admin -p Cisco123 --insecure -e JSON_IETF get --path "openconfig-interfaces:interfaces/interface"

which would work flawlessly.

But if you need to get a certain interface and not the whole list, you would need to filter on the interface name using the path similar to that openconfig-interfaces:interfaces/interface[name=GigabitEthernet0/0/0/6

...and it would fail with the on-box parsing error:

rpc error: code = Internal desc = gNMI get-request: rpc error: code = Internal desc = lexical error: invalid char in json text.
                                        {"openconfig-interfaces:interf
                     (right here) ------^

Cause of the error and the workarounds

Its been identified, that this particular XR version misbehaves by requiring the list key value (GigabitEthernet0/0/0/6 in the example above) to be provided with additional quotes.

In other words, XR expects the path to be openconfig-interfaces:interfaces/interface[name="GigabitEthernet0/0/0/6" which is incorrect according to the gNMI path convention.

gnmic will be able to handle paths like that in its next release (#119).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment