diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-04-21 13:28:59 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-04-21 13:28:59 +0000 |
commit | 5c9ced73f65201c384dcb96ebb835d836605595e (patch) | |
tree | 995636bcc876b426d13b5353ec5a7a1bcccdc51c | |
parent | 5a99238c6d2dab4d57578d53eb0e16609098203b (diff) | |
parent | 68d6f924037f3b931add2ce5d0d433913e720ca6 (diff) | |
download | nova-5c9ced73f65201c384dcb96ebb835d836605595e.tar.gz |
Merge "Add min/max of API microversions to version API" into stable/kilo
5 files changed, 29 insertions, 0 deletions
diff --git a/doc/api_samples/versions/versions-get-resp.json b/doc/api_samples/versions/versions-get-resp.json index 371e0ccc95..2b456fd73a 100644 --- a/doc/api_samples/versions/versions-get-resp.json +++ b/doc/api_samples/versions/versions-get-resp.json @@ -9,6 +9,8 @@ } ], "status": "SUPPORTED", + "version": "", + "min_version": "", "updated": "2011-01-21T11:33:21Z" }, { @@ -20,6 +22,8 @@ } ], "status": "CURRENT", + "version": "2.3", + "min_version": "2.1", "updated": "2013-07-23T11:33:21Z" } ] diff --git a/nova/api/openstack/compute/versions.py b/nova/api/openstack/compute/versions.py index d6a633f3ba..4b727de320 100644 --- a/nova/api/openstack/compute/versions.py +++ b/nova/api/openstack/compute/versions.py @@ -15,6 +15,7 @@ from oslo_config import cfg +from nova.api.openstack import api_version_request from nova.api.openstack.compute.views import versions as views_versions from nova.api.openstack import wsgi @@ -36,6 +37,8 @@ VERSIONS = { "v2.0": { "id": "v2.0", "status": "SUPPORTED", + "version": "", + "min_version": "", "updated": "2011-01-21T11:33:21Z", "links": [ { @@ -54,6 +57,8 @@ VERSIONS = { "v2.1": { "id": "v2.1", "status": "CURRENT", + "version": api_version_request._MAX_API_VERSION, + "min_version": api_version_request._MIN_API_VERSION, "updated": "2013-07-23T11:33:21Z", "links": [ { diff --git a/nova/api/openstack/compute/views/versions.py b/nova/api/openstack/compute/views/versions.py index cf76c2be8d..237826a344 100644 --- a/nova/api/openstack/compute/views/versions.py +++ b/nova/api/openstack/compute/views/versions.py @@ -55,6 +55,8 @@ class ViewBuilder(common.ViewBuilder): version_objs.append({ "id": version['id'], "status": version['status'], + "version": version['version'], + "min_version": version['min_version'], "updated": version['updated'], "links": self._build_links(version), }) diff --git a/nova/tests/functional/api_samples/versions/versions-get-resp.json.tpl b/nova/tests/functional/api_samples/versions/versions-get-resp.json.tpl index 371e0ccc95..2b456fd73a 100644 --- a/nova/tests/functional/api_samples/versions/versions-get-resp.json.tpl +++ b/nova/tests/functional/api_samples/versions/versions-get-resp.json.tpl @@ -9,6 +9,8 @@ } ], "status": "SUPPORTED", + "version": "", + "min_version": "", "updated": "2011-01-21T11:33:21Z" }, { @@ -20,6 +22,8 @@ } ], "status": "CURRENT", + "version": "2.3", + "min_version": "2.1", "updated": "2013-07-23T11:33:21Z" } ] diff --git a/nova/tests/unit/api/openstack/compute/test_versions.py b/nova/tests/unit/api/openstack/compute/test_versions.py index 46cd4f91e7..9b235c782a 100644 --- a/nova/tests/unit/api/openstack/compute/test_versions.py +++ b/nova/tests/unit/api/openstack/compute/test_versions.py @@ -45,6 +45,8 @@ EXP_VERSIONS = { "v2.0": { "id": "v2.0", "status": "SUPPORTED", + "version": "", + "min_version": "", "updated": "2011-01-21T11:33:21Z", "links": [ { @@ -63,6 +65,8 @@ EXP_VERSIONS = { "v2.1": { "id": "v2.1", "status": "CURRENT", + "version": "2.3", + "min_version": "2.1", "updated": "2013-07-23T11:33:21Z", "links": [ { @@ -98,6 +102,8 @@ class VersionsTestV20(test.NoDBTestCase): { "id": "v2.0", "status": "SUPPORTED", + "version": "", + "min_version": "", "updated": "2011-01-21T11:33:21Z", "links": [ { @@ -108,6 +114,8 @@ class VersionsTestV20(test.NoDBTestCase): { "id": "v2.1", "status": "CURRENT", + "version": "2.3", + "min_version": "2.1", "updated": "2013-07-23T11:33:21Z", "links": [ { @@ -139,6 +147,8 @@ class VersionsTestV20(test.NoDBTestCase): "version": { "id": "v2.0", "status": "SUPPORTED", + "version": "", + "min_version": "", "updated": "2011-01-21T11:33:21Z", "links": [ { @@ -291,6 +301,8 @@ class VersionsViewBuilderTests(test.NoDBTestCase): "v3.2.1": { "id": "3.2.1", "status": "CURRENT", + "version": "2.3", + "min_version": "2.1", "updated": "2011-07-18T11:30:00Z", } } @@ -300,6 +312,8 @@ class VersionsViewBuilderTests(test.NoDBTestCase): { "id": "3.2.1", "status": "CURRENT", + "version": "2.3", + "min_version": "2.1", "updated": "2011-07-18T11:30:00Z", "links": [ { |