Memperbarui aturan pemutusan sirkuit.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mse:UpdateCircuitBreakerRule |
update |
*All Resource
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| Namespace |
string |
Yes |
Namespace layanan mikro tempat aplikasi berada. |
default |
| AppName |
string |
Yes |
Nama aplikasi. |
spring-cloud-a |
| Threshold |
number |
No |
Ambang batas persentase untuk Pemicu pemutusan sirkuit. Nilai valid: 0 hingga 1. Nilai ini mewakili 0% hingga 100%. |
0.8 |
| Enable |
boolean |
No |
Apakah akan mengaktifkan aturan. Nilai valid:
Valid values:
|
true |
| AppId |
string |
No |
ID aplikasi. |
hkhon1po62@c3df23522bXXXXX |
| Strategy |
integer |
No |
Tipe ambang batas. Nilai valid:
Valid values:
|
0 |
| RetryTimeoutMs |
integer |
No |
Periode penerapan pemutusan sirkuit. Unit: milidetik. Jika pemutusan sirkuit diterapkan pada permintaan untuk entri rute, semua panggilan ke entri rute akan gagal selama periode pemutusan sirkuit yang dikonfigurasi. Nilai harus merupakan kelipatan bilangan bulat dari 1.000. Nilai default: 10000. Nilai ini menunjukkan 10 detik. |
10000 |
| StatIntervalMs |
integer |
No |
Panjang jendela pengatur waktu. Unit: milidetik. Nilai valid: 1 detik hingga 120 menit. Nilai default: 20000. Nilai ini menunjukkan 20 detik. |
20000 |
| MaxAllowedRtMs |
integer |
No |
Pengatur waktu tanggapan (RT) maksimum. Unit: milidetik. Jika RT suatu permintaan lebih besar dari nilai parameter ini, permintaan tersebut dihitung sebagai panggilan lambat. Jika Anda menetapkan Strategy ke 0, Anda harus menentukan parameter ini. |
200 |
| MinRequestAmount |
integer |
No |
Jumlah minimum permintaan yang diperlukan untuk Pemicu pemutusan sirkuit. Jika jumlah permintaan dalam jendela pengatur waktu saat ini kurang dari nilai parameter ini, pemutusan sirkuit tidak akan dipicu meskipun aturan pemutusan sirkuit terpenuhi. Nilai default: 10. |
10 |
| HalfOpenBaseAmountPerStep |
integer |
No |
Jumlah minimum permintaan yang dapat diteruskan di setiap langkah setelah pemutusan sirkuit pulih. Nilai default: 1. |
5 |
| HalfOpenRecoveryStepNum |
integer |
No |
Jumlah langkah pemulihan pemutusan sirkuit. Nilai default: 1. |
1 |
| RuleId |
integer |
Yes |
ID aturan. |
1 |
| AcceptLanguage |
string |
No |
Bahasa tanggapan. Nilai valid: zh-CN dan en-US. Nilai default: zh-CN. Nilai zh-CN menunjukkan bahasa Tionghoa, dan nilai en-US menunjukkan bahasa Inggris. |
zh |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| Message |
string |
The returned message. |
OK |
| RequestId |
string |
The request ID. |
EE5C32A1-BC0E-4B79-817C-103E4EDF**** |
| Code |
string |
The response code. |
200 |
| Data |
object |
The details of the rule. |
|
| Namespace |
string |
The microservice namespace to which the application belongs. |
default |
| Id |
integer |
The ID of the rule. |
1 |
| AppName |
string |
The name of the application. |
spring-cloud-a |
| Resource |
string |
The name of the interface to which the rule is applicable. The interface name must be the same as the name on the interface details page in the console. |
/a |
| Strategy |
integer |
The threshold type. Valid values:
Valid values:
|
0 |
| Threshold |
number |
A percentage threshold for triggering circuit breaking. Valid values: 0-1. These values represent 0% to 100%. |
0.8 |
| Enable |
boolean |
Indicates whether the rule is enabled. |
true |
| RetryTimeoutMs |
integer |
The period in which circuit breaking is implemented. Unit: milliseconds. If circuit breaking is implemented on the requests for the route, the calls to all the requests for the route fail in the configured circuit breaking period. |
10000 |
| StatIntervalMs |
integer |
The length of the time window. Unit: milliseconds. The valid range is from 1 second to 120 minutes. |
20000 |
| AppId |
string |
The ID of the application. |
hkhon1po62@c3df23522bXXXXX |
| MaxAllowedRtMs |
integer |
The maximum RT. Unit: milliseconds. If the RT of a request is greater than the value of this parameter, a slow call is counted. If you set Strategy to 0, you must specify this parameter. |
200 |
| MinRequestAmount |
integer |
The minimum number of requests to trigger circuit breaking. If the number of requests in the current time window is less than the value of this parameter, circuit breaking is not triggered even if the circuit breaking rule is met. |
10 |
| HalfOpenBaseAmountPerStep |
integer |
The minimum number of requests that can be passed in each step after circuit breaking recovers. |
5 |
| HalfOpenRecoveryStepNum |
integer |
The number of circuit breaking recovery steps. |
1 |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
Valid values:
|
true |
Contoh
Respons sukses
JSONformat
{
"Message": "OK",
"RequestId": "EE5C32A1-BC0E-4B79-817C-103E4EDF****",
"Code": "200",
"Data": {
"Namespace": "default",
"Id": 1,
"AppName": "spring-cloud-a",
"Resource": "/a",
"Strategy": 0,
"Threshold": 0.8,
"Enable": true,
"RetryTimeoutMs": 10000,
"StatIntervalMs": 20000,
"AppId": "hkhon1po62@c3df23522bXXXXX",
"MaxAllowedRtMs": 200,
"MinRequestAmount": 10,
"HalfOpenBaseAmountPerStep": 5,
"HalfOpenRecoveryStepNum": 1
},
"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.