[NETCONF-80] RPC POST to yang-ext:mount doesn't support XML Attributes Created: 08/Oct/15 Updated: 04/Nov/21 |
|
| Status: | Confirmed |
| Project: | netconf |
| Component/s: | restconf-nb |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | James Gregory Hall | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 4440 |
| Description |
|
Context: I'm using the controller's ability to mount netconf devices to make it easy to script RESTCONF clients to access such devices's configuration. So I'd like to pass RPC get-config requests through RESTCONF yang-ext:mount which will only work if they include XML attributes and/or the json equivalent as per the NETCONF spec. JSON Example: 1. Mount a netconf device, any will do with payload: { , } <errors XML Example: 1. Mount a netconf device, any will do With payload: <input xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> This will strip the attributes and return the entire configuration instead of the filtered config. |
| Comments |
| Comment by James Gregory Hall [ 08/Oct/15 ] |
|
Having read a similar NETCONF-52 there is a response: "When editing configuration on a mounted Netconf device over Restconf, ODL hides the edit+commit rpcs to make Restconf behave as expected (you alse cannot choose which datastore to edit). And I dont think we should change that." I belive it's clear that yang-ext:mount RPC's which use XML Attributes can't work without passing through the attributes. |
| Comment by Tony Tkacik [ 12/Oct/15 ] |
|
{ , } Where (which draft) is @filter type of attributes specified? |
| Comment by James Gregory Hall [ 15/Oct/15 ] |
|
Apparently there is no "standard" for converting xml -> json. So we can put that issue aside temporarily ... if we accept that NETCONF RPC's can't be made through RESTCONF with json, you must use xml. So lets focus on the issue of XML attributes & RESTCONF yang-ext:mount RPCs. |
| Comment by Robert Varga [ 04/Nov/21 ] |
|
So the attributes/JSON gap is bridged via annotations on anyxml. The syntax is going to be slightly different, but that's not of import. So when a device advertises the :xpath capability, we need to play pretend there is an RFC6241bis, which defines RFC7952 annotations to carry filter attributes, as per section 8.9.5.1:
<!-- get the user named fred -->
<filter xmlns:t="http://example.com/schema/1.2/config"
type="xpath"
select="/t:top/t:users/t:user[t:name='fred']"/>
When we bind to such a context, we will recognize the attributes on input and be able to translate them back and forth. Alternatively, we can get this working by completely passing the request document to the NETCONF device without alteration. That should become possible once we have NETCONF-718 and its follow-ups done. |