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

Yangtools is not processing the output of get-config RPC in ietf-netconf YANG model

XMLWordPrintable

      We were trying to run the "get-config" RPC of ietf-netconf.yang file on a mounted NETCONF device. While other operations such as "edit-config", "connit" etc works, "get" and "get-config" fail because for these RPCs  top level element in the output is anyxml which Yangtools is not handling. This functionality is very useful as this enables the user to get around not supported features on Restcong such as NETCONF filtering. Using this method we can construct the NETCONF request in the way desired.

       

      Here are the call details:  Tested on Carbon. Oxygen etc essentially obtaining the same result.

       

      http://controller:8181/restconf/operations/network-topology:network-topology/topology/topology-netconf/node/vyatta1/yang-ext:mount/ietf-netconf:get-config

       

      <input xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <source>
       <running/>
       </source>
       <filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree">
       <interfaces xmlns="urn:vyatta.com:mgmt:vyatta-interfaces:1"/>
       </filter>
       </input>

       

      Output from the controller:

       

       

      <html>
       <head>
       <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
       <title>Error 500 Server Error</title>
       </head>
       <body>
       <h2>HTTP ERROR 500</h2>
       <p>Problem accessing /restconf/operations/network-topology:network-topology/topology/topology-netconf/node/vyatta1/yang-ext:mount/ietf-netconf:get-config. Reason:
      <pre> Server Error</pre>
       </p>
       <h3>Caused by:</h3>
       <pre>java.lang.IllegalArgumentException: Node AbsoluteSchemaPath{path=[(urn:ietf:params:xml:ns:netconf:base:1.0?revision=2011-06-01)get-config, (urn:ietf:params:xml:ns:netconf:base:1.0?revision=2011-06-01)output, (urn:ietf:params:xml:ns:netconf:base:1.0?revision=2011-06-01)data]} is not a container nor a notification
       at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
       at org.opendaylight.yangtools.yang.data.impl.codec.SchemaTracker.startContainerNode(SchemaTracker.java:199)
       at org.opendaylight.yangtools.yang.data.impl.codec.xml.SchemaAwareXMLStreamNormalizedNodeStreamWriter.startContainerNode(SchemaAwareXMLStreamNormalizedNodeStreamWriter.java:116)
       at org.opendaylight.yangtools.yang.data.impl.codec.xml.XMLStreamNormalizedNodeStreamWriter.startContainerNode(XMLStreamNormalizedNodeStreamWriter.java:176)
       at org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeWriter.wasProcessedAsCompositeNode(NormalizedNodeWriter.java:189)
       at org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeWriter.write(NormalizedNodeWriter.java:97)
       at org.opendaylight.netconf.sal.rest.impl.RestconfDelegatingNormalizedNodeWriter.write(RestconfDelegatingNormalizedNodeWriter.java:37)
       at org.opendaylight.netconf.sal.rest.impl.RestconfDelegatingNormalizedNodeWriter.write(RestconfDelegatingNormalizedNodeWriter.java:19)
       at org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter.writeElements(NormalizedNodeXmlBodyWriter.java:149)
       at org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter.writeNormalizedNode(NormalizedNodeXmlBodyWriter.java:116)
       at org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter.writeTo(NormalizedNodeXmlBodyWriter.java:102)
       at org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter.writeTo(NormalizedNodeXmlBodyWriter.java:50)
       at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306)
       at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1479)
       at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
       
      

       

       

            JakubToth Jakub Toth
            bvaradar Balaji Varadaraju
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: