Reload enforcement-point api
Change-Id: I842ea0d45f40c95674a0c199c346ec056197ff3e
This commit is contained in:
parent
243e93b081
commit
3547654c6f
@ -2176,6 +2176,16 @@ class TestPolicyEnforcementPoint(NsxPolicyLibTestCase):
|
||||
TEST_TENANT, ep_id)
|
||||
api_get.assert_called_once_with(path, silent=False)
|
||||
|
||||
def test_reload(self):
|
||||
ef_id = '111'
|
||||
with mock.patch.object(self.policy_api.client, "url_post") as api_post:
|
||||
self.resourceApi.reload(ef_id, tenant=TEST_TENANT)
|
||||
expected_def = core_defs.EnforcementPointDef(ep_id=ef_id,
|
||||
tenant=TEST_TENANT)
|
||||
api_post.assert_called_once_with(
|
||||
expected_def.get_resource_path() + '?action=reload',
|
||||
None, expected_results=None, headers=None)
|
||||
|
||||
|
||||
class TestPolicyDeploymentMap(NsxPolicyLibTestCase):
|
||||
|
||||
|
@ -91,9 +91,9 @@ class NsxPolicyResourceBase(object):
|
||||
"""Create new or overwrite existing resource
|
||||
|
||||
Create would list keys and attributes, set defaults and
|
||||
perform nesessary validations.
|
||||
perform necessary validations.
|
||||
If object with same IDs exists on backend, it will
|
||||
be overriden.
|
||||
be overridden.
|
||||
"""
|
||||
pass
|
||||
|
||||
@ -3345,6 +3345,12 @@ class NsxPolicyEnforcementPointApi(NsxPolicyResourceBase):
|
||||
silent=silent,
|
||||
realization_info=realization_info)
|
||||
|
||||
def reload(self, ep_id, tenant=constants.POLICY_INFRA_TENANT):
|
||||
# Use post command to reload the enforcement point
|
||||
ep_def = core_defs.EnforcementPointDef(ep_id=ep_id, tenant=tenant)
|
||||
path = "%s?action=reload" % ep_def.get_resource_path()
|
||||
self.policy_api.client.create(path)
|
||||
|
||||
|
||||
class NsxPolicyTransportZoneApi(NsxPolicyResourceBase):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user