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 RESTful API. DNS records must be provided as either a character vector of DNS record identifiers or a dataframe/tibble with an id column. Further columns are silently ignored.

Usage

netlify_dns_records_delete(
  records,
  domain,
  token = pal::pkg_config_val("netlify_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

Netlify personal access token used for authentication. A character scalar.

max_tries

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

Details

Supported are the DNS record types A, AAAA, ALIAS, CAA, CNAME, MX, NS, SPF, SRV and TXT. Netlify's own custom record types NETLIFY and NETLIFY6 cannot be altered via the API and must be configured via Netlify's web interface.

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")

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

salim-b/yay documentation built on Oct. 25, 2024, 9:42 p.m.