Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use yang prefix in first path element? #56

Closed
hellt opened this issue Mar 25, 2022 · 4 comments
Closed

use yang prefix in first path element? #56

hellt opened this issue Mar 25, 2022 · 4 comments

Comments

@hellt
Copy link

hellt commented Mar 25, 2022

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:

/oc-netinst:network-instances/...

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 be oc-netinst:network-instances with no origin set.

@akarneliuk
Copy link
Owner

Hello @hellt ,

yes, here is explained expected formats:

"""Parses an XPath expression into a gNMI Path

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

@hellt
Copy link
Author

hellt commented Mar 26, 2022

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

@akarneliuk
Copy link
Owner

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

@hellt
Copy link
Author

hellt commented Apr 8, 2022

Great. That will help with using uniform path notation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants