socketry / cloudflare

An asynchronous Ruby wrapper for the CloudFlare V4 API.
MIT License
139 stars 88 forks source link

delete a record #68

Closed wshihadeh closed 3 years ago

wshihadeh commented 3 years ago

is there a way to delete a DNS record?

sirwolfgang commented 3 years ago
Cloudflare.connect(token: CLOUDFLARE_API_TOKEN) do |connection|
  zone = connection.zones.find_by_name(TLD_DOMAIN)
  record = zone.dns_records.find_by_name(name)

  record.delete
end
olleolleolle commented 3 years ago

Thanks, @sirwolfgang! Good example, looks solid to me.

@ioquatix Would that example feel out of place in the Usage section of the Readme? Is it too much? I suggested linking to the underlying Cloudflare ReST API in an Issue here, to let users explore that way.

ioquatix commented 3 years ago

@olleolleolle feel free to update the documentation.