Add utils for getting bgpvpn information 93/21093/1
authorRomanos Skiadas <rski@intracom-telecom.com>
Wed, 14 Sep 2016 07:36:50 +0000 (10:36 +0300)
committerRomanos Skiadas <rski@intracom-telecom.com>
Wed, 14 Sep 2016 07:46:06 +0000 (10:46 +0300)
Change-Id: I86f9e2afa6578dc60ea82fd163427a4f6e2f8526
Signed-off-by: Romanos Skiadas <rski@intracom-telecom.com>
Co-Authored-By: George Paraskevopoulos <geopar@intracom-telecom.com>
utils/openstack_utils.py

index 8c2e00c..5a4775d 100755 (executable)
@@ -727,6 +727,18 @@ def update_bgpvpn(neutron_client, bgpvpn_id, **kwargs):
 def delete_bgpvpn(neutron_client, bgpvpn_id):
     return neutron_client.delete_bgpvpn(bgpvpn_id)
 
+
+def get_bgpvpn(neutron_client, bgpvpn_id):
+    return neutron_client.show_bgpvpn(bgpvpn_id)
+
+
+def get_bgpvpn_routers(neutron_client, bgpvpn_id):
+    return get_bgpvpn(neutron_client, bgpvpn_id)['bgpvpn']['routers']
+
+
+def get_bgpvpn_networks(neutron_client, bgpvpn_id):
+    return get_bgpvpn(neutron_client, bgpvpn_id)['bgpvpn']['networks']
+
 # *********************************************
 #   SEC GROUPS
 # *********************************************