Adds an accelerated domain name. You can specify only one domain name in each request.

Note
  • The Dynamic Route for CDN (DCDN) service is activated.
  • Internet content provider (ICP) filing is complete for the accelerated domain name.
  • If the content of the origin server is not stored on Alibaba Cloud, the content must be reviewed. After you submit the request, the review is complete by the end of the following business day.
  • The maximum number of times that each user can call this operation per second is 30.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes AddDcdnDomain

The operation that you want to perform. Set the value to AddDcdnDomain.

DomainName String Yes example.com

The domain name that you want to add. You can specify only one domain name in each request.

Wildcard domain names are supported. Wildcard domain names must start with a period (.). Example: .example.com.

Sources String Yes [{"content":"10.10.10.10","type":"ipaddr","priority":"20","port":80}]

The information about the addresses of origin servers.

ResourceGroupId String No rg-acfmyuji4b6r4**

The ID of the resource group. If you do not specify a value for this parameter, the system automatically assigns the ID of the default resource group.

CheckUrl String No xxx.com

The URL that is used to check the accessibility of the origin server.

Scope String No domestic

The accelerated region. Valid values:

  • domestic: mainland China
  • overseas: global (excluding mainland China)
  • global: global

Default value: domestic.

TopLevelDomain String No yourTopLevelDomain

The top-level domain name.

The following table describes the fields in the Sources parameter.

Field

Type

Required

Description

type

String

Yes

The type of the origin server. A value of ipaddr specifies the IP address of the origin server. A value of domain specifies the domain name of the origin server. A value of oss specifies the endpoint of an Object Storage Service (OSS) bucket.

content

String

Yes

The address of the origin server. You can specify an IP address or a domain name.

port

Integer

No

The port number. You can set the port parameter to 443, 80, or a custom port. Default value: 80. If you specify port 443, DCDN communicates with the origin server over HTTPS.

priority

String

No

The priority of the origin server if multiple origin servers are specified. Valid values: 20 and 30. Default value: 20. A value of 20 specifies that the origin is a primary origin. A value of 30 specifies that the origin is a secondary origin.

weight

String

No

The weight of the origin server if multiple origin servers are specified. You must specify a value that is less than 100. Default value: 10.

Response parameters

Parameter Type Example Description
RequestId String 15C66C7B-671A-4297-9187-2C4477247A74

The ID of the request.

Examples

Sample requests

http(s)://dcdn.aliyuncs.com/?Action=AddDcdnDomain
&DomainName=example.com
&Sources=[{"content":"10.10.10.10","type":"ipaddr","priority":"20","port":80}]
&<Common request parameters>

Sample success responses

XML format

<AddDcdnDomainResponse>
      <RequestId>15C66C7B-671A-4297-9187-2C4477247A74</RequestId>
</AddDcdnDomainResponse>

JSON format

{
  "RequestId": "15C66C7B-671A-4297-9187-2C4477247A74"
}

Error codes

HttpCode Error code Error message Description
400 InvalidDomainName.Malformed The specified DomainName is invalid. The error message returned because the format of the domain name is invalid.
400 InvalidSource.Content.Malformed The specified Source Content is invalid. The error message returned because the value specified for the Sources parameter is invalid. Specify a valid value and try again.
400 MissingSource.Content The Source Content must be specified. The error message returned because no value is specified for the content field in the Sources parameter. Specify a value for the field and try again.
400 MissingSource.Type The Source Type must be specified. The error message returned because no value is specified for the type field in the Sources parameter. Specify a value for the field and try again.
400 InvalidSource.Type.Malformed The specified Source Type is invalid. The error message returned because the value specified for the type field in the Sources parameter is invalid. Specify a value in the correct format.
400 InvalidSource.Priority.Malformed The specified Source Priority is invalid. The error message returned because the value specified for the priority field in the Sources parameter is invalid. Specify a value in the correct format.
400 InvalidScope.Malformed The specified Scope is invalid. The error message returned because the value specified for the Scope parameter is invalid. Specify a valid value and try again.
400 SourceIp.Exceed The maximum number of back-to-origin IP addresses is exceeded. The error message returned because the maximum number of origin IP addresses has been reached.
400 InvalidCertificate The specified certificate format is invalid. The error message returned because the format of the specified certificate is invalid. Specify a valid certificate and try again.
400 InvalidCertificate.TooLong The maximum length of the certificate is exceeded. The error message returned because the maximum length of the specified certificate content has been reached.
400 CheckSourceHealthFailed Error checking the security. Provide the valid origin site information. The error message returned because security check failed due to invalid origin information. Specify valid origin information and try again.
400 ExtensiveAndAllBothExist A wildcard domain name and a domain name with an all. prefix cannot be both specified. The error message returned because wildcard domain names and domain names that start with the string all. cannot exist at the same time.
400 CdnTypeNotSupportExtensiveDomain Wildcard domain names are not supported. The error message returned because wildcard domain names are not supported.
400 ExtensiveAndSpecificDomainConflict The wildcard domain name overlaps a domain name at the same level. The error message returned because the specified domain name is an exact match of an existing wildcard domain name at the same level. Specify another domain name.
400 InvalidResourceGroupId.Malformed The specified ResourceGroupId is invalid. The error message returned because the value specified for the ResourceGroupId parameter is invalid. Specify a valid value and try again.
400 DomainReserved The root domain of your domain is reserved by another account. Submit a ticket to contact customer support. The error message returned because the root domain of the specified domain name is used by another Alibaba Cloud account. If you want to add the domain name, submit a ticket.
400 InvalidDomainNameLevel The alicdn.com domain supports a maximum of three levels of domain. The error message returned because the specified domain name is not supported. DCDN supports only top-level, second-level, and third-level domain names.
400 EntityNotExists.ResourceGroup The resource group does not exist. The error message returned because the specified resource group does not exist.
400 InvalidStatus.ResourceGroup The current status of the resource group does not support this operation. The error message returned because the operation is not allowed when the resource group is in the current state.
400 NotInternationRealIdentity Real-name registration is required for services offered in Mainland China. The error message returned because real-name verification that is required to purchase or use Internet content services in mainland China is not complete.
400 TopLevelDomain.NotFound The specified TopLevelDomain does not exist. The error message returned because the specified top-level domain name does not exist.
400 RecordCheckNotAvailable The ICP filing interface is unavailable. Please try again later. The error message returned because the operation for ICP filing is unavailable. Try again later.
400 IcpBlack The domain is on the ICP blacklist. The error message returned because the domain name is included in the ICP filing blacklist of the Ministry of Industry and Information Technology (MIIT).
400 IspBlack The domain is on the ISP blacklist. The error message returned because the domain name is included in the blacklist of Alibaba Cloud.
400 InvalidCheckUrl.Malformed The specified CheckUrl is invalid. The error message returned because the value specified for the CheckUrl parameter is invalid.
400 DomainOwnerVerifyFail Owner verification of the root domain failed. The error message returned because the ownership of the domain name is not verified. The first time you add a domain name to DCDN, you must add a DNS record or upload a verification file to verify the ownership of the domain name.
400 TopLevelDomain.Mismatch The specified TopLevelDomain does not match webSiteType. The error message returned because the specified top-level domain name does not match the type of the domain name.

For a list of error codes, visit the API Error Center.