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
This commit is contained in:
Goutham Pacha Ravi 2017-01-26 11:47:11 -05:00
parent c4da03274c
commit 6ba74918d5
4 changed files with 16 additions and 2 deletions

View File

@ -1,7 +1,7 @@
{
"versions": [
{
"status": "SUPPORTED",
"status": "DEPRECATED",
"updated": "2015-08-27T11:33:21Z",
"links": [
{

View File

@ -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',

View File

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

View File

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