Consulte les règles de disjoncteur.
Testez maintenant
Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale. Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale.
Test
Autorisation RAM
|
mse:ListCircuitBreakerRules |
list |
*All Resource
|
Aucune | Aucune |
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| Namespace |
string |
Oui |
L'espace de noms de microservice auquel l'application appartient. |
default |
| AppName |
string |
Oui |
Le nom de l'application. |
spring-cloud-a |
| ResourceSearchKey |
string |
Non |
Le mot-clé d'interface dans la règle de protection. |
a |
| AppId |
string |
Non |
L'identifiant de l'application. |
hkhon1po62@c3df23522bXXXXX |
| Resource |
string |
Non |
L'interface pour laquelle la règle de protection est configurée. |
/a |
| PageIndex |
integer |
Non |
Le numéro de la première page. Valeur par défaut : 1. |
1 |
| PageSize |
integer |
Non |
Le nombre d'entrées par page. Valeur par défaut : 6. |
10 |
| AcceptLanguage |
string |
Non |
La langue dans laquelle les résultats doivent être affichés. Valeurs valides : zh-CN (valeur par défaut) : chinois. en-US : anglais. |
zh |
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
|
object |
|||
| Code |
integer |
Le code de réponse. |
200 |
| Message |
string |
Le message de réponse. |
OK |
| RequestId |
string |
L'identifiant de la requête. |
4E9FDCFE-0738-493B-B801-82BDFBCB**** |
| Success |
boolean |
Le résultat de la requête. |
true |
| Data |
object |
Les règles. |
|
| Result |
array<object> |
Le résultat renvoyé. |
|
|
object |
|||
| Namespace |
string |
The microservice namespace to which the application belongs. |
default |
| RuleId |
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 applies. The interface name must be the same as that displayed on the API Details page in the console. |
/a |
| ResourceType |
integer |
The interface resource type. |
1 |
| Strategy |
integer |
The threshold type. Valeurs valides :
|
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 resources, all requests quickly fail in the configured duration. |
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 |
| RegionId |
string |
The region in which the cluster resides. |
cn-hangzhou |
| FallbackObject |
string |
The behavior that was bound to the rule. |
"{\"appName\":\"spring-cloud-a\",\"fallbackBehavior\":{\"webFallbackMode\":0,\"webRespContentType\":0,\"webRespMessage\":\"Blocked\",\"webRespStatusCode\":429},\"id\":977,\"name\":\"Fallback\",\"namespace\":\"default\",\"resourceClassification\":1}" |
| 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 |
| PageNumber |
integer |
Le numéro de la première page. |
1 |
| PageSize |
integer |
Le nombre d'entrées par page. |
10 |
| TotalSize |
integer |
Le nombre total de pages. |
3 |
| HttpStatusCode |
integer |
Le code d'état HTTP. |
200 |
Exemples
JSON format
{
"Code": 200,
"Message": "OK",
"RequestId": "4E9FDCFE-0738-493B-B801-82BDFBCB****",
"Success": true,
"Data": {
"Result": [
{
"Namespace": "default",
"RuleId": 1,
"AppName": "spring-cloud-a",
"Resource": "/a",
"ResourceType": 1,
"Strategy": 0,
"Threshold": 0.8,
"Enable": true,
"RetryTimeoutMs": 10000,
"StatIntervalMs": 20000,
"AppId": "hkhon1po62@c3df23522bXXXXX",
"RegionId": "cn-hangzhou",
"FallbackObject": "\"{\\\"appName\\\":\\\"spring-cloud-a\\\",\\\"fallbackBehavior\\\":{\\\"webFallbackMode\\\":0,\\\"webRespContentType\\\":0,\\\"webRespMessage\\\":\\\"Blocked\\\",\\\"webRespStatusCode\\\":429},\\\"id\\\":977,\\\"name\\\":\\\"Fallback\\\",\\\"namespace\\\":\\\"default\\\",\\\"resourceClassification\\\":1}\"",
"MaxAllowedRtMs": 200,
"MinRequestAmount": 10,
"HalfOpenBaseAmountPerStep": 5,
"HalfOpenRecoveryStepNum": 1
}
],
"PageNumber": 1,
"PageSize": 10,
"TotalSize": 3
},
"HttpStatusCode": 200
}
Codes d'erreur
|
Code de statut HTTP |
Code d'erreur |
Message d'erreur |
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 |
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.