Updates the configurations of multiple accelerated domain names at a time.

Note
  • The maximum number of times that each user can call this operation per second is 30.
  • You can specify multiple domain names (no more than 50) and separate them with commas (,).

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 BatchUpdateCdnDomain

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

DomainName String Yes example.com,example.org

The accelerated domain names. You can specify one or more accelerated domain names. Separate domain names with commas (,).

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

The information about the addresses of origin servers.

Note You can set only one of Sources and TopLevelDomain. If you set both Sources and TopLevelDomain, TopLevelDomain does not take effect.
ResourceGroupId String No rg-acfmyuji4b6r4**

The ID of the resource group.

TopLevelDomain String No example.com

The top-level domain name.

Note You can set only one of Sources and TopLevelDomain. If you set both Sources and TopLevelDomain, TopLevelDomain does not take effect.

The following table describes the fields in the Sources parameter.

Parameter

Type

Required

Description

type

String

Yes

The type of the origin server. Valid values:

ipaddr: The origin server uses an IP address.

domain: The origin server uses a domain name.

oss: The origin server uses an Object Storage Service (OSS) bucket.

fc_domain: The origin server uses a Function Compute domain name.

content

String

Yes

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

port

Integer

No

The port. You can specify port 80, port 443, or a custom port. Default value: 80. If you specify port 443, Alibaba Cloud CDN 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 smaller 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)://cdn.aliyuncs.co/?Action=BatchUpdateCdnDomain
&DomainName=example.com,example.org
&Sources=[{"content":"10.10.10.10","type":"ipaddr","priority":"20","port":80}]
&<Common request parameters>

Sample success responses

XML format

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

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 origin server address is specified in an invalid format.
400 MissingSource.Content The Source Content must be specified. The error message returned because the origin server information is not specified.
400 InvalidSources.Malformed Specified Sources is malformed. The error message returned because the origin server address is specified in an invalid format.
400 EntityNotExists.ResourceGroup The resource group does not exist. The error message returned because the specified resource group does not exist.

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