diff --git a/vmware_nsxlib/tests/unit/v3/test_resources.py b/vmware_nsxlib/tests/unit/v3/test_resources.py index c9a292dc..5ef18278 100644 --- a/vmware_nsxlib/tests/unit/v3/test_resources.py +++ b/vmware_nsxlib/tests/unit/v3/test_resources.py @@ -1342,6 +1342,18 @@ class MetadataProxy(BaseTestResource): data=jsonutils.dumps(fake_md, sort_keys=True), headers=self.default_headers()) + def test_get_md_proxy_status(self): + """Test getting proxy_status.""" + mocked_resource = self.get_mocked_resource() + attachment_id = 'd84ba3b8-9201-4591-8264-aad289e762ee' + logical_switch_id = 'e11803a2-2d3e-452b-a834-aeb94940d272' + mocked_resource.get_md_proxy_status(attachment_id, logical_switch_id) + test_client.assert_json_call( + 'get', mocked_resource, + "https://1.2.3.4/api/v1/md-proxies/%s/%s/status" % + (attachment_id, logical_switch_id), + headers=self.default_headers()) + class NsxLibSwitchTestCase(BaseTestResource): diff --git a/vmware_nsxlib/v3/core_resources.py b/vmware_nsxlib/v3/core_resources.py index c45d5360..109eb1df 100644 --- a/vmware_nsxlib/v3/core_resources.py +++ b/vmware_nsxlib/v3/core_resources.py @@ -825,6 +825,12 @@ class NsxLibMetadataProxy(utils.NsxLibApiBase): body['edge_cluster_id'] = edge_cluster_id return self._update_with_retry(uuid, body) + def get_md_proxy_status(self, attachment_id, logical_switch_id): + """Return all matching logical port statuses""" + url_suffix = ('/%s/%s/status' % + (attachment_id, logical_switch_id)) + return self.client.get(self.get_path(url_suffix)) + class NsxLibBridgeCluster(utils.NsxLibApiBase):