Uploaded image for project: 'netconf'
  1. netconf
  2. NETCONF-185

Delete subset of list items using PATCH?

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • restconf-nb
    • None
    • Operating System: All
      Platform: All

    • 5730

    Description

      This is against Beryllium code that is not merged yet:
      https://git.opendaylight.org/gerrit/#/c/36177/6

      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?
      Maybe a unit test for deleting subset of list items could be added.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ivan.hrasko@pantheon.tech Ivan Hrasko
            vrpolak Vratko Polak
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: