summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Paraskevopoulos <geopar@intracom-telecom.com>2016-09-01 16:27:44 +0300
committerJose Lausuch <jose.lausuch@ericsson.com>2016-09-01 15:50:42 +0000
commitf43a97038c712de33129786df56bbc569dfa1fdb (patch)
tree91d726187994feb29514de477c84b447d636fa01
parent2236c2a3498e62fad98de0ad533612bf82bab9e3 (diff)
Add router association utility function
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)
-rwxr-xr-xutils/openstack_utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/utils/openstack_utils.py b/utils/openstack_utils.py
index 21e00d9b9..ff9b54a58 100755
--- a/utils/openstack_utils.py
+++ b/utils/openstack_utils.py
@@ -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)