socketry / cloudflare

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

[Feature] Get DNS record from a token that is not allowed to list all zones #56

Open jamesst20 opened 4 years ago

jamesst20 commented 4 years ago

Hi,

it currently is not possible to get dns records for a specific domain without granting permissions to list all zones.

As a workaround, this is what I currently do :

connection.with(Cloudflare::Zone, path: "zones/#{cloudflare_zone}").dns_records

It would be great if it could be natively supported :)

It would be even better if we could do something like this (if the api supports it, probably not):

connection.zone_by_name("domain.com").dns_records

Thank you !

ioquatix commented 4 years ago

Yeah that makes sense.