Uploaded image for project: 'controller'
  1. controller
  2. CONTROLLER-1368

Restconf drops namespace for target-rib type (BGP application peer config)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • None
    • Lithium
    • config
    • None
    • Operating System: All
      Platform: All

    • 3675

      Here is the link describing how to configure application RIB: https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Application_Peer

      When the data is added to 41-example-bgp.xml config file, module is created correctly. But if restconf PUT is used to create (or update) the module, using the following command:
      curl -v -X PUT -H "Content-Type:application/xml" -d '<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
      <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-application-peer</type>
      <name>example-bgp-peer-app</name>
      <bgp-peer-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">22.22.22.22</bgp-peer-id>
      <target-rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
      <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:rib-instance</type>
      <name>example-bgp-rib</name>
      </target-rib>
      <application-rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">example-app-rib</application-rib-id>
      <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
      <type xmlns:sal="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">sal:dom-async-data-broker</type>
      <name>pingpong-broker</name>
      </data-broker>
      </module>' 127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:bgp-application-peer/example-bgp-peer-app

      it returns http status 500. Here is segment of karaf.log:

      2015-06-11 13:39:39,719 | WARN | oupCloseable-6-1 | NetconfDeviceCommunicator | 240 - org.opendaylight.controller.sal-netconf-connector - 1.2.0.SNAPSHOT | RemoteDevice

      {controller-config}

      : Error reply from remote device, request: <rpc message-id="m-2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
      <edit-config>
      <target>
      <candidate/>
      </target>
      <default-operation>none</default-operation>
      <config>
      <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
      <module xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0" a:operation="replace">
      <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-application-peer</type>
      <name>example-bgp-peer-app</name>
      <application-rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">example-app-rib</application-rib-id>
      <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
      <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">x:dom-async-data-broker</type>
      <name>pingpong-broker</name>
      </data-broker>
      <bgp-peer-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">22.22.22.22</bgp-peer-id>
      <target-rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
      <type>rib-instance</type>
      <name>example-bgp-rib</name>
      </target-rib>
      </module>
      </modules>
      </config>
      </edit-config>
      </rpc>
      , response: <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-2">
      <rpc-error>
      <error-type>application</error-type>
      <error-tag>operation-failed</error-tag>
      <error-severity>error</error-severity>
      <error-message>Unexpected error</error-message>
      <error-info>
      <error>java.lang.IllegalStateException: Service type value not prefixed with namespace</error>
      </error-info>
      </rpc-error>
      </rpc-reply>

      The log shows <type>rib-instance</type>, which would explain which value was not prefixed, but the curl command did have prefix there: <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:rib-instance</type>
      It seems the prefix was dropped somewhere in restconf (maybe because target-rib has the same prefix?) but netconf (or config) subsystem still requires it.

            mmarsale@cisco.com Maros Marsalek
            vrpolak Vratko Polak
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: