From dab5df1747a47570cc48c2dad663afce1a25be41 Mon Sep 17 00:00:00 2001 From: Gorka Eguileor Date: Wed, 12 May 2021 20:18:07 +0200 Subject: [PATCH] Update volume api microversion doc and tests We have many microversions but we but we haven't kept the samples, docs, and tests up to date with them. Of the many microversions this patch will focus on the ones that have updated the fields returned for volumes updating the docs, adding the appropriate json samples, updating the tests, and updating the contributor docs to highlight the need to keep these up to date. Some convenience methods have been added to facilitate the testing: - use_versions: class decorator that allows us to run the same tests with different microversions, each using their respective json and templates. - override_mv: method decorator to change the microversion in a single test. - common_api_sample: context manager to use the base sample instead of a microversion specific one. Change-Id: Ide303685a4cd1477c319b36e67a3b05c8d129126 --- api-ref/source/v3/parameters.yaml | 13 ++- .../volumes/v3.13/volume-create-response.json | 35 +++++++ .../volumes/v3.13/volume-show-response.json | 39 ++++++++ .../volumes/v3.13/volume-update-response.json | 37 ++++++++ .../v3.13/volumes-list-detailed-response.json | 41 +++++++++ .../volumes/v3.21/volume-create-response.json | 36 ++++++++ .../volumes/v3.21/volume-show-response.json | 40 ++++++++ .../volumes/v3.21/volume-update-response.json | 38 ++++++++ .../v3.21/volumes-list-detailed-response.json | 42 +++++++++ .../volumes/v3.48/volume-create-response.json | 38 ++++++++ .../volumes/v3.48/volume-show-response.json | 42 +++++++++ .../volumes/v3.48/volume-update-response.json | 40 ++++++++ .../v3.48/volumes-list-detailed-response.json | 44 +++++++++ .../volumes/v3.61/volume-create-response.json | 39 ++++++++ .../volumes/v3.61/volume-show-response.json | 43 +++++++++ .../volumes/v3.61/volume-update-response.json | 41 +++++++++ .../v3.61/volumes-list-detailed-response.json | 45 +++++++++ .../volumes/v3.63/volume-create-response.json | 40 ++++++++ .../volumes/v3.63/volume-show-response.json | 44 +++++++++ .../volumes/v3.63/volume-update-response.json | 42 +++++++++ .../v3.63/volumes-list-detailed-response.json | 46 ++++++++++ .../volumes-list-detailed-response.json | 10 +- api-ref/source/v3/volumes-v3-volumes.inc | 42 ++++++--- .../v3.13/volume-create-response.json.tpl | 35 +++++++ .../v3.13/volume-show-response.json.tpl | 39 ++++++++ .../v3.13/volume-update-response.json.tpl | 37 ++++++++ .../volumes-list-detailed-response.json.tpl | 41 +++++++++ .../v3.21/volume-create-response.json.tpl | 37 ++++++++ .../v3.21/volume-show-response.json.tpl | 40 ++++++++ .../v3.21/volume-update-response.json.tpl | 38 ++++++++ .../volumes-list-detailed-response.json.tpl | 42 +++++++++ .../v3.48/volume-create-response.json.tpl | 38 ++++++++ .../v3.48/volume-show-response.json.tpl | 42 +++++++++ .../v3.48/volume-update-response.json.tpl | 40 ++++++++ .../volumes-list-detailed-response.json.tpl | 44 +++++++++ .../v3.61/volume-create-response.json.tpl | 39 ++++++++ .../v3.61/volume-show-response.json.tpl | 43 +++++++++ .../v3.61/volume-update-response.json.tpl | 41 +++++++++ .../volumes-list-detailed-response.json.tpl | 45 +++++++++ .../v3.63/volume-create-response.json.tpl | 40 ++++++++ .../v3.63/volume-show-response.json.tpl | 44 +++++++++ .../v3.63/volume-update-response.json.tpl | 42 +++++++++ .../volumes-list-detailed-response.json.tpl | 46 ++++++++++ .../volumes-list-detailed-response.json.tpl | 10 +- .../api_sample_tests/test_limits.py | 4 +- .../functional/api_sample_tests/test_qos.py | 4 +- .../api_sample_tests/test_quota_classes.py | 4 +- .../api_sample_tests/test_quota_sets.py | 4 +- .../api_sample_tests/test_snapshots.py | 4 +- .../api_sample_tests/test_volume_actions.py | 4 +- .../api_sample_tests/test_volume_transfer.py | 4 +- .../api_sample_tests/test_volumes.py | 91 ++++++++++--------- .../tests/functional/api_samples_test_base.py | 72 ++++++++++----- cinder/tests/functional/functional_helpers.py | 56 +++++++++++- cinder/tests/functional/test_default_types.py | 2 +- .../functional/test_group_replication.py | 3 +- .../tests/functional/test_group_snapshots.py | 3 +- cinder/tests/functional/test_groups.py | 3 +- .../contributor/api_microversion_dev.rst | 25 +++++ 59 files changed, 1862 insertions(+), 121 deletions(-) create mode 100644 api-ref/source/v3/samples/volumes/v3.13/volume-create-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.13/volume-show-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.13/volume-update-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.13/volumes-list-detailed-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.21/volume-create-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.21/volume-show-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.21/volume-update-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.21/volumes-list-detailed-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.48/volume-create-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.48/volume-show-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.48/volume-update-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.48/volumes-list-detailed-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.61/volume-create-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.61/volume-show-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.61/volume-update-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.61/volumes-list-detailed-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.63/volume-create-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.63/volume-show-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.63/volume-update-response.json create mode 100644 api-ref/source/v3/samples/volumes/v3.63/volumes-list-detailed-response.json create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.13/volume-create-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.13/volume-show-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.13/volume-update-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.13/volumes-list-detailed-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.21/volume-create-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.21/volume-show-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.21/volume-update-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.21/volumes-list-detailed-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.48/volume-create-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.48/volume-show-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.48/volume-update-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.48/volumes-list-detailed-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.61/volume-create-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.61/volume-show-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.61/volume-update-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.61/volumes-list-detailed-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.63/volume-create-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.63/volume-show-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.63/volume-update-response.json.tpl create mode 100644 cinder/tests/functional/api_sample_tests/samples/volumes/v3.63/volumes-list-detailed-response.json.tpl diff --git a/api-ref/source/v3/parameters.yaml b/api-ref/source/v3/parameters.yaml index b82cae1afb3..fac755ba550 100644 --- a/api-ref/source/v3/parameters.yaml +++ b/api-ref/source/v3/parameters.yaml @@ -1257,6 +1257,7 @@ group_id_optional: in: body required: false type: string + min_version: 3.13 group_name: description: | The group name. @@ -1265,10 +1266,11 @@ group_name: type: string group_replication_status: description: | - The group replication status. Introduced with API microversion 3.38. + The group replication status. in: body required: false type: string + min_version: 3.38 group_snapshot: description: | The group snapshot. @@ -2301,6 +2303,15 @@ provider: # required response parameter (get/create) in: body required: true type: string +provider_id: + description: | + The provider ID for the volume. The value is either a string set by the + driver or ``null`` if the driver doesn't use the field or if it hasn't + created it yet. Only returned for administrators. + in: body + required: false + type: string + min_version: 3.21 provider_optional: # optional response parameter (update) description: | The class that provides encryption support. diff --git a/api-ref/source/v3/samples/volumes/v3.13/volume-create-response.json b/api-ref/source/v3/samples/volumes/v3.13/volume-create-response.json new file mode 100644 index 00000000000..427f60ddded --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.13/volume-create-response.json @@ -0,0 +1,35 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-28T06:21:12.715987", + "description": null, + "encrypted": false, + "id": "2b955850-f177-45f7-9f49-ecb2c256d161", + "links": [ + { + "href": "http://127.0.0.1:33951/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/2b955850-f177-45f7-9f49-ecb2c256d161", + "rel": "self" + }, + { + "href": "http://127.0.0.1:33951/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/2b955850-f177-45f7-9f49-ecb2c256d161", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "group_id": null + } +} diff --git a/api-ref/source/v3/samples/volumes/v3.13/volume-show-response.json b/api-ref/source/v3/samples/volumes/v3.13/volume-show-response.json new file mode 100644 index 00000000000..7358146ec16 --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.13/volume-show-response.json @@ -0,0 +1,39 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-29T06:50:07.770785", + "description": null, + "encrypted": false, + "id": "f7223234-1afc-4d19-bfa3-d19deb6235ef", + "links": [ + { + "href": "http://127.0.0.1:45839/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/f7223234-1afc-4d19-bfa3-d19deb6235ef", + "rel": "self" + }, + { + "href": "http://127.0.0.1:45839/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/f7223234-1afc-4d19-bfa3-d19deb6235ef", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "89afd400-b646-4bbc-b12b-c0a4d63e5bd3", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "group_id": null + } +} diff --git a/api-ref/source/v3/samples/volumes/v3.13/volume-update-response.json b/api-ref/source/v3/samples/volumes/v3.13/volume-update-response.json new file mode 100644 index 00000000000..906739a5016 --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.13/volume-update-response.json @@ -0,0 +1,37 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-29T06:59:23.679903", + "description": "This is yet, another volume.", + "encrypted": false, + "id": "8b2459d1-0059-4e14-a89f-dfa73a452af6", + "links": [ + { + "href": "http://127.0.0.1:41467/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/8b2459d1-0059-4e14-a89f-dfa73a452af6", + "rel": "self" + }, + { + "href": "http://127.0.0.1:41467/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/8b2459d1-0059-4e14-a89f-dfa73a452af6", + "rel": "bookmark" + } + ], + "metadata": { + "name": "metadata0" + }, + "migration_status": null, + "multiattach": false, + "name": "vol-003", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "group_id": null + } +} diff --git a/api-ref/source/v3/samples/volumes/v3.13/volumes-list-detailed-response.json b/api-ref/source/v3/samples/volumes/v3.13/volumes-list-detailed-response.json new file mode 100644 index 00000000000..3f545d2a8d1 --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.13/volumes-list-detailed-response.json @@ -0,0 +1,41 @@ +{ + "volumes": [ + { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-28T06:25:15.288987", + "description": null, + "encrypted": false, + "id": "cb49b381-9012-40cb-b8ee-80c19a4801b5", + "links": [ + { + "href": "http://127.0.0.1:43543/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/cb49b381-9012-40cb-b8ee-80c19a4801b5", + "rel": "self" + }, + { + "href": "http://127.0.0.1:43543/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/cb49b381-9012-40cb-b8ee-80c19a4801b5", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "89afd400-b646-4bbc-b12b-c0a4d63e5bd3", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "group_id": null + } + ] +} diff --git a/api-ref/source/v3/samples/volumes/v3.21/volume-create-response.json b/api-ref/source/v3/samples/volumes/v3.21/volume-create-response.json new file mode 100644 index 00000000000..3ac6eb6dc35 --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.21/volume-create-response.json @@ -0,0 +1,36 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-28T06:21:12.715987", + "description": null, + "encrypted": false, + "id": "2b955850-f177-45f7-9f49-ecb2c256d161", + "links": [ + { + "href": "http://127.0.0.1:33951/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/2b955850-f177-45f7-9f49-ecb2c256d161", + "rel": "self" + }, + { + "href": "http://127.0.0.1:33951/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/2b955850-f177-45f7-9f49-ecb2c256d161", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null + } +} diff --git a/api-ref/source/v3/samples/volumes/v3.21/volume-show-response.json b/api-ref/source/v3/samples/volumes/v3.21/volume-show-response.json new file mode 100644 index 00000000000..fa480be5e17 --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.21/volume-show-response.json @@ -0,0 +1,40 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-29T06:50:07.770785", + "description": null, + "encrypted": false, + "id": "f7223234-1afc-4d19-bfa3-d19deb6235ef", + "links": [ + { + "href": "http://127.0.0.1:45839/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/f7223234-1afc-4d19-bfa3-d19deb6235ef", + "rel": "self" + }, + { + "href": "http://127.0.0.1:45839/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/f7223234-1afc-4d19-bfa3-d19deb6235ef", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "89afd400-b646-4bbc-b12b-c0a4d63e5bd3", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null + } +} diff --git a/api-ref/source/v3/samples/volumes/v3.21/volume-update-response.json b/api-ref/source/v3/samples/volumes/v3.21/volume-update-response.json new file mode 100644 index 00000000000..b86136856f9 --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.21/volume-update-response.json @@ -0,0 +1,38 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-29T06:59:23.679903", + "description": "This is yet, another volume.", + "encrypted": false, + "id": "8b2459d1-0059-4e14-a89f-dfa73a452af6", + "links": [ + { + "href": "http://127.0.0.1:41467/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/8b2459d1-0059-4e14-a89f-dfa73a452af6", + "rel": "self" + }, + { + "href": "http://127.0.0.1:41467/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/8b2459d1-0059-4e14-a89f-dfa73a452af6", + "rel": "bookmark" + } + ], + "metadata": { + "name": "metadata0" + }, + "migration_status": null, + "multiattach": false, + "name": "vol-003", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null + } +} diff --git a/api-ref/source/v3/samples/volumes/v3.21/volumes-list-detailed-response.json b/api-ref/source/v3/samples/volumes/v3.21/volumes-list-detailed-response.json new file mode 100644 index 00000000000..ab72a300b71 --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.21/volumes-list-detailed-response.json @@ -0,0 +1,42 @@ +{ + "volumes": [ + { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-28T06:25:15.288987", + "description": null, + "encrypted": false, + "id": "cb49b381-9012-40cb-b8ee-80c19a4801b5", + "links": [ + { + "href": "http://127.0.0.1:43543/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/cb49b381-9012-40cb-b8ee-80c19a4801b5", + "rel": "self" + }, + { + "href": "http://127.0.0.1:43543/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/cb49b381-9012-40cb-b8ee-80c19a4801b5", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "89afd400-b646-4bbc-b12b-c0a4d63e5bd3", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null + } + ] +} diff --git a/api-ref/source/v3/samples/volumes/v3.48/volume-create-response.json b/api-ref/source/v3/samples/volumes/v3.48/volume-create-response.json new file mode 100644 index 00000000000..92592a99031 --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.48/volume-create-response.json @@ -0,0 +1,38 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-28T06:21:12.715987", + "description": null, + "encrypted": false, + "id": "2b955850-f177-45f7-9f49-ecb2c256d161", + "links": [ + { + "href": "http://127.0.0.1:33951/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/2b955850-f177-45f7-9f49-ecb2c256d161", + "rel": "self" + }, + { + "href": "http://127.0.0.1:33951/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/2b955850-f177-45f7-9f49-ecb2c256d161", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null, + "service_uuid": null, + "shared_targets": true + } +} diff --git a/api-ref/source/v3/samples/volumes/v3.48/volume-show-response.json b/api-ref/source/v3/samples/volumes/v3.48/volume-show-response.json new file mode 100644 index 00000000000..7657eabc4c8 --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.48/volume-show-response.json @@ -0,0 +1,42 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-29T06:50:07.770785", + "description": null, + "encrypted": false, + "id": "f7223234-1afc-4d19-bfa3-d19deb6235ef", + "links": [ + { + "href": "http://127.0.0.1:45839/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/f7223234-1afc-4d19-bfa3-d19deb6235ef", + "rel": "self" + }, + { + "href": "http://127.0.0.1:45839/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/f7223234-1afc-4d19-bfa3-d19deb6235ef", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "89afd400-b646-4bbc-b12b-c0a4d63e5bd3", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "provider_id": null, + "group_id": null, + "service_uuid": null, + "shared_targets": true + } +} diff --git a/api-ref/source/v3/samples/volumes/v3.48/volume-update-response.json b/api-ref/source/v3/samples/volumes/v3.48/volume-update-response.json new file mode 100644 index 00000000000..c76a1a9bb21 --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.48/volume-update-response.json @@ -0,0 +1,40 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-29T06:59:23.679903", + "description": "This is yet, another volume.", + "encrypted": false, + "id": "8b2459d1-0059-4e14-a89f-dfa73a452af6", + "links": [ + { + "href": "http://127.0.0.1:41467/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/8b2459d1-0059-4e14-a89f-dfa73a452af6", + "rel": "self" + }, + { + "href": "http://127.0.0.1:41467/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/8b2459d1-0059-4e14-a89f-dfa73a452af6", + "rel": "bookmark" + } + ], + "metadata": { + "name": "metadata0" + }, + "migration_status": null, + "multiattach": false, + "name": "vol-003", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null, + "service_uuid": null, + "shared_targets": true + } +} diff --git a/api-ref/source/v3/samples/volumes/v3.48/volumes-list-detailed-response.json b/api-ref/source/v3/samples/volumes/v3.48/volumes-list-detailed-response.json new file mode 100644 index 00000000000..1130e6dbf90 --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.48/volumes-list-detailed-response.json @@ -0,0 +1,44 @@ +{ + "volumes": [ + { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-28T06:25:15.288987", + "description": null, + "encrypted": false, + "id": "cb49b381-9012-40cb-b8ee-80c19a4801b5", + "links": [ + { + "href": "http://127.0.0.1:43543/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/cb49b381-9012-40cb-b8ee-80c19a4801b5", + "rel": "self" + }, + { + "href": "http://127.0.0.1:43543/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/cb49b381-9012-40cb-b8ee-80c19a4801b5", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "89afd400-b646-4bbc-b12b-c0a4d63e5bd3", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "provider_id": null, + "group_id": null, + "service_uuid": null, + "shared_targets": true + } + ] +} diff --git a/api-ref/source/v3/samples/volumes/v3.61/volume-create-response.json b/api-ref/source/v3/samples/volumes/v3.61/volume-create-response.json new file mode 100644 index 00000000000..53bf50b1262 --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.61/volume-create-response.json @@ -0,0 +1,39 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-28T06:21:12.715987", + "description": null, + "encrypted": false, + "id": "2b955850-f177-45f7-9f49-ecb2c256d161", + "links": [ + { + "href": "http://127.0.0.1:33951/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/2b955850-f177-45f7-9f49-ecb2c256d161", + "rel": "self" + }, + { + "href": "http://127.0.0.1:33951/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/2b955850-f177-45f7-9f49-ecb2c256d161", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null, + "service_uuid": null, + "shared_targets": true, + "cluster_name": null + } +} diff --git a/api-ref/source/v3/samples/volumes/v3.61/volume-show-response.json b/api-ref/source/v3/samples/volumes/v3.61/volume-show-response.json new file mode 100644 index 00000000000..4a77b01c9eb --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.61/volume-show-response.json @@ -0,0 +1,43 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-29T06:50:07.770785", + "description": null, + "encrypted": false, + "id": "f7223234-1afc-4d19-bfa3-d19deb6235ef", + "links": [ + { + "href": "http://127.0.0.1:45839/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/f7223234-1afc-4d19-bfa3-d19deb6235ef", + "rel": "self" + }, + { + "href": "http://127.0.0.1:45839/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/f7223234-1afc-4d19-bfa3-d19deb6235ef", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "89afd400-b646-4bbc-b12b-c0a4d63e5bd3", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "provider_id": null, + "group_id": null, + "service_uuid": null, + "shared_targets": true, + "cluster_name": null + } +} diff --git a/api-ref/source/v3/samples/volumes/v3.61/volume-update-response.json b/api-ref/source/v3/samples/volumes/v3.61/volume-update-response.json new file mode 100644 index 00000000000..7e64c11dff2 --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.61/volume-update-response.json @@ -0,0 +1,41 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-29T06:59:23.679903", + "description": "This is yet, another volume.", + "encrypted": false, + "id": "8b2459d1-0059-4e14-a89f-dfa73a452af6", + "links": [ + { + "href": "http://127.0.0.1:41467/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/8b2459d1-0059-4e14-a89f-dfa73a452af6", + "rel": "self" + }, + { + "href": "http://127.0.0.1:41467/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/8b2459d1-0059-4e14-a89f-dfa73a452af6", + "rel": "bookmark" + } + ], + "metadata": { + "name": "metadata0" + }, + "migration_status": null, + "multiattach": false, + "name": "vol-003", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null, + "service_uuid": null, + "shared_targets": true, + "cluster_name": null + } +} diff --git a/api-ref/source/v3/samples/volumes/v3.61/volumes-list-detailed-response.json b/api-ref/source/v3/samples/volumes/v3.61/volumes-list-detailed-response.json new file mode 100644 index 00000000000..4f36bf81455 --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.61/volumes-list-detailed-response.json @@ -0,0 +1,45 @@ +{ + "volumes": [ + { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-28T06:25:15.288987", + "description": null, + "encrypted": false, + "id": "cb49b381-9012-40cb-b8ee-80c19a4801b5", + "links": [ + { + "href": "http://127.0.0.1:43543/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/cb49b381-9012-40cb-b8ee-80c19a4801b5", + "rel": "self" + }, + { + "href": "http://127.0.0.1:43543/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/cb49b381-9012-40cb-b8ee-80c19a4801b5", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "89afd400-b646-4bbc-b12b-c0a4d63e5bd3", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "provider_id": null, + "group_id": null, + "service_uuid": null, + "shared_targets": true, + "cluster_name": null + } + ] +} diff --git a/api-ref/source/v3/samples/volumes/v3.63/volume-create-response.json b/api-ref/source/v3/samples/volumes/v3.63/volume-create-response.json new file mode 100644 index 00000000000..16808b72214 --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.63/volume-create-response.json @@ -0,0 +1,40 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-28T06:21:12.715987", + "description": null, + "encrypted": false, + "id": "2b955850-f177-45f7-9f49-ecb2c256d161", + "links": [ + { + "href": "http://127.0.0.1:33951/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/2b955850-f177-45f7-9f49-ecb2c256d161", + "rel": "self" + }, + { + "href": "http://127.0.0.1:33951/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/2b955850-f177-45f7-9f49-ecb2c256d161", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null, + "service_uuid": null, + "shared_targets": true, + "cluster_name": null, + "volume_type_id": "5fed9d7c-401d-46e2-8e80-f30c70cb7e1d" + } +} diff --git a/api-ref/source/v3/samples/volumes/v3.63/volume-show-response.json b/api-ref/source/v3/samples/volumes/v3.63/volume-show-response.json new file mode 100644 index 00000000000..00572918dbb --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.63/volume-show-response.json @@ -0,0 +1,44 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-29T06:50:07.770785", + "description": null, + "encrypted": false, + "id": "f7223234-1afc-4d19-bfa3-d19deb6235ef", + "links": [ + { + "href": "http://127.0.0.1:45839/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/f7223234-1afc-4d19-bfa3-d19deb6235ef", + "rel": "self" + }, + { + "href": "http://127.0.0.1:45839/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/f7223234-1afc-4d19-bfa3-d19deb6235ef", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "89afd400-b646-4bbc-b12b-c0a4d63e5bd3", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "provider_id": null, + "group_id": null, + "service_uuid": null, + "shared_targets": true, + "cluster_name": null, + "volume_type_id": "5fed9d7c-401d-46e2-8e80-f30c70cb7e1d" + } +} diff --git a/api-ref/source/v3/samples/volumes/v3.63/volume-update-response.json b/api-ref/source/v3/samples/volumes/v3.63/volume-update-response.json new file mode 100644 index 00000000000..29b5d064d8a --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.63/volume-update-response.json @@ -0,0 +1,42 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-29T06:59:23.679903", + "description": "This is yet, another volume.", + "encrypted": false, + "id": "8b2459d1-0059-4e14-a89f-dfa73a452af6", + "links": [ + { + "href": "http://127.0.0.1:41467/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/8b2459d1-0059-4e14-a89f-dfa73a452af6", + "rel": "self" + }, + { + "href": "http://127.0.0.1:41467/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/8b2459d1-0059-4e14-a89f-dfa73a452af6", + "rel": "bookmark" + } + ], + "metadata": { + "name": "metadata0" + }, + "migration_status": null, + "multiattach": false, + "name": "vol-003", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null, + "service_uuid": null, + "shared_targets": true, + "cluster_name": null, + "volume_type_id": "5fed9d7c-401d-46e2-8e80-f30c70cb7e1d" + } +} diff --git a/api-ref/source/v3/samples/volumes/v3.63/volumes-list-detailed-response.json b/api-ref/source/v3/samples/volumes/v3.63/volumes-list-detailed-response.json new file mode 100644 index 00000000000..b899e848e0e --- /dev/null +++ b/api-ref/source/v3/samples/volumes/v3.63/volumes-list-detailed-response.json @@ -0,0 +1,46 @@ +{ + "volumes": [ + { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "2018-11-28T06:25:15.288987", + "description": null, + "encrypted": false, + "id": "cb49b381-9012-40cb-b8ee-80c19a4801b5", + "links": [ + { + "href": "http://127.0.0.1:43543/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/cb49b381-9012-40cb-b8ee-80c19a4801b5", + "rel": "self" + }, + { + "href": "http://127.0.0.1:43543/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/cb49b381-9012-40cb-b8ee-80c19a4801b5", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "89afd400-b646-4bbc-b12b-c0a4d63e5bd3", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", + "volume_type": "__DEFAULT__", + "provider_id": null, + "group_id": null, + "service_uuid": null, + "shared_targets": true, + "cluster_name": null, + "volume_type_id": "5fed9d7c-401d-46e2-8e80-f30c70cb7e1d" + } + ] +} diff --git a/api-ref/source/v3/samples/volumes/volumes-list-detailed-response.json b/api-ref/source/v3/samples/volumes/volumes-list-detailed-response.json index 82c73eea67b..f077bec3051 100644 --- a/api-ref/source/v3/samples/volumes/volumes-list-detailed-response.json +++ b/api-ref/source/v3/samples/volumes/volumes-list-detailed-response.json @@ -34,13 +34,7 @@ "status": "creating", "updated_at": null, "user_id": "c853ca26-e8ea-4797-8a52-ee124a013d0e", - "volume_type": "__DEFAULT__", - "volume_type_id": "5fed9d7c-401d-46e2-8e80-f30c70cb7e1d", - "provider_id": null, - "group_id": null, - "service_uuid": null, - "shared_targets": true, - "cluster_name": null + "volume_type": "__DEFAULT__" } ] -} \ No newline at end of file +} diff --git a/api-ref/source/v3/volumes-v3-volumes.inc b/api-ref/source/v3/volumes-v3-volumes.inc index 49cbc4b0d7f..f6aff16893d 100644 --- a/api-ref/source/v3/volumes-v3-volumes.inc +++ b/api-ref/source/v3/volumes-v3-volumes.inc @@ -134,14 +134,17 @@ Response Parameters - volume_type_id: volume_type_id_363 - group_id: group_id_optional - volumes_links: links_vol_optional + - provider_id: provider_id + - service_uuid: service_uuid + - shared_targets: shared_targets + - cluster_name: cluster_name - count: count +Response Example (v3.63) +------------------------ -Response Example ----------------- - -.. literalinclude:: ./samples/volumes/volumes-list-detailed-response.json +.. literalinclude:: ./samples/volumes/v3.63/volumes-list-detailed-response.json :language: javascript @@ -247,12 +250,17 @@ Response Parameters - bootable: bootable_response - created_at: created_at - volume_type: volume_type_vol + - volume_type_id: volume_type_id_363 - group_id: group_id_optional + - provider_id: provider_id + - service_uuid: service_uuid + - shared_targets: shared_targets + - cluster_name: cluster_name -Response Example ----------------- +Response Example (v3.63) +------------------------ -.. literalinclude:: ./samples/volumes/volume-create-response.json +.. literalinclude:: ./samples/volumes/v3.63/volume-create-response.json :language: javascript @@ -382,12 +390,14 @@ Response Parameters - service_uuid: service_uuid - shared_targets: shared_targets - cluster_name: cluster_name + - provider_id: provider_id + - group_id: group_id_optional -Response Example ----------------- +Response Example (v3.63) +------------------------ -.. literalinclude:: ./samples/volumes/volume-show-response.json +.. literalinclude:: ./samples/volumes/v3.63/volume-show-response.json :language: javascript @@ -455,12 +465,18 @@ Response Parameters - bootable: bootable_response - created_at: created_at - volume_type: volume_type_vol + - volume_type_id: volume_type_id_363 + - group_id: group_id_optional + - provider_id: provider_id + - service_uuid: service_uuid + - shared_targets: shared_targets + - cluster_name: cluster_name -Response Example ----------------- +Response Example (v3.63) +------------------------ -.. literalinclude:: ./samples/volumes/volume-update-response.json +.. literalinclude:: ./samples/volumes/v3.63/volume-update-response.json :language: javascript diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.13/volume-create-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.13/volume-create-response.json.tpl new file mode 100644 index 00000000000..e40d48e1fd1 --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.13/volume-create-response.json.tpl @@ -0,0 +1,35 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": null, + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "__DEFAULT__", + "group_id": null + } +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.13/volume-show-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.13/volume-show-response.json.tpl new file mode 100644 index 00000000000..0fd32452578 --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.13/volume-show-response.json.tpl @@ -0,0 +1,39 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": null, + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "%(uuid)s", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "__DEFAULT__", + "group_id": null + } +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.13/volume-update-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.13/volume-update-response.json.tpl new file mode 100644 index 00000000000..c975e4dfcf5 --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.13/volume-update-response.json.tpl @@ -0,0 +1,37 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": "This is yet, another volume.", + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": { + "name": "metadata0" + }, + "migration_status": null, + "multiattach": false, + "name": "vol-003", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "__DEFAULT__", + "group_id": null + } +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.13/volumes-list-detailed-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.13/volumes-list-detailed-response.json.tpl new file mode 100644 index 00000000000..a3213f4cbb9 --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.13/volumes-list-detailed-response.json.tpl @@ -0,0 +1,41 @@ +{ + "volumes": [ + { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": null, + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "%(uuid)s", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "%(name)s", + "group_id": null + } + ] +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.21/volume-create-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.21/volume-create-response.json.tpl new file mode 100644 index 00000000000..5c99dfa69d9 --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.21/volume-create-response.json.tpl @@ -0,0 +1,37 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": null, + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null + } +} + diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.21/volume-show-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.21/volume-show-response.json.tpl new file mode 100644 index 00000000000..e0076cd55c1 --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.21/volume-show-response.json.tpl @@ -0,0 +1,40 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": null, + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "%(uuid)s", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null + } +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.21/volume-update-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.21/volume-update-response.json.tpl new file mode 100644 index 00000000000..b2e92530ba6 --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.21/volume-update-response.json.tpl @@ -0,0 +1,38 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": "This is yet, another volume.", + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": { + "name": "metadata0" + }, + "migration_status": null, + "multiattach": false, + "name": "vol-003", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null + } +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.21/volumes-list-detailed-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.21/volumes-list-detailed-response.json.tpl new file mode 100644 index 00000000000..577a6ff066f --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.21/volumes-list-detailed-response.json.tpl @@ -0,0 +1,42 @@ +{ + "volumes": [ + { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": null, + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "%(uuid)s", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "%(name)s", + "group_id": null, + "provider_id": null + } + ] +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.48/volume-create-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.48/volume-create-response.json.tpl new file mode 100644 index 00000000000..0f1a51a4954 --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.48/volume-create-response.json.tpl @@ -0,0 +1,38 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": null, + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null, + "service_uuid": null, + "shared_targets": true + } +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.48/volume-show-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.48/volume-show-response.json.tpl new file mode 100644 index 00000000000..ffcdc47f6b5 --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.48/volume-show-response.json.tpl @@ -0,0 +1,42 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": null, + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "%(uuid)s", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "__DEFAULT__", + "provider_id": null, + "group_id": null, + "service_uuid": null, + "shared_targets": true + } +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.48/volume-update-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.48/volume-update-response.json.tpl new file mode 100644 index 00000000000..2132da0d700 --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.48/volume-update-response.json.tpl @@ -0,0 +1,40 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": "This is yet, another volume.", + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": { + "name": "metadata0" + }, + "migration_status": null, + "multiattach": false, + "name": "vol-003", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null, + "service_uuid": null, + "shared_targets": true + } +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.48/volumes-list-detailed-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.48/volumes-list-detailed-response.json.tpl new file mode 100644 index 00000000000..34726ae1da5 --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.48/volumes-list-detailed-response.json.tpl @@ -0,0 +1,44 @@ +{ + "volumes": [ + { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": null, + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "%(uuid)s", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "%(name)s", + "service_uuid": null, + "provider_id": null, + "group_id": null, + "shared_targets": true + } + ] +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.61/volume-create-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.61/volume-create-response.json.tpl new file mode 100644 index 00000000000..94c9aabee70 --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.61/volume-create-response.json.tpl @@ -0,0 +1,39 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": null, + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null, + "service_uuid": null, + "shared_targets": true, + "cluster_name": null + } +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.61/volume-show-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.61/volume-show-response.json.tpl new file mode 100644 index 00000000000..e1e237186ff --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.61/volume-show-response.json.tpl @@ -0,0 +1,43 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": null, + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "%(uuid)s", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "__DEFAULT__", + "provider_id": null, + "group_id": null, + "service_uuid": null, + "shared_targets": true, + "cluster_name": null + } +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.61/volume-update-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.61/volume-update-response.json.tpl new file mode 100644 index 00000000000..d4f376163d6 --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.61/volume-update-response.json.tpl @@ -0,0 +1,41 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": "This is yet, another volume.", + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": { + "name": "metadata0" + }, + "migration_status": null, + "multiattach": false, + "name": "vol-003", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null, + "service_uuid": null, + "shared_targets": true, + "cluster_name": null + } +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.61/volumes-list-detailed-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.61/volumes-list-detailed-response.json.tpl new file mode 100644 index 00000000000..f632dee2e0b --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.61/volumes-list-detailed-response.json.tpl @@ -0,0 +1,45 @@ +{ + "volumes": [ + { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": null, + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "%(uuid)s", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "%(name)s", + "service_uuid": null, + "provider_id": null, + "group_id": null, + "shared_targets": true, + "cluster_name": null + } + ] +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.63/volume-create-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.63/volume-create-response.json.tpl new file mode 100644 index 00000000000..e82fd87e7bc --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.63/volume-create-response.json.tpl @@ -0,0 +1,40 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": null, + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null, + "service_uuid": null, + "shared_targets": true, + "cluster_name": null, + "volume_type_id": "%(uuid)s" + } +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.63/volume-show-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.63/volume-show-response.json.tpl new file mode 100644 index 00000000000..d1ec79500c2 --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.63/volume-show-response.json.tpl @@ -0,0 +1,44 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": null, + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "%(uuid)s", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "__DEFAULT__", + "provider_id": null, + "group_id": null, + "service_uuid": null, + "shared_targets": true, + "cluster_name": null, + "volume_type_id": "%(uuid)s" + } +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.63/volume-update-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.63/volume-update-response.json.tpl new file mode 100644 index 00000000000..434e0dd7f2f --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.63/volume-update-response.json.tpl @@ -0,0 +1,42 @@ +{ + "volume": { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": "This is yet, another volume.", + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": { + "name": "metadata0" + }, + "migration_status": null, + "multiattach": false, + "name": "vol-003", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "__DEFAULT__", + "group_id": null, + "provider_id": null, + "service_uuid": null, + "shared_targets": true, + "cluster_name": null, + "volume_type_id": "%(uuid)s" + } +} diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/v3.63/volumes-list-detailed-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.63/volumes-list-detailed-response.json.tpl new file mode 100644 index 00000000000..090084f665f --- /dev/null +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/v3.63/volumes-list-detailed-response.json.tpl @@ -0,0 +1,46 @@ +{ + "volumes": [ + { + "attachments": [], + "availability_zone": "nova", + "bootable": "false", + "consistencygroup_id": null, + "created_at": "%(strtime)s", + "description": null, + "encrypted": false, + "id": "%(uuid)s", + "links": [ + { + "href": "%(host)s/v3/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/89afd400-b646-4bbc-b12b-c0a4d63e5bd3/volumes/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": {}, + "migration_status": null, + "multiattach": false, + "name": null, + "os-vol-host-attr:host": null, + "os-vol-mig-status-attr:migstat": null, + "os-vol-mig-status-attr:name_id": null, + "os-vol-tenant-attr:tenant_id": "%(uuid)s", + "replication_status": null, + "size": 10, + "snapshot_id": null, + "source_volid": null, + "status": "creating", + "updated_at": null, + "user_id": "%(uuid)s", + "volume_type": "%(name)s", + "volume_type_id": "%(uuid)s", + "service_uuid": null, + "provider_id": null, + "group_id": null, + "shared_targets": true, + "cluster_name": null + } + ] +} \ No newline at end of file diff --git a/cinder/tests/functional/api_sample_tests/samples/volumes/volumes-list-detailed-response.json.tpl b/cinder/tests/functional/api_sample_tests/samples/volumes/volumes-list-detailed-response.json.tpl index 090084f665f..77d0816aab7 100644 --- a/cinder/tests/functional/api_sample_tests/samples/volumes/volumes-list-detailed-response.json.tpl +++ b/cinder/tests/functional/api_sample_tests/samples/volumes/volumes-list-detailed-response.json.tpl @@ -34,13 +34,7 @@ "status": "creating", "updated_at": null, "user_id": "%(uuid)s", - "volume_type": "%(name)s", - "volume_type_id": "%(uuid)s", - "service_uuid": null, - "provider_id": null, - "group_id": null, - "shared_targets": true, - "cluster_name": null + "volume_type": "%(name)s" } ] -} \ No newline at end of file +} diff --git a/cinder/tests/functional/api_sample_tests/test_limits.py b/cinder/tests/functional/api_sample_tests/test_limits.py index fd77660ee65..e88352b3598 100644 --- a/cinder/tests/functional/api_sample_tests/test_limits.py +++ b/cinder/tests/functional/api_sample_tests/test_limits.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from cinder.tests.functional.api_sample_tests import test_volumes +from cinder.tests.functional import api_samples_test_base as test_base -class LimitsSampleJsonTest(test_volumes.VolumesSampleBase): +class LimitsSampleJsonTest(test_base.VolumesSampleBase): sample_dir = "limits" def setUp(self): diff --git a/cinder/tests/functional/api_sample_tests/test_qos.py b/cinder/tests/functional/api_sample_tests/test_qos.py index 5f5b450018f..426672d6b6c 100644 --- a/cinder/tests/functional/api_sample_tests/test_qos.py +++ b/cinder/tests/functional/api_sample_tests/test_qos.py @@ -12,10 +12,10 @@ from oslo_serialization import jsonutils -from cinder.tests.functional.api_sample_tests import test_volumes +from cinder.tests.functional import api_samples_test_base as test_base -class QOSSampleJsonTest(test_volumes.VolumesSampleBase): +class QOSSampleJsonTest(test_base.VolumesSampleBase): sample_dir = "qos" def setUp(self): diff --git a/cinder/tests/functional/api_sample_tests/test_quota_classes.py b/cinder/tests/functional/api_sample_tests/test_quota_classes.py index 00154f901ab..8ab6e25d2cf 100644 --- a/cinder/tests/functional/api_sample_tests/test_quota_classes.py +++ b/cinder/tests/functional/api_sample_tests/test_quota_classes.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from cinder.tests.functional.api_sample_tests import test_volumes +from cinder.tests.functional import api_samples_test_base as test_base -class QuotaClassesSampleJsonTest(test_volumes.VolumesSampleBase): +class QuotaClassesSampleJsonTest(test_base.VolumesSampleBase): sample_dir = "quota_classes" def setUp(self): diff --git a/cinder/tests/functional/api_sample_tests/test_quota_sets.py b/cinder/tests/functional/api_sample_tests/test_quota_sets.py index 49d09c5de1e..d762c953dc2 100644 --- a/cinder/tests/functional/api_sample_tests/test_quota_sets.py +++ b/cinder/tests/functional/api_sample_tests/test_quota_sets.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from cinder.tests.functional.api_sample_tests import test_volumes +from cinder.tests.functional import api_samples_test_base as test_base -class QuotaSetsSampleJsonTest(test_volumes.VolumesSampleBase): +class QuotaSetsSampleJsonTest(test_base.VolumesSampleBase): sample_dir = "quota_sets" def setUp(self): diff --git a/cinder/tests/functional/api_sample_tests/test_snapshots.py b/cinder/tests/functional/api_sample_tests/test_snapshots.py index 4306c001bc8..c7545c1711a 100644 --- a/cinder/tests/functional/api_sample_tests/test_snapshots.py +++ b/cinder/tests/functional/api_sample_tests/test_snapshots.py @@ -12,10 +12,10 @@ from oslo_serialization import jsonutils -from cinder.tests.functional.api_sample_tests import test_volumes +from cinder.tests.functional import api_samples_test_base as test_base -class VolumeSnapshotsSampleJsonTest(test_volumes.VolumesSampleBase): +class VolumeSnapshotsSampleJsonTest(test_base.VolumesSampleBase): sample_dir = "snapshots" def setUp(self): diff --git a/cinder/tests/functional/api_sample_tests/test_volume_actions.py b/cinder/tests/functional/api_sample_tests/test_volume_actions.py index 65ba81b8814..44c3636caac 100644 --- a/cinder/tests/functional/api_sample_tests/test_volume_actions.py +++ b/cinder/tests/functional/api_sample_tests/test_volume_actions.py @@ -13,10 +13,10 @@ from oslo_serialization import jsonutils from cinder.tests.functional.api_sample_tests import fakes -from cinder.tests.functional.api_sample_tests import test_volumes +from cinder.tests.functional import api_samples_test_base as test_base -class VolumeActionsSampleJsonTest(test_volumes.VolumesSampleBase): +class VolumeActionsSampleJsonTest(test_base.VolumesSampleBase): sample_dir = "volume_actions" def setUp(self): diff --git a/cinder/tests/functional/api_sample_tests/test_volume_transfer.py b/cinder/tests/functional/api_sample_tests/test_volume_transfer.py index 53f43dd8bf3..ddee8c059e8 100644 --- a/cinder/tests/functional/api_sample_tests/test_volume_transfer.py +++ b/cinder/tests/functional/api_sample_tests/test_volume_transfer.py @@ -12,10 +12,10 @@ from oslo_serialization import jsonutils -from cinder.tests.functional.api_sample_tests import test_volumes +from cinder.tests.functional import api_samples_test_base as test_base -class VolumeTransferSampleJsonTest(test_volumes.VolumesSampleBase): +class VolumeTransferSampleJsonTest(test_base.VolumesSampleBase): sample_dir = "volume_transfer" def setUp(self): diff --git a/cinder/tests/functional/api_sample_tests/test_volumes.py b/cinder/tests/functional/api_sample_tests/test_volumes.py index 1ff5d8333e1..a80d3ef1cbc 100644 --- a/cinder/tests/functional/api_sample_tests/test_volumes.py +++ b/cinder/tests/functional/api_sample_tests/test_volumes.py @@ -12,71 +12,76 @@ from oslo_serialization import jsonutils -from cinder.api.microversions import VOLUME_TYPE_ID_IN_VOLUME_DETAIL -from cinder.tests.functional import api_samples_test_base +from cinder.api import microversions as mv +from cinder.tests.functional import api_samples_test_base as test_base -class VolumesSampleBase(api_samples_test_base.ApiSampleTestBase): - sample_dir = "volumes" +@test_base.VolumesSampleBase.use_versions( + mv.BASE_VERSION, # 3.0 + mv.GROUP_VOLUME, # 3.13 + mv.VOLUME_DETAIL_PROVIDER_ID, # 3.21 + mv.VOLUME_SHARED_TARGETS_AND_SERVICE_FIELDS, # 3.48 + mv.VOLUME_CLUSTER_NAME, # 3.61 + mv.VOLUME_TYPE_ID_IN_VOLUME_DETAIL) # 3.63 +class VolumeDetailTests(test_base.VolumesSampleBase): + """Test volume details returned for operations with different MVs. - def _create_volume(self, _use_common_volume_api_samples=True, subs=None): + The details of a volume have changed in the different microversions, and we + have multiple operations that return them, so we should confirm that each + microversion returns the right values for all these different operations. + """ + def setup(self): + """Create a volume before we run each test. - orig_value = self.__class__._use_common_volume_api_samples - try: - self.__class__._use_common_volume_api_samples = ( - _use_common_volume_api_samples) - response = self._do_post('volumes', - 'volume-create-request', - subs) - return response + This method is called by _FunctionalTestBase right before each test is + called. - finally: - self.__class__._use_common_volume_api_samples = orig_value + We cannot create the volume on the setUp method because at that time + the API version is still 3.0, so we need it to be created right after + the microversion under test has been set. - -class VolumesSampleJsonTest(VolumesSampleBase): - - def setUp(self): - super(VolumesSampleBase, self).setUp() + This way the create method is called using the right microversion, + which is required for some tests, like test_volume_create. + """ self.response = self._create_volume() def test_volume_list_detail(self): - original_api_version = self.api.api_version - - try: - self.api.api_version = VOLUME_TYPE_ID_IN_VOLUME_DETAIL - response = self._do_get('volumes/detail') - self._verify_response('volumes-list-detailed-response', - {}, response, 200) - finally: - self.api.api_version = original_api_version - - def test_volume_create(self): - - self._verify_response('volume-create-response', - {}, self.response, 202) - - def test_volume_list(self): - - response = self._do_get('volumes') - self._verify_response('volumes-list-response', + response = self._do_get('volumes/detail') + self._verify_response('volumes-list-detailed-response', {}, response, 200) def test_volume_show_detail(self): - res = jsonutils.loads(self.response.content)['volume'] response = self._do_get('volumes/%s' % res['id']) self._verify_response('volume-show-response', {}, response, 200) - def test_volume_update(self): + def test_volume_create(self): + self._verify_response('volume-create-response', + {}, self.response, 202) + def test_volume_update(self): res = jsonutils.loads(self.response.content)['volume'] - response = self._do_put('volumes/%s' % res['id'], - 'volume-update-request') + # Use the request sample from the common API, since the request didn't + # change with the microversion, what changes is the response. + with self.common_api_sample(): + response = self._do_put('volumes/%s' % res['id'], + 'volume-update-request') self._verify_response('volume-update-response', {}, response, 200) + +class VolumesSampleJsonTest(test_base.VolumesSampleBase): + def setUp(self): + super(test_base.VolumesSampleBase, self).setUp() + self.response = self._create_volume() + + def test_volume_list(self): + + response = self._do_get('volumes') + self._verify_response('volumes-list-response', + {}, response, 200) + def test_volume_metadata_create(self): res = jsonutils.loads(self.response.content)['volume'] diff --git a/cinder/tests/functional/api_samples_test_base.py b/cinder/tests/functional/api_samples_test_base.py index d5d0a9c2dbb..ca9ee9612c0 100644 --- a/cinder/tests/functional/api_samples_test_base.py +++ b/cinder/tests/functional/api_samples_test_base.py @@ -10,6 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. +import contextlib import os import pprint import re @@ -66,7 +67,7 @@ class ApiSampleTestBase(functional_helpers._FunctionalTestBase): all_extensions = True sample_dir = None _project_id = True - _use_common_volume_api_samples = False + _use_common_sample = None def __init__(self, *args, **kwargs): super(ApiSampleTestBase, self).__init__(*args, **kwargs) @@ -74,8 +75,6 @@ class ApiSampleTestBase(functional_helpers._FunctionalTestBase): def setUp(self): super(ApiSampleTestBase, self).setUp() - self.api_major_version = 'v3' - # this is used to generate sample docs self.generate_samples = os.getenv('GENERATE_SAMPLES') is not None @@ -98,20 +97,21 @@ class ApiSampleTestBase(functional_helpers._FunctionalTestBase): @classmethod def _get_sample_path(cls, name, dirname, suffix='', api_version=None): - parts = [dirname] - parts.append('samples') - # Note: if _use_common_volume_api_samples is set to True - # then common volume sample files present in 'volumes' directory - # will be used. As of now it is being used for volume POST request - # to avoid duplicate copy of volume req and resp sample files. - # Example - VolumesSampleBase's _create_volume method. - if cls._use_common_volume_api_samples: - parts.append('volumes') - else: - parts.append(cls.sample_dir) - if api_version: - parts.append('v' + api_version) + + # Note: if _use_common_sample is set then common sample files from + # that location will be used instead of using the location from the + # sample_dir attribute. As of now it is being used for volume POST + # request to avoid duplicate copy of volume req and resp sample files. + # The best approach is using the context manager provided by the + # common_api_sample method as used in example + # VolumesSampleBase's _create_volume method. + parts = [dirname, 'samples', cls._use_common_sample or cls.sample_dir] + # Base version doesn't live in a specific vX.Y directory + if (not cls._use_common_sample + and api_version and api_version != cls._osapi_version): + parts.append('v' + api_version) parts.append(name + ".json" + suffix) + return os.path.join(*parts) @classmethod @@ -130,16 +130,16 @@ class ApiSampleTestBase(functional_helpers._FunctionalTestBase): api_version=api_version) def _read_template(self, name): - template = self._get_template(name) + template = self._get_template(name, self.osapi_version) with open(template) as inf: return inf.read().strip() def _write_template(self, name, data): - with open(self._get_template(name), 'w') as outf: + with open(self._get_template(name, self.osapi_version), 'w') as outf: outf.write(data) def _write_sample(self, name, data): - with open(self._get_sample(name), 'w') as outf: + with open(self._get_sample(name, self.osapi_version), 'w') as outf: outf.write(data) def _compare_dict(self, expected, result, result_str, matched_value): @@ -328,7 +328,7 @@ class ApiSampleTestBase(functional_helpers._FunctionalTestBase): """Process sample data and update version specific links.""" # replace version urls url_re = self._get_host() + "/v3/" + PROJECT_ID - new_url = self._get_host() + "/" + self.api_major_version + new_url = self._get_host() + "/v" + self.osapi_version_major if self._project_id: new_url += "/" + PROJECT_ID updated_data = re.sub(url_re, new_url, sample_data) @@ -356,17 +356,18 @@ class ApiSampleTestBase(functional_helpers._FunctionalTestBase): self.assertEqual(exp_code, response.status_code, message) response_data = response.content response_data = pretty_data(response_data) - if not os.path.exists(self._get_template(name)): + if not os.path.exists(self._get_template(name, self.osapi_version)): self._write_template(name, response_data) template_data = response_data else: template_data = self._read_template(name) if (self.generate_samples and - not os.path.exists(self._get_sample(name))): + not os.path.exists(self._get_sample(name, + self.osapi_version))): self._write_sample(name, response_data) sample_data = response_data else: - with open(self._get_sample(name)) as sample: + with open(self._get_sample(name, self.osapi_version)) as sample: sample_data = sample.read() if update_links: sample_data = self._update_links(sample_data) @@ -442,7 +443,7 @@ class ApiSampleTestBase(functional_helpers._FunctionalTestBase): 'text': text, 'int': '[0-9]+', 'user_id': text, - 'api_vers': self.api_major_version, + 'api_vers': 'v' + self.osapi_version_major, 'volume_endpoint': self._get_volume_endpoint(), 'versioned_volume_endpoint': self._get_versioned_volume_endpoint(), 'name': text, @@ -486,7 +487,7 @@ class ApiSampleTestBase(functional_helpers._FunctionalTestBase): body = None if name: body = self._read_template(name) % self.subs - sample = self._get_sample(name) + sample = self._get_sample(name, self.osapi_version) if self.generate_samples and not os.path.exists(sample): self._write_sample(name, body) return self._get_response(url, method, body, headers=headers) @@ -503,3 +504,24 @@ class ApiSampleTestBase(functional_helpers._FunctionalTestBase): def _do_delete(self, url, headers=None): return self._get_response(url, 'DELETE', headers=headers) + + @contextlib.contextmanager + def common_api_sample(self, api=None): + orig_value = self.__class__._use_common_sample + try: + self.__class__._use_common_sample = api or self.sample_dir + yield + finally: + self.__class__._use_common_sample = orig_value + + +class VolumesSampleBase(ApiSampleTestBase): + sample_dir = "volumes" + + def _create_volume(self, subs=None): + # Use the samples from the common API for the request + with self.common_api_sample('volumes'): + response = self._do_post('volumes', + 'volume-create-request', + subs) + return response diff --git a/cinder/tests/functional/functional_helpers.py b/cinder/tests/functional/functional_helpers.py index 8cfc486b3b3..a7258ed1606 100644 --- a/cinder/tests/functional/functional_helpers.py +++ b/cinder/tests/functional/functional_helpers.py @@ -14,6 +14,7 @@ # under the License. """Provides common functionality for functional tests.""" +import functools import os.path import random import string @@ -60,9 +61,59 @@ def generate_new_element(items, prefix, numeric=False): class _FunctionalTestBase(test.TestCase): + # Inheritors can change this attribute to change default tests microversion + _osapi_version = '3.0' + + # These attributes are automatically set based on _osapi_version and when + # setting osapi_version property. osapi_version_major = '3' osapi_version_minor = '0' + @property + def osapi_version(self): + return self._osapi_version + + @osapi_version.setter + def osapi_version(self, value): + self._osapi_version = value + self.osapi_version_major, self.osapi_version_minor = value.split('.') + self.api.api_version = value + + @staticmethod + def override_mv(version, pre_call=None): + """Decorator that overrides the microversion for 1 test.""" + def decorator(func): + @functools.wraps(func) + def wrapper(self, *args, **kwargs): + original_api_version = self.osapi_version + self.osapi_version = version + try: + if pre_call: + pre_call(self) + return func(self, *args, **kwargs) + finally: + self.osapi_version = original_api_version + return wrapper + return decorator + + @staticmethod + def use_versions(*versions): + """Class decorator to repeat tests for each provided version.""" + def generate_methods(cls): + setup = getattr(cls, 'setup', None) + + for name, func in list(cls.__dict__.items()): + if name.startswith('test_') and callable(func): + for version in versions: + setattr(cls, + f'{name}_{version.replace(".", "_")}', + _FunctionalTestBase.override_mv(version, + setup)(func)) + delattr(cls, name) + return cls + + return generate_methods + def setUp(self): super(_FunctionalTestBase, self).setUp() @@ -82,10 +133,11 @@ class _FunctionalTestBase(test.TestCase): self._start_api_service() self.addCleanup(self.osapi.stop) - api_version = self.osapi_version_major + '.' + self.osapi_version_minor + self.osapi_version_major, self.osapi_version_minor = \ + self._osapi_version.split('.') self.api = client.TestOpenStackClient(fake.USER_ID, fake.PROJECT_ID, self.auth_url, - api_version) + self.osapi_version) def _update_project(self, new_project_id): self.api.update_project(new_project_id) diff --git a/cinder/tests/functional/test_default_types.py b/cinder/tests/functional/test_default_types.py index d3b1535b471..e26120d8c7e 100644 --- a/cinder/tests/functional/test_default_types.py +++ b/cinder/tests/functional/test_default_types.py @@ -23,7 +23,7 @@ from cinder.tests.functional import functional_helpers class DefaultVolumeTypesTest(functional_helpers._FunctionalTestBase): _vol_type_name = 'functional_test_type' - osapi_version_minor = '62' + _osapi_version = '3.62' def setUp(self): super(DefaultVolumeTypesTest, self).setUp() diff --git a/cinder/tests/functional/test_group_replication.py b/cinder/tests/functional/test_group_replication.py index 66c3aa3640d..a154c5e2520 100644 --- a/cinder/tests/functional/test_group_replication.py +++ b/cinder/tests/functional/test_group_replication.py @@ -23,8 +23,7 @@ from cinder.volume import configuration class GroupReplicationTest(functional_helpers._FunctionalTestBase): _vol_type_name = 'functional_test_type' _grp_type_name = 'functional_grp_test_type' - osapi_version_major = '3' - osapi_version_minor = '38' + _osapi_version = '3.38' def setUp(self): super(GroupReplicationTest, self).setUp() diff --git a/cinder/tests/functional/test_group_snapshots.py b/cinder/tests/functional/test_group_snapshots.py index 1744b4e99d4..90346d9bcdc 100644 --- a/cinder/tests/functional/test_group_snapshots.py +++ b/cinder/tests/functional/test_group_snapshots.py @@ -23,8 +23,7 @@ from cinder.volume import configuration class GroupSnapshotsTest(functional_helpers._FunctionalTestBase): _vol_type_name = 'functional_test_type' _grp_type_name = 'functional_grp_test_type' - osapi_version_major = '3' - osapi_version_minor = '19' + _osapi_version = '3.19' def setUp(self): super(GroupSnapshotsTest, self).setUp() diff --git a/cinder/tests/functional/test_groups.py b/cinder/tests/functional/test_groups.py index 13f22b1795a..97c69984610 100644 --- a/cinder/tests/functional/test_groups.py +++ b/cinder/tests/functional/test_groups.py @@ -22,8 +22,7 @@ from cinder.volume import configuration class GroupsTest(functional_helpers._FunctionalTestBase): _vol_type_name = 'functional_test_type' _grp_type_name = 'functional_grp_test_type' - osapi_version_major = '3' - osapi_version_minor = '20' + _osapi_version = '3.20' def setUp(self): super(GroupsTest, self).setUp() diff --git a/doc/source/contributor/api_microversion_dev.rst b/doc/source/contributor/api_microversion_dev.rst index d28da16fab3..46cadd11c76 100644 --- a/doc/source/contributor/api_microversion_dev.rst +++ b/doc/source/contributor/api_microversion_dev.rst @@ -299,6 +299,31 @@ necessary to add changes to other places which describe your change: ``cinder/api-ref/source/v3/samples/versions/versions-response.json`` to the latest microversion to avoid functional test failure. +* If the API microversion has changed an endpoint accepted parameters or the + values it returns, we need to create the appropriate API samples within + the ``api-ref/source/v3/samples`` tree creating a new ``vX.Y`` directory + with our request and/or response json. + +* Update the functional API tests in the + ``cinder/tests/functional/api_sample_tests`` tree to make requests and + validate responses with the new microversion. There are multiple convenience + methods provided for testing, such as ``use_versions`` class decorator that + allows us to run the same tests with different microversions (each will use + their respective json and templates), the ``override_mv`` method decorator to + change the microversion in a single test, and the ``common_api_sample`` + context manager to use the base sample instead of a microversion specific + one. + +* Update the documentation adding any new parameter to + ``api-ref/source/v3/parameters.yaml`` (remember to add the ``min_version``) + and then making appropriate changes to the ``.inc`` file in + ``api-ref/source/v3/`` to reflect new possible return codes, new accepted + parameters and their ``Request Example (vX.Y)`` title and include file, and + returned values and their ``Response Example (vX.Y)`` title and include file. + +The Cinder project's policy is that the sample requests and responses should +always reflect the *most recent* microversion. + Allocating a microversion -------------------------