All Products
Search
Document Center

Object Storage Service:get-cname-token

Last Updated:Mar 20, 2026

Retrieves a previously created CNAME token for verifying domain name ownership for a bucket.

Prerequisites

Before you begin, make sure you have:

  • The oss:GetCnameToken permission, if using a RAM user or Security Token Service (STS). By default, an Alibaba Cloud account has this permission. To grant access to a RAM user or STS, attach a custom policy that includes oss:GetCnameToken. For more information, see Attach a custom policy to a RAM user

Synopsis

ossutil api get-cname-token --bucket <value> --cname <value> [flags]

Parameters

ParameterTypeDescription
--bucketstringThe name of the bucket.
--cnamestringThe CNAME record mapped to the bucket.
get-cname-token corresponds to the GetCnameToken API operation. For supported global flags, see Global command-line options.

Examples

Retrieve the CNAME token for example.com mapped to examplebucket:

ossutil api get-cname-token --bucket examplebucket --cname example.com

Retrieve the token and display the output in JSON format:

ossutil api get-cname-token --bucket examplebucket --cname example.com --output-format json

Retrieve the token and display the output in YAML format:

ossutil api get-cname-token --bucket examplebucket --cname example.com --output-format yaml