[NETCONF-1245] Full list delete fails when called on remote device via restconf Created: 02/Feb/24 Updated: 02/Feb/24 |
|
| Status: | Open |
| Project: | netconf |
| Component/s: | netconf, restconf-nb |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Medium |
| Reporter: | Ruslan Kashapov | Assignee: | Ruslan Kashapov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
The full list deletion could be invoked on processing new item insertion into ordered list. See NETCONF-1177 When netconf edit-config message is constructed for remove operation using yang instance identifier pointing to list the message like below occurs <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-19"> <edit-config> <target> <candidate/> </target> <config> <root xmlns="http://example.com/user-ordered-list" xmlns:op="urn:ietf:params:xml:ns:netconf:base:1.0" op:operation="remove"> <items/> </root> </config> </edit-config> </rpc> According to https://datatracker.ietf.org/doc/html/rfc6241#section-7.2 the operation expected to be defined on element the operation being applied to. The message above instructs to remove parent container (instead of list elements within), and empty <items/> causes parse error, because the key is mandatory. In order to remove all the elements belonging to requested list all the elements require to be listed like below <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-19"> <edit-config> <target> <candidate/> </target> <config> <root xmlns="http://example.com/user-ordered-list" xmlns:op="urn:ietf:params:xml:ns:netconf:base:1.0"> <items op:operation="remove"> <id>0</id> </items> <items op:operation="remove"> <id>1</id> </items> </root> </config> </edit-config> </rpc> |