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

Support for RESTCONF-like URL expressions #23

Open
wisotzky opened this issue May 31, 2021 · 4 comments
Open

Support for RESTCONF-like URL expressions #23

wisotzky opened this issue May 31, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@wisotzky
Copy link

wisotzky commented May 31, 2021

Today, libyang-python only supports XPATH expressions. There is a need to alternatively support RESTCONF compliant path expression, as specified in rfc8040.

XPATH expression example:
/nokia-conf:configure/port[port-id=1/1/1]

Corresponding RESTCONF URL syntax
/nokia-conf:configure/port=1%2F1%2F1

Usage information:

  • RESTCONF uses URL encoding for key values
  • Only list-key values are provided (no attribute names)
  • For lists with multiple keys, comma is used as separator while key values will follow the same order as in the YANG key statement

Example with multiple keys:
In YANG the statement key: "p1 p2 p3 p4" for list mylist occurs. To access an object with p1="bla" and p4="bing" one would use the following URL path statement .../mylist=bla,,,bing/...

Rational:
To convert a RESTCONF URL/PATH to XPATH is rather complex, because one needs to understand the list keys (aka requires to know the corresponding YANG file). As libyang has the knowledge the recommendation is to support URL style (model-path) out-of-the-box.

@rjarry
Copy link
Collaborator

rjarry commented Jun 1, 2021

Hi,

is that something that libyang supports? If not, it must be first supported by the C library. This project is only a python wrapper/binding on top of it.

@rjarry rjarry added the enhancement New feature or request label Jun 1, 2021
@rjarry rjarry changed the title Feature Request: Support for RESTCONF-like URL expressions Support for RESTCONF-like URL expressions Jun 1, 2021
@wisotzky
Copy link
Author

Okay, will raise this against libyang2. Will keep this item open, so it can be considered as soon the lib feature is available.

@wisotzky
Copy link
Author

I've opened this ticket:
CESNET/libyang#1622

@samuel-gauthier
Copy link
Collaborator

Hi @wisotzky, it does not seem that the libyang feature is going anywhere, can we close this?

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

No branches or pull requests

3 participants