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

provider/azurerm: dump entire Request/Response in autorest Decorator #7719

Merged
merged 1 commit into from
Jul 20, 2016

Conversation

pmcatominey
Copy link
Contributor

Before

2016/07/20 16:00:06 [DEBUG] plugin: terraform: azurerm-provider (internal) 2016/07/20 16:00:06 [DEBUG] Sending Azure RM Request "PUT" to "https://management.azure.com/subscriptions/res-id-here/resourceGroups/acctestrg-1234/providers/Microsoft.Network/trafficmanagerprofiles/acctesttmp-1234?api-version=2015-11-01"
2016/07/20 16:00:06 [DEBUG] plugin: terraform: azurerm-provider (internal) 2016/07/20 16:00:06 [DEBUG] Received Azure RM Request status code 409 Conflict for https://management.azure.com/subscriptions/res-id-here/resourceGroups/acctestrg-1234/providers/Microsoft.Network/trafficmanagerprofiles/acctesttmp-1234?api-version=2015-11-01

After:

2016/07/20 16:28:06 [DEBUG] plugin: terraform: azurerm-provider (internal) 2016/07/20 16:28:06 [DEBUG] AzureRM Request: PUT /subscriptions/res-id-here/resourceGroups/acctestrg-1234/providers/Microsoft.Network/trafficmanagerprofiles/acctesttmp-1234?api-version=2015-11-01 HTTP/1.1
2016/07/20 16:28:06 [DEBUG] plugin: terraform: Host: management.azure.com
2016/07/20 16:28:06 [DEBUG] plugin: terraform: User-Agent: HashiCorp-Terraform-v0.7.0-dev
2016/07/20 16:28:06 [DEBUG] plugin: terraform: Content-Length: 253
2016/07/20 16:28:06 [DEBUG] plugin: terraform: Authorization: Bearer token
2016/07/20 16:28:06 [DEBUG] plugin: terraform: Content-Type: application/json
2016/07/20 16:28:06 [DEBUG] plugin: terraform: Accept-Encoding: gzip
2016/07/20 16:28:06 [DEBUG] plugin: terraform: 
2016/07/20 16:28:06 [DEBUG] plugin: terraform: {"name":"acctesttmp-1234","location":"North Europe","tags":{},"properties":{"profileStatus":"","trafficRoutingMethod":"Weighted","dnsConfig":{"relativeName":"pmin01tm","ttl":100},"monitorConfig":{"protocol":"http","port":80,"path":"/"},"endpoints":[{}]}}
2016/07/20 16:28:06 [DEBUG] plugin: terraform: azurerm-provider (internal) 2016/07/20 16:28:06 [DEBUG] AzureRM Response for https://management.azure.com/subscriptions/res-id-here/resourceGroups/acctestrg-1234/providers/Microsoft.Network/trafficmanagerprofiles/acctesttmp-1234?api-version=2015-11-01: HTTP/1.1 409 Conflict
2016/07/20 16:28:06 [DEBUG] plugin: terraform: Content-Length: 256
2016/07/20 16:28:06 [DEBUG] plugin: terraform: Cache-Control: no-cache
2016/07/20 16:28:06 [DEBUG] plugin: terraform: Content-Type: application/json; charset=utf-8
2016/07/20 16:28:06 [DEBUG] plugin: terraform: Date: Wed, 20 Jul 2016 15:28:06 GMT
2016/07/20 16:28:06 [DEBUG] plugin: terraform: Expires: -1
2016/07/20 16:28:06 [DEBUG] plugin: terraform: Pragma: no-cache
2016/07/20 16:28:06 [DEBUG] plugin: terraform: Strict-Transport-Security: max-age=31536000; includeSubDomains
2016/07/20 16:28:06 [DEBUG] plugin: terraform: X-Ms-Correlation-Request-Id: request-id
2016/07/20 16:28:06 [DEBUG] plugin: terraform: X-Ms-Failure-Cause: gateway
2016/07/20 16:28:06 [DEBUG] plugin: terraform: X-Ms-Request-Id: request-id
2016/07/20 16:28:06 [DEBUG] plugin: terraform: X-Ms-Routing-Request-Id: WESTEUROPE:20160720T152806Z:request-id
2016/07/20 16:28:06 [DEBUG] plugin: terraform: 
2016/07/20 16:28:06 [DEBUG] plugin: terraform: {"error":{"code":"MissingRegistrationForLocation","message":"The subscription is not registered for the resource type 'trafficmanagerprofiles' in the location 'North Europe'. Please re-register for this provider in order to have access to this location."}}

@stack72
Copy link
Contributor

stack72 commented Jul 20, 2016

Hi @pmcatominey

I am not sure why there is an if statement here? Is this something that has to be enabled?

P.

@stack72 stack72 added enhancement waiting-response An issue/pull request is waiting for a response from the community provider/azurerm labels Jul 20, 2016
@pmcatominey
Copy link
Contributor Author

Hi @stack72

DumpRequestOut and DumpResponse can both return errors, I've left it to fallback to the original message format if they do.

@stack72
Copy link
Contributor

stack72 commented Jul 20, 2016

I see - in that case, this LGTM!

P.

@stack72 stack72 merged commit c9138da into hashicorp:master Jul 20, 2016
@ghost
Copy link

ghost commented Apr 24, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement provider/azurerm waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants