delete-cname

Updated at:

Deletes a custom domain name (CNAME record) that is mapped to a bucket.

Usage note

By default, an Alibaba Cloud account has the permissions to delete a custom domain name that is mapped to a bucket. The oss:DeleteCname permission is required to delete a CNAME as a RAM user or by using STS. For more information, see Grant a custom policy.

Command syntax

ossutil api delete-cname --bucket value --cname-configuration value --wildcard=value [flags]

Parameter

Type

Description

--bucket

string

The name of the bucket.

--cname-configuration

string

The CNAME configuration container.

--wildcard

bool

Specifies whether to delete 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.

Note
  • The delete-cname command corresponds to the DeleteCname API operation. For more information about the parameters, see DeleteCname.

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

--cname-configuration

The --cname-configuration option accepts both XML and JSON. If the value contains the file:// prefix, the configuration is read from a file.

  • XML syntax:

    <BucketCnameConfiguration>
      <Cname>
        <Domain>string</Domain>
      </Cname>
    </BucketCnameConfiguration>
  • JSON syntax:

    {
      "Cname": {
        "Domain": "string"
      }
    }
Note

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

Examples

  1. Delete the custom domain name example.com mapped to examplebucket.

    • Use an XML configuration file. The content of cname-configuration.xml is as follows:

      <?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
    • Use a JSON configuration file. The content of cname-configuration.json is as follows:

      {
        "Cname": {
          "Domain": "example.com"
        }
      }

      Sample command:

      ossutil api delete-cname --bucket examplebucket --cname-configuration file://cname-configuration.json
    • Use JSON configuration parameters. Sample command:

      ossutil api delete-cname --bucket examplebucket --cname-configuration "{\"Cname\":{\"Domain\":\"example.com\"}}"
  2. Delete the wildcard CNAME for example.com (without the *. prefix) from the Agentic Bucket my-uid-region-ab-apsr.

    • Use JSON configuration parameters. Sample command:

      ossutil api delete-cname --bucket my-uid-region-ab-apsr --cname-configuration "{\"Cname\":{\"Domain\":\"example.com\"}}" --wildcard=true