summaryrefslogtreecommitdiff
path: root/tempest_lib/services/compute/servers_client.py
diff options
context:
space:
mode:
Diffstat (limited to 'tempest_lib/services/compute/servers_client.py')
-rw-r--r--tempest_lib/services/compute/servers_client.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tempest_lib/services/compute/servers_client.py b/tempest_lib/services/compute/servers_client.py
index 5bbcf24..cdb992b 100644
--- a/tempest_lib/services/compute/servers_client.py
+++ b/tempest_lib/services/compute/servers_client.py
@@ -312,6 +312,15 @@ class ServersClient(rest_client.RestClient):
self.validate_response(schema.attach_volume, resp, body)
return rest_client.ResponseBody(resp, body)
+ def update_attached_volume(self, server_id, attachment_id, **kwargs):
+ """Swaps a volume attached to an instance for another volume"""
+ post_body = json.dumps({'volumeAttachment': kwargs})
+ resp, body = self.put('servers/%s/os-volume_attachments/%s' %
+ (server_id, attachment_id),
+ post_body)
+ self.validate_response(schema.update_attached_volume, resp, body)
+ return rest_client.ResponseBody(resp, body)
+
def detach_volume(self, server_id, volume_id): # noqa
"""Detaches a volume from a server instance."""
resp, body = self.delete('servers/%s/os-volume_attachments/%s' %