-
Notifications
You must be signed in to change notification settings - Fork 134
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
feat: implement name server resource for domains #669
base: master
Are you sure you want to change the base?
Conversation
Using the /nameServers/update endpoint, we allow to update the NS of a domain registered at OVHCloud Note that this resource require a new testing resource of a Domain where you can change the NS on it.
Co-authored-by: Romain Beuque <[email protected]>
Hello @rbeuque74 , have you got any update for that PR ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, you're missing a doc page in website/docs/r
"strings" | ||
) | ||
|
||
type OvhDomainNameServerUpdate struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you place the structs in a file type_domain.go
, to keep consistency with other resources ?
} | ||
|
||
func resourceOvhDomainNameServersDelete(d *schema.ResourceData, meta interface{}) error { | ||
// Note that NameServers can not be deleted, only updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when deleting, shouldn't we call /domain/xxx/nameServers/update
with an empty array ? If this doesn't work, you should call DELETE /domain/{serviceName}/nameServer/{id}
on each nameServer to clean them.
} | ||
rec := &([]int{}) | ||
|
||
endpoint := fmt.Sprintf("/domain/%s/nameServer", domain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please url.PathEscape()
all string path parameters
func ovhDomainNameServer(client *ovh.Client, domain string, id int) (*OvhDomainNameServer, error) { | ||
rec := &OvhDomainNameServer{} | ||
|
||
endpoint := fmt.Sprintf("/domain/%s/nameServer/%d", domain, id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment, to url.PathEscape()
}) | ||
} | ||
|
||
func testSweepOvhDomainNameServers(region string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this func seems useless as it doesn't remove anything, or am I missing something ?
@PhilippeVienne any news on this PR ? |
Sure, here's the completed PR template with the provided diff details:
Description
This pull request implements a new feature: the name server resource for domains. Using the
/nameServers/update
endpoint, this change allows users to update the Name Servers (NS) of a domain registered at OVHCloud. This resource requires a new testing resource of a Domain where the NS can be changed. The changes have been tested on a separate account with a restricted token to ensure proper functionality.The following files have been updated:
README.md
: AddedOVH_DOMAIN_TEST
environment variable for testing.provider.go
: Registered the newovh_domain_name_servers
resource.provider_test.go
: Included a check forOVH_DOMAIN_TEST
.resource_domain_name_servers.go
: Implementation of the new resource.resource_domain_name_servers_test.go
: Test cases for the new resource.Fixes #146 (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
The changes have been tested on a separate account with a restricted token. The following tests were conducted to verify the new functionality:
make testacc TESTARGS="-run TestAccDomainNameServers_Basic"
– This test verifies the basic functionality of updating the Name Servers for a domain.Test Configuration:
terraform version
: Terraform v1.8.3Checklist:
go mod vendor
if I added or modifygo.mod
file