Skip to content

CLI Tagging

github-actions[bot] edited this page Oct 9, 2026 · 1 revision

CLI: Tagging

One tag API on the vServer gateway serves every resource type: there is no per-resource tag command, only ResourceID.

list-resource-tags

Kind: Read.

Returns every tag on the resource, system tags included: vng.zone, vng.region, and vng.createdBy are confirmed live on a virtual IP address. Tag.SystemTag marks one of them.

Flag Type Required
--resource-id string yes
vngcloud tagging list-resource-tags --resource-id <resource-id>

tag-resource

Kind: Write.

Refuses, before any write, with error code SystemTag, when --key starts with vng. or already names an existing system tag on the resource: the platform's own tags (vng.zone, vng.region, and vng.createdBy, confirmed live on a virtual IP address) are never sent and can never be set or removed through this command. Setting --key to a --value it already holds among the user tags is a no-op: Changed is false and nothing is sent.

Reads every tag on the resource, replaces its whole user tag list with the change, then reads it again to confirm: the PUT never includes a system tag, since it replaces only the user tag list. A mismatched or failed confirm read is error code NotSettled; the write already reached the server, so the CLI still prints the last tags a read returned on stdout, and the tags should be read again before writing once more, rather than repeating this command blind.

Needs no --yes: the write's own Previous field names Key's value before the change (empty when it was absent), so the change can be undone with one more tag-resource or untag-resource call.

--resource-type is sent to the server exactly as given. VIRTUAL-IP-ADDRESS is confirmed live to accept a tag write for free; SERVER, VOLUME, and LOAD-BALANCER are named by VNG Cloud's own SDK for this same call, on paid resources this CLI has not tried.

Flag Type Required
--resource-id string yes
--resource-type string yes
--key string yes
--value string
vngcloud tagging tag-resource --resource-id <resource-id> --resource-type <resource-type> --key <key>

untag-resource

Kind: Write.

Refuses, before any write, with error code SystemTag, when --key starts with vng. or already names an existing system tag on the resource: the platform's own tags (vng.zone, vng.region, and vng.createdBy, confirmed live on a virtual IP address) are never sent and can never be set or removed through this command. Removing a --key already absent from the user tags is a no-op: Changed is false and nothing is sent.

Reads every tag on the resource, replaces its whole user tag list with the change, then reads it again to confirm: the PUT never includes a system tag, since it replaces only the user tag list. A mismatched or failed confirm read is error code NotSettled; the write already reached the server, so the CLI still prints the last tags a read returned on stdout, and the tags should be read again before writing once more, rather than repeating this command blind.

Needs no --yes: the write's own Previous field names Key's value before the change (empty when it was absent), so the change can be undone with one more tag-resource or untag-resource call.

--resource-type is sent to the server exactly as given. VIRTUAL-IP-ADDRESS is confirmed live to accept a tag write for free; SERVER, VOLUME, and LOAD-BALANCER are named by VNG Cloud's own SDK for this same call, on paid resources this CLI has not tried.

Flag Type Required
--resource-id string yes
--resource-type string yes
--key string yes
vngcloud tagging untag-resource --resource-id <resource-id> --resource-type <resource-type> --key <key>

Clone this wiki locally