Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add flags for verbose output of HTTP request data New global flags `--verbose` and `--vverbose` (very verbose) configure the network library to write data about API requests to stderr. (I would have used `-v` and `-vv` but the former is already taken as shorthand for `--version`.) The intention is to make it easier to debug both the working of the CLI and unexpected responses from Brooklyn servers. Example: ``` $ ./bin/br --verbose deploy ./bp.yaml POST /v1/applications HTTP/1.1 Host: localhost:8081 User-Agent: Go-http-client/1.1 Content-Length: 0 Authorization: ****** Content-Type: application/json Accept-Encoding: gzip HTTP/1.1 201 Created Transfer-Encoding: chunked Cache-Control: no-cache, no-store Content-Type: application/json Date: Thu, 27 Jul 2017 14:12:56 GMT Expires: 0 Location: http://localhost:8081/v1/applications/sr9uw9bdbu Pragma: no-cache Server: Jetty(9.2.13.v20150730) Vary: Accept-Encoding Id: | sr9uw9bdbu Name: | Application (sr9uw9bdbu) Status: | In progress ``` ``` $ ./bin/br --vverbose application vhkhp6nbbl entity GET /v1/applications/vhkhp6nbbl/entities HTTP/1.1 Host: localhost:8081 User-Agent: Go-http-client/1.1 Accept: application/json, text/plain Authorization: ****** Accept-Encoding: gzip HTTP/1.1 200 OK Transfer-Encoding: chunked Cache-Control: no-cache, no-store Content-Type: application/json Date: Thu, 27 Jul 2017 14:16:43 GMT Expires: 0 Pragma: no-cache Server: Jetty(9.2.13.v20150730) Vary: Accept-Encoding 503 [{"id":"tqj1a2g883","name":"Tomcat 7 Server","type":"org.apache.brooklyn.entity.webapp.tomcat.TomcatServer","catalogItemId":"org.apache.brooklyn.entity.webapp.tomcat.TomcatServer:0.12.0-SNAPSHOT","links":{"self":"/v1/applications/vhkhp6nbbl/entities/tqj1a2g883","parent":"/v1/applications/vhkhp6nbbl/entities/vhkhp6nbbl","application":"/v1/applications/vhkhp6nbbl","children":"/v1/applications/vhkhp6nbbl/entities/tqj1a2g883/children","config":"/v1/applications/vhkhp6nbbl/entities/tqj1a2g883/config","sensors":"/v1/applications/vhkhp6nbbl/entities/tqj1a2g883/sensors","effectors":"/v1/applications/vhkhp6nbbl/entities/tqj1a2g883/effectors","policies":"/v1/applications/vhkhp6nbbl/entities/tqj1a2g883/policies","activities":"/v1/applications/vhkhp6nbbl/entities/tqj1a2g883/activities","locations":"/v1/applications/vhkhp6nbbl/entities/tqj1a2g883/locations","tags":"/v1/applications/vhkhp6nbbl/entities/tqj1a2g883/tags","expunge":"/v1/applications/vhkhp6nbbl/entities/tqj1a2g883/expunge","rename":"/v1/applications/vhkhp6nbbl/entities/tqj1a2g883/name","spec":"/v1/applications/vhkhp6nbbl/entities/tqj1a2g883/spec","iconUrl":"/v1/applications/vhkhp6nbbl/entities/tqj1a2g883/icon","catalog":"/v1/catalog/entities/org.apache.brooklyn.entity.webapp.tomcat.TomcatServer/0.12.0-SNAPSHOT"}}] 0 Id | Name | Type tqj1a2g883 | Tomcat 7 Server | org.apache.brooklyn.entity.webapp.tomcat.TomcatServer ``` The Authorization header is redacted.
- Loading branch information