Skip to content

CLI CDN

github-actions[bot] edited this page Oct 10, 2026 · 4 revisions

CLI: CDN

list-ip-ranges needs no credential. The other commands call the vCDN API with a vCDN API key, which is separate from the IAM login. Only the root user can make the key, in the vCDN Portal, with an expiry of up to one year. Store it with vngcloud configure set vcdn_api_key - (the key on stdin) or set VNGCLOUD_VCDN_API_KEY; there is no flag for it. Without a key a command exits 3 with error code NoCredentials and sends nothing.

Any key can read every key and certificate of the account, so keep its expiry short. The SDK sends no Origin header, so a key's AllowOriginHeader does not apply. A 401 (error code Unauthorized, exit 3) means the key is wrong or expired.

delete-web-accelerator

Kind: Write, destructive.

Deletes the CDN and its generated CNAME target. Pass --yes to confirm.

Flag Type Required
--cdn-id string yes
vngcloud cdn delete-web-accelerator --cdn-id <cdn-id> --yes

disable-web-accelerator

Kind: Write, destructive.

Returns WebAccelerator and Changed. It confirms with reads at 0, 2, 4, and 8 seconds. --no-wait skips only the settle wait. A CDN that does not settle prints its last read on stdout and exits 1.

Flag Type Required
--cdn-id string yes
--no-wait bool
vngcloud cdn disable-web-accelerator --cdn-id <cdn-id> --yes

enable-web-accelerator

Kind: Write.

Returns WebAccelerator and Changed. It confirms with reads at 0, 2, 4, and 8 seconds. --no-wait skips only the settle wait. A CDN that does not settle prints its last read on stdout and exits 1.

Flag Type Required
--cdn-id string yes
--no-wait bool
vngcloud cdn enable-web-accelerator --cdn-id <cdn-id>

get-cache-status

Kind: Read.

Uses generated CDN domains, not customer domains. Analytics calls use POST but remain reads, so read-only allows them.

Flag Type Required
CDNDomains (via --cli-input-json only) []string yes
--period string
--from string
--to string
vngcloud cdn get-cache-status --cli-input-json '{"CDNDomains":["<cdn-domain>"]}' --query Counts

get-certificate

Kind: Read.

Prints the certificate and CA chain as PEM text. The server also returns the private key; the CLI never prints it.

Flag Type Required
--certificate-id string yes
vngcloud cdn get-certificate --certificate-id <certificate-id> --query Certificate

get-http-codes

Kind: Read.

Uses generated CDN domains, not customer domains. Analytics calls use POST but remain reads, so read-only allows them.

Flag Type Required
CDNDomains (via --cli-input-json only) []string yes
--period string
--from string
--to string
vngcloud cdn get-http-codes --cli-input-json '{"CDNDomains":["<cdn-domain>"]}' --query Counts

get-request-rate

Kind: Read.

Uses generated CDN domains, not customer domains. Analytics calls use POST but remain reads, so read-only allows them.

Flag Type Required
CDNDomains (via --cli-input-json only) []string yes
--period string
--from string
--to string
vngcloud cdn get-request-rate --cli-input-json '{"CDNDomains":["<cdn-domain>"]}' --query Points

get-traffic

Kind: Read.

Uses generated CDN domains, not customer domains. Analytics calls use POST but remain reads, so read-only allows them.

Flag Type Required
CDNDomains (via --cli-input-json only) []string yes
--period string
--from string
--to string
vngcloud cdn get-traffic --cli-input-json '{"CDNDomains":["<cdn-domain>"]}' --query Points

get-traffic-report

Kind: Read.

Uses generated CDN domains, not customer domains. Analytics calls use POST but remain reads, so read-only allows them.

Flag Type Required
CDNDomains (via --cli-input-json only) []string yes
--from string yes
--to string yes
vngcloud cdn get-traffic-report --from <from> --to <to> --cli-input-json '{"CDNDomains":["<cdn-domain>"]}' --query Items

get-web-accelerator

Kind: Read.

Flag Type Required
--cdn-id string yes
vngcloud cdn get-web-accelerator --cdn-id <cdn-id> --query WebAccelerator

list-api-keys

Kind: Read.

Current marks the key this command sent, so its ExpiresAt is the expiry of the key in use. The server also returns every key's token and the account email; the CLI never prints them.

No fields.

vngcloud cdn list-api-keys

list-certificates

Kind: Read.

Lists every certificate of the account without its PEM text. The server also returns each private key; the CLI never prints it.

No fields.

vngcloud cdn list-certificates

list-ip-ranges

Kind: Read.

No fields.

vngcloud cdn list-ip-ranges

list-web-accelerators

Kind: Read.

Lists portal-created Web Accelerators. CDNDomain is the generated CNAME target.

No fields.

vngcloud cdn list-web-accelerators

purge-paths

Kind: Write.

Purges exact cached paths. Supply Paths through --cli-input-json. Wait at least 30 seconds before another purge of the same CDN. Each purge consumes the package's daily purge limit; the Basic package permits five per day.

Flag Type Required
--cdn-domain string yes
Paths (via --cli-input-json only) []string yes
vngcloud cdn purge-paths --cdn-domain <cdn-domain> --cli-input-json '{"Paths":["/<path>"]}'

update-web-accelerator

Kind: Write.

Merges changes into a fresh CDN read. Use --cli-input-json for every list. --no-wait makes one follow-up read and skips the settle wait.

Flag Type Required
--cdn-id string yes
SetRuleActions (via --cli-input-json only) []cdn.RuleActionInput
RemoveRuleActions (via --cli-input-json only) []string
Upstreams (via --cli-input-json only) []cdn.UpstreamInput
--lb-type *string
FailOverErrorCodes (via --cli-input-json only) []string
--certificate-id *string
--origin-host-header *string
CNames (via --cli-input-json only) []string
--no-wait bool
vngcloud cdn update-web-accelerator --cdn-id <cdn-id> --cli-input-json file://changes.json

Clone this wiki locally