Membuat aturan pembatasan kecepatan.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mse:CreateFlowRule |
create |
*All Resource
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| Namespace |
string |
Yes |
Namespace. |
default |
| AppName |
string |
Yes |
Nama aplikasi. |
spring-cloud-a |
| Threshold |
integer |
Yes |
Ambang batas pembatasan kecepatan. |
20 |
| Enable |
boolean |
Yes |
Apakah akan mengaktifkan aturan. Valid values:
|
false |
| Resource |
string |
Yes |
Nama Sumber daya antarmuka. |
/b |
| AppId |
string |
No |
ID aplikasi. |
ib09eblv6p@c3df23522****** |
| ControlBehavior |
integer |
No |
Efek pembatasan kecepatan. Valid values:
|
0 |
| MaxQueueingTimeMs |
integer |
No |
Periode waktu habis. Unit: milidetik. Parameter ini diperlukan jika parameter ControlBehavior diatur ke 2. |
10 |
| RegionId |
string |
No |
Wilayah tempat kluster berada. |
cn-hangzhou |
| ResourceType |
integer |
No |
Tipe Sumber daya antarmuka. |
1 |
| LimitApp |
string |
No |
Aplikasi sumber permintaan. |
spring-cloud-a |
| AcceptLanguage |
string |
No |
Bahasa tanggapan. Nilai valid:
|
zh |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| Message |
string |
The returned message. |
请求处理成功 |
| RequestId |
string |
The request ID. |
69AD2AA7-DB47-449B-941B-B14409DF**** |
| Code |
string |
The response code. |
200 |
| Data |
object |
The data returned. |
|
| Namespace |
string |
The namespace. |
default |
| Id |
integer |
The ID. |
12 |
| AppName |
string |
The name of the application. |
spring-cloud-a |
| Resource |
string |
The interface resource name. |
app |
| ControlBehavior |
integer |
The throttling effect. Valid values:
|
0 |
| MaxQueueingTimeMs |
integer |
The timeout period for queuing when the ControlBehavior parameter is set to 2. Unit: milliseconds. |
500 |
| Threshold |
number |
The throttling threshold. |
200 |
| Enable |
boolean |
Indicates whether the rule is enabled. Valid values:
|
true |
| AppId |
string |
The application ID. |
hkhon1po62@54e1f42f3****** |
| RegionId |
string |
The region of the gateway. |
cn-hangzhou |
| LimitApp |
string |
The source application of the request. |
spring-cloud-a |
| Success |
boolean |
The result of the request. Valid values:
|
true |
Contoh
Respons sukses
JSONformat
{
"Message": "请求处理成功",
"RequestId": "69AD2AA7-DB47-449B-941B-B14409DF****",
"Code": "200",
"Data": {
"Namespace": "default",
"Id": 12,
"AppName": "spring-cloud-a",
"Resource": "app",
"ControlBehavior": 0,
"MaxQueueingTimeMs": 500,
"Threshold": 200,
"Enable": true,
"AppId": "hkhon1po62@54e1f42f3******",
"RegionId": "cn-hangzhou",
"LimitApp": "spring-cloud-a"
},
"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.