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
This commit is contained in:
Tong Liu 2016-02-03 04:52:19 +00:00
parent 1e1df3bdcb
commit d8569bb7ee

View File

@ -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