Queries all CNAME records that are mapped to a bucket.

Request syntax

GET /?cname HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Content-Type: application/xml
Content-Length: 186
Date: Tues, 11 May 2022 11:39:12 GMT
Authorization: OSS qn6qrrqxo2oawuk53otf****:KU5h8YMUC78M30dXqf3JxrTZ****

Request headers

The request headers involved in this API operation include only common request headers. For more information, see Common request headers.

Response headers

This request contains only common response headers. For more information, see Common response headers.

Response elements

ElementTypeExampleDescription
ListCnameResultContainerN/AThe container that is used to query information about all CNAME records.

Parent nodes: none

Child nodes: Bucket, Owner, and Cname

BucketStringexamplebucketThe name of the bucket to which the CNAME records you want to query are mapped.

Parent nodes: ListCnameResult

Child nodes: none

OwnerStringtestownerThe name of the bucket owner.

Parent nodes: ListCnameResult

Child nodes: none

CnameContainerN/AThe container that is used to store the information about all CNAME records.

Parent nodes: ListCnameResult

Child nodes: Domain, LastModified, Status, and Certificate

DomainStringexample.comThe custom domain name.

Parent nodes: Cname

Child nodes: none

LastModifiedString2021-09-15T02:35:07.000ZThe time when the custom domain name was mapped.

Parent nodes: Cname

Child nodes: none

StatusStringEnabledThe status of the domain name. Valid values:
  • Enabled:: The domain name is enabled.
  • Disabled: The domain name is disabled.

Parent nodes: Cname

Child nodes: none

CertificateContainerN/AThe container in which the certificate information is stored.

Parent nodes: Cname

Child nodes: Type, CertId, Status, CreationDate, Fingerprint, ValidStartDate, and ValidEndDate

TypeStringCASThe source of the certificate. Valid values:
  • CAS: The certificate that is obtained by using SSL Certificates Service.
  • Upload: The certificate that is uploaded by the user to the earlier version of the certificate hosting service.

Parent nodes: Certificate

Child nodes: none

CertIdString493****-cn-hangzhouThe ID of the certificate.

Parent nodes: Certificate

Child nodes: none

StatusStringEnabledThe status of the certificate. Valid values:
  • Enabled: The certificate is used.
  • Disabled: The certificate is not used.

Parent nodes: Certificate

Child nodes: none

CreationDateStringWed, 15 Sep 2021 02:35:06 GMTThe time when the certificate was bound.

Parent nodes: Certificate

Child nodes: none

FingerprintStringDE:01:CF:EC:7C:A7:98:CB:D8:6E:FB:1D:97:EB:A9:64:1D:4E:**:**The signature of the certificate.

Parent nodes: Certificate

Child nodes: none

ValidStartDateStringWed, 12 Apr 2023 10:14:51 GMTThe time when the certificate takes effect.

Parent nodes: Certificate

Child nodes: none

ValidEndDateStringMon, 4 May 2048 10:14:51 GMTThe time when the certificate expires.

Parent nodes: Certificate

Child nodes: none

Examples

  • Sample request
    GET /?cname HTTP/1.1
    Host: oss-example.oss-cn-hangzhou.aliyuncs.com
    Content-Type: application/xml
    Content-Length: 186
    Date: Tues, 11 May 2022 11:39:12 GMT
    Authorization: OSS qn6qrrqxo2oawuk53otf****:KU5h8YMUC78M30dXqf3JxrTZ****
  • Sample response
    content-length: 1855
    x-oss-console-auth: success
    server: AliyunOSS
    x-oss-server-time: 7
    connection: keep-alive
    x-oss-request-id: 614169F1AE63BD37355CA12B
    date: Tues, 11 May 2022 11:39:12 GMT
    content-type: application/xml
    <?xml version="1.0" encoding="UTF-8"?>
    <ListCnameResult>
      <Bucket>targetbucket</Bucket>
      <Owner>testowner</Owner>
      <Cname>
        <Domain>example.com</Domain>
        <LastModified>2021-09-15T02:35:07.000Z</LastModified>
        <Status>Enabled</Status>
        <Certificate>
          <Type>CAS</Type>
          <CertId>493****-cn-hangzhou</CertId>
          <Status>Enabled</Status>
          <CreationDate>Wed, 15 Sep 2021 02:35:06 GMT</CreationDate>
          <Fingerprint>DE:01:CF:EC:7C:A7:98:CB:D8:6E:FB:1D:97:EB:A9:64:1D:4E:**:**</Fingerprint>
          <ValidStartDate>Wed, 12 Apr 2023 10:14:51 GMT</ValidStartDate>
          <ValidEndDate>Mon, 4 May 2048 10:14:51 GMT</ValidEndDate>
        </Certificate>
      </Cname>
      <Cname>
        <Domain>example.org</Domain>
        <LastModified>2021-09-15T02:34:58.000Z</LastModified>
        <Status>Enabled</Status>
      </Cname>
      <Cname>
        <Domain>example.edu</Domain>
        <LastModified>2021-09-15T02:50:34.000Z</LastModified>
        <Status>Enabled</Status>
      </Cname>
    </ListCnameResult>

Error codes

Error codeHTTP status codeDescription
AccessDenied403The error message returned because you do not have the permissions to call the ListCname operation. Only the bucket owner and RAM users that are granted the oss:ListCname permission can query all CNAME records mapped to the bucket.
NoSuchCname404The error message returned because no CNAME record is mapped to the bucket.