全部產品
Search
文件中心

Microservices Engine:UpdateGatewayRouteWafStatus - 更新路由防護狀態

更新時間:Dec 16, 2025

更新路由waf狀態。

調試

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

調試

授權資訊

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

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

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

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

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

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

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

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

操作

存取層級

資源類型

條件關鍵字

關聯操作

mse:UpdateGatewayRouteWafStatus

update

*Gateway

acs:mse:{#regionId}:{#accountId}:instance/{#GatewayUniqueId}

請求參數

名稱

類型

必填

描述

樣本值

RouteId

integer

路由條目 ID。

645

GatewayUniqueId

string

網關唯一 ID。

gw-86575c0bc9f04ecfbacb92b8e392****

AcceptLanguage

string

返回資訊的語言類型:

  • zh:中文

  • en:英文

zh

EnableWaf

boolean

是否開啟 WAF。

true

返回參數

名稱

類型

描述

樣本值

object

Schema of Response。

RequestId

string

ID of the Request。

7466566F-F30F-4A29-965D-3E0AF21D****

HttpStatusCode

integer

HTTP 狀態代碼。

200

Message

string

響應資訊。

success

Code

integer

狀態代碼。說明 200 表示成功。

200

Success

boolean

請求結果,取值如下:

  • true:請求成功。

  • false:請求失敗。

true

Data

object

返回資料。

Id

integer

路由 ID。

12

Name

string

訊息路由名稱。

test

GatewayUniqueId

string

網關唯一 ID。

gw-7ea3da97b96543e19f6c597cd4a9****

GatewayId

integer

網關 ID。

102

DefaultServiceId

integer

預設服務 ID。

1

DefaultServiceName

string

預設服務名稱。

test

Status

integer

路由狀態。

1

GmtCreate

string

建立時間。

2022-01-26T09:52:41.000+0000

GmtModified

string

修改日期。

2022-02-24T06:08:29.230+0000

RouteOrder

integer

路由順序。

1

Predicates

string

匹配規則。

{\"PathPredicates\":{\"Path\":\"/metas\",\"Type\":\"PRE\",\"IgnoreCase\":false}}

RoutePredicates

object

路由匹配。

PathPredicates

object

路由匹配。

Path

string

路徑。

/zookeeper/mmgw/unlogined/common.getBu

Type

string

匹配類型。

PRE

IgnoreCase

boolean

是否忽略大小寫。

true

MethodPredicates

array

匹配方法。

string

方法。

GET

HeaderPredicates

array<object>

要求標頭匹配規則。

object

要求標頭。

Key

string

要求標頭 KEY。

alibo

Value

string

值。

200

Type

string

匹配類型。

PRE

QueryPredicates

array<object>

參數匹配規則。

object

參數。

Key

string

參數名稱。

instanceId

Value

string

匹配值。

test

Type

string

類型。

PRE

DomainId

integer

網域名稱 ID。

235

DomainName

string

網域名稱。

nbhamster.com

Services

string

服務。

[{\"Percent\":100,\"ServiceId\":126}]

RouteServices

array<object>

服務。

object

服務。

ServiceId

integer

服務 id。

547

ServiceName

string

服務名稱。

b-service

Percent

integer

權重。

80

Version

string

服務版本。

v1

Name

string

服務名稱。

test-aixue-gray

SourceType

string

服務來源。

K8s

Namespace

string

命名空間。

default

GroupName

string

服務分組名稱。

DEFAULT_GROUP

HTTPRewrite

object

重寫策略資訊。

Status

string

HTTP 狀態。

off

Path

string

HTTP 要求路徑。

/test/client

Host

string

網域名稱。

aliyuncs.com

PathType

string

HTTP 要求路徑類型。

PRE

Pattern

string

匹配 Pattern。

/test

Substitution

string

替換。

test

HeaderOp

object

Header 設定資訊。

Status

string

狀態。

off

HeaderOpItems

array<object>

設定策略。

object

設定策略。

DirectionType

string

請求或者響應。

Response

OpType

string

操作類型。

Add

Key

string

Header Key。

debug

Value

string

設定值。

test

DestinationType

string

目標服務類型。

Single

DirectResponse

object

Mock 資訊。

Code

integer

傳回值。

200

Body

string

Mock 傳回值。

[{\"key\":\"h68d13466.sqa.eu95\",\"dims\":\"groupName=All}]

Cors

object

跨網域設定。

Status

string

狀態。

off

AllowOrigins

string

跨域。

*

AllowMethods

string

跨域方法。

GET,POST,PUT,DELETE,HEAD,OPTIONS,PATCH

AllowHeaders

string

跨域 Header。

*

ExposeHeaders

string

回應標頭。

*

TimeUnit

string

時間單位。

s

UnitNum

integer

時間數。

1

AllowCredentials

boolean

允許攜帶憑證。

true

Timeout

object

逾時配置。

UnitNum

integer

時間數。

10

TimeUnit

string

時間單位。

s

Status

string

狀態。

off

Retry

object

重試配置。

Attempts

integer

給定請求允許的重試次數。

1

RetryOn

array

重試條件。

string

重試條件。

5xx

HttpCodes

array

HTTP 狀態代碼。

string

HTTP 狀態代碼。

500

Status

string

重試狀態。

on

DomainIdList

array

網域名稱 ID 列表。

integer

網域名稱 ID 列表。

1

DomainNameList

array

網域名稱列表。

string

網域名稱列表。

test.com

Redirect

object

重新導向配置。

Code

integer

響應碼。

200

Host

string

主機。

ww.al.c

Path

string

路徑。

/

EnableWaf

boolean

是否開啟 WAF。

0

樣本

正常返回樣本

JSON格式

{
  "RequestId": "7466566F-F30F-4A29-965D-3E0AF21D****",
  "HttpStatusCode": 200,
  "Message": "success",
  "Code": 200,
  "Success": true,
  "Data": {
    "Id": 12,
    "Name": "test",
    "GatewayUniqueId": "gw-7ea3da97b96543e19f6c597cd4a9****",
    "GatewayId": 102,
    "DefaultServiceId": 1,
    "DefaultServiceName": "test",
    "Status": 1,
    "GmtCreate": "2022-01-26T09:52:41.000+0000",
    "GmtModified": "2022-02-24T06:08:29.230+0000",
    "RouteOrder": 1,
    "Predicates": "{\\\"PathPredicates\\\":{\\\"Path\\\":\\\"/metas\\\",\\\"Type\\\":\\\"PRE\\\",\\\"IgnoreCase\\\":false}}",
    "RoutePredicates": {
      "PathPredicates": {
        "Path": "/zookeeper/mmgw/unlogined/common.getBu",
        "Type": "PRE",
        "IgnoreCase": true
      },
      "MethodPredicates": [
        "GET"
      ],
      "HeaderPredicates": [
        {
          "Key": "alibo",
          "Value": "200",
          "Type": "PRE"
        }
      ],
      "QueryPredicates": [
        {
          "Key": "instanceId",
          "Value": "test",
          "Type": "PRE"
        }
      ]
    },
    "DomainId": 235,
    "DomainName": "nbhamster.com",
    "Services": "[{\\\"Percent\\\":100,\\\"ServiceId\\\":126}]",
    "RouteServices": [
      {
        "ServiceId": 547,
        "ServiceName": "b-service",
        "Percent": 80,
        "Version": "v1",
        "Name": "test-aixue-gray",
        "SourceType": "K8s",
        "Namespace": "default",
        "GroupName": "DEFAULT_GROUP"
      }
    ],
    "HTTPRewrite": {
      "Status": "off",
      "Path": "/test/client",
      "Host": "aliyuncs.com",
      "PathType": "PRE",
      "Pattern": "/test",
      "Substitution": "test"
    },
    "HeaderOp": {
      "Status": "off",
      "HeaderOpItems": [
        {
          "DirectionType": "Response",
          "OpType": "Add",
          "Key": "debug",
          "Value": "test"
        }
      ]
    },
    "DestinationType": "Single",
    "DirectResponse": {
      "Code": 200,
      "Body": "[{\\\"key\\\":\\\"h68d13466.sqa.eu95\\\",\\\"dims\\\":\\\"groupName=All}]"
    },
    "Cors": {
      "Status": "off",
      "AllowOrigins": "*",
      "AllowMethods": "GET,POST,PUT,DELETE,HEAD,OPTIONS,PATCH",
      "AllowHeaders": "*",
      "ExposeHeaders": "*",
      "TimeUnit": "s",
      "UnitNum": 1,
      "AllowCredentials": true
    },
    "Timeout": {
      "UnitNum": 10,
      "TimeUnit": "s",
      "Status": "off"
    },
    "Retry": {
      "Attempts": 1,
      "RetryOn": [
        "5xx"
      ],
      "HttpCodes": [
        "500"
      ],
      "Status": "on"
    },
    "DomainIdList": [
      1
    ],
    "DomainNameList": [
      "test.com"
    ],
    "Redirect": {
      "Code": 200,
      "Host": "ww.al.c",
      "Path": "/"
    },
    "EnableWaf": true
  }
}

錯誤碼

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

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

變更歷史

更多資訊,參考變更詳情