]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
cinder-api-microversions code
authorscottda <scott.dangelo@hp.com>
Wed, 16 Sep 2015 12:57:35 +0000 (12:57 +0000)
committerscottda <scott.dangelo@hp.com>
Wed, 24 Feb 2016 13:50:54 +0000 (06:50 -0700)
commit6b11d276d13cc866aea9b3cfa321b3b19ee13d55
treedb4f4dd6b823ef75ec0a52d4147304a0f937248f
parent5e821cdb33f4a922bd60ed4eab09d553a80a082a
cinder-api-microversions code

Many changes to the Cinder REST API require changes to the consumers of the API.
For example, If we need to add a required parameter to a method that is called
 by Nova, we'd need both the Nova calling code and the cinderclient that
Nova uses to change. But newer Cinder versions with the change must work with
older Nova versions, and there is no mechanism for this at the moment. Adding
microversions will solve this problem.
With microversions, the highest supported version will be negotiated by a field
in the HTTP header that is sent to the Cinder API. In the case where the field
'versions' is not sent (i.e. clients and scripts that pre-date this change),
then the lowest supported version would be used. In order to ensure that the
API consumer is explicitly asking for a microversioned API, a new endpoint v3
is added, which is identical to API version v2. This means that our new
Cinder API v3 would be the default, and consumers of the API that wished to
use a newer version could do so by using that endpoint and a microversion in
the HTTP header.
New tests for microversioned API features on endpoint /v3 should be added to
cinder/tests/unit/api/v3/ directory. Existing functionality will be tested via
the .../v2/ unit tests.

DocImpact
APIImpact
Implements: https://blueprints.launchpad.net/cinder/+spec/cinder-api-microversions
Change-Id: I48cdbbc900c2805e59ee9aebc3b1c64aed3212ae
31 files changed:
cinder/api/__init__.py
cinder/api/common.py
cinder/api/openstack/api_version_request.py [new file with mode: 0644]
cinder/api/openstack/rest_api_version_history.rst [new file with mode: 0644]
cinder/api/openstack/versioned_method.py [new file with mode: 0644]
cinder/api/openstack/wsgi.py
cinder/api/v1/router.py
cinder/api/v2/router.py
cinder/api/v2/volumes.py
cinder/api/v3/__init__.py [new file with mode: 0644]
cinder/api/v3/router.py [new file with mode: 0644]
cinder/api/versions.py
cinder/api/views/versions.py
cinder/common/config.py
cinder/exception.py
cinder/opts.py
cinder/tests/unit/api/fakes.py
cinder/tests/unit/api/openstack/test_api_version_request.py [new file with mode: 0644]
cinder/tests/unit/api/openstack/test_versioned_method.py [new file with mode: 0644]
cinder/tests/unit/api/openstack/test_wsgi.py
cinder/tests/unit/api/test_router.py [deleted file]
cinder/tests/unit/api/test_versions.py
cinder/tests/unit/api/v2/test_snapshots.py
cinder/tests/unit/api/views/test_versions.py [new file with mode: 0644]
cinder/tests/unit/test_utils.py
cinder/utils.py
doc/source/devref/api_microversion_dev.rst [new file with mode: 0644]
doc/source/devref/api_microversion_history.rst [new file with mode: 0644]
doc/source/devref/index.rst
etc/cinder/api-paste.ini
releasenotes/notes/cinder-api-microversions-d2082a095c322ce6.yaml [new file with mode: 0644]