用于创建或者更新全链路灰度泳道。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
mse:CreateOrUpdateSwimmingLane |
create |
*GovernanceNamespace
|
无 | 无 |
请求参数
名称 |
类型 |
必填 |
描述 |
示例值 |
RegionId |
string |
否 |
地域。 |
cn-beijing |
Namespace |
string |
否 |
MSE 命名空间名字 |
default |
Id |
integer |
否 |
主键 ID。-1 时为创建泳道,大于 0 时为修改指定泳道。 |
-1 |
Name |
string |
是 |
泳道名称。 |
gray |
Tag |
string |
否 |
标识。 |
gray |
Enable |
boolean |
否 |
是否开启。 |
true |
GroupId |
integer |
否 |
所属泳道组。 |
115 |
EnableRules |
boolean |
否 |
是否配置泳道的路由规则,Ingress 为网关暂时不需要配置。 |
false |
PathIndependentPercentageEnable |
boolean |
否 |
已废弃。Java 网关相关配置,Path 按比例路由 |
false |
EntryRules |
array<object> |
否 |
泳道规则集合 |
|
array<object> |
否 |
泳道规则 |
||
Paths |
array |
否 |
路径列表 |
|
string |
否 |
路径 |
/ |
|
Condition |
string |
否 |
指示 RestItems 如何组合成最终的条件 |
AND |
RestItems |
array |
否 |
匹配列表 |
|
object |
否 |
Rest 匹配信息 |
||
Type |
string |
否 |
匹配类型 |
header |
Name |
string |
否 |
名称 |
x-mse-tag |
Operator |
string |
否 |
操作符 |
rawvalue |
NameList |
array |
否 |
匹配列表 |
|
string |
否 |
名称 |
test |
|
Datum |
string |
否 |
数值 |
x |
Cond |
string |
否 |
匹配符 |
== |
Divisor |
integer |
否 |
除数 |
10 |
Remainder |
integer |
否 |
余数 |
10 |
Rate |
integer |
否 |
百分比 |
30 |
Value |
string |
否 |
值 |
gray |
Priority |
integer |
否 |
优先级 |
1 |
EntryRule
deprecated
|
string |
否 |
json string。 |
[{"Priority":1,"Paths":[],"Condition":"AND","RestItems":[{"Type":"param","Name":"name","Value":"xiaoming","Cond":"==","Operator":"rawvalue"}]}] |
GatewaySwimmingLaneRouteJson |
object |
否 |
网关路由信息(使用云原生网关为入口时使用) |
|
GatewayId |
integer |
否 |
网关 ID |
1 |
GatewayUniqueId |
string |
否 |
网关唯一 ID |
gw-84efde2ee1464260bdb17a5b**** |
RouteIdList |
array |
否 |
路由 ID 列表 |
|
integer |
否 |
路由 ID |
1 |
|
CanaryModel |
integer |
否 |
全链路灰度模式:
|
0 |
Conditions |
array |
否 |
匹配条件列表 |
|
object |
否 |
条件项 |
||
Name |
string |
否 |
参数名称 |
name |
Value |
string |
否 |
参数值 |
xiaoming |
Type |
string |
否 |
参数类型:
|
header |
Cond |
string |
否 |
条件:
|
PRE |
Percentage |
integer |
否 |
流量比例(按比例路由使用,取值 0-100) |
30 |
RouteIndependentPercentageEnable |
boolean |
否 |
已废弃。MSE 云原生网关为入口时使用该参数指定按照路由进行百分比设置 |
|
RouteIndependentPercentageList |
array |
否 |
已废弃。按照路由独立进行百分比灰度的路由列表 |
|
object |
否 |
路由与百分比列表 |
||
RouteId |
integer |
否 |
路由 ID。 |
111 |
Percentage |
integer |
否 |
流量比例(按比例路由使用,取值 0-100) |
50 |
Condition |
string |
否 |
灰度条件同时满足:AND; 灰度条件任意满足:OR |
AND |
AcceptLanguage |
string |
否 |
返回结果显示的语言。取值:zh(默认值):中文,en:英文 |
zh |
返回参数
名称 |
类型 |
描述 |
示例值 |
object |
RestResult |
||
RequestId |
string |
请求 ID。 |
EE5C32A1-BC0E-4B79-817C-103E4EDF**** |
Success |
boolean |
请求结果,取值如下:
|
true |
Code |
integer |
Code 仅仅用来和 Success 同步。 |
200 |
ErrorCode |
string |
错误码。 |
mse-100-000 |
HttpStatusCode |
integer |
HTTP 状态码。 |
200 |
Message |
string |
返回信息。 |
请求处理成功 |
Data |
object |
数据概览。 |
{} |
name |
string |
泳道名称 |
test |
id |
integer |
泳道 ID |
94765 |
tag |
string |
泳道对应的标签。 |
release |
status |
integer |
泳道状态 |
0 |
enable |
boolean |
泳道开关 |
true |
regionId |
string |
应用所在的区域。 |
cn-beijing |
groupId |
integer |
泳道组 Id。 |
72586 |
entryRule |
string |
入口应用规则 |
{} |
entryRules |
array<object> |
名称 |
|
object |
入口应用规则详情 |
||
paths |
array |
路径列表 |
|
string |
路径列表 |
/ |
|
path |
string |
代码组路径 |
/adump/wxb/prod |
condition |
string |
条件 |
AND |
restItems |
array<object> |
Rest 匹配规则列表 |
|
object |
Rest 匹配规则 |
||
type |
string |
匹配类型 |
cookie |
name |
string |
名称 |
test |
operator |
string |
操作符 |
rawvalue |
nameList |
array |
名称列表 |
|
string |
名称 |
test |
|
datum |
string |
数值 |
x |
cond |
string |
匹配符 |
== |
divisor |
integer |
除数 |
10 |
remainder |
integer |
余数 |
10 |
rate |
integer |
百分比 |
30 |
value |
string |
值 |
9 |
enableRules |
boolean |
是否开启规则。 |
true |
gmtCreate |
string |
泳道创建时间。 |
1545726028000 |
gmtModified |
string |
泳道更新时间。 |
1565701886000 |
gatewaySwimmingLaneRouteJson |
string |
MSE 网关路由规则 |
{} |
pathIndependentPercentageEnable |
boolean |
已废弃。Java 网关为入口时使用,该参数标识是否开启按照 path 百分比灰度。 |
false |
示例
正常返回示例
JSON
格式
{
"RequestId": "EE5C32A1-BC0E-4B79-817C-103E4EDF****",
"Success": true,
"Code": 200,
"ErrorCode": "mse-100-000",
"HttpStatusCode": 200,
"Message": "请求处理成功",
"Data": {
"name": "test",
"id": 94765,
"tag": "release",
"status": 0,
"enable": true,
"regionId": "cn-beijing",
"groupId": 72586,
"entryRule": "{}",
"entryRules": [
{
"paths": [
"/"
],
"path": "/adump/wxb/prod",
"condition": "AND",
"restItems": [
{
"type": "cookie",
"name": "test",
"operator": "rawvalue",
"nameList": [
"test"
],
"datum": "x",
"cond": "==",
"divisor": 10,
"remainder": 10,
"rate": 30,
"value": "9"
}
]
}
],
"enableRules": true,
"gmtCreate": "1545726028000",
"gmtModified": "1565701886000",
"gatewaySwimmingLaneRouteJson": "{}",
"pathIndependentPercentageEnable": false
}
}
错误码
HTTP status code |
错误码 |
错误信息 |
描述 |
---|---|---|---|
400 | IllegalRequest | Invalid request:%s | 非法请求: %s |
400 | InvalidParameter | Parameter error:%s | 请求参数错误:%s |
500 | InternalError | Console error. Try again later:%s | 控制台错误.稍后重试:%s |
403 | NoPermission | You are not authorized to perform this operation:%s | 没有权限使用此接口:%s |
404 | NotFound | Not found:%s | 资源不存在:%s |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。