Skip to content

gilbertobr/ex_cloudflare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExCloudflare

LinkedIn

About the project

Cloudflare

Project was developed to facilitate DNS management in cloudflare through the API provided.

The Cloudflare API exposes the entire Cloudflare infrastructure through a standardized programmatic interface. Using the Cloudflare API, you can do just about anything on cloudflare.com via the client dashboard.

Requirements:

Built with

Elixir

  1. List all Zones
ExCloudflare.list_all_zone()
  1. Lists all DNS registered in the Zone
ExCloudflare.get_dnsrecord("mydomain.com")
  1. Create a new DNS in the Zone
ExCloudflare.create_dns_zone("subdomain6.mydomain.com", "CNAME", "google.com", 60, "mydomain.com")
  1. Update an existing zone
ExCloudflare.update_dns_zone(
     %{name: "subdomain1.mydomain.com", 
          type: "A", 
          content: "127.0.0.1"
     }, 
     "mydomain.com", 
     %{content: "8.8.8.8", 
          type: "A", 
          name: "subdomain1", 
          ttl: 60,
          comment: "My Comment",
          proxied: false
     }
)
  1. Delete an existing zone
ExCloudflare.delete_dns_zone(
     %{name: "subdomain5.mydomain.com", 
          type: "A", 
          content: "127.0.0.1"
     }, "mydomain.com"
)

Using Docker

Image Information

  1. Download the Image
docker pull dockergpsj/ex_cloudflare:latest
  1. Start queries on Cloudflare.
docker run -e "API_KEY_CLOUDFLARE=API_TOKEN" -e "FUNCTION=ExCloudflare.get_dnsrecord(\"mydomain.com\")" dockergpsj/ex_cloudflare:latest

Notice that there is a variable named FUNCTION. In this field you put the name of the function you want.

About

Making changes to Cloudflare via API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published