Add policy group get_path api
Change-Id: I492e0f9b7bfae8507ee11634f405a8f0f6669d04
This commit is contained in:
@@ -540,6 +540,15 @@ class TestPolicyGroup(NsxPolicyLibTestCase):
|
||||
TEST_TENANT, domain_id, group_id)
|
||||
api_get.assert_called_once_with(path)
|
||||
|
||||
def test_get_path(self):
|
||||
domain_id = 'd1'
|
||||
group_id = 'g1'
|
||||
result = self.resourceApi.get_path(domain_id, group_id,
|
||||
tenant=TEST_TENANT)
|
||||
expected_path = '/%s/domains/%s/groups/%s' % (
|
||||
TEST_TENANT, domain_id, group_id)
|
||||
self.assertEqual(expected_path, result)
|
||||
|
||||
|
||||
class TestPolicyL4Service(NsxPolicyLibTestCase):
|
||||
|
||||
|
||||
@@ -467,6 +467,13 @@ class NsxPolicyGroupApi(NsxPolicyResourceBase):
|
||||
tenant=tenant)
|
||||
return self._get_realization_info(group_def, entity_type=entity_type)
|
||||
|
||||
def get_path(self, domain_id, group_id,
|
||||
tenant=constants.POLICY_INFRA_TENANT):
|
||||
group_def = self.entry_def(domain_id=domain_id,
|
||||
group_id=group_id,
|
||||
tenant=tenant)
|
||||
return group_def.get_resource_full_path()
|
||||
|
||||
|
||||
class NsxPolicyServiceBase(NsxPolicyResourceBase):
|
||||
"""Base class for NSX Policy Service with a single entry.
|
||||
|
||||
Reference in New Issue
Block a user