Skip to content

Conversation

@fabiante
Copy link
Contributor

This PR aims to clarify that the SetRecords function is only
usable for updating existing records.

As the current API documentation states:

Modifies a record of a zone and returns the updated record

See: https://api.ns1.hosttech.eu/api/documentation/#/Records/put_api_user_v1_zones__zoneId__records__recordId_

Closes #11

Copy link
Collaborator

@MasterEvarior MasterEvarior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is a tricky one. As you can see from this line onwards, it should create a new record if it does not already exist. This behavior is known and desired.

Instead of updating the documentation, I'd rather fix the (potential) bug. Currently it only checks for HTTP 404. Maybe there should also be a check for HTTP 405?

@fabiante
Copy link
Contributor Author

Oh wow, I totally missed that one. I will have a look at it. Today I was focussed on integrating the client in a custom Terraform provider.

Thanks for your feedback!

@fabiante
Copy link
Contributor Author

I was not able to reproduce this issue. I will close the PR and eventually reopen if I manage to reproduce it.

@fabiante fabiante closed this Nov 14, 2024
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.

Creation of new records fails with status 405

2 participants