You can call this operation to configure one or more accelerated 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 BatchSetDcdnDomainConfigs

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

DomainNames String Yes example.com

The name of the accelerated domain. You can separate multiple accelerated domain names with commas (,).

Functions String Yes [{"functionArgs":[{"argName":"domain_name","argValue":"api.hellodtworld.com"}],"functionName":"set_req_host_header"}]

The list of features.

  • argName: specifies the name of the parameter. The parameter name varies based on the specified feature.
  • argValue: specifies the value of the parameter. Set the specific value based on the feature.
  • functionName: specifies the name of the feature.

Functions specification: all parameter values must be of the string type.

Some features, such as filetype_based_ttl_set, support more than one configuration record. To update one of the configuration records, use the configId parameter to specify the record.

[{"functionArgs":[{"argName":"file_type","argValue":"jpg"},{"argName":"ttl","argValue":"18"},{"argName":"weight","argValue":"30"}],"functionName":"filetype_based_ttl_set","configId":5068995}]

Features

Feature

Parameter description

referer_white_list_set: configures the referer whitelist.

refer_domain_allow_list: the referers to be added to the whitelist. Separate multiple referers with commas (,).

allow_empty: specifies whether an empty referer is allowed. Valid values: on and off.

referer_black_list_set: specifies the referer blacklist.

refer_domain_deny_list: the referers to be added to the blacklist. Separate multiple referers with commas (,).

allow_empty: specifies whether an empty referer is allowed. Valid values: on and off.

filetype_based_ttl_set: sets an expiration rule for specific files.

ttl: the validity period of the cached content. Unit: seconds.

file_type: the file type. You can specify multiple file types and separate them with commas (,). Example: txt, jpg

weight: the weight of the file expiration. Valid values: 1 to 99.

path_based_ttl_set: specifies an expiration rule for a directory.

ttl: the validity period of the cached content. Unit: seconds.

path: the directory, which must start with a forward slash (/).

weight: the weight of the directory expiration. Valid values: 1 to 99.

oss_auth: configures the authentication of the access to an Object Storage Service (OSS) bucket.

oss_bucket_id: the ID of your bucket.

ip_black_list_set: specifies the IP blacklist.

ip_list: the IP addresses to be added to the blacklist. Separate multiple IP addresses with commas (,).

ip_allow_list_set: configures the IP whitelist.

ip_list: the IP addresses to be added to the whitelist. Separate multiple IP addresses with commas (,).

ip_white_list_set: configures the Taobao Missile Defense (TMD) whitelist.

ip_list: the IP addresses to be added to the whitelist. Separate multiple IP addresses with commas (,).

error_page: redirects an error page to another specified page.

error_code: the error code.

rewrite_page: the page to be redirected to when the specified error occurs.

set_req_host_header: specifies the custom header of the origin host.

domain_name: the custom domain name that is used as the origin host.

set_hashkey_args: configures parameter filtering.

hashkey_args: the list of reserved parameters. Separate multiple parameters with commas (,).

disable: specifies whether to ignore all parameters. Valid values: on and off.

aliauth: configures URL signing.

auth_type: the signing type. Valid values: no_auth, type_a, type_b, and type_c.

auth_key1: the cryptographic key 1. auth_key2: the cryptographic key 2.

ali_auth_delta: the custom buffer time for authentication.

set_resp_header: sets a response header. To verify the setting, you can check the response messages on the client through the browser.

key: the name of the response header.

value: the content of the response header. Enter null if you want to delete the header.

https_force: configures the forcible redirect of HTTP requests to HTTPS.

enable: specifies whether to enable the feature. Valid values: on and off.

https_force: configures the forcible redirect of HTTPS requests to HTTP.

enable: specifies whether to enable the feature. Valid values: on and off.

https_option: specifies basic parameters of HTTPS.

http2: specifies whether to enable HTTP/2. Valid values: on and off.

l2_oss_key: configures private OSS bucket access control.

private_oss_auth: specifies whether to authenticate the access to a private OSS bucket. Valid values: on and off.

forward_scheme: specifies the origin protocol policy.

enable: specifies whether to enable the feature. Valid values: on and off.

scheme_origin: the protocol policy used to communicate with the origin. Valid values: http, https, and follow.

green_manager: configures illicit content moderation.

enable: specifies whether to enable the feature. Valid values: on and off.

tmd_signature: sets a TMD custom rule.

name: specifies the name of the rule. It must be unique per domain name.

path: specifies the URI path. You can specify duplicate URI paths. However, you must verify their validity.

pathType: specifies the matching mode. Valid values: 0 specifies prefix match and 1 specifies exact match.

interval: the interval during which the data is monitored. Unit: seconds. The interval must be greater than or equal to 10 seconds.

count: the number of visits to an IP address.

action: the operation to be performed after specified conditions are met. Valid values: 0 specifies blocking and 1 specifies bot detection.

ttl: the time period during which access is denied. Unit: seconds.

dynamic: configures Dynamic Route for CDN (DCDN).

enable: specifies whether to enable the service. Required. Valid values: on and off.

static_route_type: the file name extension for static content.

static_route_url: the URI of the static content.

static_route_path: the path of the static content.

dynamic_route_origin: the protocol policy used to communicate with the origin. Valid values: http, https, and follow.

Response parameters

Parameter Type Example Description
RequestId String 04F0F334-1335-436C-A1D7-6C044FE73368

The ID of the request.

Examples

Sample requests

http://dcdn.aliyuncs.com/?Action=BatchSetDcdnDomainConfigs
&DomainName=example.com
&Functions=[{"functionArgs":[{"argName":"domain_name","argValue":"api.hellodtworld.com"}],"functionName":"set_req_host_header"}]
&<Common request parameters>

Sample success responses

XML format

<BatchSetDcdnDomainConfigsResponse>
	  <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
</BatchSetDcdnDomainConfigsResponse>

JSON format

{
	"RequestId":"04F0F334-1335-436C-A1D7-6C044FE73368"
}

Error codes

HTTP status code Error code Error message Description
400 InvalidFunctions.Malformed The specified Functions is invalid. The error message returned because the specified Functions parameter is not supported.
400 InvalidArgValue.Malformed The specified ArgValue is invalid. The error message returned because the specified argValue is invalid.
400 Invalid%s.ValueNotSupported [%s] is not supported. The error message returned because the specified value is not supported.
400 Invalid%s.Malformed The specified ArgValue [%s] is invalid. The error message returned because the specified argValue is not supported.

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