The command delete-cname is used to delete a CNAME record that is mapped to an OSS bucket.
Usage notes
By default, an Alibaba Cloud account has the permissions to delete a CNAME record that is mapped to an OSS bucket. Deleting CNAME records as a RAM user or by using Security Token Service (STS) requires oss:DeleteCname
permissions. For more information, see Attach a custom policy to a RAM user.
Command syntax
ossutil api delete-cname --bucket value --cname-configuration value [flags]
Parameter | Type | Description |
--bucket | string | Name of the bucket. |
--cname-configuration | string | Container that stores the CNAME record. |
The delete-cname command corresponds to the DeleteCname operation. For more information about the parameters in the DeletaCname 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 CNAME record example.com
that is mapped to examplebucket
.
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\"}}"