Gunakan BatchSetCdnDomainConfig untuk menerapkan konfigurasi batch ke nama domain.
Deskripsi operasi
Frekuensi pemanggilan dibatasi hingga 3 permintaan per detik per pengguna.
Anda dapat mengonfigurasi hingga 50 nama domain dalam satu permintaan. Pisahkan nama domain dengan koma.
Saat memanggil
BatchSetCdnDomainConfiguntuk mengonfigurasi fitur pada nama domain, sistem akan menghasilkanConfigIdunik. GunakanConfigIdini untuk memperbarui atau menghapus konfigurasi tersebut. Untuk informasi selengkapnya, lihat 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 untuk dikonfigurasi. Pisahkan beberapa nama domain dengan koma. Perhatikan batasan berikut:
|
www.example.com |
| Functions |
string |
Yes |
String berformat JSON yang berisi array konfigurasi fungsi. Anda dapat menentukan hingga 50 konfigurasi dalam satu permintaan. Setiap objek konfigurasi berisi bidang-bidang berikut:
Jika Anda mengatur parentId ke -1, asosiasi dengan kondisi aturan yang ada akan dihapus. Contoh konfigurasi tanpa menggunakan parentId: Contoh berikut menggunakan fungsi origin_request_header untuk menambahkan Header permintaan HTTP origin: Contoh konfigurasi menggunakan parentId: Untuk menambahkan Header permintaan HTTP origin dan mengaitkannya dengan kondisi aturan configid=222728944812032, gunakan parameter permintaan berikut: Untuk menghapus referensi ke kondisi aturan configid=222728944812032 dari konfigurasi origin_request_header yang sudah ada, 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 |
ID permintaan. |
04F0F334-1335-436C-A1D7-6C044FE73368 |
| DomainConfigList |
object |
|
|
| DomainConfigModel |
array<object> |
Daftar konfigurasi domain. |
|
|
object |
|
||
| ConfigId |
integer |
ID konfigurasi. Nilai |
1234567 |
| DomainName |
string |
Nama domain. |
www.example.com |
| FunctionName |
string |
Nama fungsi. |
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.