Configures features for one or more specified domains that are 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
Action String Yes BatchSetDcdnIpaDomainConfigs

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

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.xxx.com"}],"functionName":"set_req_host_header"}]
The features to configure.
[{"functionArgs":[{"argName":"Parameter name","argValue":"Parameter value"}],"functionName":"Feature name"}]

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"}],"functionName":"filetype_based_ttl_set","configId":5068995}]

Feature

Parameter description

referer_white_list_set: specifies the referer whitelist.

refer_domain_allow_list: specifies 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: specifies 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: specifies an expiration rule for specified files.

ttl: specifies the validity period of the cached resources. Unit: second.

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

path_based_ttl_set: specifies an expiration rule for a directory.

ttl: specifies the validity period of the cached resources. Unit: second.

path: specifies the directory. It must start with a forward slash (/).

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

oss_bucket_id: specifies the ID of the bucket.

ip_black_list_set: specifies the IP address blacklist.

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

ip_allow_list_set: specifies the IP address whitelist.

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

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

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

error_page: redirects an error page to a specified page.

error_code: specifies the error code.

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

set_req_host_header: modifies the custom header of back-to-origin requests.

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

set_hashkey_args: ignores URL parameters.

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

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

aliauth: configures Alibaba authentication.

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

auth_key1: specifies the primary authentication key. auth_key2: specifies the secondary authentication key.

ali_auth_delta: specifies the custom buffer time for authentication.

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

key: specifies 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: specifies the value of the response header. Enter null if you need to delete the header.

https_force: redirects the original requests from a client to L1 as HTTPS requests.

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

http_force: redirects the original requests from a client to L1 as HTTP requests.

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: authenticates the access to private OSS buckets in L2 back-to-origin requests.

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: specifies the protocol policy that is used to communicate with the origin. Valid values: http, https, and follow.

green_manager: configures pornography detection.

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

tmd_signature: specifies a TMD custom rule.

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

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

pathType: specifies the match mode. Valid values: 0 and 1. A value of 0 indicates a prefix match. A value of 1 indicates an exact match.

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

count: specifies the number of visits from an IP address.

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

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

dynamic: configures the Dynamic Route for CDN (DCDN) service.

enable: specifies whether to enable the service. This parameter is required. Valid values: on and off.

static_route_type: specifies the file extension for static content.

static_route_url: specifies the URI of static content.

static_route_path: specifies the path of static content.

dynamic_route_origin: specifies the protocol policy that is 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: specifies the name of the header.

value: specifies the value of the header.

l2_oss_key: retrieves your content from private OSS buckets.

private_oss_auth: specifies whether to retrieve your content from private OSS buckets. Valid values: on and off.

range: configures object chunking.

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: specifies whether to enable the feature. This parameter is required. Valid values: on and off.

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

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

ali_remove_args: removes URL parameters.

ali_remove_args: specifies the parameters to be removed. The remaining parameters are used as the URL parameters in the hashkey. Separate multiple parameters with spaces. The ali_remove_args parameter is required. keep_oss_args: specifies whether to reserve all the parameters during the back-to-origin process. Valid values: on and off. Specify a value of on to reserve all the parameters. Specify a value of off to reserve only the parameters in the hashkey.

https_tls_version: specifies the version of the Transport Layer Security (TLS) protocol.

tls10: specifies whether to enable TLS 1.0. Valid values: on and off. Default value: on.

tls11: specifies whether to enable TLS 1.1. Valid values: on and off. Default value: on.

tls12: specifies whether to enable TLS 1.2. Valid values: on and off. Default value: on.

tls13: specifies whether to enable TLS 1.3. Valid values: on and off. Default value: off.

HSTS: configures HTTP Strict Transport Security (HSTS).

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

https_hsts_max_age: specifies the validity period of the HSTS policy. This parameter is required. Unit: milliseconds. We recommend that you set the value to 5184000000 milliseconds. This value equals 60 days.

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

filetype_force_ttl_code: specifies an expiration rule for file status codes.

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

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

path_force_ttl_code: specifies an expiration rule for directory status codes.

path: specifies the directory. This parameter is required. It must start with a forward slash (/). Example: /image.

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

gzip: configures HTML optimization.

enable: specifies whether to enable the feature. This parameter is required. Valid values: on and off.

tesla: configures page optimization to accelerate accesses.

enable: specifies whether to enable the feature. This parameter is required. Valid values: on and off.

protogw: configures the IPA service.

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

port: specifies the service port. This parameter is required.

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.xxx.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 code

HttpCode Error code Error message Description
400 InvalidFunctions.Malformed The specified Functions is invalid. The error message returned because the specified Functions parameter is invalid.
400 InvalidArgValue.Malformed The specified ArgValue is invalid. The error message returned because the specified argValue parameter 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 parameter is invalid.
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.