From d8569bb7ee8b284389223deb2377cae34f3a2d66 Mon Sep 17 00:00:00 2001 From: Tong Liu Date: Wed, 3 Feb 2016 04:52:19 +0000 Subject: [PATCH] Add method to get firewall rule in nsxv3 client Add a method in nsxv3 client to get firewall rule in a firewall section based on name. The name of the firewall rule is the uuid of the security group rule created from OpenStack. Change-Id: I33c9c44cfd716cb91579b598ba8fbcc777f2c467 --- vmware_nsx_tempest/services/nsxv3_client.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vmware_nsx_tempest/services/nsxv3_client.py b/vmware_nsx_tempest/services/nsxv3_client.py index 3f71add038..86687889bb 100755 --- a/vmware_nsx_tempest/services/nsxv3_client.py +++ b/vmware_nsx_tempest/services/nsxv3_client.py @@ -274,6 +274,14 @@ class NSXV3Client(object): response = self.get(endpoint=endpoint) return response.json()['results'] + def get_firewall_section_rule(self, fw_section, os_uuid): + """ + Get the firewall section rule based on the name + """ + fw_rules = self.get_firewall_section_rules(fw_section) + nsx_name = os_uuid + return self.get_nsx_resource_by_name(fw_rules, nsx_name) + def get_ns_groups(self): """ Retrieve all NSGroups on NSX backend