skytap / terraform-provider-skytap

Terraform Skytap provider
https://www.terraform.io/docs/providers/skytap/
Mozilla Public License 2.0
4 stars 11 forks source link

Gracefully handle Skytap's REST API status codes #34

Closed thewellington closed 5 years ago

thewellington commented 5 years ago

Terraform Version

11.13

Affected Resource(s)

Skytap's API is pretty good about returning status codes and error messages for every API call. Handling these calls throughout the product instead of simply retrying and timing out would allow end users to effectively determine where things have gone wrong.

References

ja6a commented 5 years ago

This work was covered under #33 and PR #41 .

The behaviour is described in the ticket #33 but the status code logic is recapped here:

  1. 200: is considered a successful request and polling occurs until the state is as expected.
  2. 409, 422, 423, 429: the request is retried. An error is extracted if present. The wait time is 10 seconds unless prescribed in the response.
  3. all other status codes are considered as errors.
  4. a 422 error other than busy will be considered as an error.
ja6a commented 5 years ago

The terraform provider now has reduced logging for most output, i.e. at INFO level. The verbose output has been demoted to trace level.

thewellington commented 5 years ago

This issue is resolved in v.0.11.1