Updated on 2025-08-15 GMT+08:00

BreakerContent

Table 1 BreakerContent

Parameter

Mandatory

Type

Description

scope

No

String

Circuit breaker plug-in type. Options:

  • basic: APIs bound with the plug-in are calculated separately for circuit breaker triggering.
  • share: APIs bound with the plug-in are calculated together for circuit breaker triggering.

breaker_condition

Yes

PluginBreakerCondition object

Circuit breaker plug-in condition.

downgrade_default

No

PluginBreakerDowngradeInfo object

Backend definition for the downgrade policy of the circuit breaker plug-in.

downgrade_parameters

No

Array of PluginCommonParameter objects

Circuit breaker rule parameters.

downgrade_rules

No

Array of PluginBreakerDowngradeRule objects

Downgrade rules of the circuit breaker.

Table 2 PluginBreakerDowngradeRule

Parameter

Mandatory

Type

Description

rule_name

Yes

String

Circuit breaker rule name.

match_regex

Yes

String

Circuit breaker rule expression. For details, see the rule expression description.

breaker_condition

No

PluginBreakerCondition object

Circuit breaker plug-in condition.

downgrade_backend

No

PluginBreakerDowngradeInfo object

Backend definition for the downgrade policy of the circuit breaker plug-in.

parameters

No

Array of PluginCommonParameter objects

Circuit breaker rule parameters.

Table 3 PluginBreakerCondition

Parameter

Mandatory

Type

Description

breaker_type

Yes

String

Circuit breaker type. Options:

  • timeout: Backend timeout circuit breaker.
  • condition: Backend condition-based circuit breaker.

breaker_mode

No

String

Circuit breaker condition type. Options:

  • counter
  • percentage

unhealthy_condition

No

String

Rule expression. For details, see the rule expression description.

unhealthy_threshold

No

Integer

Number of requests to trigger unhealthy conditions. This parameter is required when breaker_mode is set to counter.

min_call_threshold

No

Integer

Minimum number of requests to trigger the circuit breaker. This parameter is required when breaker_mode is set to percentage.

unhealthy_percentage

No

Integer

Minimum percentage of unhealthy conditions to trigger the circuit breaker. This parameter is required when breaker_mode is set to percentage.

time_window

Yes

Integer

Time window for determining the number of unhealthy times. The unit is second.

open_breaker_time

Yes

Integer

Duration for which the circuit breaker is on. The unit is second.

Table 4 PluginBreakerDowngradeInfo

Parameter

Mandatory

Type

Description

type

Yes

String

Circuit breaker downgrade type: http, http_vpc, function, mock, or passthrough. Options:

  • http: HTTP backend.
  • http_vpc: HTTP load balancer.
  • function: function backend.
  • mock: Mock backend.
  • passthrough: passthrough parameters.

http_info

No

PluginBreakerDowngradeHttpInfo object

HTTP backend definition for the downgrade policy of the circuit breaker plug-in.

http_vpc_info

No

PluginBreakerDowngradeHttpVpcInfo object

HTTP backend load balancing definition for the downgrade policy of the circuit breaker plug-in.

func_info

No

PluginBreakerDowngradeFunctionInfo object

Function backend definition for the downgrade policy of the circuit breaker plug-in.

mock_info

No

PluginBreakerDowngradeMockInfo object

Mock backend definition for the downgrade policy of the circuit breaker plug-in.

passthrough_infos

No

Array of PluginBreakerDowngradePassthroughInfo objects

This parameter is required when the circuit breaker downgrade type is set to "passthrough".

Table 5 PluginBreakerDowngradeHttpInfo

Parameter

Mandatory

Type

Description

address

Yes

String

Backend service address.

It consists of a domain name or IP address and a port number. Maximum length: 255 characters. It must be in the format "Host name:Port number", for example, apig.example.com:7443. If the port number is not specified, the default HTTPS port 443 or the default HTTP port 80 is used.

scheme

Yes

String

Request protocol. Options:

  • HTTP
  • HTTPS

method

Yes

String

Request method. Options:

  • GET
  • POST
  • PUT
  • DELETE
  • HEAD
  • PATCH
  • OPTIONS
  • ANY

path

Yes

String

Request address. The request path can contain a maximum of 512 characters with request parameters enclosed in braces ({}), for example, /getUserInfo/{userId}, and these special characters: */%-_.

NOTE:

The value of this parameter must comply with URI specifications.

timeout

Yes

Integer

Timeout allowed for requesting the backend service. You can set the maximum timeout using the backend_timeout configuration item. The maximum value is 600,000.

Unit: ms.

Table 6 PluginBreakerDowngradeHttpVpcInfo

Parameter

Mandatory

Type

Description

vpc_channel_id

Yes

String

Load balance channel ID.

scheme

Yes

String

