All Products
Search
Document Center

BatchSetDcdnDomainConfigs

Last Updated: Mar 01, 2019

Description

You can call this operation to batch configure domain name functions.

Request parameters

Name Type Required Description
Action String Yes The operation that you want to perform. Set the value to BatchSetDcdnDomainConfigs.
DomainNames String Yes The domain names. The domain names must be separated by half-width commas (,).
Functions Json Yes The list of functions.

Functions

  • The format for Functions is as follows: [{"functionArgs":[{"argName":"domain_name","argValue":"home.1sapp.com"}],"functionName":"set_req_host_header"}].

  • You can set certain functions, such as filetype_based_ttl_set, in multiple configuration records. To update one of the configuration records, use the configId to identify that record. For example, one configuration record for the filetype_based_ttl_set function is described as follows: [{"functionArgs":[{"argName":"file_type","argValue":"jpg"},{"argName":"ttl","argValue":"18"},{"argName":"weight","argValue":"30"}],"functionName":"filetype_based_ttl_set","configId":5068995}].

Functions

The type of parameter values is string.

Function name Parameter description
referer_white_list_set: Specifies and enables the referer whitelist.
  • refer_domain_allow_list: The whitelist of domain names, which are separated with commas (,).
  • allow_empty: Indicates whether an empty referer is allowed.
  • Valid values: on and off.
referer_black_list_set: Specifies and enables the referer blacklist.
  • refer_domain_deny_list: The blacklist of domain names, which are separated with commas (,).
  • allow_empty: Indicates whether an empty referer is allowed.
  • Valid values: on and off.
filetype_based_ttl_set: Specifies the expiration time of files.
  • ttl: The expiration time of the cached content. Unit: second.
  • file_type: The file type. You can specify multiple file types. The specified file types must be separated with commas (,), for example, txt,jpg.
  • weight: The weight.
  • Valid values: 1 to 199.
path_based_ttl_set: Specifies the expiration time of the path.
  • ttl: The expiration time of the cached content. Unit: second.
  • path: The path, which must start with a forward slash (/).
  • weight: The weight.
  • Valid values: 1 to 99.
oss_auth: Specifies the bucket that requires OSS authentication. oss_bucket_id: The address of your bucket.
ip_black_list_set: Specifies the IP blacklist. ip_list: The list of IP addresses, which are separated with commas (,).
ip_allow_list_set: Specifies the IP whitelist. ip_list: The list of IP addresses, which are separated with commas (,).
ip_white_list_set: Specifies the list of IP addresses that are not blocked by the TMD system. ip_list: The list of IP addresses, which are separated with commas (,).
error_page: Specifies the page that the error page is to be redirected.
  • error_code: The error code.
  • rewrite_page: The page that the error page is to be redirected.
set_req_host_header: Modifies the custom header of the origin host. domain_name: The header of the origin host.
set_hashkey_args: Ignores URL parameters.
  • hashkey_args: The list of reserved parameters, which are separated with commas (,).
  • disable: Indicates whether to enable all parameters. The value “on” indicates that all parameters are ignored, and the value “off” indicates that none of the parameters are ignored.
aliauth: Enables Alibaba authentication and specifies the authentication type.
  • auth_type: The authentication type.
  • Valid values: no_auth, type_a, type_b, and type_c.
  • auth_key1: The authentication key. Valid values: specified by users. auth_key2: The authentication key. Valid values: specified by users.
  • ali_auth_delta: The custom buffer time of authentication.
set_resp_header: Specifies the response header (visible to the browser).
  • key: The response header.
  • value: The content of the response header. Enter “null” when you want to delete the header.
https_force: Enables forced redirect to HTTPS.
  • enable: Indicates whether to enable forced redirect to HTTPS.
  • Valid values: on and off.
http_force: Enables forced redirect to HTTP.
  • enable: Indicates whether to enable forced redirect to HTTP.
  • Valid values: on and off.
https_option: Specifies HTTPS basic parameters.
  • http2: Indicates whether to enable HTTP/2 support.
  • Valid values: on and off.
l2_oss_key: Enables the private key authentication to access an OSS bucket in an L2 origin fetch request.
  • private_oss_auth: Indicates whether the authentication is enabled to access a private OSS bucket in an L2 origin fetch request.
  • Valid values: on and off.
forward_scheme: Specifies the protocol of the origin.
  • enable: Indicates whether to enable the function.
  • Valid values: on and off.
  • scheme_origin: The protocol of the origin. Valid values: http, https, and follow.
green_manager: Enables pornographic image detection.
  • enable: Indicates whether to enable pornographic image detection.
  • Valid values: on and off.
tmd_signature: Specifies TMD custom rules.
  • name: The name of the rule. It must be unique in the domain name.
  • path: The URI path. You can specify duplicate URI paths. You must check their validity.
  • pathType: The matching rule. Valid values: 0 for prefix match and 1 for exact match.
  • interval: The interval during which the data is monitored, measured in 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 block and 1 for man-machine identification. Man-machine identification means that the user is redirected back to the requested page after the user is verified.
  • ttl: The specified time period to block access. Unit: second.
dynamic: Specifies DCDN settings.
  • enable: Indicates whether to enable the service. You must specify this parameter. 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 of the origin. Valid values: http, https, and follow.
set_req_header: Specifies the custom HTTP header for the origin fetch request.
  • key: The header for the origin fetch request.
  • value: The content of the header for the origin fetch request.
range: Enables origin fetch based on HTTP range requests. enable: Indicates whether to enable the function. Valid values: on and off.
video_seek: Enables the seeking feature. enable: Indicates whether to enable the feature. Valid values: on and off.

Response parameters

Name Type Description
RequestId String The ID of the request.

Examples

Sample requests

  1. http://dcdn.aliyuncs.com/?Action=BatchSetDcdnDomainConfigs
  2. &DomainName=www.macaron.org.cn,xxx.org.com
  3. &Functions=[{"functionArgs":[{"argName":"domain_name","argValue":"home.1sapp.com"}],"functionName":"set_req_host_header"}]
  4. &<Common request parameters>

Sample responses

JSON format

  1. {
  2. "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368"
  3. }

Error codes

Error code Error message HTTP status code Description
InvalidFunctions.Malformed Specified Functions is malformed. 400 The error message returned when the specified Functions is invalid.
InvalidFunctionName.ValueNotSupported FunctionName %s is not supported. 400 The error message returned when the specified FunctionName is invalid. The symbol “%s” stands for the function name.
InvalidArgName.ValueNotSupported ArgName %s is not supported. 400 The error message returned when the specified ArgName is invalid. The symbol “%s” stands for the parameter name.
InvalidArgValue.Malformed Specified ArgValue is malformed. 400 The error message returned when the specified ArgValue is invalid.