全部產品
Search
文件中心

Microservices Engine:CreateOrUpdateSwimmingLane - 建立或者更新全鏈路灰階泳道

更新時間:Apr 21, 2026

用於建立或者更新全鏈路灰階泳道。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

mse:CreateOrUpdateSwimmingLane

create

*GovernanceNamespace

acs:mse:{#regionId}:{#accountId}:namespace/{#Namespace}

請求參數

名稱

類型

必填

描述

樣本值

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>

匹配列表

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: 按請求內容路由

  • 1: 按比例路由

0

Conditions

array<object>

匹配條件列表

object

條件項

Name

string

參數名稱

name

Value

string

參數值

xiaoming

Type

string

參數類型:

  • header:Header

  • param:Parameter

header

Cond

string

如果您使用老版本的全鏈路灰階(swimversion 為 0,使用標籤路由和灰階路由),支援:

  • PRE:首碼匹配

  • ERGULAR:正則匹配

  • EQUAL:精準匹配

如果您使用新版本的全鏈路灰階(swiminversion 為 1 或 2,使用單服務路由),支援:

  • PRE:首碼匹配

  • regexp:正則匹配

  • ==

  • !=

  • list :in

  • % :百分比

新版全鏈路灰階和舊版全鏈路灰階功能一樣,效能更強、配置更簡單,請您遷移至新版全鏈路灰階

PRE

Percentage

integer

流量比例(按比例路由使用,取值 0-100)

30

RouteIndependentPercentageEnable

boolean

已廢棄。MSE 雲原生網關為入口時使用該參數指定按照路由進行百分比設定

RouteIndependentPercentageList

array<object>

已廢棄。按照路由獨立進行百分比灰階的路由列表

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:請求成功。

  • false:請求失敗。

true

Code

integer

Code 僅僅用來和 Success 同步。

200

ErrorCode

string

錯誤碼。

mse-100-000

HttpStatusCode

integer

HTTP 狀態代碼。

200

Message

string

返回資訊。

Succ

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>

名稱

array<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": "Succ",
  "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

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情