Merge "Reload enforcement-point api"
This commit is contained in:
commit
54393a235c
@ -2227,6 +2227,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
|
||||
|
||||
@ -3372,6 +3372,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