Automate generation of volume transfer api-ref samples
This patch adds the following tests: 1) Volume transfer 2) Snapshot manage extensions Change-Id: I6be1ca51ba29513fd9b1abe2791a7bb5815e20a3 Partially-Implements: blueprint generating-sample-files
This commit is contained in:
parent
d8f681dcef
commit
4e8ed9d5c0
@ -33,7 +33,7 @@ Request
|
||||
Request Example
|
||||
---------------
|
||||
|
||||
.. literalinclude:: ./samples/volume-transfer-accept-request.json
|
||||
.. literalinclude:: ./samples/volume_transfer/volume-transfer-accept-request.json
|
||||
:language: javascript
|
||||
|
||||
Response Parameters
|
||||
@ -50,7 +50,7 @@ Response Parameters
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: ./samples/volume-transfer-accept-response.json
|
||||
.. literalinclude:: ./samples/volume_transfer/volume-transfer-accept-response.json
|
||||
:language: javascript
|
||||
|
||||
|
||||
@ -88,7 +88,7 @@ Request
|
||||
Request Example
|
||||
---------------
|
||||
|
||||
.. literalinclude:: ./samples/volume-transfer-create-request.json
|
||||
.. literalinclude:: ./samples/volume_transfer/volume-transfer-create-request.json
|
||||
:language: javascript
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ Response Parameters
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: ./samples/volume-transfer-create-response.json
|
||||
.. literalinclude:: ./samples/volume_transfer/volume-transfer-create-response.json
|
||||
:language: javascript
|
||||
|
||||
|
||||
@ -149,7 +149,7 @@ Response Parameters
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: ./samples/volume-transfers-list-response.json
|
||||
.. literalinclude:: ./samples/volume_transfer/volume-transfers-list-response.json
|
||||
:language: javascript
|
||||
|
||||
|
||||
@ -192,7 +192,7 @@ Response Parameters
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: ./samples/volume-transfer-show-response.json
|
||||
.. literalinclude:: ./samples/volume_transfer/volume-transfer-show-response.json
|
||||
:language: javascript
|
||||
|
||||
|
||||
@ -257,5 +257,5 @@ Response Parameters
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: ./samples/volume-transfers-list-detailed-response.json
|
||||
.. literalinclude:: ./samples/volume_transfer/volume-transfers-list-detailed-response.json
|
||||
:language: javascript
|
||||
|
@ -6,6 +6,6 @@
|
||||
"source-name": "lvol0"
|
||||
},
|
||||
"name": null,
|
||||
"volume_id": "7c064b34-1e4b-40bd-93ca-4ac5a973661b"
|
||||
"volume_id": "1df34919-aba7-4a1b-a614-3b409d71ac03"
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
{
|
||||
"snapshot": {
|
||||
"created_at": "2018-09-26T03:45:03.893592",
|
||||
"description": "this is a new snapshot",
|
||||
"id": "b6314a71-9d3d-439a-861d-b790def0d693",
|
||||
"metadata": {
|
||||
"manage-snap-meta1": "value1",
|
||||
"manage-snap-meta2": "value2",
|
||||
"manage-snap-meta3": "value3"
|
||||
},
|
||||
"name": "new_snapshot",
|
||||
"size": 1,
|
||||
"status": "creating",
|
||||
"updated_at": "null",
|
||||
"volume_id": "1df34919-aba7-4a1b-a614-3b409d71ac03"
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
"transfer": {
|
||||
"id": "cac5c677-73a9-4288-bb9c-b2ebfb547377",
|
||||
"name": "first volume transfer",
|
||||
"volume_id": "894623a6-e901-4312-aa06-4275e6321cce",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://localhost/v3/firstproject/volumes/1",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://localhost/firstproject/volumes/1",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
{
|
||||
"transfer": {
|
||||
"id": "1a7059f5-8ed7-45b7-8d05-2811e5d09f24",
|
||||
"created_at": "2015-02-25T03:56:53.081642",
|
||||
"name": "first volume",
|
||||
"volume_id": "c86b9af4-151d-4ead-b62c-5fb967af0e37",
|
||||
"auth_key": "9266c59563c84664",
|
||||
"source_project_id": "10f92548903841278443fcf3da935b22",
|
||||
"destination_project_id": null,
|
||||
"accepted": false,
|
||||
"links": [
|
||||
{
|
||||
"href": "http://localhost/v3/firstproject/volumes/3",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://localhost/firstproject/volumes/3",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
{
|
||||
"transfer": {
|
||||
"id": "cac5c677-73a9-4288-bb9c-b2ebfb547377",
|
||||
"created_at": "2015-02-25T03:56:53.081642",
|
||||
"name": "first volume transfer",
|
||||
"volume_id": "894623a6-e901-4312-aa06-4275e6321cce",
|
||||
"source_project_id": "10f92548903841278443fcf3da935b22",
|
||||
"destination_project_id": null,
|
||||
"accepted": false,
|
||||
"links": [
|
||||
{
|
||||
"href": "http://localhost/v3/firstproject/volumes/1",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://localhost/firstproject/volumes/1",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
{
|
||||
"transfers": [
|
||||
{
|
||||
"id": "cac5c677-73a9-4288-bb9c-b2ebfb547377",
|
||||
"created_at": "2015-02-25T03:56:53.081642",
|
||||
"name": "first volume transfer",
|
||||
"volume_id": "894623a6-e901-4312-aa06-4275e6321cce",
|
||||
"source_project_id": "10f92548903841278443fcf3da935b22",
|
||||
"destination_project_id": null,
|
||||
"accepted": false,
|
||||
"links": [
|
||||
{
|
||||
"href": "http://localhost/v3/firstproject/volumes/1",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://localhost/firstproject/volumes/1",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "f26c0dee-d20d-4e80-8dee-a8d91b9742a1",
|
||||
"created_at": "2015-03-25T03:56:53.081642",
|
||||
"name": "second volume transfer",
|
||||
"volume_id": "673db275-379f-41af-8371-e1652132b4c1",
|
||||
"source_project_id": "10f92548903841278443fcf3da935b22",
|
||||
"destination_project_id": null,
|
||||
"accepted": false,
|
||||
"links": [
|
||||
{
|
||||
"href": "http://localhost/v3/firstproject/volumes/2",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://localhost/firstproject/volumes/2",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
{
|
||||
"transfers": [
|
||||
{
|
||||
"id": "cac5c677-73a9-4288-bb9c-b2ebfb547377",
|
||||
"name": "first volume transfer",
|
||||
"volume_id": "894623a6-e901-4312-aa06-4275e6321cce",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://localhost/v3/firstproject/volumes/1",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://localhost/firstproject/volumes/1",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "f26c0dee-d20d-4e80-8dee-a8d91b9742a1",
|
||||
"name": "second volume transfer",
|
||||
"volume_id": "673db275-379f-41af-8371-e1652132b4c1",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://localhost/v3/firstproject/volumes/2",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://localhost/firstproject/volumes/2",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -1,17 +1,33 @@
|
||||
{
|
||||
"availability_zone": "az2",
|
||||
"bootable": true,
|
||||
"cluster": "cluster@backend",
|
||||
"description": "Volume imported from existingLV",
|
||||
"host": "null",
|
||||
"metadata": {
|
||||
"key1": "value1",
|
||||
"key2": "value2"
|
||||
},
|
||||
"name": "New Volume",
|
||||
"ref": {
|
||||
"source-id": "1234",
|
||||
"source-name": "existingLV"
|
||||
},
|
||||
"volume_type": "null"
|
||||
"volume": {
|
||||
"attachments": [],
|
||||
"availability_zone": "az2",
|
||||
"bootable": "false",
|
||||
"created_at": "2014-07-18T00:12:54.000000",
|
||||
"description": "Volume imported from existingLV",
|
||||
"encrypted": "false",
|
||||
"id": "23cf872b-c781-4cd4-847d-5f2ec8cbd91c",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://10.0.2.15:8776/v3/87c8522052ca4eed98bc672b4c1a3ddb/volumes/23cf872b-c781-4cd4-847d-5f2ec8cbd91c",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://10.0.2.15:8776/87c8522052ca4eed98bc672b4c1a3ddb/volumes/23cf872b-c781-4cd4-847d-5f2ec8cbd91c",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"key1": "value1",
|
||||
"key2": "value2"
|
||||
},
|
||||
"name": "New Volume",
|
||||
"os-vol-tenant-attr:tenant_id": "87c8522052ca4eed98bc672b4c1a3ddb",
|
||||
"size": 0,
|
||||
"snapshot_id": "null",
|
||||
"source_volid": "null",
|
||||
"status": "creating",
|
||||
"user_id": "eae1472b5fc5496998a3d06550929e7e",
|
||||
"volume_type": "null"
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
{
|
||||
"transfer": {
|
||||
"id": "0a840aa1-8f8f-4042-86d7-09d8ca755272",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://127.0.0.1:46057/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/os-volume-transfer/0a840aa1-8f8f-4042-86d7-09d8ca755272",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://127.0.0.1:46057/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/os-volume-transfer/0a840aa1-8f8f-4042-86d7-09d8ca755272",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"name": "first volume",
|
||||
"volume_id": "e56dee53-e565-40f4-9c6b-b983f74a2aa5"
|
||||
}
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
"transfer": {
|
||||
"volume_id": "c86b9af4-151d-4ead-b62c-5fb967af0e37",
|
||||
"name": "first volume",
|
||||
"no_snapshots": false,
|
||||
"name": "first volume"
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
{
|
||||
"transfer": {
|
||||
"auth_key": "dbccabcdbad19e07",
|
||||
"created_at": "2019-03-20T09:29:46.743632",
|
||||
"id": "3d26db0c-69cd-42e4-ae42-7552759ab361",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://127.0.0.1:40345/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/os-volume-transfer/3d26db0c-69cd-42e4-ae42-7552759ab361",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://127.0.0.1:40345/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/os-volume-transfer/3d26db0c-69cd-42e4-ae42-7552759ab361",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"name": "first volume",
|
||||
"volume_id": "59fe2097-931b-4ceb-b74b-f862ff3b6277"
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
{
|
||||
"transfer": {
|
||||
"created_at": "2019-03-20T09:29:48.732953",
|
||||
"id": "5055b9c2-527b-47ef-bdd6-62e1130f511f",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://127.0.0.1:41845/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/os-volume-transfer/5055b9c2-527b-47ef-bdd6-62e1130f511f",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://127.0.0.1:41845/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/os-volume-transfer/5055b9c2-527b-47ef-bdd6-62e1130f511f",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"name": "first volume",
|
||||
"volume_id": "8cdd62be-4bea-4b7c-bb53-c0b5424ee2af"
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"transfers": [
|
||||
{
|
||||
"created_at": "2019-03-20T09:29:52.758407",
|
||||
"id": "1b3f7d49-8fd8-41b8-b2a5-859c5fe71a20",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://127.0.0.1:37479/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/os-volume-transfer/1b3f7d49-8fd8-41b8-b2a5-859c5fe71a20",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://127.0.0.1:37479/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/os-volume-transfer/1b3f7d49-8fd8-41b8-b2a5-859c5fe71a20",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"name": "first volume",
|
||||
"volume_id": "acb5a860-3f17-4c35-9484-394a12dd7dfc"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
{
|
||||
"transfers": [
|
||||
{
|
||||
"id": "a0f13fb9-904c-41c8-8c2e-495cac61a78f",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://127.0.0.1:45017/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/os-volume-transfer/a0f13fb9-904c-41c8-8c2e-495cac61a78f",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://127.0.0.1:45017/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/os-volume-transfer/a0f13fb9-904c-41c8-8c2e-495cac61a78f",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"name": "first volume",
|
||||
"volume_id": "e72d7454-0234-4e3e-99e9-560d1ff79a71"
|
||||
}
|
||||
]
|
||||
}
|
@ -49,7 +49,7 @@ Request
|
||||
Request Example
|
||||
---------------
|
||||
|
||||
.. literalinclude:: ./samples/snapshot-manage-request.json
|
||||
.. literalinclude:: ./samples/snapshot_manage_extensions/snapshot-manage-request.json
|
||||
:language: javascript
|
||||
|
||||
|
||||
|
@ -38,7 +38,7 @@ Request
|
||||
Request Example
|
||||
---------------
|
||||
|
||||
.. literalinclude:: ./samples/volume-transfer-accept-request.json
|
||||
.. literalinclude:: ./samples/volume_transfer/volume-transfer-accept-request.json
|
||||
:language: javascript
|
||||
|
||||
Response Parameters
|
||||
@ -55,7 +55,7 @@ Response Parameters
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: ./samples/volume-transfer-accept-response.json
|
||||
.. literalinclude:: ./samples/volume_transfer/volume-transfer-accept-response.json
|
||||
:language: javascript
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ Request
|
||||
Request Example
|
||||
---------------
|
||||
|
||||
.. literalinclude:: ./samples/volume-transfer-create-request.json
|
||||
.. literalinclude:: ./samples/volume_transfer/volume-transfer-create-request.json
|
||||
:language: javascript
|
||||
|
||||
|
||||
@ -121,7 +121,7 @@ Response Parameters
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: ./samples/volume-transfer-create-response.json
|
||||
.. literalinclude:: ./samples/volume_transfer/volume-transfer-create-response.json
|
||||
:language: javascript
|
||||
|
||||
|
||||
@ -168,7 +168,7 @@ Response Parameters
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: ./samples/volume-transfers-list-response.json
|
||||
.. literalinclude:: ./samples/volume_transfer/volume-transfers-list-response.json
|
||||
:language: javascript
|
||||
|
||||
|
||||
@ -214,7 +214,7 @@ Response Parameters
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: ./samples/volume-transfer-show-response.json
|
||||
.. literalinclude:: ./samples/volume_transfer/volume-transfer-show-response.json
|
||||
:language: javascript
|
||||
|
||||
|
||||
@ -282,5 +282,5 @@ Response Parameters
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: ./samples/volume-transfers-list-detailed-response.json
|
||||
.. literalinclude:: ./samples/volume_transfer/volume-transfers-list-detailed-response.json
|
||||
:language: javascript
|
||||
|
@ -31,21 +31,63 @@ def stub_copy_volume_to_image(self, context, volume, metadata, force):
|
||||
|
||||
def stub_manage_existing(self, req, body):
|
||||
volume = {
|
||||
"host": "null",
|
||||
"cluster": "cluster@backend",
|
||||
"ref": {
|
||||
"source-name": "existingLV",
|
||||
"source-id": "1234"
|
||||
},
|
||||
"name": "New Volume",
|
||||
"availability_zone": "az2",
|
||||
"description": "Volume imported from existingLV",
|
||||
"volume_type": "null",
|
||||
"bootable": True,
|
||||
"metadata": {
|
||||
"key1": "value1",
|
||||
"key2": "value2"
|
||||
"volume": {
|
||||
"status": "creating",
|
||||
"user_id": "eae1472b5fc5496998a3d06550929e7e",
|
||||
"attachments": [],
|
||||
"links": [
|
||||
{
|
||||
"href":
|
||||
"http://10.0.2.15:8776/v3/87c8522052ca4eed98bc672b4c1a"
|
||||
"3ddb/volumes/23cf872b-c781-4cd4-847d-5f2ec8cbd91c",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://10.0.2.15:8776/87c8522052ca4eed98bc672b4c1"
|
||||
"a3ddb/volumes/23cf872b-c781-4cd4-847d-5f2ec8cbd91"
|
||||
"c",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"availability_zone": "az2",
|
||||
"bootable": "false",
|
||||
"encrypted": "false",
|
||||
"created_at": "2014-07-18T00:12:54.000000",
|
||||
"description": "Volume imported from existingLV",
|
||||
"os-vol-tenant-attr:tenant_id": "87c8522052ca4eed98bc672b4c1a3ddb",
|
||||
"volume_type": "null",
|
||||
"name": "New Volume",
|
||||
"source_volid": "null",
|
||||
"snapshot_id": "null",
|
||||
"metadata": {
|
||||
"key2": "value2",
|
||||
"key1": "value1"
|
||||
},
|
||||
"id": "23cf872b-c781-4cd4-847d-5f2ec8cbd91c",
|
||||
"size": 0
|
||||
}
|
||||
}
|
||||
|
||||
return volume
|
||||
|
||||
|
||||
def stub_manage_existing_snapshot(self, req, body):
|
||||
snapshot = {
|
||||
"snapshot": {
|
||||
"status": "creating",
|
||||
"size": 1,
|
||||
"metadata": {
|
||||
"manage-snap-meta1": "value1",
|
||||
"manage-snap-meta3": "value3",
|
||||
"manage-snap-meta2": "value2"
|
||||
},
|
||||
"name": "new_snapshot",
|
||||
"volume_id": "1df34919-aba7-4a1b-a614-3b409d71ac03",
|
||||
"created_at": "2018-09-26T03:45:03.893592",
|
||||
"description": "this is a new snapshot",
|
||||
"id": "b6314a71-9d3d-439a-861d-b790def0d693",
|
||||
"updated_at": "null"
|
||||
}
|
||||
}
|
||||
|
||||
return snapshot
|
||||
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"snapshot": {
|
||||
"description": null,
|
||||
"metadata": null,
|
||||
"ref": {
|
||||
"source-name": "lvol0"
|
||||
},
|
||||
"name": null,
|
||||
"volume_id": "1df34919-aba7-4a1b-a614-3b409d71ac03"
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
{
|
||||
"snapshot": {
|
||||
"created_at": "2018-09-26T03:45:03.893592",
|
||||
"description": "this is a new snapshot",
|
||||
"id": "b6314a71-9d3d-439a-861d-b790def0d693",
|
||||
"metadata": {
|
||||
"manage-snap-meta1": "value1",
|
||||
"manage-snap-meta2": "value2",
|
||||
"manage-snap-meta3": "value3"
|
||||
},
|
||||
"name": "new_snapshot",
|
||||
"size": 1,
|
||||
"status": "creating",
|
||||
"updated_at": "null",
|
||||
"volume_id": "1df34919-aba7-4a1b-a614-3b409d71ac03"
|
||||
}
|
||||
}
|
@ -1,17 +1,33 @@
|
||||
{
|
||||
"availability_zone": "az2",
|
||||
"bootable": true,
|
||||
"cluster": "cluster@backend",
|
||||
"description": "Volume imported from existingLV",
|
||||
"host": "null",
|
||||
"metadata": {
|
||||
"key1": "value1",
|
||||
"key2": "value2"
|
||||
},
|
||||
"name": "New Volume",
|
||||
"ref": {
|
||||
"source-id": "1234",
|
||||
"source-name": "existingLV"
|
||||
},
|
||||
"volume_type": "null"
|
||||
"volume": {
|
||||
"attachments": [],
|
||||
"availability_zone": "az2",
|
||||
"bootable": "false",
|
||||
"created_at": "2014-07-18T00:12:54.000000",
|
||||
"description": "Volume imported from existingLV",
|
||||
"encrypted": "false",
|
||||
"id": "23cf872b-c781-4cd4-847d-5f2ec8cbd91c",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://10.0.2.15:8776/v3/87c8522052ca4eed98bc672b4c1a3ddb/volumes/23cf872b-c781-4cd4-847d-5f2ec8cbd91c",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://10.0.2.15:8776/87c8522052ca4eed98bc672b4c1a3ddb/volumes/23cf872b-c781-4cd4-847d-5f2ec8cbd91c",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"key1": "value1",
|
||||
"key2": "value2"
|
||||
},
|
||||
"name": "New Volume",
|
||||
"os-vol-tenant-attr:tenant_id": "87c8522052ca4eed98bc672b4c1a3ddb",
|
||||
"size": 0,
|
||||
"snapshot_id": "null",
|
||||
"source_volid": "null",
|
||||
"status": "creating",
|
||||
"user_id": "eae1472b5fc5496998a3d06550929e7e",
|
||||
"volume_type": "null"
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"accept": {
|
||||
"auth_key": "%(auth_key)s"
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
{
|
||||
"transfer": {
|
||||
"id": "%(uuid)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/v3/%(uuid)s/os-volume-transfer/%(uuid)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "%(host)s/%(uuid)s/os-volume-transfer/%(uuid)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"name": "first volume",
|
||||
"volume_id": "%(uuid)s"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"transfer": {
|
||||
"volume_id": "%(volume_id)s",
|
||||
"name": "first volume"
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
{
|
||||
"transfer": {
|
||||
"auth_key": "%(auth_key)s",
|
||||
"created_at": "%(strtime)s",
|
||||
"id": "%(uuid)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/v3/%(uuid)s/os-volume-transfer/%(uuid)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "%(host)s/%(uuid)s/os-volume-transfer/%(uuid)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"name": "first volume",
|
||||
"volume_id": "%(uuid)s"
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
{
|
||||
"transfer": {
|
||||
"created_at": "%(strtime)s",
|
||||
"id": "%(uuid)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/v3/%(uuid)s/os-volume-transfer/%(uuid)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "%(host)s/%(uuid)s/os-volume-transfer/%(uuid)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"name": "first volume",
|
||||
"volume_id": "%(uuid)s"
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"transfers": [
|
||||
{
|
||||
"created_at": "%(strtime)s",
|
||||
"id": "%(uuid)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/v3/%(uuid)s/os-volume-transfer/%(uuid)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "%(host)s/%(uuid)s/os-volume-transfer/%(uuid)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"name": "first volume",
|
||||
"volume_id": "%(uuid)s"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
{
|
||||
"transfers": [
|
||||
{
|
||||
"id": "%(uuid)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/v3/%(uuid)s/os-volume-transfer/%(uuid)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "%(host)s/%(uuid)s/os-volume-transfer/%(uuid)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"name": "first volume",
|
||||
"volume_id": "%(uuid)s"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from cinder.tests.functional.api_sample_tests import fakes
|
||||
from cinder.tests.functional import api_samples_test_base as base
|
||||
|
||||
|
||||
class SnapshotManageExtensionsSampleJsonTest(base.ApiSampleTestBase):
|
||||
sample_dir = "snapshot_manage_extensions"
|
||||
|
||||
def setUp(self):
|
||||
super(SnapshotManageExtensionsSampleJsonTest, self).setUp()
|
||||
self.stub_out("cinder.api.contrib.snapshot_manage."
|
||||
"SnapshotManageController.create",
|
||||
fakes.stub_manage_existing_snapshot)
|
||||
|
||||
def test_snapshot_manage_create(self):
|
||||
|
||||
response = self._do_post('os-snapshot-manage',
|
||||
'snapshot-manage-request',
|
||||
subs=self.subs)
|
||||
self._verify_response('snapshot-manage-response',
|
||||
{}, response, 202)
|
@ -0,0 +1,72 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from cinder.tests.functional.api_sample_tests import test_volumes
|
||||
|
||||
|
||||
class VolumeTransferSampleJsonTest(test_volumes.VolumesSampleBase):
|
||||
sample_dir = "volume_transfer"
|
||||
|
||||
def setUp(self):
|
||||
super(VolumeTransferSampleJsonTest, self).setUp()
|
||||
res = self._create_volume()
|
||||
res = jsonutils.loads(res.content)['volume']
|
||||
self._poll_volume_while(res['id'], ['creating'])
|
||||
self.subs = {
|
||||
"volume_id": res['id']
|
||||
}
|
||||
self.response = self._create_transfer(self.subs)
|
||||
|
||||
def _create_transfer(self, subs=None):
|
||||
response = self._do_post('os-volume-transfer',
|
||||
'volume-transfer-create-request',
|
||||
subs)
|
||||
return response
|
||||
|
||||
def test_transfer_create(self):
|
||||
|
||||
self._verify_response('volume-transfer-create-response',
|
||||
{}, self.response, 202)
|
||||
|
||||
def test_transfer_accept(self):
|
||||
|
||||
res = jsonutils.loads(self.response.content)['transfer']
|
||||
subs = {
|
||||
"auth_key": res['auth_key']
|
||||
}
|
||||
response = self._do_post(
|
||||
'os-volume-transfer/%s/accept' % res['id'],
|
||||
'volume-transfer-accept-request',
|
||||
subs)
|
||||
self._verify_response('volume-transfer-accept-response',
|
||||
{}, response, 202)
|
||||
|
||||
def test_transfers_list(self):
|
||||
|
||||
response = self._do_get('os-volume-transfer')
|
||||
self._verify_response('volume-transfers-list-response',
|
||||
{}, response, 200)
|
||||
|
||||
def test_transfer_list_detail(self):
|
||||
|
||||
res = jsonutils.loads(self.response.content)['transfer']
|
||||
response = self._do_get('os-volume-transfer/%s' % res['id'])
|
||||
self._verify_response('volume-transfer-show-response',
|
||||
{}, response, 200)
|
||||
|
||||
def test_transfers_list_detail(self):
|
||||
|
||||
response = self._do_get('os-volume-transfer/detail')
|
||||
self._verify_response('volume-transfers-list-detailed-response',
|
||||
{}, response, 200)
|
@ -448,7 +448,8 @@ class ApiSampleTestBase(functional_helpers._FunctionalTestBase):
|
||||
'versioned_volume_endpoint': self._get_versioned_volume_endpoint(),
|
||||
'name': text,
|
||||
'description': text,
|
||||
'extension_update': extension_update
|
||||
'extension_update': extension_update,
|
||||
'auth_key': '[a-z0-9]{16}'
|
||||
}
|
||||
|
||||
def _get_volume_endpoint(self):
|
||||
|
Loading…
Reference in New Issue
Block a user