You can call this operation to update the configurations of one or more CDN domains.

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

The name of the CDN domain to update the configurations. You can specify multiple CDN domain names and separate them with commas (,).

ResourceGroupId String No ResourceGroupId

The ID of the resource group.

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

The origin information.

TopLevelDomain String No TopLevelDomain

The primary domain.

Parameters in Sources

Parameter

Type

Required

Description

type

String

Yes

The origin type. Valid values: ipaddr (IP address as the origin), domain (domain name as the origin), oss (OSS bucket as the origin), and fc_domain (the Function Compute domain as the origin).

content

String

Yes

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

port

Integer

No

The port used to communicate with the origin. Port 443 and port 80 are supported. You can also specify a custom port. Default value: 80. If port 443 is specified, CDN communicates with the origin by using HTTPS.

priority

String

No

The priority of the origin If multiple origins are specified. Default value: 20.

weight

String

No

The weight of the origin If multiple origins are specified. 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://cdn.aliyuncs.com?Action=BatchUpdateCdnDomain
&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

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

JSON format

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

Error codes

HTTP status code Error code Error message Description
400 EntityNotExists.ResourceGroup The resource group does not exist. The error message returned because the specified resource group does not exist.

For more information about error codes, visit API Error Center.