Merge "New api for getting the LB virtual servers status"
This commit is contained in:
commit
ca13303116
@ -545,6 +545,15 @@ class TestService(nsxlib_testcase.NsxClientTestCase):
|
||||
get.assert_called_with(
|
||||
'loadbalancer/services/%s/status' % fake_service['id'])
|
||||
|
||||
def test_get_virtual_servers_status(self):
|
||||
with mock.patch.object(self.nsxlib.client, 'get') as get:
|
||||
fake_service = consts.FAKE_SERVICE.copy()
|
||||
self.nsxlib.load_balancer.service.get_virtual_servers_status(
|
||||
fake_service['id'])
|
||||
get.assert_called_with(
|
||||
'loadbalancer/services/%s/virtual-servers/status' %
|
||||
fake_service['id'])
|
||||
|
||||
def test_delete_service(self):
|
||||
with mock.patch.object(self.nsxlib.client, 'delete') as delete:
|
||||
fake_service = consts.FAKE_SERVICE.copy()
|
||||
|
@ -454,6 +454,11 @@ class Service(LoadBalancerBase):
|
||||
object_url = '%s/%s/%s' % (self.resource, service_id, 'status')
|
||||
return self.client.get(object_url)
|
||||
|
||||
def get_virtual_servers_status(self, service_id):
|
||||
object_url = '%s/%s/%s/%s' % (self.resource, service_id,
|
||||
'virtual-servers', 'status')
|
||||
return self.client.get(object_url)
|
||||
|
||||
def get_stats(self, service_id, source='realtime'):
|
||||
object_url = '%s/%s/%s?source=%s' % (self.resource, service_id,
|
||||
'statistics', source)
|
||||
|
Loading…
Reference in New Issue
Block a user