From cf271466bc1f4d808cf3b306d9038ff79a726d7f Mon Sep 17 00:00:00 2001 From: Pino de Candia <32303022+pinodeca@users.noreply.github.com> Date: Thu, 25 Jan 2018 15:58:12 -0600 Subject: [PATCH] (Re)introduce use of criterion and response_key in API 'list' calls. --- tatuclient/v1/ca.py | 5 +++-- tatuclient/v1/hostcert.py | 5 +++-- tatuclient/v1/usercert.py | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tatuclient/v1/ca.py b/tatuclient/v1/ca.py index f379853..e310115 100644 --- a/tatuclient/v1/ca.py +++ b/tatuclient/v1/ca.py @@ -21,8 +21,9 @@ class CAController(V1Controller): def create(self, auth_id): return self._post('/noauth/authorities', data={ 'auth_id': auth_id }) - def list(self): - return self._get('/noauth/authorities') + def list(self, criterion=None, marker=None, limit=None): + url = self.build_url('/noauth/authorities', criterion, marker, limit) + return self._get(url, response_key='CAs') def get(self, auth_id): return self._get('/noauth/authorities/%s' % auth_id) diff --git a/tatuclient/v1/hostcert.py b/tatuclient/v1/hostcert.py index d05f1cd..879894b 100644 --- a/tatuclient/v1/hostcert.py +++ b/tatuclient/v1/hostcert.py @@ -18,8 +18,9 @@ from tatuclient.v1 import utils as v1_utils class HostCertController(V1Controller): - def list(self): - return self._get('/noauth/hostcerts') + def list(self, criterion=None, marker=None, limit=None): + url = self.build_url('/noauth/hostcerts', criterion, marker, limit) + return self._get(url, response_key='hosts') def get(self, host_id, fingerprint): return self._get('/noauth/hostcerts/%s/%s' % (host_id, fingerprint)) diff --git a/tatuclient/v1/usercert.py b/tatuclient/v1/usercert.py index 1f71956..aa6501c 100644 --- a/tatuclient/v1/usercert.py +++ b/tatuclient/v1/usercert.py @@ -21,8 +21,9 @@ class UserCertController(V1Controller): def create(self, **kwargs): return self._post('/noauth/usercerts', data=kwargs) - def list(self): - return self._get('/noauth/usercerts') + def list(self, criterion=None, marker=None, limit=None): + url = self.build_url('/noauth/usercerts', criterion, marker, limit) + return self._get(url, response_key='users') def get(self, serial): return self._get('/noauth/usercerts/%s' % serial)