diff --git a/doc/api_samples/os-volumes/list-volume-attachments-resp.json b/doc/api_samples/os-volumes/list-volume-attachments-resp.json index 68411d9c95e5..3ad77cf7de8a 100644 --- a/doc/api_samples/os-volumes/list-volume-attachments-resp.json +++ b/doc/api_samples/os-volumes/list-volume-attachments-resp.json @@ -1,9 +1,15 @@ { "volumeAttachments": [ + { + "device": "/dev/sdc", + "id": "227cc671-f30b-4488-96fd-7d0bf13648d8", + "serverId": "4b293d31-ebd5-4a7f-be03-874b90021e54", + "volumeId": "227cc671-f30b-4488-96fd-7d0bf13648d8" + }, { "device": "/dev/sdb", "id": "a07f71dc-8151-4e7d-a0cc-cd24a3f11113", - "serverId": "fd5bb1c4-de31-4071-8472-9410bc9155ec", + "serverId": "4b293d31-ebd5-4a7f-be03-874b90021e54", "volumeId": "a07f71dc-8151-4e7d-a0cc-cd24a3f11113" } ] diff --git a/doc/api_samples/os-volumes/v2.49/list-volume-attachments-resp.json b/doc/api_samples/os-volumes/v2.49/list-volume-attachments-resp.json index 4e696e9f061b..18a5aad803ab 100644 --- a/doc/api_samples/os-volumes/v2.49/list-volume-attachments-resp.json +++ b/doc/api_samples/os-volumes/v2.49/list-volume-attachments-resp.json @@ -1,9 +1,15 @@ { "volumeAttachments": [ + { + "device": "/dev/sdc", + "id": "227cc671-f30b-4488-96fd-7d0bf13648d8", + "serverId": "1453a6a8-10ec-4797-9b9e-da3c703579d5", + "volumeId": "227cc671-f30b-4488-96fd-7d0bf13648d8" + }, { "device": "/dev/sdb", "id": "a07f71dc-8151-4e7d-a0cc-cd24a3f11113", - "serverId": "1b92ff87-0116-40f5-9087-f4b907aeeaf1", + "serverId": "1453a6a8-10ec-4797-9b9e-da3c703579d5", "volumeId": "a07f71dc-8151-4e7d-a0cc-cd24a3f11113" } ] diff --git a/doc/api_samples/os-volumes/v2.70/list-volume-attachments-resp.json b/doc/api_samples/os-volumes/v2.70/list-volume-attachments-resp.json index 0b803c6d6b7a..f17cc8e2d87f 100644 --- a/doc/api_samples/os-volumes/v2.70/list-volume-attachments-resp.json +++ b/doc/api_samples/os-volumes/v2.70/list-volume-attachments-resp.json @@ -1,9 +1,16 @@ { "volumeAttachments": [ + { + "device": "/dev/sdc", + "id": "227cc671-f30b-4488-96fd-7d0bf13648d8", + "serverId": "68426b0f-511b-4cb3-8169-bba2e7a8bc89", + "tag": null, + "volumeId": "227cc671-f30b-4488-96fd-7d0bf13648d8" + }, { "device": "/dev/sdb", "id": "a07f71dc-8151-4e7d-a0cc-cd24a3f11113", - "serverId": "297155de-f7f2-4e87-82d0-ccc7d225d491", + "serverId": "68426b0f-511b-4cb3-8169-bba2e7a8bc89", "tag": "foo", "volumeId": "a07f71dc-8151-4e7d-a0cc-cd24a3f11113" } diff --git a/doc/api_samples/os-volumes/v2.79/list-volume-attachments-resp.json b/doc/api_samples/os-volumes/v2.79/list-volume-attachments-resp.json index 26ea4ee7b44d..ffe7c0baf1eb 100644 --- a/doc/api_samples/os-volumes/v2.79/list-volume-attachments-resp.json +++ b/doc/api_samples/os-volumes/v2.79/list-volume-attachments-resp.json @@ -1,10 +1,18 @@ { "volumeAttachments": [ + { + "delete_on_termination": false, + "device": "/dev/sdc", + "id": "227cc671-f30b-4488-96fd-7d0bf13648d8", + "serverId": "d5e4ae35-ac0e-4311-a8c5-0ee863e951d9", + "tag": null, + "volumeId": "227cc671-f30b-4488-96fd-7d0bf13648d8" + }, { "delete_on_termination": true, "device": "/dev/sdb", "id": "a07f71dc-8151-4e7d-a0cc-cd24a3f11113", - "serverId": "09b3b9d1-b8c5-48e1-841d-62c3ef967a88", + "serverId": "d5e4ae35-ac0e-4311-a8c5-0ee863e951d9", "tag": "foo", "volumeId": "a07f71dc-8151-4e7d-a0cc-cd24a3f11113" } diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-volumes/list-volume-attachments-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-volumes/list-volume-attachments-resp.json.tpl index 6c847d29d248..65a1055214ea 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-volumes/list-volume-attachments-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-volumes/list-volume-attachments-resp.json.tpl @@ -5,6 +5,12 @@ "id": "%(volume_id)s", "serverId": "%(uuid)s", "volumeId": "%(volume_id)s" + }, + { + "device": "%(text)s", + "id": "%(volume_id2)s", + "serverId": "%(uuid)s", + "volumeId": "%(volume_id2)s" } ] } diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-volumes/v2.49/list-volume-attachments-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-volumes/v2.49/list-volume-attachments-resp.json.tpl index 6c847d29d248..65a1055214ea 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-volumes/v2.49/list-volume-attachments-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-volumes/v2.49/list-volume-attachments-resp.json.tpl @@ -5,6 +5,12 @@ "id": "%(volume_id)s", "serverId": "%(uuid)s", "volumeId": "%(volume_id)s" + }, + { + "device": "%(text)s", + "id": "%(volume_id2)s", + "serverId": "%(uuid)s", + "volumeId": "%(volume_id2)s" } ] } diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-volumes/v2.70/list-volume-attachments-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-volumes/v2.70/list-volume-attachments-resp.json.tpl index 5f2d96bff9cb..93c651e15d48 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-volumes/v2.70/list-volume-attachments-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-volumes/v2.70/list-volume-attachments-resp.json.tpl @@ -6,6 +6,13 @@ "serverId": "%(uuid)s", "tag": "%(tag)s", "volumeId": "%(volume_id)s" + }, + { + "device": "%(text)s", + "id": "%(volume_id2)s", + "serverId": "%(uuid)s", + "tag": null, + "volumeId": "%(volume_id2)s" } ] } diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-volumes/v2.79/list-volume-attachments-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-volumes/v2.79/list-volume-attachments-resp.json.tpl index db7b4cece656..700cf5e759f2 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-volumes/v2.79/list-volume-attachments-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-volumes/v2.79/list-volume-attachments-resp.json.tpl @@ -7,6 +7,14 @@ "tag": "%(tag)s", "volumeId": "%(volume_id)s", "delete_on_termination": true + }, + { + "device": "%(text)s", + "id": "%(volume_id2)s", + "serverId": "%(uuid)s", + "tag": null, + "volumeId": "%(volume_id2)s", + "delete_on_termination": false } ] } diff --git a/nova/tests/functional/api_sample_tests/test_volumes.py b/nova/tests/functional/api_sample_tests/test_volumes.py index b92c18324d72..0b5827a0a885 100644 --- a/nova/tests/functional/api_sample_tests/test_volumes.py +++ b/nova/tests/functional/api_sample_tests/test_volumes.py @@ -219,8 +219,17 @@ class VolumeAttachmentsSample(test_servers.ServersSampleBase): def test_list_volume_attachments(self): subs = self.test_attach_volume_to_server() + # Attach another volume to the server so the response has multiple + # which is more interesting since it's a list of dicts. + body = { + 'volumeAttachment': { + 'volumeId': self.NEW_VOLUME_ID + } + } + self.api.post_server_volume(self.server_id, body) response = self._do_get('servers/%s/os-volume_attachments' % self.server_id) + subs['volume_id2'] = self.NEW_VOLUME_ID self._verify_response('list-volume-attachments-resp', subs, response, 200)