[NETCONF-185] Delete subset of list items using PATCH? Created: 14/Apr/16 Updated: 15/Mar/19 Resolved: 05/Aug/16 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | restconf-nb |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Vratko Polak | Assignee: | Ivan Hrasko |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 5730 |
| Description |
|
This is against Beryllium code that is not merged yet: It is possible that I am sending wrong requests, or I am expecting behavior that is not implied by standard, but this is how it looks like when I manipulate model (from odl-clustering-test-app feature): $ curl -u'admin:admin' -X PATCH -H "Content-Type:application/yang.patch+json" -d '{"ietf-restconf:yang-patch":{"patch-id":"0","edit":[{"edit-id":"0","operation":"replace","target":"/car:car-entry[car:id='"'"'0'"'"']","value":{"car:car-entry":[ {"id":"0"}, {"id":"1"}]}}]}' 127.0.0.1:8181/restconf/config/car:cars ;echo {"ietf-yang-patch:yang-patch-status":{"patch-id":"0","ok":null}} $ curl -u'admin:admin' 127.0.0.1:8181/restconf/config/car:cars ;echo {"cars":{"car-entry":[ {"id":"1"}, {"id":"0"}]}} $ curl -u'admin:admin' -X PATCH -H "Content-Type:application/yang.patch+json" -d '{"ietf-restconf:yang-patch":{"patch-id":"0","edit":[ {"edit-id":"0","operation":"delete","target":"/car:car-entry[car:id='"'"'0'"'"']"}]}' 127.0.0.1:8181/restconf/config/car:cars ;echo {"ietf-yang-patch:yang-patch-status":{"patch-id":"0","ok":null}} $ curl -u'admin:admin' 127.0.0.1:8181/restconf/config/car:cars ;echo {"cars":{"car-entry":[ {"id":"1"}, {"id":"0"}]}} I was expecting to only find {"id":"1"} after the second PATCH. Is it a Bug or am I doing something wrong? |
| Comments |
| Comment by Ivan Hrasko [ 27/Apr/16 ] |
|
Now it works as you expected: https://git.opendaylight.org/gerrit/#/c/38022/ |
| Comment by Ivan Hrasko [ 23/May/16 ] |
|
Merged to Beryllium. It needs separate solution for Boron. |
| Comment by Ivan Hrasko [ 27/Jul/16 ] |
|
Cherry pick to boron old Restconf: |
| Comment by Ivan Hrasko [ 29/Jul/16 ] |
|
Cherry pick merged to Boron. |
| Comment by Ivan Hrasko [ 05/Aug/16 ] |
|
patch for new restconf has been merged to master: |