diff options
author | Douglas Mendizabal <douglas.mendizabal@rackspace.com> | 2013-09-05 13:13:42 -0500 |
---|---|---|
committer | Douglas Mendizabal <douglas.mendizabal@rackspace.com> | 2013-09-05 13:13:42 -0500 |
commit | 71ae37fef1e02e486997aaddd48ee5606c19ea7b (patch) | |
tree | 12bad5ac9b6010c5f1577589285335e03007a176 | |
parent | c322aece44916ba0f3231275a1a8bd487ec3b4a7 (diff) | |
download | python-barbicanclient-71ae37fef1e02e486997aaddd48ee5606c19ea7b.tar.gz |
Add total() to both secrets and orders.
-rw-r--r-- | barbicanclient/base.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/barbicanclient/base.py b/barbicanclient/base.py index 0736e5f..c0b07a4 100644 --- a/barbicanclient/base.py +++ b/barbicanclient/base.py @@ -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'] |