The delete-cname command deletes a CNAME record that is attached to a bucket.
Precautions
By default, an Alibaba Cloud account has permission to attach a custom domain name to a bucket. If you use a Resource Access Management (RAM) user or Security Token Service (STS) to delete the CNAME record, you must have the oss:DeleteCname permission. For more information, see Grant custom access policies to a RAM user.
Command format
ossutil api delete-cname --bucket value --cname-configuration value [flags]Parameter | Type | Description |
--bucket | string | The bucket name. |
--cname-configuration | string | The container for the CNAME configuration. |
The delete-cname command corresponds to the DeleteCname API operation. For more information about the parameters in the API operation, see DeleteCname.
--cname-configuration
The --cname-configuration option supports both XML and JSON syntax. If the option value includes the file:// prefix, the configuration is read from a file.
XML syntax:
<BucketCnameConfiguration> <Cname> <Domain>string</Domain> </Cname> </BucketCnameConfiguration>JSON syntax:
{ "Cname": { "Domain": "string" } }
For information about the supported global command-line options, see Supported global command-line options.
Usage examples
The following example deletes the custom domain name example.com that is attached to the examplebucket bucket.
Use an XML configuration file. The following code shows the content of the cname-configuration.xml file:
<?xml version="1.0" encoding="UTF-8"?> <BucketCnameConfiguration> <Cname> <Domain>example.com</Domain> </Cname> </BucketCnameConfiguration>
The following command provides an example:
ossutil api delete-cname --bucket examplebucket --cname-configuration file://cname-configuration.xmlUse a JSON configuration file. The following code shows the content of the cname-configuration.json file:
{ "Cname": { "Domain": "example.com" } }The following command provides an example:
ossutil api delete-cname --bucket examplebucket --cname-configuration file://cname-configuration.jsonUse JSON configuration parameters. The following command provides an example:
ossutil api delete-cname --bucket examplebucket --cname-configuration "{\"Cname\":{\"Domain\":\"example.com\"}}"