Closed hellt closed 2 years ago
Hello @hellt ,
yes, here is explained expected formats: https://github.com/akarneliuk/pygnmi/blob/33c6fc04b7743b787f2d016e3cb9f9eed9a933fb/pygnmi/path_generator.py#L9
The paths are built in accordance with https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-path-conventions.md who specifically for OpenConfig it is expected that path should work without prefix as well. So far, this implementation was tested with Nokia SR OS (for Nokia and OpenConfig), Cisco IOS XR, Arista EOS, Juniper JUNOS.
If there is any particular problem, would be good to see derails.
Best, Anton
gnmi path conventions doc doesn't say that for a path/foo:bar/baz
the foo
part is promoted to path origin. And that is what pygnmi does
Hey @hellt ,
I've done some tests, basically, we already have implementation of the origin:
string:
openconfig-platform://openconfig-interfaces:interfaces/
Path():
origin: "openconfig-platform"
elem {
name: "openconfig-interfaces:interfaces"
}
string:
openconfig-platform:/openconfig-interfaces:interfaces/
Path():
origin: "openconfig-platform"
elem {
name: "openconfig-interfaces:interfaces"
}
string:
/openconfig-platform://openconfig-interfaces:interfaces/
Path():
origin: "openconfig-platform"
elem {
name: "openconfig-interfaces:interfaces"
}
string:
/openconfig-platform:/openconfig-interfaces:interfaces/
Path():
origin: "openconfig-platform"
elem {
name: "openconfig-interfaces:interfaces"
}
So, I guess, we are align here.
Best, Anton
Great. That will help with using uniform path notation
Hi looking at this line it seems impossible to specify the path element to contain a yang prefix, as the element before
:
will be promoted to origin.Consider the following OC path that specifies a fully qualified top level element by setting yang prefix in the first element:
In this path
oc-netinst
is a yang prefix of a module and not the origin. It is expected that this path will translate to a path with a first path element to beoc-netinst:network-instances
with no origin set.