Skip to content
This repository has been archived by the owner on Jan 20, 2018. It is now read-only.

cloudflare-python provides a CLI and Python wrappers for CloudFlare's API.

License

Notifications You must be signed in to change notification settings

cloudflare-api/cloudflare-python

Repository files navigation

cloudflare-python

THIS PROJECT IS STILL IN ITS PLANNING STAGE!

cloudflare-python provides a CLI and Python wrappers for CloudFlare's API.

Configuration

We need to create a configuration file the first time you use this.

$ cloudflare config

This asks you for the email address and API key associated with your CloudFlare account.

It then creates a file named .cloudflare.yaml in your home directory. The first line is your API key. The second line is the email address tied to your CloudFlare account.

We need this file, because CloudFlare's API wants the zone ID for most requests and it would be expensive to fetch it every time.

Usage

# General form:
$ cloudflare <noun> <verb> <noun_instance> args...

Usage: zones

According to CloudFlare's official API documentation, a zone is a domain name along with its subdomains and other identities.

# Add a site to your CloudFlare account:
$ cloudflare zone create example.com

# Show the basic info for a site tied to your CloudFlare account.
$ cloudflare zone show example.com

# List the sites tied to your CloudFlare account.
$ cloudflare zone list

Usage: DNS

# Show the DNS entries for a site
$ cloudflare dns show example.com

# Create a DNS entry for a site
$ cloudflare dns create subdomain.example.com 1.2.3.4 --type=A

# Update a DNS entry for a site
$ cloudflare dns update subdomain.example.com 1.2.3.4 --type=CNAME

Usage: cache

# Purge all files in a zone's cache
$ cloudflare cache purge example.com

# Purge a specific file in a zone's cache
$ cloudflare cache purge example.com --path=<url>

About

cloudflare-python provides a CLI and Python wrappers for CloudFlare's API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published