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.

Filename, size & hash SHA256 hash help File type Python version Upload date
pycfdns-0.0.2-py3-none-any.whl (2.9 kB) Copy SHA256 hash SHA256 Wheel py3

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page