Configures multiple accelerated domain names at a time.
Operation Description
- You can specify multiple domain names and must separate them with commas (,). You can specify up to 50 domain names in each call.
- If the BatchSetCdnDomainConfig operation is successful, a unique configuration ID (ConfigId) is generated. You can use configuration IDs to update or delete configurations. For more information, see Usage notes on ConfigId.
Authorization information
The following table is the authorization information corresponding to the API, which can be found in the RAM permission policy statement.Action
Used in the element to grant the RAM user or RAM role permission to call this API. The specific instructions are as follows:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All resources
is used in the Resource type column of the operation.
- Condition keyword: refers to the condition keyword defined by the cloud product itself.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operate | access level | Resource type | conditional keyword | Association operation |
---|---|---|---|---|
cdn:BatchSetCdnDomainConfig | WRITE |
|
|
without |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DomainNames | string | Yes |
The accelerated domain name. Separate multiple accelerated domain names with commas (,). |
www.example.com |
Functions | string | Yes |
The features that you want to configure. Format:
If you set parentId to -1, the existing rule conditions in the configurations are deleted.
The following code shows a sample configuration if parentId is not used. In this example, the origin_request_header feature is used to add back-to-origin HTTP headers, and the rule condition whose configuration ID is 222728944812032 is referenced.
The following code shows a sample configuration if parentId is used. In this example, the origin_request_header feature is used to add back-to-origin HTTP headers, and the rule condition whose configuration ID is 222728944812032 is referenced.
|
[{"functionArgs": [{"argName": "key","argValue": "Content-Encoding"},{"argName": "value","argValue": "gzip"}],"functionName": "set_resp_header"} ] |
Response parameters
Example
Normal return example
JSON
Format
{
"RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
"DomainConfigList": {
"DomainConfigModel": [
{
"ConfigId": 1234567,
"DomainName": "www.example.com",
"FunctionName": "set_resp_header"
}
]
}
}
Error codes
Http code | Error code | Error message |
---|---|---|
400 | InvalidFunctions.Malformed | The specified Functions is incorrectly formatted. |
400 | InvalidArgValue.Malformed | The specified ArgValue is invalid. |
400 | Invalid%s.ValueNotSupported | [%s] is not supported. |
400 | Invalid%s.Malformed | The specified ArgValue [%s] is invalid. |
400 | MissingParameter%s | The specified value of ArgName[%s] is missing. |
400 | InvalidFunctionArgs.Malformed | The specified FunctionArgs is invalid. |
400 | MissingParameter | The specified ArgValue is missing. |
400 | InvalidHeaderKey.ValueNotSupported | The specified value of parameter HeaderKey is not supported. |
400 | TooManyDomains | The count of domain is over 50. |
400 | InvalidRule.Malformed | %s |
400 | ConfigurationConflicts | The staging environment has a configuration in effect and cannot modify the production environment configuration. |
400 | InvalidFunction.NotSupported | The domain is not supported to set the function. |
400 | InvalidDomain.BelongToConfigGroup | This Domain activated in configuration group and should modify by config group. |
400 | EntityNotExist.Role | EntityNotExist.Role |
400 | MissingParameterFunctions | The specified value of Functions is missing. |
400 | NoPermission.SLR | The current user does not have permission to create servicelinkedrole. Please contact the Alibaba Cloud account or administrator to authorize AliyunCDNFullAccess or custom policy:Service Name:cdn-ddos.cdn.aliyuncs.com,Role: AliyunServiceRoleForCDNAccessingDDoS,Permission: ram: CreateServiceLinkedRole |
400 | ConfigExceedLimit | Count of config entries exceeds the limit. |
For a list of error codes, visit the API error center.