cli4 man page

cli4 ā€” Command line access to CloudFlare v4 API

Synopsis

cli4 [-V] [-h|--help] [-v|--verbose] [-q|--quiet] [-j|--json] [-y|--yaml] [-n|--ndjson] [item=value ...] [-G|--get] [-P|--patch] [-O|--post] [-U|--put] [-D|--delete] /command...

Description

cli4 provides command line access to CloudFlare v4 API

Options

[-V, --version]

Display program version number and exit.

[-h, --help]

This information (in a terse form).

[-v, --verbose]

Provide some protcol debugging information.

[-q, --quiet]

Don't output any JSON/YAML responses.

[-j, --json]

Output response data in JSON format (the default).

[-y, --yaml]

Output response data in YAML format (if yaml package installed).

[-n, --ndjson]

Output response data in NDJSON format (if jsonlines package installed).

--get

Send HTTP request as a GET (the default).

--patch

Send HTTP request as a PATCH.

--post

Send HTTP request as a POST.

--put

Send HTTP request as a PUT.

--delete

Send HTTP request as a DELETE.

item=value

Set a paramater or data value to send with a GET, PATCH, POST, PUT or DELETE command. The value is sent as a string.

item:=value

Set a paramater or data value to send with a GET, PATCH, POST, PUT or DELETE command. The value is sent as an interger.

/command...

The API command. The command uses slash (/) to seperate the verbs in the same way that the CloudFlare v4 API documentation does. Any verb starting with colon (:) is either converted to zone_id, user_id, organtization_id, or otherwise.

Results

The output is either JSON or YAML formatted.

Examples

cli4 /zones List infomation for all zones.

cli4 /zones/:example.com List specific zone info.

cli4 /zones/:example.com/settings List settings for a specific zone.

cli4 --delete purge_everything=true /zones/:example.com/purge_cache Purge cache for a specific zone.

cli4 --delete files='[http://example.com/css/styles.css]' /zones/:example.com/purge_cache Purge cache for a specific zone.

cli4 --delete files='[http://example.com/css/styles.css,http://example.com/js/script.js] /zones/:example.com/purge_cache Purge cache for a specific zone.

cli4 --delete tags='[tag1,tag2,tag3]' /zones/:example.com/purge_cache Purge cache for a specific zone.

cli4 /zones/:example.com/available_plans List available plans for a zone.

cli4 --patch status=active /zones/:example.com/dnssec Make DNSSEC active for specfic zone.

cli4 /zones/:example.com/dnssec List DNSSEC infomation and status for a specific zone.

See Also

The CloudFlare API can be found https://api.cloudflare.com/. Each API call is provided via a similarly named function within the CloudFlare class.