Make identity v3 services_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 services_client list API accept
filter param.

Also add and correct doc string link.

Partially implements blueprint consistent-service-method-names

Change-Id: Iac174a5d6ab650c4512d0961d10f83a9c23eee52
This commit is contained in:
ghanshyam 2016-08-01 17:04:28 +09:00 committed by Ghanshyam Mann
parent 8679ed12e3
commit ef301d8063

View File

@ -18,6 +18,7 @@ http://developer.openstack.org/api-ref-identity-v3.html#service-catalog-v3
"""
from oslo_serialization import jsonutils as json
from six.moves.urllib import parse as urllib
from tempest.lib.common import rest_client
@ -57,13 +58,21 @@ class ServicesClient(rest_client.RestClient):
body = json.loads(body)
return rest_client.ResponseBody(resp, body)
def delete_service(self, serv_id):
url = "services/" + serv_id
def delete_service(self, service_id):
url = "services/" + service_id
resp, body = self.delete(url)
self.expected_success(204, resp.status)
return rest_client.ResponseBody(resp, body)
def list_services(self):
def list_services(self, **params):
"""List services.
Available params: see http://developer.openstack.org/
api-ref/identity/v3/#list-services
"""
url = 'services'
if params:
url += '?%s' % urllib.urlencode(params)
resp, body = self.get('services')
self.expected_success(200, resp.status)
body = json.loads(body)