You can call this operation to configure features for one or more domains accelerated by IP Application Accelerator (IPA).

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
DomainNames String Yes example.com

The name of the accelerated domain for which you want to configure features. You can specify multiple domain names and separate them with commas (,).

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

The features to configure.

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}]

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: configures 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 resources. 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 a directory in the cache. Valid values: 1 to 99.

path_based_ttl_set: sets an expiration rule for a directory.

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

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

weight: the weight of a directory in the cache. Valid values: 1 to 99.

oss_auth: authenticates the access to an Object Storage Service (OSS) bucket.

oss_bucket_id: the address of your bucket.

ip_black_list_set: configures the IP blacklist.

ip_list: the IP addresses to be added to the IP 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 IP 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: customizes an error page.

error_code: the error code.

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

set_req_host_header: modifies the custom origin host.

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

set_hashkey_args: ignores URL parameters.

hashkey_args: the parameters to be retained. Separate multiple parameters with commas (,).

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

aliauth: configures URL authentication.

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

auth_key1: the primary cryptographic key.

auth_key2: the secondary cryptographic key.

ali_auth_delta: the custom buffer time for signing.

set_resp_header: customizes a response header. To verify the setting, you can check the response messages on the client (browser).

key: the name of the response header. Valid values: Content-Type, Cache-Control, Content-Disposition, Content-Language, Expires, Access-Control-Allow-Origin, Access-Control-Allow-Methods, Access-Control-Allow-Headers, Access-Control-Max-Age, and Access-Control-Expose-Headers.

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

https_force: configures force redirect to HTTPS.

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

https_force: configures force redirect to HTTP.

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

https_option: sets the basic HTTPS parameters.

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 private OSS buckets. Valid values: on and off.

forward_scheme: configures the static 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: the name of the rule. It must be unique per domain name.

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

pathType: the match mode. Valid values: 0 for prefix match and 1 for 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 from an IP address.

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

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

dynamic: configures Dynamic Route for CDN.

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

static_route_type: the file name extension for static content.

static_route_url: the URI of static content.

static_route_path: the path of static content.

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

set_req_header: customizes an HTTP header of back-to-origin requests.

key: the name of the header.

value: the value of the header.

l2_oss_key: configures private bucket access control.

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

range: configures object chunking to retrieve content from the origin based on HTTP range requests.

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

video_seek: configures video seeking.

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

websocket: configures the WebSocket protocol.

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

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

heartbeat: the heartbeat interval. Unit: seconds. Valid values: 1 to 300. Default value: 60.

ali_remove_args: ignores URL parameters.

ali_remove_args: required. It specifies the parameters to be ignored. The remaining parameters are used as the URL parameters in the hashkey. Separate multiple parameters with space characters.

keep_oss_args: specifies whether to retain all parameters during the back-to-origin process. Valid values: on and off. Specify a value of on to retain all parameters. Specify a value of off to use the parameters in the hashkey during the back-to-origin process.

https_tls_version: configures the TLS protocol.

tls10: configures TLS 1.0. Valid values: on and off. Default value: on.

tls11: configures TLS 1.1. Valid values: on and off. Default value: on.

tls12: configures TLS 1.2. Valid values: on and off. Default value: on.

tls13: configures TLS 1.3. Valid values: on and off. Default value: off.

HSTS: configures HSTS.

enabled: required. It specifies whether to enable the feature. Valid values: on and off. Default value: off.

https_hsts_max_age: required. It specifies the validity period of the HSTS policy. Unit: milliseconds. We recommend that you set the value to 5184000000 milliseconds (60 days).

https_hsts_include_subdomains: specifies whether the HSTS header contains the IncludeSubDomains parameter. Valid values: on and off. Use caution when you configure this feature. Make sure that HTTPS is enabled for all subdomains of the accelerated domain. Otherwise, the subdomains will become inaccessible after they are redirected to HTTPS.

filetype_force_ttl_code: configures an expiration rule for file status codes.

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

code_string: required. It specifies the time-to-live (TTL) value for each status code. Example: 302=0,301=0,4xx=2

path_force_ttl_code: configures an expiration rule for directory status codes.

path: required. It specifies the directory, which must start with a forward slash (/). Example: /image

code_string: required. It specifies the TTL value for each status code. Example: 302=0,301=0,4xx=2

gzip: configures the intelligent compression feature.

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

tesla: configures HTML optimization.

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

protogw: configures IP Application Accelerator.

realip: required. It specifies the transparent proxy mode for the origin server to obtain the real IP addresses of the clients. Valid values: off, toa, and pp.

port: required. It specifies the service port.

Response parameters

Parameter Type Example Description
RequestId String 0AEDAF20-4DDF-4165-8750-47FF9C1929C9

The ID of the request.

Examples

Sample requests

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

Sample success responses

XML format

<BatchSetDcdnIpaDomainConfigsResponse>
	  <RequestId>0AEDAF20-4DDF-4165-8750-47FF9C1929C9</RequestId>
</BatchSetDcdnIpaDomainConfigsResponse>

JSON format

{
	"RequestId":"0AEDAF20-4DDF-4165-8750-47FF9C1929C9"
}

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.
403 DcdnIpaServiceNotFound The DCDN IPA service has not been activated. The error message returned because the IPA service is not activated.

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