Return request Id to caller

Registered by Abhishek Kekane

Most of the OpenStack RESTful API returns X-Openstack-Request-Id in the API response header but this request id is not available to the caller from the python client. When you run command on the command prompt using client with --debug option, then it displays X-Openstack-Request-Id on the console but if you are using it in some third party applications and if some api fails or succeeds then there is no way to get X-Openstack-Request-Id from the returned value. If request id is made to the caller, then it would definitely help in getting quick support from infrastructure support team in case of any problems.

We are proposing to add 'request_ids' as attribute to the response objects returned from python-keystoneclient.

For more details on how request_id will be returned to the caller, please refer to the approved blueprint [1] discussed with the cross-project team.

[1] : https://review.openstack.org/#/c/156508

For example:

from keystoneclient.v2_0 import client

keystone = client.Client(username='admin', password='pass', tenant_name='admin', auth_url="http://10.69.4.150:5000/v2.0")

users = keystone.users.list()

# Get request id from users resource object

users['request_ids']

'req-ddb583dd-8a03-42f6-930a-5b7d581aab4f'

Blueprint information

Status:
Started
Approver:
Steve Martinelli
Priority:
Low
Drafter:
Abhishek Kekane
Direction:
Approved
Assignee:
Maho Koshiya
Definition:
Approved
Series goal:
Proposed for mitaka
Implementation:
Started
Milestone target:
None
Started by
Dave Chen

Related branches

Sprints

Whiteboard

Cross-project spec has been already approved.
https://specs.openstack.org/openstack/openstack-specs/specs/return-request-id.html

approved at keystone meeting - 12/22/2015

Gerrit topic: https://review.openstack.org/#q,topic:bp/return-request-id-to-caller,n,z

Addressed by: https://review.openstack.org/261188
    Add wrapper classes for return-request-id-to-caller

Addressed by: https://review.openstack.org/267449
    Add return-request-id-to-caller function(v2_0)

Addressed by: https://review.openstack.org/267456
    Add return-request-id-to-caller function(v3)

Addressed by: https://review.openstack.org/268003
    Add return-request-id-to-caller function(v3/contrib)

Addressed by: https://review.openstack.org/276644
    Add release notes for return-request-id-to-caller

Addressed by: https://review.openstack.org/329913
    Add Response class to return request-id to caller

Addressed by: https://review.openstack.org/624898
    Add return-request-id-to-caller function(v3/contrib)

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.