Closed terinjokes closed 7 months ago
That would be great!
Can you fetch all DNS records in one request without pagination?
Not at this time.
I would also be very grateful if either there could be larger paging or pagination as at the moment we are having to store all the zone IDs in our own database because zones.browse()
only returns the first 20 zones.
The last parameter, after all the URL parameters and body, is and optional query parameter object, so you should be able to pass { page: 2 }
Ohh that is handy @terinjokes . I've tried that out and it works like a charm.
Does that mean that any browse
method will accept an options object in the same manner and that we could also pass an options object to a read
method after the required parameters? e.g. pageRules.read('abc123', { status: active })
.
All the methods should allow setting query parameters as the last (optional) function parameter, though the browse
and read
ones are probably the most useful.
Thanks for confirming that @terinjokes . The biggest benefit is that I can simply return a named zone pageRules.browse( { name: 'foo.com' } )
effectively using the browse
method as a read method.
For the benefit of others here are all the optional parameters you could pass into the zones.browse()
method.
The Cloudflare API is pretty consistent in how it supports pagination. It would be nice to have to support asynchronously fetching new pages.
34 #37