From c8028768e69713868f359d3bea2f63ab62a95717 Mon Sep 17 00:00:00 2001 From: Brian Rosmaita Date: Thu, 19 Jan 2017 12:32:21 -0500 Subject: [PATCH] Bump minor API version Change-Id I94bc7708b291ce37319539e27b3e88c9a17e1a9f (Community Images) entails a minor version bump in the v2 API. Change-Id: I2b7cd5ec9b974ebc738feb89ef22c428fbe3be06 Depends-On: I94bc7708b291ce37319539e27b3e88c9a17e1a9f --- api-ref/source/versions/index.rst | 5 +++ .../samples/image-versions-response.json | 12 +++++- glance/api/middleware/version_negotiation.py | 1 + glance/api/versions.py | 3 +- glance/tests/functional/test_api.py | 21 ++++++++-- glance/tests/unit/test_versions.py | 39 ++++++++++++++++--- ...i-minor-version-bump-bbd69dc457fc731c.yaml | 18 +++++++++ 7 files changed, 89 insertions(+), 10 deletions(-) create mode 100644 releasenotes/notes/api-minor-version-bump-bbd69dc457fc731c.yaml diff --git a/api-ref/source/versions/index.rst b/api-ref/source/versions/index.rst index 16e4809be9..b2fe30f392 100644 --- a/api-ref/source/versions/index.rst +++ b/api-ref/source/versions/index.rst @@ -24,6 +24,11 @@ Image Service Versions Version History *************** +**Ocata changes** + +- version 2.5 is CURRENT +- version 2.4 is SUPPORTED + **Newton changes** - version 2.4 is CURRENT diff --git a/api-ref/source/versions/samples/image-versions-response.json b/api-ref/source/versions/samples/image-versions-response.json index 5cd136687f..df42d87775 100644 --- a/api-ref/source/versions/samples/image-versions-response.json +++ b/api-ref/source/versions/samples/image-versions-response.json @@ -1,5 +1,15 @@ { "versions": [ + { + "id": "v2.5", + "links": [ + { + "href": "http://glance.openstack.example.org/v2/", + "rel": "self" + } + ], + "status": "CURRENT" + }, { "id": "v2.4", "links": [ @@ -8,7 +18,7 @@ "rel": "self" } ], - "status": "CURRENT" + "status": "SUPPORTED" }, { "id": "v2.3", diff --git a/glance/api/middleware/version_negotiation.py b/glance/api/middleware/version_negotiation.py index edaeff4723..62a26c08ce 100644 --- a/glance/api/middleware/version_negotiation.py +++ b/glance/api/middleware/version_negotiation.py @@ -84,6 +84,7 @@ class VersionNegotiationFilter(wsgi.Middleware): allowed_versions['v2.2'] = 2 allowed_versions['v2.3'] = 2 allowed_versions['v2.4'] = 2 + allowed_versions['v2.5'] = 2 return allowed_versions def _match_version_string(self, subject): diff --git a/glance/api/versions.py b/glance/api/versions.py index 3aaecf0e95..7546b3f51d 100644 --- a/glance/api/versions.py +++ b/glance/api/versions.py @@ -81,7 +81,8 @@ class Controller(object): version_objs = [] if CONF.enable_v2_api: version_objs.extend([ - build_version_object(2.4, 'v2', 'CURRENT'), + build_version_object(2.5, 'v2', 'CURRENT'), + build_version_object(2.4, 'v2', 'SUPPORTED'), build_version_object(2.3, 'v2', 'SUPPORTED'), build_version_object(2.2, 'v2', 'SUPPORTED'), build_version_object(2.1, 'v2', 'SUPPORTED'), diff --git a/glance/tests/functional/test_api.py b/glance/tests/functional/test_api.py index de0d1f0454..f71a69117f 100644 --- a/glance/tests/functional/test_api.py +++ b/glance/tests/functional/test_api.py @@ -33,10 +33,15 @@ class TestApiVersions(functional.FunctionalTest): url = 'http://127.0.0.1:%d/v%%s/' % self.api_port versions = {'versions': [ { - 'id': 'v2.4', + 'id': 'v2.5', 'status': 'CURRENT', 'links': [{'rel': 'self', 'href': url % '2'}], }, + { + 'id': 'v2.4', + 'status': 'SUPPORTED', + 'links': [{'rel': 'self', 'href': url % '2'}], + }, { 'id': 'v2.3', 'status': 'SUPPORTED', @@ -85,10 +90,15 @@ class TestApiVersions(functional.FunctionalTest): url = 'http://127.0.0.1:%d/v%%s/' % self.api_port versions = {'versions': [ { - 'id': 'v2.4', + 'id': 'v2.5', 'status': 'CURRENT', 'links': [{'rel': 'self', 'href': url % '2'}], }, + { + 'id': 'v2.4', + 'status': 'SUPPORTED', + 'links': [{'rel': 'self', 'href': url % '2'}], + }, { 'id': 'v2.3', 'status': 'SUPPORTED', @@ -155,10 +165,15 @@ class TestApiPaths(functional.FunctionalTest): url = 'http://127.0.0.1:%d/v%%s/' % self.api_port versions = {'versions': [ { - 'id': 'v2.4', + 'id': 'v2.5', 'status': 'CURRENT', 'links': [{'rel': 'self', 'href': url % '2'}], }, + { + 'id': 'v2.4', + 'status': 'SUPPORTED', + 'links': [{'rel': 'self', 'href': url % '2'}], + }, { 'id': 'v2.3', 'status': 'SUPPORTED', diff --git a/glance/tests/unit/test_versions.py b/glance/tests/unit/test_versions.py index e7037d6f99..aed722a717 100644 --- a/glance/tests/unit/test_versions.py +++ b/glance/tests/unit/test_versions.py @@ -37,11 +37,17 @@ class VersionsTest(base.IsolatedUnitTest): results = jsonutils.loads(res.body)['versions'] expected = [ { - 'id': 'v2.4', + 'id': 'v2.5', 'status': 'CURRENT', 'links': [{'rel': 'self', 'href': 'http://127.0.0.1:9292/v2/'}], }, + { + 'id': 'v2.4', + 'status': 'SUPPORTED', + 'links': [{'rel': 'self', + 'href': 'http://127.0.0.1:9292/v2/'}], + }, { 'id': 'v2.3', 'status': 'SUPPORTED', @@ -92,11 +98,17 @@ class VersionsTest(base.IsolatedUnitTest): results = jsonutils.loads(res.body)['versions'] expected = [ { - 'id': 'v2.4', + 'id': 'v2.5', 'status': 'CURRENT', 'links': [{'rel': 'self', 'href': 'https://example.com:9292/v2/'}], }, + { + 'id': 'v2.4', + 'status': 'SUPPORTED', + 'links': [{'rel': 'self', + 'href': 'https://example.com:9292/v2/'}], + }, { 'id': 'v2.3', 'status': 'SUPPORTED', @@ -146,11 +158,17 @@ class VersionsTest(base.IsolatedUnitTest): results = jsonutils.loads(res.body)['versions'] expected = [ { - 'id': 'v2.4', + 'id': 'v2.5', 'status': 'CURRENT', 'links': [{'rel': 'self', 'href': 'http://localhost:9292/v2/'}], }, + { + 'id': 'v2.4', + 'status': 'SUPPORTED', + 'links': [{'rel': 'self', + 'href': 'http://localhost:9292/v2/'}], + }, { 'id': 'v2.3', 'status': 'SUPPORTED', @@ -201,11 +219,17 @@ class VersionsTest(base.IsolatedUnitTest): results = jsonutils.loads(res.body)['versions'] expected = [ { - 'id': 'v2.4', + 'id': 'v2.5', 'status': 'CURRENT', 'links': [{'rel': 'self', 'href': 'https://localhost:9292/v2/'}], }, + { + 'id': 'v2.4', + 'status': 'SUPPORTED', + 'links': [{'rel': 'self', + 'href': 'https://localhost:9292/v2/'}], + }, { 'id': 'v2.3', 'status': 'SUPPORTED', @@ -303,8 +327,13 @@ class VersionNegotiationTest(base.IsolatedUnitTest): self.middleware.process_request(request) self.assertEqual('/v2/images', request.path_info) - def test_request_url_v2_5_unsupported(self): + def test_request_url_v2_5(self): request = webob.Request.blank('/v2.5/images') + self.middleware.process_request(request) + self.assertEqual('/v2/images', request.path_info) + + def test_request_url_v2_6_unsupported(self): + request = webob.Request.blank('/v2.6/images') resp = self.middleware.process_request(request) self.assertIsInstance(resp, versions.Controller) diff --git a/releasenotes/notes/api-minor-version-bump-bbd69dc457fc731c.yaml b/releasenotes/notes/api-minor-version-bump-bbd69dc457fc731c.yaml new file mode 100644 index 0000000000..b4f7735947 --- /dev/null +++ b/releasenotes/notes/api-minor-version-bump-bbd69dc457fc731c.yaml @@ -0,0 +1,18 @@ +--- +prelude: > + - The *minor* version of the Images API v2 is bumped to **2.5**. +upgrade: + - | + The **CURRENT** version of the version 2 Images API supplied + by Glance is now **2.5**. Changes include: + + * The 'visibility' enumeration has been increased from two values + (``public``, ``private``) to four values (``public``, ``private``, + ``shared``, and ``community``). + + * Formerly, it was possible to add members to an image whose + visibility was ``private``, thereby creating a "shared" image. + In this release, an image must have a visibility of ``shared`` + in order to accept member operations. Attempting to add a + member to an image with a visibility of ``private`` will result + in a 409 (Conflict) response.