blob: c3388bbd9646441feca906f0739b0d19cc4d76a1 [file] [log] [blame]
Peter Stachowski320f9c72014-04-21 16:13:23 -04001# 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
16import urllib
17
Ken'ichi Ohmichi0e836652015-01-08 04:38:56 +000018from tempest.common import service_client
Peter Stachowski320f9c72014-04-21 16:13:23 -040019
20
Ken'ichi Ohmichi0e836652015-01-08 04:38:56 +000021class DatabaseVersionsClientJSON(service_client.ServiceClient):
Peter Stachowski320f9c72014-04-21 16:13:23 -040022
Ken'ichi Ohmichi737a6032015-01-21 07:04:42 +000023 def __init__(self, auth_provider, service, region,
24 endpoint_type=None, build_interval=None, build_timeout=None,
25 disable_ssl_certificate_validation=None, ca_certs=None,
26 trace_requests=None):
27 dscv = disable_ssl_certificate_validation
Ken'ichi Ohmichi0cd316b2014-12-24 03:51:04 +000028 super(DatabaseVersionsClientJSON, self).__init__(
Ken'ichi Ohmichi737a6032015-01-21 07:04:42 +000029 auth_provider, service, region,
30 endpoint_type=endpoint_type,
31 build_interval=build_interval,
32 build_timeout=build_timeout,
33 disable_ssl_certificate_validation=dscv,
34 ca_certs=ca_certs,
35 trace_requests=trace_requests)
Peter Stachowski320f9c72014-04-21 16:13:23 -040036 self.skip_path()
Peter Stachowski320f9c72014-04-21 16:13:23 -040037
38 def list_db_versions(self, params=None):
39 """List all versions."""
40 url = ''
41 if params:
42 url += '?%s' % urllib.urlencode(params)
43
44 resp, body = self.get(url)
Swapnil Kulkarni59c7f9b2014-08-20 14:55:23 +000045 self.expected_success(200, resp.status)
Peter Stachowski320f9c72014-04-21 16:13:23 -040046 return resp, self._parse_resp(body)