RestConf API to add bgp peer give Error

asked 2015-05-06 05:49:10 -0800

viru gravatar image

updated 2015-05-07 01:50:21 -0800

Dana gravatar image

Hi All,

I am using firefox rest client to add the bgp peers , i set below parameter in that:-

Method:- POST URL:- http://127.0.0.1:8181/restconf/config/opendaylight-inventory:nodes/node/controller-config/yang-ext:mount/config:modules/ Authentication: username: admin , Passowrd: admin

Body:-

<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
<type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-peer</type>
<name>example-bgp-peer</name>
<host xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">192.0.2.1</host> <holdtimer xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">180</holdtimer>
<rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
<type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:cfg">x:rib</type> <name>example-bgpls-rib</name>
</rib>
<peer-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"> <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-peer-registry</type>
<name>global-bgp-peer-registry</name>
</peer-registry>
<advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"> <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
<name>ipv4-unicast</name>
</advertized-table>
<advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"> <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
<name>ipv6-unicast</name>
</advertized-table>
<advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"> <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-table-type</type>
<name>linkstate</name>
</advertized-table> </module>

But i am getting the below error :-

<errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"> <error> <error-type>protocol</error-type> <error-tag>invalid-value</error-tag> <error-message>URI has bad format</error-message> </error> </errors>

Please let me know where i am doing wrong.

edit retag flag offensive close merge delete

Comments

If you do GET request on the link, do you see configured modules? Also did the configuration of RIB (which is supposed to be first step), work?

Dana ( 2015-05-06 06:45:19 -0800 )edit

Oh, I have updated TCP_MD5_Guide, but not other similar pages. Due to a change in netconf-connector, the URL for Lithium is: http://127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/

vrpolak ( 2015-05-06 07:13:55 -0800 )edit

Hi, After installing the "odl-netconf-all feature" i am able to get the BGP peer details but when i (POST) create the peer i am getting the below error: <errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"> <error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-message>Error creating data</error-message> <error-info> <error>java.lang.IllegalStateException: Unable to resolve value AttributeConfigElement [defaultValue=null, value=MappedDependency{namespace='urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:cfg', serviceName='rib', refName='example-bgpls-rib'}] to attribute rib</error> </error-info> </error> </error->

viru ( 2015-05-07 00:56:44 -0800 )edit

https://wiki.opendaylight.org/view/BGP_LS_PCEP:Lithium_User_Guide#Configuration_through_RESTCONF states that you HAVE TO respect the order of the steps. RIB is the first you need to configure. Peer does NOT recognize your RIB, because the preconfigured RIB has different name (example-bgp-rib).

Dana ( 2015-05-07 01:49:35 -0800 )edit

Thanks Dana ! when I first configure the RIB . I am facing below error. <errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"> <error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-message>Error creating data</error-message> <error-info> <operation_failed>{rib-impl={example-bgp-rib-1=BgpDispatcher is null, expected dependency implementing interface org.opendaylight.controller.config.yang.bgp.rib.impl.BGPDispatcherServiceInterface}}</operation_failed> </error-info> </error> </errors> Please let me know if I need to change code-base.

viru ( 2015-05-07 03:01:09 -0800 )edit