Skip to content

Commit

Permalink
secondary_dns_tsig: no need to reconstruct what we already have
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz committed Mar 16, 2021
1 parent 4ac14d1 commit 93c0060
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions secondary_dns_tsig.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,7 @@ func (api *API) ListSecondaryDNSTSIGs(ctx context.Context, accountID string) ([]
// API reference: https://api.cloudflare.com/#secondary-dns-tsig--create-tsig
func (api *API) CreateSecondaryDNSTSIG(ctx context.Context, accountID string, tsig SecondaryDNSTSIG) (SecondaryDNSTSIG, error) {
uri := fmt.Sprintf("/accounts/%s/secondary_dns/tsigs", accountID)
res, err := api.makeRequestContext(ctx, http.MethodPost, uri,
SecondaryDNSTSIG{
Name: tsig.Name,
Secret: tsig.Secret,
Algo: tsig.Algo,
},
)
res, err := api.makeRequestContext(ctx, http.MethodPost, uri, tsig)

if err != nil {
return SecondaryDNSTSIG{}, err
Expand All @@ -109,13 +103,7 @@ func (api *API) UpdateSecondaryDNSTSIG(ctx context.Context, accountID string, ts
}

uri := fmt.Sprintf("/accounts/%s/secondary_dns/tsigs/%s", accountID, tsig.ID)
res, err := api.makeRequestContext(ctx, http.MethodPut, uri,
SecondaryDNSTSIG{
Name: tsig.Name,
Secret: tsig.Secret,
Algo: tsig.Algo,
},
)
res, err := api.makeRequestContext(ctx, http.MethodPut, uri, tsig)

if err != nil {
return SecondaryDNSTSIG{}, err
Expand Down

0 comments on commit 93c0060

Please sign in to comment.