Anda dapat memanggil BatchSetCdnDomainConfig untuk mengonfigurasi beberapa nama domain sekaligus.
Deskripsi operasi
-
Maximum request rate per user: 3 requests per second.
-
After you call BatchSetCdnDomainConfig to configure a feature for a domain, a unique ConfigId is generated. Use this ConfigId to update or delete the configuration. For more information, see Use and query ConfigId.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cdn:BatchSetCdnDomainConfig |
update |
*Domain
|
None |
|
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| DomainNames |
string |
Yes |
Nama domain yang dipercepat (accelerated). Pisahkan beberapa nama domain dengan koma (,). Perhatikan batasan berikut:
|
www.example.com |
| Functions |
string |
Yes |
Daftar fitur. Anda dapat menentukan hingga 50 item dalam satu permintaan. Formatnya adalah sebagai berikut:
Jika parentId diatur ke -1, kondisi aturan yang ada untuk konfigurasi ini akan dihapus.
Contoh tanpa menggunakan parentId: Untuk menambahkan header permintaan HTTP origin menggunakan fitur origin_request_header, gunakan parameter permintaan berikut:
Contoh menggunakan parentId: Untuk menambahkan header permintaan HTTP origin menggunakan fitur origin_request_header dan mereferensikan kondisi aturan dengan configid=222728944812032, gunakan parameter permintaan berikut:
Contoh untuk menghapus referensi parentId dari konfigurasi yang ada: Fitur origin_request_header saat ini mereferensikan kondisi aturan dengan configid=222728944812032. Untuk menghapus referensi ini, gunakan parameter permintaan berikut: |
[{"functionArgs": [{"argName": "key","argValue": "Content-Encoding"},{"argName": "value","argValue": "gzip"}],"functionName": "set_resp_header"} ] |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The ID of the request. |
04F0F334-1335-436C-A1D7-6C044FE73368 |
| DomainConfigList |
object |
||
| DomainConfigModel |
array<object> |
List of domain configurations. |
|
|
object |
|||
| ConfigId |
integer |
The configuration ID. If 0 is returned, the configuration failed. Reconfigure the feature. |
1234567 |
| DomainName |
string |
The domain name. |
www.example.com |
| FunctionName |
string |
The feature name. |
set_resp_header |
Contoh
Respons sukses
JSONformat
{
"RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
"DomainConfigList": {
"DomainConfigModel": [
{
"ConfigId": 1234567,
"DomainName": "www.example.com",
"FunctionName": "set_resp_header"
}
]
}
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 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. | |
| 400 | EdgeScriptCountExceedLimit | The number of rules exceeds the default limit. | |
| 400 | EdgeScripOptionsHasInnerConfig | The extension has a background configuration or a parameter of this configuration is invalid. For more information, submit a ticket. | |
| 400 | EdgeScriptGrammarNotSupport | A background customization rule exists or a parameter of this configuration is invalid. For more information, submit a ticket. | |
| 400 | EdgeScriptNotSupportJs | JavaScript rules are not supported. For more information, submit a ticket. | |
| 400 | ServiceInvokeFailed | Failed to invoke service. | |
| 400 | ConfigParentExceedLimit | Config parent exceed limit. | |
| 400 | Function.InvalidParentId | The specified parentId does not exist. | |
| 400 | BatchSetBusinessError | some configs error:%s | |
| 400 | ConfigDuplicate | Duplicate configuration. This function has already been configured and cannot be added repeatedly. | |
| 400 | FunctionArgError | The function parameter of the domain configuration is incorrect. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.