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

Full list delete fails when called on remote device via restconf

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 7.0.4
    • None
    • netconf, restconf-nb

      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>
      

            rkashapov Ruslan Kashapov
            rkashapov Ruslan Kashapov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: