Merge "Bump minor API version"

This commit is contained in:
Jenkins 2017-01-28 00:20:40 +00:00 committed by Gerrit Code Review
commit b7c8936aa3
7 changed files with 89 additions and 10 deletions

View File

@ -24,6 +24,11 @@ Image Service Versions
Version History Version History
*************** ***************
**Ocata changes**
- version 2.5 is CURRENT
- version 2.4 is SUPPORTED
**Newton changes** **Newton changes**
- version 2.4 is CURRENT - version 2.4 is CURRENT

View File

@ -1,5 +1,15 @@
{ {
"versions": [ "versions": [
{
"id": "v2.5",
"links": [
{
"href": "http://glance.openstack.example.org/v2/",
"rel": "self"
}
],
"status": "CURRENT"
},
{ {
"id": "v2.4", "id": "v2.4",
"links": [ "links": [
@ -8,7 +18,7 @@
"rel": "self" "rel": "self"
} }
], ],
"status": "CURRENT" "status": "SUPPORTED"
}, },
{ {
"id": "v2.3", "id": "v2.3",

View File

@ -84,6 +84,7 @@ class VersionNegotiationFilter(wsgi.Middleware):
allowed_versions['v2.2'] = 2 allowed_versions['v2.2'] = 2
allowed_versions['v2.3'] = 2 allowed_versions['v2.3'] = 2
allowed_versions['v2.4'] = 2 allowed_versions['v2.4'] = 2
allowed_versions['v2.5'] = 2
return allowed_versions return allowed_versions
def _match_version_string(self, subject): def _match_version_string(self, subject):

View File

@ -81,7 +81,8 @@ class Controller(object):
version_objs = [] version_objs = []
if CONF.enable_v2_api: if CONF.enable_v2_api:
version_objs.extend([ 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.3, 'v2', 'SUPPORTED'),
build_version_object(2.2, 'v2', 'SUPPORTED'), build_version_object(2.2, 'v2', 'SUPPORTED'),
build_version_object(2.1, 'v2', 'SUPPORTED'), build_version_object(2.1, 'v2', 'SUPPORTED'),

View File

@ -33,10 +33,15 @@ class TestApiVersions(functional.FunctionalTest):
url = 'http://127.0.0.1:%d/v%%s/' % self.api_port url = 'http://127.0.0.1:%d/v%%s/' % self.api_port
versions = {'versions': [ versions = {'versions': [
{ {
'id': 'v2.4', 'id': 'v2.5',
'status': 'CURRENT', 'status': 'CURRENT',
'links': [{'rel': 'self', 'href': url % '2'}], 'links': [{'rel': 'self', 'href': url % '2'}],
}, },
{
'id': 'v2.4',
'status': 'SUPPORTED',
'links': [{'rel': 'self', 'href': url % '2'}],
},
{ {
'id': 'v2.3', 'id': 'v2.3',
'status': 'SUPPORTED', 'status': 'SUPPORTED',
@ -85,10 +90,15 @@ class TestApiVersions(functional.FunctionalTest):
url = 'http://127.0.0.1:%d/v%%s/' % self.api_port url = 'http://127.0.0.1:%d/v%%s/' % self.api_port
versions = {'versions': [ versions = {'versions': [
{ {
'id': 'v2.4', 'id': 'v2.5',
'status': 'CURRENT', 'status': 'CURRENT',
'links': [{'rel': 'self', 'href': url % '2'}], 'links': [{'rel': 'self', 'href': url % '2'}],
}, },
{
'id': 'v2.4',
'status': 'SUPPORTED',
'links': [{'rel': 'self', 'href': url % '2'}],
},
{ {
'id': 'v2.3', 'id': 'v2.3',
'status': 'SUPPORTED', 'status': 'SUPPORTED',
@ -155,10 +165,15 @@ class TestApiPaths(functional.FunctionalTest):
url = 'http://127.0.0.1:%d/v%%s/' % self.api_port url = 'http://127.0.0.1:%d/v%%s/' % self.api_port
versions = {'versions': [ versions = {'versions': [
{ {
'id': 'v2.4', 'id': 'v2.5',
'status': 'CURRENT', 'status': 'CURRENT',
'links': [{'rel': 'self', 'href': url % '2'}], 'links': [{'rel': 'self', 'href': url % '2'}],
}, },
{
'id': 'v2.4',
'status': 'SUPPORTED',
'links': [{'rel': 'self', 'href': url % '2'}],
},
{ {
'id': 'v2.3', 'id': 'v2.3',
'status': 'SUPPORTED', 'status': 'SUPPORTED',

View File

@ -37,11 +37,17 @@ class VersionsTest(base.IsolatedUnitTest):
results = jsonutils.loads(res.body)['versions'] results = jsonutils.loads(res.body)['versions']
expected = [ expected = [
{ {
'id': 'v2.4', 'id': 'v2.5',
'status': 'CURRENT', 'status': 'CURRENT',
'links': [{'rel': 'self', 'links': [{'rel': 'self',
'href': 'http://127.0.0.1:9292/v2/'}], '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', 'id': 'v2.3',
'status': 'SUPPORTED', 'status': 'SUPPORTED',
@ -92,11 +98,17 @@ class VersionsTest(base.IsolatedUnitTest):
results = jsonutils.loads(res.body)['versions'] results = jsonutils.loads(res.body)['versions']
expected = [ expected = [
{ {
'id': 'v2.4', 'id': 'v2.5',
'status': 'CURRENT', 'status': 'CURRENT',
'links': [{'rel': 'self', 'links': [{'rel': 'self',
'href': 'https://example.com:9292/v2/'}], 'href': 'https://example.com:9292/v2/'}],
}, },
{
'id': 'v2.4',
'status': 'SUPPORTED',
'links': [{'rel': 'self',
'href': 'https://example.com:9292/v2/'}],
},
{ {
'id': 'v2.3', 'id': 'v2.3',
'status': 'SUPPORTED', 'status': 'SUPPORTED',
@ -146,11 +158,17 @@ class VersionsTest(base.IsolatedUnitTest):
results = jsonutils.loads(res.body)['versions'] results = jsonutils.loads(res.body)['versions']
expected = [ expected = [
{ {
'id': 'v2.4', 'id': 'v2.5',
'status': 'CURRENT', 'status': 'CURRENT',
'links': [{'rel': 'self', 'links': [{'rel': 'self',
'href': 'http://localhost:9292/v2/'}], 'href': 'http://localhost:9292/v2/'}],
}, },
{
'id': 'v2.4',
'status': 'SUPPORTED',
'links': [{'rel': 'self',
'href': 'http://localhost:9292/v2/'}],
},
{ {
'id': 'v2.3', 'id': 'v2.3',
'status': 'SUPPORTED', 'status': 'SUPPORTED',
@ -201,11 +219,17 @@ class VersionsTest(base.IsolatedUnitTest):
results = jsonutils.loads(res.body)['versions'] results = jsonutils.loads(res.body)['versions']
expected = [ expected = [
{ {
'id': 'v2.4', 'id': 'v2.5',
'status': 'CURRENT', 'status': 'CURRENT',
'links': [{'rel': 'self', 'links': [{'rel': 'self',
'href': 'https://localhost:9292/v2/'}], 'href': 'https://localhost:9292/v2/'}],
}, },
{
'id': 'v2.4',
'status': 'SUPPORTED',
'links': [{'rel': 'self',
'href': 'https://localhost:9292/v2/'}],
},
{ {
'id': 'v2.3', 'id': 'v2.3',
'status': 'SUPPORTED', 'status': 'SUPPORTED',
@ -303,8 +327,13 @@ class VersionNegotiationTest(base.IsolatedUnitTest):
self.middleware.process_request(request) self.middleware.process_request(request)
self.assertEqual('/v2/images', request.path_info) 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') 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) resp = self.middleware.process_request(request)
self.assertIsInstance(resp, versions.Controller) self.assertIsInstance(resp, versions.Controller)

View File

@ -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.