delete-cname
The command delete-cname is used to delete a custom domain name (CNAME record) that is mapped to an OSS bucket.
Usage notes
By default, an Alibaba Cloud account has the permissions to delete a custom domain name (CNAME) that is mapped to a bucket. To delete a custom domain name as a Resource Access Management (RAM) user or by using Security Token Service (STS), you must have the oss:DeleteCname permission. For more information, see Grant a custom policy.
Command syntax
ossutil api delete-cname --bucket value --cname-configuration value [flags]
|
Parameter |
Type |
Description |
|
--bucket |
string |
The name of the bucket. |
|
--cname-configuration |
string |
The container that stores the CNAME configuration. |
The delete-cname command corresponds to the DeleteCname API operation. For more information about the parameters of the DeleteCname API operation, see DeleteCname.
--cname-configuration
The --cname-configuration option supports both XML and JSON formats. If the value of the option contains the 'file://' prefix, configuration parameters are read from the specified file.
-
XML format:
<BucketCnameConfiguration> <Cname> <Domain>string</Domain> </Cname> </BucketCnameConfiguration> -
JSON format:
{ "Cname": { "Domain": "string" } }
For more information about supported global command-line options, see Command-line options.
Examples
Delete the custom domain name example.com that is mapped to the examplebucket bucket.
-
Create a configuration file named cname-configuration.xml and add the following code:
<?xml version="1.0" encoding="UTF-8"?> <BucketCnameConfiguration> <Cname> <Domain>example.com</Domain> </Cname> </BucketCnameConfiguration>
Sample command:
ossutil api delete-cname --bucket examplebucket --cname-configuration file://cname-configuration.xml
-
Create a configuration file named cname-configuration.json and add the following code:
{ "Cname": { "Domain": "example.com" } }Sample command:
ossutil api delete-cname --bucket examplebucket --cname-configuration file://cname-configuration.json -
Configure parameters in the following command in the JSON format:
ossutil api delete-cname --bucket examplebucket --cname-configuration "{\"Cname\":{\"Domain\":\"example.com\"}}"