Add total() to both secrets and orders.

This commit is contained in:
Douglas Mendizabal
2013-09-05 13:13:42 -05:00
parent c322aece44
commit 71ae37fef1

View File

@@ -26,3 +26,13 @@ class BaseEntityManager(object):
for k in dictionary.keys():
if dictionary[k] is None:
dictionary.pop(k)
def total(self):
"""
Returns the toatl number of entities stored in Barbican.
"""
href = '{0}/{1}'.format(self.api.base_url, self.entity)
params ={'limit': 0, 'offset': 0}
resp = self.api.get(href, params)
return resp['total']