1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Increase Cloudflare page size

Increase Cloudflare page size to reduce request count

`GET zones` has a MAX of 50 and a default of 20
https://api.cloudflare.com/#zone-list-zones

`GET zones/:zone_identifier/dns_records` has a MAX of 100 and a default of 20
https://api.cloudflare.com/#dns-records-for-a-zone-list-dns-records
This commit is contained in:
Lance Hudson
2020-06-11 17:46:29 -04:00
committed by GitHub
parent 0826746cac
commit 90cc9576f5

View File

@@ -142,7 +142,7 @@ class CloudflareProvider(BaseProvider):
zones = []
while page:
resp = self._try_request('GET', '/zones',
params={'page': page})
params={'page': page, 'per_page': 50})
zones += resp['result']
info = resp['result_info']
if info['count'] > 0 and info['count'] == info['per_page']:
@@ -251,7 +251,7 @@ class CloudflareProvider(BaseProvider):
path = '/zones/{}/dns_records'.format(zone_id)
page = 1
while page:
resp = self._try_request('GET', path, params={'page': page})
resp = self._try_request('GET', path, params={'page': page, 'per_page': 100})
records += resp['result']
info = resp['result_info']
if info['count'] > 0 and info['count'] == info['per_page']: