Skip to main content

A module for updating Cloudflare DNS records.

Project description

A module for updating Cloudflare DNS records.

Notes

This has been tested with python 3.6
This module require a Cloudflare username and API key.
This module uses these external libararies:

  • json
  • requests

Install

pip install pycfdns

Usage:

from pycfdns import CloudflareUpdater

cfupdate = CloudflareUpdater()
email = 'user@example.com'
key = 'fks343489734jkhfsfk387dfjksh78'
zone = 'example.com'
records = ['None']

#Set headers:
headers = cfupdate.set_header(email,key)

#Get zoneID:
zoneID = cfupdate.get_zoneID(headers, zone)

#Get records to update:
updateRecords = cfupdate.get_recordInfo(headers, zoneID, zone, records)

#Update records:
result = cfupdate.update_records(headers, zoneID, updateRecords)

#Print the result:
print(result)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycfdns-0.0.1.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

pycfdns-0.0.1-py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page