Membuat skrip.
Deskripsi operasi
Prerequisites
You have created a standard edition or WAF-enhanced edition ALB instance. For more information, see CreateLoadBalancer.
Usage
CreateAScripts is an asynchronous operation. After you send a request, the system returns a request ID, but the programmable script is not created immediately because the creation task runs in the background. You can call ListAScripts to query the creation status of the programmable script:
-
If the programmable script is in the Creating state, it is being created.
-
If the programmable script is in the Available state, it has been created.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
alb:CreateAScripts |
create |
*LoadBalancer
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| ClientToken |
string |
No |
Token klien yang digunakan untuk memastikan idempotensi permintaan. Anda dapat menggunakan klien untuk menghasilkan nilai, tetapi Anda harus memastikan nilai tersebut unik di antara permintaan yang berbeda. Token hanya dapat berisi karakter ASCII. |
5A2CFF0E-5718-45B5-9D4D-70B****** |
| DryRun |
boolean |
No |
Apakah akan menjalankan dry run. Nilai valid:
|
false |
| ListenerId |
string |
Yes |
ID Pendengar daftar. |
lsn-6hfq3zs0x04ibn**** |
| AScripts |
array<object> |
No |
AScripts yang akan dibuat. |
|
|
array<object> |
No |
An AScript configuration. |
||
| AScriptName |
string |
Yes |
The name of the AScript. The name must be 2 to 128 characters long, and must start with a letter, a digit, or a Chinese character. It can contain digits, periods (.), underscores (_), hyphens (-), and spaces. |
test |
| Position |
string |
No |
Specifies when the AScript is executed. Valid values:
|
RequestFoot |
| Enabled |
boolean |
No |
Specifies whether the AScript is enabled. Valid values:
|
false |
| ScriptContent |
string |
Yes |
The content of the AScript. |
if and(match_re($uri, '^/1.txt$'), $arg_type) { rewrite(concat('/1.', $arg_type), 'break') } |
| ExtAttributes |
array<object> |
No |
The extended attributes. |
|
|
object |
No |
|||
| AttributeKey |
string |
No |
The attribute key. The only valid value is EsDebug. If a request contains the _es_dbg parameter and its value matches the secret key specified in AttributeValue, the system adds a debug header to the response, which contains rule execution logs. |
EsDebug |
| AttributeValue |
string |
No |
The attribute value, which is used as the secret key for the EsDebug attribute. The value must be 1 to 128 characters long and can contain uppercase letters, lowercase letters, and digits. |
test123 |
| ExtAttributeEnabled |
boolean |
No |
Specifies whether to enable extended attributes for the AScript. Valid values:
|
true |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The response data. |
||
| JobId |
string |
The ID of the asynchronous task. |
5c607642-535e-4e06-9d77-df53049b**** |
| RequestId |
string |
The ID of the request. |
BF0FE763-9603-558F-A55B-0F4****** |
| AScriptIds |
array<object> |
A list of programmable script IDs. |
|
|
object |
The programmable script ID. |
||
| AScriptId |
string |
The ID of the programmable script. |
as-xvq5igaa7uv6vr**** |
Contoh
Respons sukses
JSONformat
{
"JobId": "5c607642-535e-4e06-9d77-df53049b****",
"RequestId": "BF0FE763-9603-558F-A55B-0F4******",
"AScriptIds": [
{
"AScriptId": "as-xvq5igaa7uv6vr****"
}
]
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IncorrectStatus.Listener | The status of %s [%s] is incorrect. | |
| 400 | ResourceQuotaExceeded.AScriptsNum | The quota of %s is exceeded for resource %s, usage %s/%s. | |
| 400 | ResourceQuotaExceeded.AScriptsTotalLinesNum | The quota of %s is exceeded for resource %s, usage %s/%s. | |
| 400 | ResourceQuotaExceeded.AScriptLinesNum | The quota of %s is exceeded for resource %s, usage %s/%s. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.