Adds multiple domain names to Dynamic Route for CDN (DCDN) in each call.

Prerequisites:

  • Before you add a domain name to DCDN, you must activate the DCDN service.
  • Internet Content Provider (ICP) filling for your domain names to accelerate is complete.
Note If the content of the origin server is not stored on the Alibaba Cloud platform, the content must be reviewed. The review will be completed by the end of the next business day after you submit your application.

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 BatchAddDcdnDomain

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

DomainName String Yes example.com

You can add up to 20 domain names to the DCDN service under each account. Separate multiple domain names with commas (,).

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

The list of origin URLs.

ResourceGroupId String No testID

The ID of the resource group. If you do not specify this parameter, the system automatically uses the ID of the default resource group.

CheckUrl String No www.yourdomain.com/test.html

The URL that is used for health checks.

Scope String No domestic

The region where your acceleration service is deployed. Valid values:

  • domestic: regions inside mainland China. This is the default value.
  • overseas: regions outside mainland China.
  • global: all regions around the world.
TopLevelDomain String No example.com

The top-level domain name.

The following table describes the fields in the Sources parameter:

Parameter

Type

Required

Description

type

String

Yes

The type of origin server. Valid values:

ipaddr: the IP address of the origin server.

domain: the domain name of the origin server.

oss: the URL of an Alibaba Cloud OSS bucket.

fc_domain: the domain name of Function Compute.

content

String

Yes

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

port

Integer

No

The port that redirects back-to-origin requests. Valid values:

80: This is the default port.

443: Alibaba Cloud DCDN communicates with the origin server over HTTPS.

Custom ports.

priority

String

No

The priority of the origin server when multiple origin servers exist. Valid values:

20: the primary origin server. This is the default value.

30: the standby origin server.

weight

String

No

The weight of the origin server if multiple origin servers are specified. You must specify a value 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://dcdn.aliyuncs.com/?Action=BatchAddDcdnDomain
&DomainName=example.com,example1.com
&Sources=[{"content":"1.1.1.1","type":"ipaddr","priority":"20","port":80}]
&<Common request parameters>

Sample success responses

XML format

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

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 InvalidSources.Malformed The specified Sources is invalid. The error message returned because the format of the specified Sources parameter is invalid. You can set Sources to an IP address or a domain name. You can specify up to 20 IP addresses or one domain name. Separate multiple IP addresses with commas (,). You cannot specify both IP addresses and domain names in one request.
400 InvalidScope.Malformed The specified Scope is invalid. The error message returned because the specified value of the Scope parameter is invalid. Specify a valid value and try again.
400 InvalidSource.Priority.Malformed The specified Source Priority is invalid. The error message returned because the specified value of the priority field in the Sources parameter is invalid. Specify a value in the required format.
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 exceeded.
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 the specified origin information has failed the security check. 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 a wildcard domain name and a domain name that starts with an all. prefix 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 specified value of the ResourceGroupId parameter is invalid. Specify a valid value.
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 account. If you need 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 accelerated domain name is not supported. Alibaba Cloud DCDN supports up to three levels in an accelerated domain name.
400 TopLevelDomain.NotFound The specified TopLevelDomain does not exist. The error message returned because the specified top-level domain does not exist.
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 supported by the resource group in the current state.
400 NotInternationRealIdentity Real-name registration is required for services offered in Mainland China. The error message returned because you have not completed real-name verification that is required to use resources in mainland China. Based on the laws of People's Republic of China (PRC), you must complete real-name verification before you purchase information services in mainland China.
400 RecordCheckNotAvailable The ICP filing interface is unavailable. Please try again later. The error message returned because the interface for Internet content provider (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 that is provided by the Ministry of Industry and Information Technology of the People's Republic of China.
400 IspBlack The domain is on the ISP blacklist. The error message returned because the domain name is included in the blacklist that is provided by Alibaba Cloud.
400 DomainOwnerVerifyFail Owner verification of the root domain failed. The error message returned because you have not proven your ownership of the specified domain name. Starting June 12, 2020, you must prove that you are the owner of a new domain name the first time you add the domain name to DCDN. Before you call the AddDcdnDomain operation, you must add a DNS record or upload a valid verification file to prove your ownership of the specified domain name. The Alibaba Cloud China site: https://help.aliyun.com/document_detail/183491.html. The Alibaba Cloud International site: https://www.alibabacloud.com/help/zh/doc-detail/183491.htm.

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