Display Curl commands in debugging messages

Registered by Florent Flament

Legacy CLI clients of several services (python-novaclient,
python-swiftclient, python-cinderclient, ...) provide the user with a
--debug flag, displaying the equivalent curl command of each API call,
as well as the response received. This is very convenient, since it
allows developers to replay these commands for testing/debugging
purpose, without the need to craft the requests by hand.

On the other hand, with its --debug and -v flags
python-openstackclient doesn't provide such feature. While the --debug
flag shows tracebacks on error, the -v flag displays many debugging
messages, but the equivalent curl commands of API calls nor messages
exchanged.

This blueprint suggests that we implement a mecanism similar to the
one implemented in legacy CLI clients, to display equivalent curl
commands, along with messages exchanged with the services whenever
python-openstackclient calls an API.

Example:
$ nova --debug endpoints

REQ: curl -i 'http://11.22.33.44:5000/v2.0/tokens' -X POST -H
"Content-Type: application/json" -H "Accept: application/json" -H
"User-Agent: python-novaclient" -d '{"auth": {"tenantName": "demo",
"passwordCredentials": {"username": "admin", "password": "secret"}}}'

RESP: [200] {'date': 'Mon, 16 Dec 2013 10:09:04 GMT', 'content-type':
'application/json', 'content-length': '3939', 'vary': 'X-Auth-Token'}
RESP BODY: {...}

...

Blueprint information

Status:
Complete
Approver:
Dean Troyer
Priority:
Undefined
Drafter:
Florent Flament
Direction:
Needs approval
Assignee:
Florent Flament
Definition:
New
Series goal:
None
Implementation:
Implemented
Milestone target:
milestone icon m3
Started by
Dean Troyer
Completed by
Dean Troyer

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/curl-commands-in-debugging-messages,n,z

Addressed by: https://review.openstack.org/62914
    When using the -v option, displays curl equivalent commands and http messages exchanged with the nova API server. Displays the messages that are displayed with the --debug option of python-novaclient.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.