blob: 1e49e5a68aa7cd4e990de451d31837d88d5261b2 [file] [log] [blame]
ZhiQiang Fan39f97222013-09-20 04:49:44 +08001# Copyright 2012 OpenStack Foundation
Rohit Karajgidd47d7e2012-07-31 04:11:01 -07002# 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
rajalakshmi-ganesanddd9e0e2012-03-21 00:49:22 +053016import json
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +053017import time
Matthew Treinish26dd0fa2012-12-04 17:14:37 -050018import urllib
rajalakshmi-ganesanddd9e0e2012-03-21 00:49:22 +053019
Yuiko Takada4d41c2f2014-03-07 11:58:31 +000020from tempest.common import rest_client
Matthew Treinish684d8992014-01-30 16:27:40 +000021from tempest import config
Rohit Karajgidd47d7e2012-07-31 04:11:01 -070022from tempest import exceptions
23
Matthew Treinish684d8992014-01-30 16:27:40 +000024CONF = config.CONF
25
rajalakshmi-ganesanddd9e0e2012-03-21 00:49:22 +053026
Zhi Kun Liu6e6cf832014-05-08 17:25:22 +080027class BaseVolumesClientJSON(rest_client.RestClient):
Rohit Karajgidd47d7e2012-07-31 04:11:01 -070028 """
Zhi Kun Liu6e6cf832014-05-08 17:25:22 +080029 Base client class to send CRUD Volume API requests to a Cinder endpoint
Rohit Karajgidd47d7e2012-07-31 04:11:01 -070030 """
rajalakshmi-ganesanddd9e0e2012-03-21 00:49:22 +053031
Andrea Frittoli8bbdb162014-01-06 11:06:13 +000032 def __init__(self, auth_provider):
Zhi Kun Liu6e6cf832014-05-08 17:25:22 +080033 super(BaseVolumesClientJSON, self).__init__(auth_provider)
Rohit Karajgidd47d7e2012-07-31 04:11:01 -070034
Matthew Treinish684d8992014-01-30 16:27:40 +000035 self.service = CONF.volume.catalog_type
36 self.build_interval = CONF.volume.build_interval
37 self.build_timeout = CONF.volume.build_timeout
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +000038 self.create_resp = 200
rajalakshmi-ganesanddd9e0e2012-03-21 00:49:22 +053039
anju tiwari789449a2013-08-29 16:56:17 +053040 def get_attachment_from_volume(self, volume):
41 """Return the element 'attachment' from input volumes."""
42 return volume['attachments'][0]
43
rajalakshmi-ganesanddd9e0e2012-03-21 00:49:22 +053044 def list_volumes(self, params=None):
Sean Daguef237ccb2013-01-04 15:19:14 -050045 """List all the volumes created."""
Rohit Karajgidd47d7e2012-07-31 04:11:01 -070046 url = 'volumes'
Matthew Treinish26dd0fa2012-12-04 17:14:37 -050047 if params:
48 url += '?%s' % urllib.urlencode(params)
rajalakshmi-ganesanddd9e0e2012-03-21 00:49:22 +053049
chris fattarsi5098fa22012-04-17 13:27:00 -070050 resp, body = self.get(url)
rajalakshmi-ganesanddd9e0e2012-03-21 00:49:22 +053051 body = json.loads(body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +000052 self.expected_success(200, resp.status)
rajalakshmi-ganesanddd9e0e2012-03-21 00:49:22 +053053 return resp, body['volumes']
54
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +053055 def list_volumes_with_detail(self, params=None):
Sean Daguef237ccb2013-01-04 15:19:14 -050056 """List the details of all volumes."""
Rohit Karajgidd47d7e2012-07-31 04:11:01 -070057 url = 'volumes/detail'
Matthew Treinish26dd0fa2012-12-04 17:14:37 -050058 if params:
59 url += '?%s' % urllib.urlencode(params)
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +053060
chris fattarsi5098fa22012-04-17 13:27:00 -070061 resp, body = self.get(url)
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +053062 body = json.loads(body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +000063 self.expected_success(200, resp.status)
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +053064 return resp, body['volumes']
65
Attila Fazekasb8aa7592013-01-26 01:25:45 +010066 def get_volume(self, volume_id):
Sean Daguef237ccb2013-01-04 15:19:14 -050067 """Returns the details of a single volume."""
Rohit Karajgidd47d7e2012-07-31 04:11:01 -070068 url = "volumes/%s" % str(volume_id)
Attila Fazekasb8aa7592013-01-26 01:25:45 +010069 resp, body = self.get(url)
rajalakshmi-ganesanddd9e0e2012-03-21 00:49:22 +053070 body = json.loads(body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +000071 self.expected_success(200, resp.status)
rajalakshmi-ganesanddd9e0e2012-03-21 00:49:22 +053072 return resp, body['volume']
73
Jerry Cai9733d0e2014-03-19 15:50:49 +080074 def create_volume(self, size=None, **kwargs):
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +053075 """
76 Creates a new Volume.
Jerry Cai9733d0e2014-03-19 15:50:49 +080077 size: Size of volume in GB.
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +053078 Following optional keyword arguments are accepted:
Zhi Kun Liu6e6cf832014-05-08 17:25:22 +080079 display_name: Optional Volume Name(only for V1).
80 name: Optional Volume Name(only for V2).
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +053081 metadata: A dictionary of values to be used as metadata.
Rohan Rhishikesh Kanadec316f0a2012-12-04 05:44:39 -080082 volume_type: Optional Name of volume_type for the volume
Attila Fazekas36b1fcf2013-01-31 16:41:04 +010083 snapshot_id: When specified the volume is created from this snapshot
Giulio Fidente36836c42013-04-05 15:43:51 +020084 imageRef: When specified the volume is created from this image
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +053085 """
Jerry Cai9733d0e2014-03-19 15:50:49 +080086 # for bug #1293885:
87 # If no size specified, read volume size from CONF
88 if size is None:
89 size = CONF.volume.volume_size
Attila Fazekas36b1fcf2013-01-31 16:41:04 +010090 post_body = {'size': size}
91 post_body.update(kwargs)
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +053092 post_body = json.dumps({'volume': post_body})
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +020093 resp, body = self.post('volumes', post_body)
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +053094 body = json.loads(body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +000095 self.expected_success(self.create_resp, resp.status)
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +053096 return resp, body['volume']
97
QingXin Meng611768a2013-09-18 00:51:33 -070098 def update_volume(self, volume_id, **kwargs):
99 """Updates the Specified Volume."""
100 put_body = json.dumps({'volume': kwargs})
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200101 resp, body = self.put('volumes/%s' % volume_id, put_body)
QingXin Meng611768a2013-09-18 00:51:33 -0700102 body = json.loads(body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000103 self.expected_success(200, resp.status)
QingXin Meng611768a2013-09-18 00:51:33 -0700104 return resp, body['volume']
105
rajalakshmi-ganesanddd9e0e2012-03-21 00:49:22 +0530106 def delete_volume(self, volume_id):
Sean Daguef237ccb2013-01-04 15:19:14 -0500107 """Deletes the Specified Volume."""
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000108 resp, body = self.delete("volumes/%s" % str(volume_id))
109 self.expected_success(202, resp.status)
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +0530110
Ryan Hsua67f4632013-08-29 16:03:06 -0700111 def upload_volume(self, volume_id, image_name, disk_format):
Giulio Fidente884e9da2013-06-21 17:25:42 +0200112 """Uploads a volume in Glance."""
113 post_body = {
114 'image_name': image_name,
Ryan Hsua67f4632013-08-29 16:03:06 -0700115 'disk_format': disk_format
Giulio Fidente884e9da2013-06-21 17:25:42 +0200116 }
117 post_body = json.dumps({'os-volume_upload_image': post_body})
118 url = 'volumes/%s/action' % (volume_id)
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200119 resp, body = self.post(url, post_body)
Giulio Fidente884e9da2013-06-21 17:25:42 +0200120 body = json.loads(body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000121 self.expected_success(202, resp.status)
Giulio Fidente884e9da2013-06-21 17:25:42 +0200122 return resp, body['os-volume_upload_image']
123
Rohit Karajgia42fe442012-09-21 03:08:33 -0700124 def attach_volume(self, volume_id, instance_uuid, mountpoint):
Sean Daguef237ccb2013-01-04 15:19:14 -0500125 """Attaches a volume to a given instance on a given mountpoint."""
Rohit Karajgia42fe442012-09-21 03:08:33 -0700126 post_body = {
Zhongyue Luo30a563f2012-09-30 23:43:50 +0900127 'instance_uuid': instance_uuid,
128 'mountpoint': mountpoint,
129 }
Rohit Karajgia42fe442012-09-21 03:08:33 -0700130 post_body = json.dumps({'os-attach': post_body})
131 url = 'volumes/%s/action' % (volume_id)
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200132 resp, body = self.post(url, post_body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000133 self.expected_success(202, resp.status)
Rohit Karajgia42fe442012-09-21 03:08:33 -0700134 return resp, body
135
136 def detach_volume(self, volume_id):
Sean Daguef237ccb2013-01-04 15:19:14 -0500137 """Detaches a volume from an instance."""
Rohit Karajgia42fe442012-09-21 03:08:33 -0700138 post_body = {}
139 post_body = json.dumps({'os-detach': post_body})
140 url = 'volumes/%s/action' % (volume_id)
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200141 resp, body = self.post(url, post_body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000142 self.expected_success(202, resp.status)
Rohit Karajgia42fe442012-09-21 03:08:33 -0700143 return resp, body
144
zhangyanzi6b632432013-10-24 19:08:50 +0800145 def reserve_volume(self, volume_id):
146 """Reserves a volume."""
147 post_body = {}
148 post_body = json.dumps({'os-reserve': post_body})
149 url = 'volumes/%s/action' % (volume_id)
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200150 resp, body = self.post(url, post_body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000151 self.expected_success(202, resp.status)
zhangyanzi6b632432013-10-24 19:08:50 +0800152 return resp, body
153
154 def unreserve_volume(self, volume_id):
155 """Restore a reserved volume ."""
156 post_body = {}
157 post_body = json.dumps({'os-unreserve': post_body})
158 url = 'volumes/%s/action' % (volume_id)
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200159 resp, body = self.post(url, post_body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000160 self.expected_success(202, resp.status)
zhangyanzi6b632432013-10-24 19:08:50 +0800161 return resp, body
162
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +0530163 def wait_for_volume_status(self, volume_id, status):
Sean Daguef237ccb2013-01-04 15:19:14 -0500164 """Waits for a Volume to reach a given status."""
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +0530165 resp, body = self.get_volume(volume_id)
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +0530166 volume_status = body['status']
167 start = int(time.time())
168
169 while volume_status != status:
170 time.sleep(self.build_interval)
171 resp, body = self.get_volume(volume_id)
172 volume_status = body['status']
173 if volume_status == 'error':
rajalakshmi-ganesane3bb58f2012-05-16 12:01:15 +0530174 raise exceptions.VolumeBuildErrorException(volume_id=volume_id)
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +0530175
176 if int(time.time()) - start >= self.build_timeout:
Martin Pavlasek1102c3a2014-10-20 17:17:55 +0200177 message = ('Volume %s failed to reach %s status (current: %s) '
178 'within the required time '
179 '(%s s).' % (volume_id,
180 status,
181 volume_status,
182 self.build_timeout))
rajalakshmi-ganesanb4465572012-03-22 01:22:50 +0530183 raise exceptions.TimeoutException(message)
David Kranz6aceb4a2012-06-05 14:05:45 -0400184
185 def is_resource_deleted(self, id):
186 try:
Attila Fazekasf53172c2013-01-26 01:04:42 +0100187 self.get_volume(id)
David Kranz6aceb4a2012-06-05 14:05:45 -0400188 except exceptions.NotFound:
189 return True
190 return False
wanghao5b981752013-10-22 11:41:41 +0800191
Matt Riedemannd2b96512014-10-13 10:18:16 -0700192 @property
193 def resource_type(self):
194 """Returns the primary type of resource this client works with."""
195 return 'volume'
196
wanghao5b981752013-10-22 11:41:41 +0800197 def extend_volume(self, volume_id, extend_size):
198 """Extend a volume."""
199 post_body = {
200 'new_size': extend_size
201 }
202 post_body = json.dumps({'os-extend': post_body})
203 url = 'volumes/%s/action' % (volume_id)
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200204 resp, body = self.post(url, post_body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000205 self.expected_success(202, resp.status)
wanghao5b981752013-10-22 11:41:41 +0800206 return resp, body
wanghaoaa1f2f92013-10-10 11:30:37 +0800207
208 def reset_volume_status(self, volume_id, status):
209 """Reset the Specified Volume's Status."""
210 post_body = json.dumps({'os-reset_status': {"status": status}})
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200211 resp, body = self.post('volumes/%s/action' % volume_id, post_body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000212 self.expected_success(202, resp.status)
wanghaoaa1f2f92013-10-10 11:30:37 +0800213 return resp, body
214
215 def volume_begin_detaching(self, volume_id):
216 """Volume Begin Detaching."""
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000217 # ref cinder/api/contrib/volume_actions.py#L158
wanghaoaa1f2f92013-10-10 11:30:37 +0800218 post_body = json.dumps({'os-begin_detaching': {}})
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200219 resp, body = self.post('volumes/%s/action' % volume_id, post_body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000220 self.expected_success(202, resp.status)
wanghaoaa1f2f92013-10-10 11:30:37 +0800221 return resp, body
222
223 def volume_roll_detaching(self, volume_id):
224 """Volume Roll Detaching."""
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000225 # cinder/api/contrib/volume_actions.py#L170
wanghaoaa1f2f92013-10-10 11:30:37 +0800226 post_body = json.dumps({'os-roll_detaching': {}})
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200227 resp, body = self.post('volumes/%s/action' % volume_id, post_body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000228 self.expected_success(202, resp.status)
wanghaoaa1f2f92013-10-10 11:30:37 +0800229 return resp, body
wingwjcbd82dc2013-10-22 16:38:39 +0800230
231 def create_volume_transfer(self, vol_id, display_name=None):
232 """Create a volume transfer."""
233 post_body = {
234 'volume_id': vol_id
235 }
236 if display_name:
237 post_body['name'] = display_name
238 post_body = json.dumps({'transfer': post_body})
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200239 resp, body = self.post('os-volume-transfer', post_body)
wingwjcbd82dc2013-10-22 16:38:39 +0800240 body = json.loads(body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000241 self.expected_success(202, resp.status)
wingwjcbd82dc2013-10-22 16:38:39 +0800242 return resp, body['transfer']
243
244 def get_volume_transfer(self, transfer_id):
245 """Returns the details of a volume transfer."""
246 url = "os-volume-transfer/%s" % str(transfer_id)
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200247 resp, body = self.get(url)
wingwjcbd82dc2013-10-22 16:38:39 +0800248 body = json.loads(body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000249 self.expected_success(200, resp.status)
wingwjcbd82dc2013-10-22 16:38:39 +0800250 return resp, body['transfer']
251
252 def list_volume_transfers(self, params=None):
253 """List all the volume transfers created."""
254 url = 'os-volume-transfer'
255 if params:
256 url += '?%s' % urllib.urlencode(params)
257 resp, body = self.get(url)
258 body = json.loads(body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000259 self.expected_success(200, resp.status)
wingwjcbd82dc2013-10-22 16:38:39 +0800260 return resp, body['transfers']
261
262 def delete_volume_transfer(self, transfer_id):
263 """Delete a volume transfer."""
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000264 resp, body = self.delete("os-volume-transfer/%s" % str(transfer_id))
265 self.expected_success(202, resp.status)
wingwjcbd82dc2013-10-22 16:38:39 +0800266
267 def accept_volume_transfer(self, transfer_id, transfer_auth_key):
268 """Accept a volume transfer."""
269 post_body = {
270 'auth_key': transfer_auth_key,
271 }
272 url = 'os-volume-transfer/%s/accept' % transfer_id
273 post_body = json.dumps({'accept': post_body})
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200274 resp, body = self.post(url, post_body)
wingwjcbd82dc2013-10-22 16:38:39 +0800275 body = json.loads(body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000276 self.expected_success(202, resp.status)
wingwjcbd82dc2013-10-22 16:38:39 +0800277 return resp, body['transfer']
zhangyanziaa180072013-11-21 12:31:26 +0800278
279 def update_volume_readonly(self, volume_id, readonly):
280 """Update the Specified Volume readonly."""
281 post_body = {
282 'readonly': readonly
283 }
284 post_body = json.dumps({'os-update_readonly_flag': post_body})
285 url = 'volumes/%s/action' % (volume_id)
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200286 resp, body = self.post(url, post_body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000287 self.expected_success(202, resp.status)
zhangyanziaa180072013-11-21 12:31:26 +0800288 return resp, body
wanghao9d3d6cb2013-11-12 15:10:10 +0800289
290 def force_delete_volume(self, volume_id):
291 """Force Delete Volume."""
292 post_body = json.dumps({'os-force_delete': {}})
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200293 resp, body = self.post('volumes/%s/action' % volume_id, post_body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000294 self.expected_success(202, resp.status)
wanghao9d3d6cb2013-11-12 15:10:10 +0800295 return resp, body
huangtianhua0ff41682013-12-16 14:49:31 +0800296
297 def create_volume_metadata(self, volume_id, metadata):
298 """Create metadata for the volume."""
299 put_body = json.dumps({'metadata': metadata})
300 url = "volumes/%s/metadata" % str(volume_id)
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200301 resp, body = self.post(url, put_body)
huangtianhua0ff41682013-12-16 14:49:31 +0800302 body = json.loads(body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000303 self.expected_success(200, resp.status)
huangtianhua0ff41682013-12-16 14:49:31 +0800304 return resp, body['metadata']
305
306 def get_volume_metadata(self, volume_id):
307 """Get metadata of the volume."""
308 url = "volumes/%s/metadata" % str(volume_id)
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200309 resp, body = self.get(url)
huangtianhua0ff41682013-12-16 14:49:31 +0800310 body = json.loads(body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000311 self.expected_success(200, resp.status)
huangtianhua0ff41682013-12-16 14:49:31 +0800312 return resp, body['metadata']
313
314 def update_volume_metadata(self, volume_id, metadata):
315 """Update metadata for the volume."""
316 put_body = json.dumps({'metadata': metadata})
317 url = "volumes/%s/metadata" % str(volume_id)
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200318 resp, body = self.put(url, put_body)
huangtianhua0ff41682013-12-16 14:49:31 +0800319 body = json.loads(body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000320 self.expected_success(200, resp.status)
huangtianhua0ff41682013-12-16 14:49:31 +0800321 return resp, body['metadata']
322
323 def update_volume_metadata_item(self, volume_id, id, meta_item):
324 """Update metadata item for the volume."""
325 put_body = json.dumps({'meta': meta_item})
326 url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200327 resp, body = self.put(url, put_body)
huangtianhua0ff41682013-12-16 14:49:31 +0800328 body = json.loads(body)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000329 self.expected_success(200, resp.status)
huangtianhua0ff41682013-12-16 14:49:31 +0800330 return resp, body['meta']
331
332 def delete_volume_metadata_item(self, volume_id, id):
333 """Delete metadata item for the volume."""
334 url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
Valeriy Ponomaryov88686d82014-02-16 12:24:51 +0200335 resp, body = self.delete(url)
Swapnil Kulkarnid9df38c2014-08-16 18:06:52 +0000336 self.expected_success(200, resp.status)
Zhi Kun Liu6e6cf832014-05-08 17:25:22 +0800337
338
339class VolumesClientJSON(BaseVolumesClientJSON):
340 """
341 Client class to send CRUD Volume V1 API requests to a Cinder endpoint
342 """