Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP debugging #13

Open
t0mk opened this issue Mar 14, 2023 · 0 comments
Open

HTTP debugging #13

t0mk opened this issue Mar 14, 2023 · 0 comments

Comments

@t0mk
Copy link
Contributor

t0mk commented Mar 14, 2023

It would be useful to see HTTP traffic of the SDK. Best enabled with an envvar. Think PACKNGO_DEBUG or TF_LOG_DEBUG.

For example in my tool https://github.com/t0mk/packetjq, GET of a project can be debugged as:

tomk@xps ~ » packetjq -d -p "/projects/52000fb2-ee46-4673-93a8-de2c2bdba33b"    
2023/03/14 17:59:39 
=======[REQUEST]=============
GET /metal/v1//projects/52000fb2-ee46-4673-93a8-de2c2bdba33b HTTP/1.1
Host: api.equinix.com
User-Agent: Go-http-client/1.1
Accept: application/json
Content-Type: application/json
X-Auth-Token: --------------------------------
Accept-Encoding: gzip


2023/03/14 17:59:39 
=======[RESPONSE]============HTTP/1.1 200 OK
Content-Length: 1045
Cache-Control: max-age=0, private, must-revalidate
Connection: keep-alive
Content-Type: application/json; charset=utf-8
Date: Tue, 14 Mar 2023 16:59:40 GMT
Last-Modified: Fri, 10 Mar 2023 13:02:50 GMT
Referrer-Policy: strict-origin-when-cross-origin
Strict-Transport-Security: max-age=15724800; includeSubDomains
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Xss-Protection: 1; mode=block

{"id":"52000fb2-ee46-4673-93a8-de2c2bdba33b","name":"Terraform sandbox","description":null,"created_at":"2017-08-03T10:55:08Z","updated_at":"2023-03-10T13:02:50Z","backend_transfer_enabled":false,"customdata":{},"event_alert_configuration":{"href":"#dda0f5ab-ee0b-46c7-95cc-caef44a75ca5"},"memberships":[{"href":"/metal/v1/memberships/4e3c406b-5673-40f3-af80-461085c5237c"}],"invitations":[],"devices":[{"href":"/metal/v1/devices/8ea9837a-6d19-4607-b166-f7f7bb04b022"}],"ssh_keys":[{"href":"/metal/v1/ssh-keys/2fcd3342-4a6f-40b0-a357-3c8d46d89cbd"},{"href":"/metal/v1/ssh-keys/d25bf1dc-88d5-4056-a81c-fde723b1f6ae"}],"volumes":[],"members":[{"href":"/metal/v1/users/98bc5929-cd09-4138-a684-9376a08814c6"},{"href":"/metal/v1/users/ae8b343c-8800-44ff-a31f-edd1a2cbf86d"}],"payment_method":{"href":"/metal/v1/payment-methods/845b45a3-c565-47e5-b9b6-a86204a73d29"},"transfers":[],"organization":{"href":"/metal/v1/organizations/70c2f878-9f32-452e-8c69-ab15480e1d99"},"favorite":false,"href":"/metal/v1/projects/52000fb2-ee46-4673-93a8-de2c2bdba33b"}

{
  "id": "52000fb2-ee46-4673-93a8-de2c2bdba33b",
  "name": "Terraform sandbox",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant