Peter Stachowski | 320f9c7 | 2014-04-21 16:13:23 -0400 | [diff] [blame] | 1 | # 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 Treinish | 8912814 | 2015-04-23 10:44:30 -0400 | [diff] [blame] | 16 | from six.moves.urllib import parse as urllib |
Peter Stachowski | 320f9c7 | 2014-04-21 16:13:23 -0400 | [diff] [blame] | 17 | |
Ken'ichi Ohmichi | 0e83665 | 2015-01-08 04:38:56 +0000 | [diff] [blame] | 18 | from tempest.common import service_client |
Peter Stachowski | 320f9c7 | 2014-04-21 16:13:23 -0400 | [diff] [blame] | 19 | |
| 20 | |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 21 | class DatabaseVersionsClient(service_client.ServiceClient): |
Peter Stachowski | 320f9c7 | 2014-04-21 16:13:23 -0400 | [diff] [blame] | 22 | |
Ken'ichi Ohmichi | 737a603 | 2015-01-21 07:04:42 +0000 | [diff] [blame] | 23 | 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 Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 28 | super(DatabaseVersionsClient, self).__init__( |
Ken'ichi Ohmichi | 737a603 | 2015-01-21 07:04:42 +0000 | [diff] [blame] | 29 | 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 Stachowski | 320f9c7 | 2014-04-21 16:13:23 -0400 | [diff] [blame] | 36 | self.skip_path() |
Peter Stachowski | 320f9c7 | 2014-04-21 16:13:23 -0400 | [diff] [blame] | 37 | |
| 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 Kulkarni | 59c7f9b | 2014-08-20 14:55:23 +0000 | [diff] [blame] | 45 | self.expected_success(200, resp.status) |
Anusha Ramineni | ae4abd1 | 2015-08-20 11:24:06 +0530 | [diff] [blame] | 46 | return service_client.ResponseBody(resp, body) |