Make identity v3 groups_client use **kwargs
As we discussed on
http://lists.openstack.org/pipermail/openstack-dev/2015-July/068864.html
All http POST/PUT methods need to contain **kwargs as their arguments.
This patch makes identity v3 groups_client list APIs accept
filter param.
Also add doc string link.
Partially implements blueprint consistent-service-method-names
Change-Id: I916f2edb8706ebe9eccc0a353353e055d851f39e
diff --git a/tempest/services/identity/v3/json/groups_client.py b/tempest/services/identity/v3/json/groups_client.py
index 1a495f8..628b3e1 100644
--- a/tempest/services/identity/v3/json/groups_client.py
+++ b/tempest/services/identity/v3/json/groups_client.py
@@ -18,6 +18,7 @@
"""
from oslo_serialization import jsonutils as json
+from six.moves.urllib import parse as urllib
from tempest.lib.common import rest_client
@@ -44,9 +45,16 @@
body = json.loads(body)
return rest_client.ResponseBody(resp, body)
- def list_groups(self):
- """Lists the groups."""
- resp, body = self.get('groups')
+ def list_groups(self, **params):
+ """Lists the groups.
+
+ Available params: see http://developer.openstack.org/
+ api-ref/identity/v3/#list-groups
+ """
+ url = 'groups'
+ if params:
+ url += '?%s' % urllib.urlencode(params)
+ resp, body = self.get(url)
self.expected_success(200, resp.status)
body = json.loads(body)
return rest_client.ResponseBody(resp, body)
@@ -76,9 +84,16 @@
self.expected_success(204, resp.status)
return rest_client.ResponseBody(resp, body)
- def list_group_users(self, group_id):
- """List users in group."""
- resp, body = self.get('groups/%s/users' % group_id)
+ def list_group_users(self, group_id, **params):
+ """List users in group.
+
+ Available params: see http://developer.openstack.org/
+ api-ref/identity/v3/#list-users-in-group
+ """
+ url = 'groups/%s/users' % group_id
+ if params:
+ url += '?%s' % urllib.urlencode(params)
+ resp, body = self.get(url)
self.expected_success(200, resp.status)
body = json.loads(body)
return rest_client.ResponseBody(resp, body)