Membuat aturan perlindungan parameter hotspot untuk permintaan HTTP.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mse:CreateWebFlowRule |
update |
*All Resource
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| Namespace |
string |
No |
Namespace. |
default |
| AppName |
string |
Yes |
Nama aplikasi. |
spring-cloud-a |
| Threshold |
number |
Yes |
Ambang batas. |
20 |
| Enable |
boolean |
No |
Status aturan. Nilai valid:
Valid values:
|
true |
| Resource |
string |
Yes |
Nama antarmuka. Ini adalah Sumber daya aplikasi tempat aturan diterapkan. Nama antarmuka harus sama dengan nama pada halaman detail antarmuka di Konsol. |
/flow |
| Burst |
integer |
No |
Jumlah permintaan tambahan yang diizinkan untuk Trafik burst. Efeknya setara dengan jumlah maksimum token dalam algoritma token bucket. |
0 |
| AppId |
string |
No |
ID aplikasi. |
hkhon1****@c3df23522****** |
| ControlBehavior |
integer |
No |
Metode kontrol aliran. Nilai valid:
Valid values:
|
0 |
| MaxQueueingTimeMs |
integer |
No |
Periode pengatur waktu habis. Unit: milidetik. Parameter ini diperlukan jika ControlBehavior diatur ke 2. |
200 |
| ResourceMode |
integer |
Yes |
Mode Sumber daya. Nilai valid:
Valid values:
|
0 |
| ParamItem |
string |
No |
Deskripsi parameter, yang merupakan string JSON yang berisi pasangan kunci-nilai berikut:
|
{"fieldName":"testKey","matchStrategy":2,"parseStrategy":2,"pattern":"testValue"} |
| MetricType |
integer |
No |
Tipe ambang batas. Nilai valid:
Valid values:
|
1 |
| StatIntervalMs |
integer |
No |
Panjang jendela pengatur waktu. Unit: milidetik. Nilai default: 1000, yang menunjukkan 1 detik. |
1000 |
| RegionId |
string |
No |
ID Wilayah. |
cn-hangzhou |
| ResourceType |
integer |
No |
Tipe Sumber daya. Nilai valid:
Valid values:
|
1 |
| AcceptLanguage |
string |
No |
Bahasa hasil yang akan dikembalikan. Nilai valid: zh (default): Mandarin. en: Inggris. |
zh |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| Message |
string |
The response message. |
OK |
| RequestId |
string |
The request ID. |
A73AC37C-C617-4E3A-8049-372CF49C**** |
| Code |
string |
The response code. |
200 |
| Data |
object |
The response data. |
|
| Namespace |
string |
The namespace. |
default |
| StatIntervalMs |
integer |
The length of the time window. Unit: milliseconds. |
1000 |
| Id |
integer |
The rule ID. |
1 |
| AppName |
string |
The application name. |
spring-cloud-a |
| Resource |
string |
Interface name: the application resources to which the rule applies. The interface name must be the same as that displayed on the API details page in the console. |
/flow |
| ControlBehavior |
integer |
The flow control method. Valid values:
|
0 |
| ReourceMode |
integer |
Resource mode 0: resource name mode |
0 |
| MaxQueueingTimeMs |
integer |
The timeout period for queuing when the ControlBehavior parameter is set to 2. Unit: milliseconds. |
200 |
| Threshold |
number |
The threshold. |
20 |
| Enable |
boolean |
The rule status. Valid values:
|
true |
| AppId |
string |
The application ID. |
hkhon1****@c3df23522****** |
| MetricType |
integer |
The threshold type. Valid values:
|
1 |
| RegionId |
string |
The region ID. |
cn-hangzhou |
| Burst |
integer |
The number of additional requests allowed for burst requests. The effect is equivalent to the maximum number of tokens of the token bucket algorithm. |
0 |
| ParamItem |
string |
The parameter description, which is a JSON string containing the following key-value pairs:
|
{"fieldName":"testKey","matchStrategy":2,"parseStrategy":2,"pattern":"testValue"} |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
Contoh
Respons sukses
JSONformat
{
"Message": "OK",
"RequestId": "A73AC37C-C617-4E3A-8049-372CF49C****",
"Code": "200",
"Data": {
"Namespace": "default",
"StatIntervalMs": 1000,
"Id": 1,
"AppName": "spring-cloud-a",
"Resource": "/flow",
"ControlBehavior": 0,
"ReourceMode": 0,
"MaxQueueingTimeMs": 200,
"Threshold": 20,
"Enable": true,
"AppId": "hkhon1****@c3df23522******",
"MetricType": 1,
"RegionId": "cn-hangzhou",
"Burst": 0,
"ParamItem": "{\"fieldName\":\"testKey\",\"matchStrategy\":2,\"parseStrategy\":2,\"pattern\":\"testValue\"}"
},
"Success": true
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IllegalRequest | Invalid request:%s | Invalid request: %s |
| 400 | InvalidParameter | Parameter error:%s | Request parameter error: %s |
| 500 | InternalError | Console error. Try again later:%s | Console error. Try again later: %s |
| 403 | NoPermission | You are not authorized to perform this operation:%s | You do not have the permission to use this interface:%s |
| 404 | NotFound | Not found:%s | The resource does not exist:%s |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.