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

RPC POST to yang-ext:mount doesn't support XML Attributes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • 8.0.0
    • None
    • restconf-nb
    • None
    • Operating System: All
      Platform: All

    • 4440

      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
      2. POST to http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/1-netconf-device/yang-ext:mount/ietf-netconf:get-config

      with payload:

      {
      "ietf-netconf:input": {
      "source":

      { "running": [null] }

      ,
      "filter": {
      },
      "@filter":

      {xpath,//users }

      }
      }

      <errors
      xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf">
      <error>
      <error-type>protocol</error-type>
      <error-tag>malformed-message</error-tag>
      <error-message>Error parsing input: Schema node with name @filter wasn't found under (urn:ietf:params:xml:ns:netconf:base:1.0?revision=2011-06-01)input.</error-message>
      <error-info>java.lang.IllegalStateException: Schema node with name @filter wasn't found under (urn:ietf:params:xml:ns:netconf:base:1.0?revision=2011-06-01)input.
      at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.resolveNamespace(JsonParserStream.java:253)
      at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.read(JsonParserStream.java:154)
      .
      .
      .

      XML Example:

      1. Mount a netconf device, any will do
      2. POST to http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/1-netconf-device/yang-ext:mount/ietf-netconf:get-config

      With payload:

      <input xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
      <source>
      <running/>
      </source>
      <filter type="xpath" select="//users"/>
      </input>

      This will strip the attributes and return the entire configuration instead of the filtered config.

            Unassigned Unassigned
            jameshall03885@gmail.com James Gregory Hall
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: