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

The _do_call method needs a check for application/zip content #18

Closed
wants to merge 5 commits into from

Conversation

sbarbett
Copy link
Contributor

When you send a batch zone export request and retrieve the task, the result is a zip file. The connection module has no logic for handling application/zip content, so it tries to serialize it as though it were JSON.

@sbarbett
Copy link
Contributor Author

There was an issue with the variable name in the connection module (I copied and pasted it from my own module and forgot to rename "resp" to "r1"). However, this will not pass the pull request workflow because it looks like the hostname variable is undefined in the repository secrets:

requests.exceptions.InvalidURL: Invalid URL 'https:///v1/authorization/token': No host supplied

@sbarbett
Copy link
Contributor Author

@stevedejong if you refer back to #14 - It looks like this is the same issue

…e responses do not have content-type headers
@sbarbett
Copy link
Contributor Author

I added a few more lines of code to address some nuances with parsing the responses from certain APIs. For instance:

There are APIs that will return a 202 (ACCEPTED) response, but will not have an x-task-id header. Once such API is /v1/zones/{zone_name}/healthchecks. Instead, there is a location header which contains the URI of the result.

There are also APIs which do not have a 'content-type' header in the response, such as /v1/zones/{zone_name}/snapshot

stevedejong added a commit that referenced this pull request Sep 16, 2024
Engineering improvements,  Includes changes from PR #18 for _do_call () improvements
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

Successfully merging this pull request may close these issues.

2 participants