summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Mendizabal <douglas.mendizabal@rackspace.com>2013-09-05 13:13:42 -0500
committerDouglas Mendizabal <douglas.mendizabal@rackspace.com>2013-09-05 13:13:42 -0500
commit71ae37fef1e02e486997aaddd48ee5606c19ea7b (patch)
tree12bad5ac9b6010c5f1577589285335e03007a176
parentc322aece44916ba0f3231275a1a8bd487ec3b4a7 (diff)
downloadpython-barbicanclient-71ae37fef1e02e486997aaddd48ee5606c19ea7b.tar.gz
Add total() to both secrets and orders.
-rw-r--r--barbicanclient/base.py10
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']