From df630cd1b2e589172633b394ba187bba2524f81b Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 4 Jul 2025 11:24:23 +0100 Subject: [PATCH] api: Deprecate v2 API Change-Id: Ie236cc001ddc6362b92119710ec1672ae733318e Signed-off-by: Stephen Finucane --- api-guide/source/microversions.rst | 4 ++-- api-guide/source/versions.rst | 2 +- .../versions/v2-version-get-resp.json | 4 ++-- doc/api_samples/versions/versions-get-resp.json | 6 +++--- nova/api/openstack/compute/versions.py | 4 ++-- .../versions/v2-version-get-resp.json.tpl | 6 +++--- .../versions/versions-get-resp.json.tpl | 4 ++-- .../unit/api/openstack/compute/test_versions.py | 16 ++++++++-------- .../notes/deprecate-v2-api-22b1ca9c35c321bc.yaml | 9 +++++++++ 9 files changed, 32 insertions(+), 23 deletions(-) create mode 100644 releasenotes/notes/deprecate-v2-api-22b1ca9c35c321bc.yaml diff --git a/api-guide/source/microversions.rst b/api-guide/source/microversions.rst index 5a2045ce145d..98dfb378b860 100644 --- a/api-guide/source/microversions.rst +++ b/api-guide/source/microversions.rst @@ -65,10 +65,10 @@ as follows:: "rel": "self" } ], - "status": "SUPPORTED", + "status": "DEPRECATED", "version": "", "min_version": "", - "updated": "2011-01-21T11:33:21Z" + "updated": "2025-07-04T12:00:00Z" }, { "id": "v2.1", diff --git a/api-guide/source/versions.rst b/api-guide/source/versions.rst index d7bfd8d226e7..009d6913bab4 100644 --- a/api-guide/source/versions.rst +++ b/api-guide/source/versions.rst @@ -64,7 +64,7 @@ links and MIME types to available versions. "type": "application/vnd.openstack.compute+json;version=2" } ], - "status": "SUPPORTED" + "status": "DEPRECATED" }, { "id": "v2.1", diff --git a/doc/api_samples/versions/v2-version-get-resp.json b/doc/api_samples/versions/v2-version-get-resp.json index 518ac02ec116..8cf3208110c7 100644 --- a/doc/api_samples/versions/v2-version-get-resp.json +++ b/doc/api_samples/versions/v2-version-get-resp.json @@ -18,9 +18,9 @@ "type": "application/vnd.openstack.compute+json;version=2" } ], - "status": "SUPPORTED", + "status": "DEPRECATED", "version": "", "min_version": "", - "updated": "2011-01-21T11:33:21Z" + "updated": "2025-07-04T12:00:00Z" } } diff --git a/doc/api_samples/versions/versions-get-resp.json b/doc/api_samples/versions/versions-get-resp.json index 87ddf1865ea4..4ca27da2e697 100644 --- a/doc/api_samples/versions/versions-get-resp.json +++ b/doc/api_samples/versions/versions-get-resp.json @@ -8,10 +8,10 @@ "rel": "self" } ], - "status": "SUPPORTED", + "status": "DEPRECATED", "version": "", "min_version": "", - "updated": "2011-01-21T11:33:21Z" + "updated": "2025-07-04T12:00:00Z" }, { "id": "v2.1", @@ -27,4 +27,4 @@ "updated": "2013-07-23T11:33:21Z" } ] -} \ No newline at end of file +} diff --git a/nova/api/openstack/compute/versions.py b/nova/api/openstack/compute/versions.py index 4ed38df30314..cef1fba8ed7d 100644 --- a/nova/api/openstack/compute/versions.py +++ b/nova/api/openstack/compute/versions.py @@ -33,10 +33,10 @@ LINKS = { VERSIONS = { "v2.0": { "id": "v2.0", - "status": "SUPPORTED", + "status": "DEPRECATED", "version": "", "min_version": "", - "updated": "2011-01-21T11:33:21Z", + "updated": "2025-07-04T12:00:00Z", "links": [ { "rel": "describedby", diff --git a/nova/tests/functional/api_sample_tests/api_samples/versions/v2-version-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/versions/v2-version-get-resp.json.tpl index 02d239f8a0b0..f92323f122ad 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/versions/v2-version-get-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/versions/v2-version-get-resp.json.tpl @@ -19,8 +19,8 @@ } ], "min_version": "", - "status": "SUPPORTED", - "updated": "2011-01-21T11:33:21Z", + "status": "DEPRECATED", + "updated": "2025-07-04T12:00:00Z", "version": "" } -} \ No newline at end of file +} diff --git a/nova/tests/functional/api_sample_tests/api_samples/versions/versions-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/versions/versions-get-resp.json.tpl index 3761edcba1d5..668daa36fc2c 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/versions/versions-get-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/versions/versions-get-resp.json.tpl @@ -8,10 +8,10 @@ "rel": "self" } ], - "status": "SUPPORTED", + "status": "DEPRECATED", "version": "", "min_version": "", - "updated": "2011-01-21T11:33:21Z" + "updated": "2025-07-04T12:00:00Z" }, { "id": "v2.1", diff --git a/nova/tests/unit/api/openstack/compute/test_versions.py b/nova/tests/unit/api/openstack/compute/test_versions.py index 7e921526d447..ecdd55abfef8 100644 --- a/nova/tests/unit/api/openstack/compute/test_versions.py +++ b/nova/tests/unit/api/openstack/compute/test_versions.py @@ -46,10 +46,10 @@ EXP_LINKS = { EXP_VERSIONS = { "v2.0": { "id": "v2.0", - "status": "SUPPORTED", + "status": "DEPRECATED", "version": "", "min_version": "", - "updated": "2011-01-21T11:33:21Z", + "updated": "2025-07-04T12:00:00Z", "links": [ { "rel": "describedby", @@ -116,10 +116,10 @@ class VersionsTestV21WithV2CompatibleWrapper(test.NoDBTestCase): expected = [ { "id": "v2.0", - "status": "SUPPORTED", + "status": "DEPRECATED", "version": "", "min_version": "", - "updated": "2011-01-21T11:33:21Z", + "updated": "2025-07-04T12:00:00Z", "links": [ { "rel": "self", @@ -153,10 +153,10 @@ class VersionsTestV21WithV2CompatibleWrapper(test.NoDBTestCase): expected = { "version": { "id": "v2.0", - "status": "SUPPORTED", + "status": "DEPRECATED", "version": "", "min_version": "", - "updated": "2011-01-21T11:33:21Z", + "updated": "2025-07-04T12:00:00Z", "links": [ { "rel": "self", @@ -203,7 +203,7 @@ class VersionsTestV21WithV2CompatibleWrapper(test.NoDBTestCase): "choices": [ { "id": "v2.0", - "status": "SUPPORTED", + "status": "DEPRECATED", "links": [ { "href": "http://localhost/v2/images/1", @@ -262,7 +262,7 @@ class VersionsTestV21WithV2CompatibleWrapper(test.NoDBTestCase): "choices": [ { "id": "v2.0", - "status": "SUPPORTED", + "status": "DEPRECATED", "links": [ { "href": "http://localhost/v2/servers/" + uuid, diff --git a/releasenotes/notes/deprecate-v2-api-22b1ca9c35c321bc.yaml b/releasenotes/notes/deprecate-v2-api-22b1ca9c35c321bc.yaml new file mode 100644 index 000000000000..f5aa387ce2ac --- /dev/null +++ b/releasenotes/notes/deprecate-v2-api-22b1ca9c35c321bc.yaml @@ -0,0 +1,9 @@ +--- +deprecations: + - | + The legacy v2 API is now deprecated for removal, and the status in the root + version document (``/``) has been changed from ``SUPPORTED`` to + ``DEPRECATED``. This will cause some clients like keystoneauth to ignore + the endpoint by default. Users are encouraged to switch the v2.1 API, which + is functionally identical to the v2 API when using the ``2.1`` API + microversion.