diff options
author | Nikolas Hermanns <nikolas.hermanns@ericsson.com> | 2016-07-06 19:28:14 +0200 |
---|---|---|
committer | jose.lausuch <jose.lausuch@ericsson.com> | 2016-07-07 11:14:52 +0200 |
commit | a37e482d1566c7fa512d4fa874200ab089eb4384 (patch) | |
tree | 5e1e6bccaa2fd1dbb76c593cb337e9df4159c2f9 /utils/openstack_utils.py | |
parent | ee293e5eacd6bc4a8af95a22ac1746845546c99f (diff) |
[SDNVPN] Add helper functions to create bgpvpn and associations
JIRA: FUNCTEST-99
These functions are used by sdnvpn test cases
to create vpns and network associations
Change-Id: I2fb25c84d8d02ea1cc92677e6a33e469a5d3ddc3
Signed-off-by: Nikolas Hermanns <nikolas.hermanns@ericsson.com>
Diffstat (limited to 'utils/openstack_utils.py')
-rw-r--r-- | utils/openstack_utils.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/utils/openstack_utils.py b/utils/openstack_utils.py index b93d38185..2a3024831 100644 --- a/utils/openstack_utils.py +++ b/utils/openstack_utils.py @@ -614,9 +614,28 @@ def create_network_full(logger, return network_dic +def create_bgpvpn(neutron_client, **kwargs): + # route_distinguishers + # route_targets + json_body = {"bgpvpn": kwargs} + return neutron_client.create_bgpvpn(json_body) + + +def create_network_association(neutron_client, bgpvpn_id, neutron_network_id): + json_body = {"network_association": {"network_id": neutron_network_id, + "id": bgpvpn_id}} + return neutron_client.create_network_association(json_body) + + +def update_bgpvpn(neutron_client, **kwargs): + json_body = {"bgpvpn": kwargs} + return neutron_client.update_bgpvpn(json_body) + # ********************************************* # SEC GROUPS # ********************************************* + + def get_security_groups(neutron_client): try: security_groups = neutron_client.list_security_groups()[ |