-
Notifications
You must be signed in to change notification settings - Fork 293
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
Feature Request | RESTCONF like PATH expressions #1622
Comments
You could have at least reference the specification. Should be fairly simple to support but we have no spare time right now for implementing it and have no use-case so we would not know what exactly should the API do. But we accept pull requests so you are free to implement it. |
@michalvasko, I will start with the specification and use-case definition first. Will check, if we have cycles to add the code for this. Instead of providing alternative support for mode-path for all available API endpoints that support XPATH today, likely the best API requirement would be to have a function that translates model-path to xpath and vice versa. |
Not sure that is really possible because that would require there to already be support in libyang for expressions that can be mapped 1:1 to these RESTCONF URIs. It is certainly not XPath, it may be path but that would need careful examination to make sure of it. |
1:1 mapping shall be possible. Not sure, what libyang2 provides to make this happen...
Well, it's a path expression (FDN style), however it uses XPATH syntax. Indeed, it's not any XPATH expression just the once that are related to object paths - because else translation would not be possible. |
I think the restrictions are much more severe than that, you cannot have any operators and even no predicates, which are substituted by special syntax that is not valid in any YANG/NETCONF path. |
Right... The main use-case here is to having tooling on top of RESTCONF agent. To provide any sort of validation and compare on top of RESTCONF transformation this sort of translation is essential an requires knowledge about the YANG module contents. |
Today, libyang 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
Some details:
Example with multiple keys:
.../mylist=bla,,,bing/...
Rational:
To convert a RESTCONF URL/PATH to XPATH is rather complex, because one needs to understand the list keys including ordering (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.
The text was updated successfully, but these errors were encountered: