批量更新熔断规则
PUT
/naming/v1/circuitbreaker/rules
最后修改时间:2024-08-21 04:18:31
责任人:未设置
请求参数
Header 参数
X-Polaris-Token
string
可选
Body 参数application/json
array of:
description
string
规则描述
enable
boolean
是否启用
error_conditions
array [object {2}]
错误条件
condition
object (MatchString)
匹配方式
input_type
string
错误类型
fallbackConfig
object
降级配置
enable
boolean
是否启用
response
object
降级响应
faultDetectConfig
object
是否启用主动探测规则
enable
boolean
是否启用
id
string
规则ID
level
string
熔断级别
max_ejection_percent
integer
实例级别熔断下的最大熔断比例
name
string
规则名称
recoverCondition
object
必需
consecutiveSuccess
integer
必需
sleep_window
integer
必需
revision
string
规则摘要
rule_matcher
object
规则匹配
destination
object
被调服务
source
object
主调服务
trigger_condition
array [object {5}]
触发条件
error_count
integer
可选
error_percent
integer
可选
interval
integer
可选
minimum_request
integer
可选
trigger_type
integer
可选
示例
[
{
"ctime": "string",
"description": "string",
"enable": true,
"error_conditions": [
{
"condition": {
"type": 0,
"value": "string",
"value_type": 0
},
"input_type": 0
}
],
"etime": "string",
"fallbackConfig": {
"enable": true,
"response": {
"body": "string",
"code": 0,
"headers": [
{
"key": "string",
"value": "string"
}
]
}
},
"faultDetectConfig": {
"enable": true
},
"id": "string",
"level": 0,
"max_ejection_percent": 0,
"mtime": "string",
"name": "string",
"namespace": "string",
"recoverCondition": {
"consecutiveSuccess": 0,
"sleep_window": 0
},
"revision": "string",
"rule_matcher": {
"destination": {
"method": {
"type": 0,
"value": "string",
"value_type": 0
},
"namespace": "string",
"service": "string"
},
"source": {
"namespace": "string",
"service": "string"
}
},
"trigger_condition": [
{
"error_count": 0,
"error_percent": 0,
"interval": 0,
"minimum_request": 0,
"trigger_type": 0
}
]
}
]
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request PUT 'http://119.91.66.223:8090/naming/v1/circuitbreaker/rules' \
--header 'X-Polaris-Token;' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"ctime": "string",
"description": "string",
"enable": true,
"error_conditions": [
{
"condition": {
"type": 0,
"value": "string",
"value_type": 0
},
"input_type": 0
}
],
"etime": "string",
"fallbackConfig": {
"enable": true,
"response": {
"body": "string",
"code": 0,
"headers": [
{
"key": "string",
"value": "string"
}
]
}
},
"faultDetectConfig": {
"enable": true
},
"id": "string",
"level": 0,
"max_ejection_percent": 0,
"mtime": "string",
"name": "string",
"namespace": "string",
"recoverCondition": {
"consecutiveSuccess": 0,
"sleep_window": 0
},
"revision": "string",
"rule_matcher": {
"destination": {
"method": {
"type": 0,
"value": "string",
"value_type": 0
},
"namespace": "string",
"service": "string"
},
"source": {
"namespace": "string",
"service": "string"
}
},
"trigger_condition": [
{
"error_count": 0,
"error_percent": 0,
"interval": 0,
"minimum_request": 0,
"trigger_type": 0
}
]
}
]'
返回响应
🟢200成功
application/json
Body
code
integer
响应码
info
string
提示信息
示例
{
"code": 0,
"info": "string"
}
修改于 2024-08-21 04:18:31