All Products
Search
Document Center

Object Storage Service:get-cname-token

Last Updated:Oct 10, 2026

Queries a created CNAME token.

Usage note

By default, an Alibaba Cloud account has the permissions to query a created CNAME token. The oss:GetCnameToken permission is required to query a CNAME token as a RAM user or by using STS. For more information, see Grant a custom policy.

Command syntax

ossutil api get-cname-token --bucket value --cname value --wildcard=value [flags]

Parameter

Type

Description

--bucket

string

The name of the bucket.

--cname

string

The name of the mapped CNAME.

--wildcard

bool

Specifies whether to query the CNAME token of a wildcard domain CNAME. Valid values: true and false.

For an Agentic Bucket, you must explicitly set this parameter to true or false. For a standard bucket, this parameter is optional and defaults to false (exact CNAME).

Note
  • The get-cname-token command corresponds to the GetCnameToken API operation. For more information about the parameters, see GetCnameToken.

  • The --wildcard option is used for wildcard domain CNAME operations. Make sure that your ossutil version supports this parameter.

  • For more information about supported global command-line options, see Global command-line options.

Examples

  • Query the CNAME token for the example.com domain mapped to examplebucket.

    ossutil api get-cname-token --bucket examplebucket --cname example.com
  • Query the CNAME token for the example.com domain mapped to examplebucket and display the result in JSON format.

    ossutil api get-cname-token --bucket examplebucket --cname example.com --output-format json
  • Query the CNAME token for the example.com domain mapped to examplebucket and display the result in YAML format.

    ossutil api get-cname-token --bucket examplebucket --cname example.com --output-format yaml
  • Query the CNAME token for the base domain foo.example.com of a wildcard domain for the Agentic Bucket myab-$uid-$region-ab-apsr.

    ossutil api get-cname-token --bucket my-uid-region-ab-apsr --cname foo.example.com --wildcard=true