blob: 5f4b278e8051e1e63093e804362ee73787f9bd3a [file] [log] [blame]
jeremy.zhang79a1cbf2017-05-07 16:09:17 +08001# Copyright 2017 FiberHome Telecommunication Technologies CO.,LTD
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
16from oslo_serialization import jsonutils as json
17from six.moves.urllib import parse as urllib
18
19from tempest.lib.common import rest_client
20from tempest.lib.services.volume.v2 import volumes_client
jeremy.zhang79a1cbf2017-05-07 16:09:17 +080021
22
zhufl02736522017-06-19 13:57:28 +080023class VolumesClient(volumes_client.VolumesClient):
jeremy.zhang79a1cbf2017-05-07 16:09:17 +080024 """Client class to send CRUD Volume V3 API requests"""
25 api_version = "v3"
26
27 def show_volume_summary(self, **params):
28 """Get volumes summary.
29
30 For a full list of available parameters, please refer to the official
31 API reference:
32 https://developer.openstack.org/api-ref/block-storage/v3/#get-volumes-summary
33 """
34 url = 'volumes/summary'
35 if params:
36 url += '?%s' % urllib.urlencode(params)
37 resp, body = self.get(url)
38 body = json.loads(body)
39 self.expected_success(200, resp.status)
40 return rest_client.ResponseBody(resp, body)