Request protocol. Options:

  • HTTP
  • HTTPS

method

Yes

String

Request method.

path

Yes

String

Request address. The request path can contain a maximum of 512 characters with request parameters enclosed in braces ({}), for example, /getUserInfo/{userId}, and these special characters: */%-_.

NOTE:

The value of this parameter must comply with URI specifications.

timeout

Yes

Integer

Timeout allowed for requesting the backend service. You can set the maximum timeout using the backend_timeout configuration item. The maximum value is 600,000.

Unit: ms.

Table 7 PluginBreakerDowngradeFunctionInfo

Parameter

Mandatory

Type

Description

function_urn

Yes

String

Function URN.

version

No

String

Version. Either alias or version must be set.

alias_urn

No

String

Alias. Either alias or version must be set.

invocation_type

Yes

String

Invocation mode. Options:

  • async: asynchronous
  • sync: synchronous

timeout

Yes

Integer

Timeout allowed for requesting the backend service. You can set the maximum timeout using the backend_timeout configuration item. The maximum value is 600,000.

Unit: ms.

Table 8 PluginBreakerDowngradeMockInfo

Parameter

Mandatory

Type

Description

status_code

Yes

String

HTTP status code for the Mock backend. Options:

  • 200: OK
  • 201: Created
  • 202: Accepted
  • 203: NonAuthoritativeInformation
  • 204: NoContent
  • 205: ResetContent
  • 206: PartialContent
  • 300: MultipleChoices
  • 301: MovedPermanently
  • 302: Found
  • 303: SeeOther
  • 304: NotModified
  • 305: UseProxy
  • 306: Unused
  • 307: TemporaryRedirect
  • 400: BadRequest
  • 401: Unauthorized
  • 402: PaymentRequired
  • 403: Forbidden
  • 404: NotFound
  • 405: MethodNotAllowed
  • 406: NotAcceptable
  • 407: ProxyAuthenticationRequired
  • 408: RequestTimeout
  • 409: Conflict
  • 410: Gone
  • 411: LengthRequired
  • 412: PreconditionFailed
  • 413: RequestEntityTooLarge
  • 414: RequestURITooLong
  • 415: UnsupportedMediaType
  • 416: RequestedRangeNotSatisfiable
  • 417: ExpectationFailed
  • 450: ParameterRequried
  • 451: MethodConnectException
  • 500: InternalServerError
  • 501: NotImplemented
  • 502: BadGateway
  • 503: ServiceUnavailable
  • 504: GatewayTimeout
  • 505: HTTPVersionNotSupported

result_content

No

String

Response body.

headers

No

Array of PluginBreakerDowngradeMockHeader objects

Mock response header.

Table 9 PluginBreakerDowngradeMockHeader

Parameter

Mandatory

Type

Description

key

No

String

Response header name.

value

Yes

String

Response header value.

Table 10 PluginBreakerDowngradePassthroughInfo

Parameter

Mandatory

Type

Description

location

No

String

Parameter location: header, query, or path.

name

Yes

String

Parameter name.

Start with a letter and include only letters, digits, hyphens (-), underscores (_), and periods (.).

origin

Yes

String

Parameter type: constant or system.

value

Yes

String

Parameter value with a maximum of 255 characters.

If the origin type is "constant", the value is a constant.

If the origin type is "system", the value is a system parameter name. System parameters include gateway parameters and frontend/backend authentication parameters. You can set the frontend or backend authentication parameters after enabling custom frontend or backend authentication.

The gateway parameters are as follows:

  • $context.sourceIp: source IP address of the API caller
  • $context.stage: deployment environment in which the API is called
  • $context.apiName: API name.
  • $context.apiId: API ID
  • $context.appName: name of the app used by the API caller.
  • $context.appId: ID of the app used by the API caller
  • $context.requestId: request ID generated when the API is called
  • $context.serverAddr: address of the gateway server
  • $context.serverName: name of the gateway server
  • $context.handleTime: processing time of the API request
  • $context.providerAppId: ID of the app used by the API owner (not supported)

Frontend authentication parameter: prefixed with "$context.authorizer.frontend.". For example, to return "aaa" upon successful custom authentication, set this parameter to "$context.authorizer.frontend.aaa".

Backend authentication parameter: prefixed with "$context.authorizer.backend.". For example, to return "aaa" upon successful custom authentication, set this parameter to "$context.authorizer.backend.aaa".

Table 11 PluginCommonParameter

Parameter

Mandatory

Type

Description

type

Yes

String

Parameter type. Options:

  • header: the value of the first HTTP header with the parameter name you set.
  • query: the value of the first query string with the parameter name you set.
  • path: complete HTTP request path.
  • method: HTTP request method.
  • system: system parameter.

name

Yes

String

Parameter name for "parameters" of "rules".

value

Yes

String

Parameter source value.