blob: da495d7d7d55135598966fb397d8844c64a6920f [file] [log] [blame]
ravikumar-venkatesan9e81b442014-12-08 09:57:56 +00001# Copyright 2014 OpenStack Foundation
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
Anusha Ramineni2e2ba0c2015-08-28 12:37:29 +053016from oslo_serialization import jsonutils as json
Matthew Treinish89128142015-04-23 10:44:30 -040017from six.moves.urllib import parse as urllib
ravikumar-venkatesan9e81b442014-12-08 09:57:56 +000018
David Kranzb728df72015-02-18 13:40:29 -050019from tempest.common import service_client
ravikumar-venkatesan9e81b442014-12-08 09:57:56 +000020
ravikumar-venkatesan9e81b442014-12-08 09:57:56 +000021
Ken'ichi Ohmichia6287072015-07-02 02:43:15 +000022class DatabaseLimitsClient(service_client.ServiceClient):
ravikumar-venkatesan9e81b442014-12-08 09:57:56 +000023
24 def list_db_limits(self, params=None):
25 """List all limits."""
26 url = 'limits'
27 if params:
28 url += '?%s' % urllib.urlencode(params)
29 resp, body = self.get(url)
30 self.expected_success(200, resp.status)
Anusha Ramineni2e2ba0c2015-08-28 12:37:29 +053031 body = json.loads(body)
Anusha Ramineniae4abd12015-08-20 11:24:06 +053032 return service_client.ResponseBody(resp, body)