Skip to content
Martin J. Levy edited this page May 5, 2016 · 10 revisions

#Examples

There is an example folder with many more coding examples included.

A most simple example

This short example prints the name of all your zones and if IPv6 is enabled for that specific zone. This code can be found at https://github.com/cloudflare/python-cloudflare/blob/master/examples/example-are-zones-ipv6-simple.py

#!/usr/bin/env python
import CloudFlare
def main():
	cf = CloudFlare.CloudFlare()
	zones = cf.zones.get(params={'per_page':50})
	for zone in zones:
		zone_name = zone['name']
		zone_id = zone['id']
		settings_ipv6 = cf.zones.settings.ipv6.get(zone_id)
		ipv6_on = settings_ipv6['value']
		print zone_id, ipv6_on, zone_name
	exit(0)
if __name__ == '__main__':
	main()

Clone this wiki locally