Closed mikehardenize closed 5 years ago
FWIW, I added the following to DNSRecords.js:
bindConfig: method({
method: 'GET',
path: 'export',
json: false,
}),
Allowing me to call:
cf.dnsRecords.bindConfig(zone_id);
This worked fine. I haven't submitted it as a PR as I suspect you would maybe want to expand "browse" instead, or give the function a different name?
I'm happy to submit as a PR, with or without changes. Let me know...
Additionally, I know this feature isn't in the current set of cloudflare API documentation, but I believe that is an oversight. I have reached out to cloudflare support regarding the issue and they responded:
Thank you for bringing this to our attention, I believe this should be documented,
as we do document /import. I have reached out to the team who owns the
documentation to see if we can get this updated to include /export.
In the meantime, I have confirmed that it is just a GET request with the endpoint
being /export, if you do need/want to use the endpoint.
As another data point, they use this API end-point themselves on their own frontend to allow users to export zones in this format.
Not heard anything, so submitting as a PR
In general, I prefer not to add functionality that isn't documented.
FWIW, I got another response from Cloudflare this morning, to say:
We appreciate your patience here. We've heard back that our API documentation should
be updated to include this information toward the latter half of the month.
We're happy to update you again with a more concrete date when the documentation is
updated - just let us know.
So I don't think we'll have to wait too long.
This feature is now documented. You can see it at https://api.cloudflare.com/#dns-records-for-a-zone-export-dns-records
Released in v2.6.0.
You can fetch a cloudflare zone by calling:
GET zones/$zone_id/dns_records
This is possible with node-cloudflare. However, you can fetch it in bind configuration syntax if you append /export:
GET zones/$zone_id/dns_records/export
This does not appear to be possible with node-cloudflare. Please consider adding this functionality.