All Products
Search
Document Center

Microservices Engine:ListCircuitBreakerRules

Last Updated:Aug 12, 2024

Queries a list of circuit breaking rules.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
mse:ListCircuitBreakerRuleslist
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
NamespacestringYes

The microservice namespace to which the application belongs.

default
AppNamestringYes

The name of the application.

spring-cloud-a
ResourceSearchKeystringNo

This parameter is used for fuzzy match of circuit breaking rules.

a
AppIdstringNo

The ID of the application.

hkhon1po62@c3df23522bXXXXX
ResourcestringNo

This parameter is used for exact match of circuit breaking rules.

/a
PageIndexintegerNo

The start page of the returned pages. Default value: 1.

1
PageSizeintegerNo

The number of entries per page. Default value: 6.

10
AcceptLanguagestringNo

The language of the response. Valid values: zh-CN and en-US. Default value: zh-CN. The value zh-CN indicates Chinese, and the value en-US indicates English.

zh

Response parameters

ParameterTypeDescriptionExample
object
Codeinteger

The response code.

200
Messagestring

The returned message.

OK
RequestIdstring

The request ID.

4E9FDCFE-0738-493B-B801-82BDFBCB****
Successboolean

Indicates whether the request was successful.

true
Dataobject

The details of the rule.

Resultarray<object>

The returned result.

object
Namespacestring

The microservice namespace to which the application belongs.

default
RuleIdlong

The ID of the rule.

1
AppNamestring

The name of the application.

spring-cloud-a
Resourcestring

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
Strategyinteger

The threshold type.

Valid values:

  • 0

    :

    slow call proportion

  • 1

    :

    abnormal proportion

0
Thresholdfloat

A percentage threshold for triggering circuit breaking. Valid values: 0-1. These values represent 0% to 100%.

0.8
Enableboolean

Indicates whether the rule was enabled.

true
RetryTimeoutMsinteger

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
StatIntervalMsinteger

The length of the time window. Unit: milliseconds. The valid range is from 1 second to 120 minutes.

20000
AppIdstring

The ID of the application.

hkhon1po62@c3df23522bXXXXX
RegionIdstring

The region in which the instance resides.

cn-hangzhou
FallbackObjectstring

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}"
MaxAllowedRtMsinteger

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
MinRequestAmountinteger

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
HalfOpenBaseAmountPerStepinteger

The minimum number of requests that can be passed in each step after circuit breaking recovers.

5
HalfOpenRecoveryStepNuminteger

The number of circuit breaking recovery steps.

1
PageNumberinteger

The page number.

1
PageSizeinteger

The number of entries per page.

10
TotalSizeinteger

The total number of pages.

3
HttpStatusCodeinteger

The HTTP status code.

200

Examples

Sample success responses

JSONformat

{
  "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": 0,
        "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
}

Error codes

HTTP status codeError codeError messageDescription
400IllegalRequestInvalid request:%sInvalid request: %s
400InvalidParameterParameter error:%sRequest parameter error: %s
403NoPermissionYou are not authorized to perform this operation:%sYou do not have the permission to use this interface:%s
404NotFoundNot found:%sThe resource does not exist:%s
500InternalErrorConsole error. Try again later:%sConsole error. Try again later: %s

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-12-19The response structure of the API has changedView Change Details