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-neutronclient.

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 neutronclient import client

neutron = client.Client('demo', 'admin', 'demo', 'http://21.12.4.342:5000/v2.0')

ports = neutron.port.list()

# Get request id from ports resource object

ports['request_ids']

'req-a9b74258-0b21-49c2-8ce8-673b420e20cc'

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
Abhishek Kekane
Direction:
Approved
Assignee:
Hirofumi Ichihara
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
milestone icon 4.0.0
Started by
Hirofumi Ichihara
Completed by
Armando Migliaccio

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/expose-get-x-openstack-request-id,n,z

Addressed by: https://review.openstack.org/194513
    Add support to return request_id of last request

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

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

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.