summaryrefslogtreecommitdiff
path: root/etc/nova/api-paste.ini
diff options
context:
space:
mode:
authorChris Buccella <buccella@linux.vnet.ibm.com>2014-01-15 06:21:27 +0000
committerChris Buccella <buccella@linux.vnet.ibm.com>2014-04-28 21:03:38 +0000
commit49d83e356afd6197fc95277f0d18723bdfa11652 (patch)
treec4012f88e05bc0c6ce11e85c2f4560b73aacc289 /etc/nova/api-paste.ini
parent296f2fa1831d2dff5a96796e251ecf0e3703b56e (diff)
downloadnova-49d83e356afd6197fc95277f0d18723bdfa11652.tar.gz
Add x-openstack-request-id to nova v3 responses
x-openstack-request-id is the common header name for request ID going forward. Nova, cinder, and neutron return this header. Using the request_id middleware is a convenient way to ensure this header is in the response. We will also be using the middleware to generate the request ID. The ID will be generated by the middleware and is inserted into the request environment. The current code generates the request ID in the constructor of RequestContext; with this change, the ID is generated beforehand and passed in to the RequestContext constructor. Not much different here: a request ID is generated and is available for use in the handling of the request. On the response end, the middleware is again used, this time to attach the x-openstack-request-id header, using the value of the generated request ID. For v3, we will be using the request_id middleware provided in oslo. For v2, nova-specific middleware (compute_request_id.py) is used. Therefore, v3 responses will have the header x-openstack-request-id, and v2 responses will have the header x-compute-request-id (no change). It is necessary to move the existing code out into middleware, so that the old header is not attached to v3 responses. UpgradeImpact: api-paste.ini is modified DocImpact: v3 responses of the API will only include x-openstack-request-id Implements: blueprint cross-service-request-id Change-Id: I5e370fd3de5ee2f8a8d13553015d88910ff5ea87
Diffstat (limited to 'etc/nova/api-paste.ini')
-rw-r--r--etc/nova/api-paste.ini16
1 files changed, 11 insertions, 5 deletions
diff --git a/etc/nova/api-paste.ini b/etc/nova/api-paste.ini
index 893e866b0b..5f50e8a6c0 100644
--- a/etc/nova/api-paste.ini
+++ b/etc/nova/api-paste.ini
@@ -65,14 +65,20 @@ use = call:nova.api.openstack.urlmap:urlmap_factory
[composite:openstack_compute_api_v2]
use = call:nova.api.auth:pipeline_factory
-noauth = faultwrap sizelimit noauth ratelimit osapi_compute_app_v2
-keystone = faultwrap sizelimit authtoken keystonecontext ratelimit osapi_compute_app_v2
-keystone_nolimit = faultwrap sizelimit authtoken keystonecontext osapi_compute_app_v2
+noauth = compute_req_id faultwrap sizelimit noauth ratelimit osapi_compute_app_v2
+keystone = compute_req_id faultwrap sizelimit authtoken keystonecontext ratelimit osapi_compute_app_v2
+keystone_nolimit = compute_req_id faultwrap sizelimit authtoken keystonecontext osapi_compute_app_v2
[composite:openstack_compute_api_v3]
use = call:nova.api.auth:pipeline_factory_v3
-noauth = faultwrap sizelimit noauth_v3 osapi_compute_app_v3
-keystone = faultwrap sizelimit authtoken keystonecontext osapi_compute_app_v3
+noauth = request_id faultwrap sizelimit noauth_v3 osapi_compute_app_v3
+keystone = request_id faultwrap sizelimit authtoken keystonecontext osapi_compute_app_v3
+
+[filter:request_id]
+paste.filter_factory = nova.openstack.common.middleware.request_id:RequestIdMiddleware.factory
+
+[filter:compute_req_id]
+paste.filter_factory = nova.api.compute_req_id:ComputeReqIdMiddleware.factory
[filter:faultwrap]
paste.filter_factory = nova.api.openstack:FaultWrapper.factory