[CONTROLLER-1283] Unable to configure BGP peer-role through RESTCONF Created: 28/Apr/15  Updated: 02/Jun/15  Resolved: 02/Jun/15

Status: Resolved
Project: controller
Component/s: netconf
Affects Version/s: Post-Helium
Fix Version/s: None

Type: Bug
Reporter: Vratko Polak Assignee: Maros Marsalek
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Blocks
is blocked by CONTROLLER-1050 Proper support for ENUMs in Netconf n... Resolved
External issue ID: 3077

 Description   

This is basically what CONTROLLER-1281 wanted to be.

Any attempt to add a BGP peer (with peer-type specified) through RESTCONF will be rejected.

Steps to reproduce:

1. ODL_ROOT=<where_yourODL_installation_lives>
2. Boot ODL.
3. Install features "odl-restconf", "odl-bgppcep-bgp-all" and "odl-netconf-connector-all".
4. Wait for ODL to fully load (run "top" in another console and wait until CPU usage of the massive Java process stays below 5%).
5. curl -v -u 'admin:admin' -X POST -H "Content-Type:application/xml" -d '<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>
<peer-role xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">Ebgp</peer-role>
<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-bgp-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>' 127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules

which leads to this response (code 400):
{"errors":{"error":[

{"error-type":"protocol","error-tag":"malformed-message","error-message":"Error parsing input: Invalid value 'Ebgp' for enum type. Allowed values are: [ebgp, ibgp, rr-client]"}

]}}

6. Replacing "Ebgp" with "ebgp" in the curl data leads to another response (code 500):
{"errors":{"error":[

{"error-type":"application","error-tag":"operation-failed","error-message":"Error creating data"}

]}}

7. Neither POST generates anything in karaf.log, which is itself a minor bug.

Based on discussion in CONTROLLER-1281 setting this bug to depend on CONTROLLER-1050.
Change in BGP (to not use leafs of enum type) would fix this bug too.



 Comments   
Comment by Maros Marsalek [ 28/Apr/15 ]

This is a symptom of 2453, thats correct. The bug prevents reading/writing enum leaves for configuration over RESTCONF due to different mapping of enum values in RESTCONF and NETCONF->CONFIG.

Comment by Maros Marsalek [ 26/May/15 ]

Fixes have been merged into stable/lithium

Generated at Wed Feb 07 19:55:08 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.