Return request-id to APIs that don't respond with a body

Request-IDs help track actions initiated via the API.
With this patch, we can supply the request ID in the
following APIs:
- POST {resource}/action APIs for actions such as
  'reset-state', 'force-delete', 'shrink',
  'extend', 'manage', 'deny_access', 'addProjectAccess',
  'removeProjectAccess', 'promote', 'resync', 'unmanage',
  'revert', 'migration_start', 'migration_complete',
  'migration_cancel'
- POST /share_unmanage/{id}
- DELETE /{resource}/{id} APIs for
  shares, share networks, share groups, share replicas,
  security services, share servers, share snapshots,
  extra specs, messages, quota sets, share-group-snapshots,
  group specs, share-group-types, share types

Change-Id: I64ed14b5a44d6e1b37cfc9321b25bdf4e0aabea5
Closes-Bug: #1815532
(cherry picked from commit 52db0754fe)
This commit is contained in:
Goutham Pacha Ravi 2019-02-15 14:14:15 -08:00 committed by Tom Barron
parent 2de3256439
commit d06801153d
2 changed files with 5 additions and 1 deletions

View File

@ -863,7 +863,7 @@ class Resource(wsgi.Application):
for hdr, val in response.headers.items():
val = utils.convert_str(val)
response.headers[hdr] = val
_set_request_id_header(request, response.headers)
if not request.api_version_request.is_null():
response.headers[API_VERSION_REQUEST_HEADER] = (
request.api_version_request.get_string())

View File

@ -0,0 +1,4 @@
---
fixes:
- APIs that were not returning a request ID ('x-compute-request-id') in the
response headers have been fixed.