netlify_dns_records_delete: Delete Netlify DNS records

netlify_dns_records_deleteR Documentation

Delete Netlify DNS records

Description

Deletes DNS records on Netlify for the specified domain using the deleteDnsRecord endpoint of Netlify's REST API. DNS records must be provided as either a character vector of record identifiers or a dataframe/tibble with an id column. Further columns are silently ignored.

Usage

netlify_dns_records_delete(records, domain, token, max_tries = 3L)

Arguments

records

DNS records to delete. A character vector of record identifiers or a dataframe/tibble with an id column. Further columns are silently ignored.

domain

Domain name to delete DNS records for. This is translated into the corresponding Netlify DNS Zone. A character scalar.

token

Personal access token used for authentication.

max_tries

Maximum number of attempts to retry in case of an HTTP error. An integerish scalar.

Details

Supported are the DNS record types ALIAS, CAA, CNAME, MX, NS, SPF, SRV and TXT. A and AAAA (or NETLIFY and NETLIFY6, respectively) cannot be deleted via the API, but must be configured via Netlify's web interface instead.

Value

A character vector of deleted record identifiers, invisibly.

See Also

Other Netlify functions: netlify_dns_records_get(), netlify_dns_records_set()

Examples

## Not run: 
yay::netlify_dns_records_delete(domain = "my.site",
                                records = "xyz123",
                                token = Sys.getenv("NETLIFY_PAT"))

# The output of `netlify_dns_records_get()` can directly be fed. To delete all (!) records:
yay::netlify_dns_records_get(domain = "my.site",
                             token = Sys.getenv("NETLIFY_PAT")) |>
  dplyr::filter(!managed) |>
  yay::netlify_dns_records_delete(domain = "my.site",
                                  token = Sys.getenv("NETLIFY_PAT"))
## End(Not run)

salim-b/yay documentation built on May 17, 2024, 5:24 a.m.