summaryrefslogtreecommitdiff
path: root/barbicanclient
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-15 18:42:21 +0000
committerGerrit Code Review <review@openstack.org>2017-06-15 18:42:21 +0000
commit83eb7b3b3a80873b6f33e89b885e6af1f931717c (patch)
treeb805b2941e79b98baf73a97b675c7e5aefbe2729 /barbicanclient
parent53bf2322319153fa8a7ee1c121f7c4abaa185f7d (diff)
parent8254828e6445878bf73427e1d8184773ae36a8c2 (diff)
downloadpython-barbicanclient-83eb7b3b3a80873b6f33e89b885e6af1f931717c.tar.gz
Merge "Add client list filter functionality"
Diffstat (limited to 'barbicanclient')
-rw-r--r--barbicanclient/secrets.py32
1 files changed, 30 insertions, 2 deletions
diff --git a/barbicanclient/secrets.py b/barbicanclient/secrets.py
index f373007..0f9de79 100644
--- a/barbicanclient/secrets.py
+++ b/barbicanclient/secrets.py
@@ -537,19 +537,37 @@ class SecretManager(base.BaseEntityManager):
raise ValueError('secret_ref is required.')
self._api.delete(secret_ref)
- def list(self, limit=10, offset=0, name=None, algorithm=None,
- mode=None, bits=0):
+ def list(self, limit=10, offset=0, name=None, algorithm=None, mode=None,
+ bits=0, secret_type=None, created=None, updated=None,
+ expiration=None, sort=None):
"""List Secrets for the project
This method uses the limit and offset parameters for paging,
and also supports filtering.
+ The time filters (created, updated, and expiration) are expected to
+ be an ISO 8601 formatted string, which can be prefixed with comparison
+ operators: 'gt:' (greater-than), 'gte:' (greater-than-or-equal), 'lt:'
+ (less-than), or 'lte': (less-than-or-equal).
+
:param limit: Max number of secrets returned
:param offset: Offset secrets to begin list
:param name: Name filter for the list
:param algorithm: Algorithm filter for the list
:param mode: Mode filter for the list
:param bits: Bits filter for the list
+ :param secret_type: Secret type filter for the list
+ :param created: Created time filter for the list, an ISO 8601 format
+ string, optionally prefixed with 'gt:', 'gte:', 'lt:', or 'lte:'
+ :param updated: Updated time filter for the list, an ISO 8601 format
+ string, optionally prefixed with 'gt:', 'gte:', 'lt:', or 'lte:'
+ :param expiration: Expiration time filter for the list, an ISO 8601
+ format string, optionally prefixed with 'gt:', 'gte:', 'lt:',
+ or 'lte:'
+ :param sort: Determines the sorted order of the returned list, a
+ string of comma-separated sort keys ('created', 'expiration',
+ 'mode', 'name', 'secret_type', 'status', or 'updated') with a
+ direction appended (':asc' or ':desc') to each key
:returns: list of Secret objects that satisfy the provided filter
criteria.
:rtype: list
@@ -568,6 +586,16 @@ class SecretManager(base.BaseEntityManager):
params['mode'] = mode
if bits > 0:
params['bits'] = bits
+ if secret_type:
+ params['secret_type'] = secret_type
+ if created:
+ params['created'] = created
+ if updated:
+ params['updated'] = updated
+ if expiration:
+ params['expiration'] = expiration
+ if sort:
+ params['sort'] = sort
response = self._api.get(self._entity, params=params)