Add silent param for lb stats
Change-Id: Ic18d177a4fbec74646d0128dd9faf3c5cb3a0bce
This commit is contained in:
parent
849d2c0e5a
commit
c13089edcc
@ -609,7 +609,8 @@ class TestService(nsxlib_testcase.NsxClientTestCase):
|
||||
self.nsxlib.load_balancer.service.get_stats(fake_service['id'])
|
||||
get.assert_called_with(
|
||||
'loadbalancer/services/%s/statistics?source=realtime' %
|
||||
fake_service['id'])
|
||||
fake_service['id'],
|
||||
silent=False)
|
||||
|
||||
def test_get_status(self):
|
||||
with mock.patch.object(self.nsxlib.client, 'get') as get:
|
||||
|
@ -494,10 +494,10 @@ class Service(LoadBalancerBase):
|
||||
'virtual-servers', 'status')
|
||||
return self.client.get(object_url)
|
||||
|
||||
def get_stats(self, service_id, source='realtime'):
|
||||
def get_stats(self, service_id, source='realtime', silent=False):
|
||||
object_url = '%s/%s/%s?source=%s' % (self.resource, service_id,
|
||||
'statistics', source)
|
||||
return self.client.get(object_url)
|
||||
return self.client.get(object_url, silent=silent)
|
||||
|
||||
def get_usage(self, service_id):
|
||||
object_url = '%s/%s/%s' % (self.resource, service_id, 'usage')
|
||||
|
@ -351,8 +351,8 @@ class NsxPolicyResourceBase(object, metaclass=abc.ABCMeta):
|
||||
except IndexError:
|
||||
return
|
||||
|
||||
def _list(self, obj_def):
|
||||
return self.policy_api.list(obj_def).get('results', [])
|
||||
def _list(self, obj_def, silent=False):
|
||||
return self.policy_api.list(obj_def, silent=silent).get('results', [])
|
||||
|
||||
def _create_or_store(self, policy_def, child_def=None):
|
||||
transaction = trans.NsxPolicyTransaction.get_current()
|
||||
|
Loading…
Reference in New Issue
Block a user