func: Remove references to attachment_id when volume_id is used

GET [1], PUT [2] and DELETE [3] os-volume_attachments APIs all take the
server and volume ids as part of the request path. This change simply
replaces any reference to attachment_id when calling these APIs from the
functional API client.

[1] https://docs.openstack.org/api-ref/compute/#show-a-detail-of-a-volume-attachment
    GET /servers/{server_id}/os-volume_attachments/{volume_id}

[2] https://docs.openstack.org/api-ref/compute/#update-a-volume-attachment
    PUT /servers/{server_id}/os-volume_attachments/{volume_id}

[3] https://docs.openstack.org/api-ref/compute/#detach-a-volume-from-an-instance
    DELETE /servers/{server_id}/os-volume_attachments/{volume_id}

Change-Id: Ie9e65c93a1abc3778094ab18f2f7916f7f2d0cb8
This commit is contained in:
Lee Yarwood 2020-09-02 20:46:20 +01:00
parent 611399744f
commit a77f44a6c5
1 changed files with 6 additions and 6 deletions

View File

@ -366,9 +366,9 @@ class TestOpenStackClient(object):
def delete_snapshot(self, snap_id):
return self.api_delete('/os-snapshots/%s' % snap_id)
def get_server_volume(self, server_id, attachment_id):
def get_server_volume(self, server_id, volume_id):
return self.api_get('/servers/%s/os-volume_attachments/%s' %
(server_id, attachment_id)
(server_id, volume_id)
).body['volumeAttachment']
def get_server_volumes(self, server_id):
@ -380,14 +380,14 @@ class TestOpenStackClient(object):
(server_id), volume_attachment
).body['volumeAttachment']
def put_server_volume(self, server_id, attachment_id, volume_id):
def put_server_volume(self, server_id, original_volume_id, volume_id):
return self.api_put('/servers/%s/os-volume_attachments/%s' %
(server_id, attachment_id),
(server_id, original_volume_id),
{"volumeAttachment": {"volumeId": volume_id}})
def delete_server_volume(self, server_id, attachment_id):
def delete_server_volume(self, server_id, volume_id):
return self.api_delete('/servers/%s/os-volume_attachments/%s' %
(server_id, attachment_id))
(server_id, volume_id))
def post_server_metadata(self, server_id, metadata):
post_body = {'metadata': {}}