From 6ba74918d5e43bbe0fcf0ce900294941ef5d43b8 Mon Sep 17 00:00:00 2001 From: Goutham Pacha Ravi Date: Thu, 26 Jan 2017 11:47:11 -0500 Subject: [PATCH] Mark 'v1' API deprecated in the versions response We announced the deprecation of the v1 API on the mailing list during the mitaka release. While we continue to support it in code and run CI tests on it, we should allow the consumers of the versions API to acknowledge this change. This patch does not remove the API. It only marks the version as "DEPRECATED". [1] http://lists.openstack.org/pipermail/openstack-dev/2016-June/096517.html Change-Id: If80bddb68a5b92b604ef582fe07eef72c47d6f2f --- api-ref/source/samples/versions-index-response.json | 2 +- manila/api/versions.py | 2 +- manila/tests/api/test_versions.py | 3 +++ ...-versions-mark-v1-deprecated-3540d39279fbd60e.yaml | 11 +++++++++++ 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/api-versions-mark-v1-deprecated-3540d39279fbd60e.yaml diff --git a/api-ref/source/samples/versions-index-response.json b/api-ref/source/samples/versions-index-response.json index 33c483fe63..2c44512e63 100644 --- a/api-ref/source/samples/versions-index-response.json +++ b/api-ref/source/samples/versions-index-response.json @@ -1,7 +1,7 @@ { "versions": [ { - "status": "SUPPORTED", + "status": "DEPRECATED", "updated": "2015-08-27T11:33:21Z", "links": [ { diff --git a/manila/api/versions.py b/manila/api/versions.py index 3bfdb726ba..e4238ba6a8 100644 --- a/manila/api/versions.py +++ b/manila/api/versions.py @@ -40,7 +40,7 @@ _MEDIA_TYPES = [{ _KNOWN_VERSIONS = { 'v1.0': { 'id': 'v1.0', - 'status': 'SUPPORTED', + 'status': 'DEPRECATED', 'version': '', 'min_version': '', 'updated': '2015-08-27T11:33:21Z', diff --git a/manila/tests/api/test_versions.py b/manila/tests/api/test_versions.py index c8b59a14f7..c36623f435 100644 --- a/manila/tests/api/test_versions.py +++ b/manila/tests/api/test_versions.py @@ -56,12 +56,14 @@ class VersionsControllerTestCase(test.TestCase): v1 = [v for v in version_list if v['id'] == 'v1.0'][0] self.assertEqual('', v1.get('min_version')) self.assertEqual('', v1.get('version')) + self.assertEqual('DEPRECATED', v1.get('status')) v2 = [v for v in version_list if v['id'] == 'v2.0'][0] self.assertEqual(api_version_request._MIN_API_VERSION, v2.get('min_version')) self.assertEqual(api_version_request._MAX_API_VERSION, v2.get('version')) + self.assertEqual('CURRENT', v2.get('status')) @ddt.data('1.0', '1.1', @@ -84,6 +86,7 @@ class VersionsControllerTestCase(test.TestCase): self.assertEqual(version_header_name, response.headers['Vary']) self.assertEqual('', version_list[0].get('min_version')) self.assertEqual('', version_list[0].get('version')) + self.assertEqual('DEPRECATED', version_list[0].get('status')) @ddt.data(api_version_request._MIN_API_VERSION, api_version_request._MAX_API_VERSION) diff --git a/releasenotes/notes/api-versions-mark-v1-deprecated-3540d39279fbd60e.yaml b/releasenotes/notes/api-versions-mark-v1-deprecated-3540d39279fbd60e.yaml new file mode 100644 index 0000000000..c08b62bc63 --- /dev/null +++ b/releasenotes/notes/api-versions-mark-v1-deprecated-3540d39279fbd60e.yaml @@ -0,0 +1,11 @@ +--- +deprecations: + - Deprecation of the manila v1 API was announced in the mitaka release. + The versions response from the API has been fixed to state that this + version has been deprecated. If you are using v1 API, consider switching + to the v2 API to take advantage of newer features. v2 API has support for + 'microversions'. Any endpoint on the v2 API can be requested with the HTTP header + 'X-OpenStack-Manila-API-Version' and providing a value '2.x', where '2' is the + major version and 'x' is the minor (or 'micro') version. To continue exploiting + feature functionality that was part of the v1 API, you may use the v2 API with + the microverison '2.0', which is behaviourally identical to the v1 API.