6b11d276d1
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
76 lines
2.7 KiB
INI
76 lines
2.7 KiB
INI
#############
|
|
# OpenStack #
|
|
#############
|
|
|
|
[composite:osapi_volume]
|
|
use = call:cinder.api:root_app_factory
|
|
/: apiversions
|
|
/v1: openstack_volume_api_v1
|
|
/v2: openstack_volume_api_v2
|
|
/v3: openstack_volume_api_v3
|
|
|
|
[composite:openstack_volume_api_v1]
|
|
use = call:cinder.api.middleware.auth:pipeline_factory
|
|
noauth = cors request_id faultwrap sizelimit osprofiler noauth apiv1
|
|
keystone = cors request_id faultwrap sizelimit osprofiler authtoken keystonecontext apiv1
|
|
keystone_nolimit = cors request_id faultwrap sizelimit osprofiler authtoken keystonecontext apiv1
|
|
|
|
[composite:openstack_volume_api_v2]
|
|
use = call:cinder.api.middleware.auth:pipeline_factory
|
|
noauth = cors request_id faultwrap sizelimit osprofiler noauth apiv2
|
|
keystone = cors request_id faultwrap sizelimit osprofiler authtoken keystonecontext apiv2
|
|
keystone_nolimit = cors request_id faultwrap sizelimit osprofiler authtoken keystonecontext apiv2
|
|
|
|
[composite:openstack_volume_api_v3]
|
|
use = call:cinder.api.middleware.auth:pipeline_factory
|
|
noauth = cors request_id faultwrap sizelimit osprofiler noauth apiv3
|
|
keystone = cors request_id faultwrap sizelimit osprofiler authtoken keystonecontext apiv3
|
|
keystone_nolimit = cors request_id faultwrap sizelimit osprofiler authtoken keystonecontext apiv3
|
|
|
|
[filter:request_id]
|
|
paste.filter_factory = oslo_middleware.request_id:RequestId.factory
|
|
|
|
[filter:cors]
|
|
paste.filter_factory = oslo_middleware.cors:filter_factory
|
|
oslo_config_project = cinder
|
|
latent_allow_headers = X-Auth-Token, X-Identity-Status, X-Roles, X-Service-Catalog, X-User-Id, X-Tenant-Id, X-OpenStack-Request-ID, X-Trace-Info, X-Trace-HMAC, OpenStack-Volume-microversion
|
|
latent_expose_headers = X-Auth-Token, X-Subject-Token, X-Service-Token, X-OpenStack-Request-ID, OpenStack-Volume-microversion
|
|
latent_allow_methods = GET, PUT, POST, DELETE, PATCH
|
|
|
|
[filter:faultwrap]
|
|
paste.filter_factory = cinder.api.middleware.fault:FaultWrapper.factory
|
|
|
|
[filter:osprofiler]
|
|
paste.filter_factory = osprofiler.web:WsgiMiddleware.factory
|
|
|
|
[filter:noauth]
|
|
paste.filter_factory = cinder.api.middleware.auth:NoAuthMiddleware.factory
|
|
|
|
[filter:sizelimit]
|
|
paste.filter_factory = cinder.api.middleware.sizelimit:RequestBodySizeLimiter.factory
|
|
|
|
[app:apiv1]
|
|
paste.app_factory = cinder.api.v1.router:APIRouter.factory
|
|
|
|
[app:apiv2]
|
|
paste.app_factory = cinder.api.v2.router:APIRouter.factory
|
|
|
|
[app:apiv3]
|
|
paste.app_factory = cinder.api.v3.router:APIRouter.factory
|
|
|
|
[pipeline:apiversions]
|
|
pipeline = cors faultwrap osvolumeversionapp
|
|
|
|
[app:osvolumeversionapp]
|
|
paste.app_factory = cinder.api.versions:Versions.factory
|
|
|
|
##########
|
|
# Shared #
|
|
##########
|
|
|
|
[filter:keystonecontext]
|
|
paste.filter_factory = cinder.api.middleware.auth:CinderKeystoneContext.factory
|
|
|
|
[filter:authtoken]
|
|
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
|