blob: 43d253b457b11b3988cce3756785e5b77a5c81f1 [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
Matthew Treinish89128142015-04-23 10:44:30 -040016from six.moves.urllib import parse as urllib
Peter Stachowski320f9c72014-04-21 16:13:23 -040017
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 Ohmichia6287072015-07-02 02:43:15 +000021class DatabaseVersionsClient(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 Ohmichia6287072015-07-02 02:43:15 +000028 super(DatabaseVersionsClient, 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)
Anusha Ramineniae4abd12015-08-20 11:24:06 +053046 return service_client.ResponseBody(resp, body)