全部产品
Search
文档中心

微服务引擎MSE:UpdateGatewayRouteWafStatus - 更新路由防护状态

更新时间:Aug 28, 2026

更新路由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

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情