Add router association utility function 45/20145/1
authorGeorge Paraskevopoulos <geopar@intracom-telecom.com>
Thu, 1 Sep 2016 13:27:44 +0000 (16:27 +0300)
committerGeorge Paraskevopoulos <geopar@intracom-telecom.com>
Thu, 1 Sep 2016 13:27:44 +0000 (16:27 +0300)
Add function to create an association between a router and a bgpvpn

Change-Id: I23449a0363f9d8f3c77ea3be1e104586d3c111d1
Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
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)