-
Notifications
You must be signed in to change notification settings - Fork 4
Zones
{
"id": "023e105f4ecef8ad9ca31a8372d0c353",
"name": "example.com",
"development_mode": 7200,
"original_name_servers": [
"ns1.originaldnshost.com",
"ns2.originaldnshost.com"
],
"original_registrar": "GoDaddy",
"original_dnshost": "NameCheap",
"created_on": "2014-01-01T05:20:00.12345Z",
"modified_on": "2014-01-01T05:20:00.12345Z",
"activated_on": "2014-01-02T00:01:00.12345Z",
"owner": {
"id": {},
"email": {},
"type": "user"
},
"account": {
"id": "01a7362d577a6c3019a474fd6f485823",
"name": "Demo Account"
},
"permissions": [
"#zone:read",
"#zone:edit"
],
"plan": {
"id": "e592fd9519420ba7405e1307bff33214",
"name": "Pro Plan",
"price": 20,
"currency": "USD",
"frequency": "monthly",
"legacy_id": "pro",
"is_subscribed": true,
"can_subscribe": true
},
"plan_pending": {
"id": "e592fd9519420ba7405e1307bff33214",
"name": "Pro Plan",
"price": 20,
"currency": "USD",
"frequency": "monthly",
"legacy_id": "pro",
"is_subscribed": true,
"can_subscribe": true
},
"status": "active",
"paused": false,
"type": "full",
"name_servers": [
"tony.ns.cloudflare.com",
"woz.ns.cloudflare.com"
]
}
See this doc for more details: https://api.cloudflare.com/#zone-properties
List, search, sort, and filter your zones. See api doc here: https://api.cloudflare.com/#zone-list-zones
Command: cf zones list
Options:
Options:
--version Show version number [boolean]
--disableSpinner Disable spinner [boolean] [default: false]
--verbose Enable verbose messages [boolean] [default: false]
--useToken Use specific token [string] [default: ""]
--help Show help [boolean]
--format Format the output, value: table, string, json, list [string]
--separator Separator value when the output format is string [string] [default: " "]
--account Filter by account id [string]
--direction Direction to order zones [string] [default: "asc"]
--exportCsv File path tp export as CSV File [string]
--fields Fields to return [string] [default: "id,name,status,name_servers"]
--order Field to order zones by [string] [default: "name"]
--perPage Number of zones per page [default: 20]
--page Page number of paginated results [default: 1]
--status Status of the zone [string]
--zoneName Array of domain names [array]
Samples:
cf zones list --zoneName=example.com example2.com example3.com
cf zones list --perPage=1000 --fields=name,status,name_servers --exportCsv=/path/to/file.csv
cf zones list --perPage=10 --page=2
cf zones list --zoneName=example.com example2.com example3.com --fields=id
cf zones list --zoneName=example.com example2.com example3.com --fields=id | xargs -n1 -I % cf zones get %
cf zones list --zoneName=example.com example2.com example3.com --fields=id | xargs -n1 -I % cf firewall list %
Create new zone, permission needed: #zone:edit. See api doc here: https://api.cloudflare.com/#zone-create-zone
Command: cf zones create <zone> --accountId=<accountId>
Options:
Options:
--version Show version number [boolean]
--help Show help [boolean]
--format Format the output, value: table, string, json, list [string]
--separator Separator value when the output format is string [string] [default: " "]
--accountId Account ID where Zone added to [string] [required]
--jumpStart Automatically attempt to fetch existing DNS records [boolean] [default: true]
--type A full or partial zone hosted with Cloudflare. default: full [string] [default: "full"]
--fields Fields to return [string] [default: "id,name,status,name_servers,original_name_servers"]
Samples:
cf zones create example.com --accountId=3d6af8ca7d6be38cd42603989528d63d
cf zones create example.com --accountId=3d6af8ca7d6be38cd42603989528d63d --jumpStart=false
Get information about a specific zone. See api doc here: https://api.cloudflare.com/#zone-zone-details
Command: cf zones get <zone>
Options:
Options:
--version Show version number [boolean]
--help Show help [boolean]
--format Format the output, value: table, string, json, list [string]
--separator Separator value when the output format is string [string] [default: " "]
--fields Fields to return [string] [default: "id,name,status,account.id,account.name,name_servers"]
Samples:
cf dns get example.com sub1.example.com
cf zones get 3e2c9160aba2ef6484132fd060827c93
cf zones get example.com
cf zones get example.com --fields=name_servers
cf zones get example.com --fields=name_servers --format=json
Remove files from Cloudflare's cache. See api doc here: https://api.cloudflare.com/#zone-purge-all-files
Command: cf zones purge <zone>
Options:
Options:
--version Show version number [boolean]
--help Show help [boolean]
--all Purge Everything [boolean] [default: false]
--files Purge selected files [array] [default: []]
--tags Purge selected tags [array] [default: []]
--hosts Purge selected hosts [array] [default: []]
Samples:
cf zones purge example.com --all=true
cf zones purge example.com --hosts subdomain1 subdomdain2
cf zones purge example.com --tags tag1 tag2 tag3
cf zones purge example.com --files file1 file2 file3
Delete an existing zone. Warning: This command will delete a zone and irreversible. See api doc here: https://api.cloudflare.com/#zone-delete-zone
Command: cf zones delete <zone>
Samples:
cf zones delete b9be87b67698e5d3c5efe837529d82d0
cf zones delete example.com
Initiate another zone activation check
Command: cf zones activation_check [zones...]
Options:
Options:
--version Show version number [boolean]
--disableSpinner Disable spinner [boolean] [default: false]
--verbose Enable verbose messages [boolean] [default: false]
--help Show help [boolean]
--format Format the output, value: table, string, json, list [string]
--separator Separator value when the output format is string [string] [default: " "]
--fields Fields to return [string] [default: "name,status,message"]
Samples:
cf zones activation_check b9be87b67698e5d3c5efe837529d82d0
cf zones activation_check example.com example2.com example3.com