GitHub user sjcorbett opened a pull request:

    https://github.com/apache/brooklyn-client/pull/57

    Add flags for verbose output of HTTP request data

    Adds global new 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`.)
    
    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: Basic czpz
    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: Basic czpz
    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   
    ```
    
    Note that the output includes the Authorization header.
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sjcorbett/brooklyn-client verbose

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-client/pull/57.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #57
    
----

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to