Add router association utility function 75/20175/1
authorGeorge Paraskevopoulos <geopar@intracom-telecom.com>
Thu, 1 Sep 2016 13:27:44 +0000 (16:27 +0300)
committerJose Lausuch <jose.lausuch@ericsson.com>
Thu, 1 Sep 2016 15:50:42 +0000 (15:50 +0000)
Add function to create an association between a router and a bgpvpn

Change-Id: I23449a0363f9d8f3c77ea3be1e104586d3c111d1
Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
(cherry picked from commit 1d01ece307a130bdd0c85ea811b3b72cc6d53156)

utils/openstack_utils.py

index 21e00d9..ff9b54a 100755 (executable)
@@ -705,6 +705,11 @@ def create_network_association(neutron_client, bgpvpn_id, neutron_network_id):
     return neutron_client.create_network_association(bgpvpn_id, json_body)
 
 
+def create_router_association(neutron_client, bgpvpn_id, router_id):
+    json_body = {"router_association": {"router_id": router_id}}
+    return neutron_client.create_router_association(bgpvpn_id, json_body)
+
+
 def update_bgpvpn(neutron_client, bgpvpn_id, **kwargs):
     json_body = {"bgpvpn": kwargs}
     return neutron_client.update_bgpvpn(bgpvpn_id, json_body)