610177a779
Adding two classes RequestIdProxy and GeneratorProxy derived from wrapt.ObjectProxy to wrap objects returned from the API. GeneratorProxy class is used to wrap generator objects returned by cases like images.list() etc. whereas RequestIdProxy class is used to wrap non-generator object cases like images.create() etc. In all cases the returned object will have the same behavior as the wrapped(original) object. However now the returned objects will have an extra property 'request_ids' which is a list of exactly one request id. For generator cases the request_ids property will be an empty list until the underlying generator is invoked at-least once. Co-Authored-By: Abhishek Kekane <abhishek.kekane@nttdata.com> Closes-Bug: #1525259 Blueprint: return-request-id-to-caller Change-Id: If8c0e0843270ff718a37ca2697afeb8da22aa3b1
11 lines
338 B
YAML
11 lines
338 B
YAML
---
|
|
features:
|
|
- Added support to return "x-openstack-request-id" header in request_ids attribute
|
|
for better tracing.
|
|
|
|
| For ex.
|
|
| >>> from glanceclient import Client
|
|
| >>> glance = Client('2', endpoint='OS_IMAGE_ENDPOINT', token='OS_AUTH_TOKEN')
|
|
| >>> res = glance.images.get('<image_id>')
|
|
| >>> res.request_ids
|