UpdateGatewayRoute - 更新网关路由

更新网关路由。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

mse:UpdateGatewayRoute

update

*Gateway

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

请求参数

名称

类型

必填

描述

示例值

GatewayId

integer

网关 ID。

501

Name deprecated

string

路由名称。

route-web

RouteOrder

integer

路由顺序。

1

Predicates

array

路由匹配条件。

PathPredicates

object

Path 匹配。

Path

string

路由 Path 路径。

/test

Type

string

匹配类型。

PRE

IgnoreCase

boolean

忽略大小写。

true

MethodPredicates

array

方法匹配。

string

具体方法。

GET

HeaderPredicates

array

请求头匹配。

object

请求头。

Key

string

请求头 Key。

debug

Value

string

对应的 Value。

on

Type

string

匹配类型。

PRE

QueryPredicates

array

参数匹配。

object

URL 参数。

Key

string

参数名。

userid

Value

string

匹配值。

test

Type

string

匹配类型。

PRE

Services

array

目标服务(路由指向为单服务、多服务、标签路由时填写)。

array

服务列表。

ServiceId

integer

服务 ID。

1

Percent

integer

当前服务/服务版本分流百分比(只在使用多服务、标签路由时填写)。

80

Version

string

服务版本(只在使用标签路由时填写)。

v1

Name

string

名称。

web

SourceType

string

来源类型。

MSE

Namespace

string

服务所在命名空间。

default

GroupName

string

服务分组名称。

test

AgreementType

string

协议类型。

DUBBO

HttpDubboTranscoder

object

Dubbo 协议转换体。

DubboServiceName

string

Dubbo 服务名称。

org.apache.dubbo.samples.basic.api.DemoService

DubboServiceVersion

string

Dubbot 服务版本。

0.0.0

DubboServiceGroup

string

Dubbo 服务组。

service name

MothedMapList

array

Dubbo 转发规则列表。

array

方法映射体。

DubboMothedName

string

Dubbo 方法名。

sayHello

HttpMothed

string

Http 方法。

说明

支持 http 方法参数值。

  • ALL_GET。

  • ALL_POST。

  • ALL_PUT。

  • ALL_DELETE。

  • ALL_PATCH。

ALL_GET

Mothedpath

string

方法匹配路径。

/mytestzbk/sayhello

PassThroughAllHeaders

string

Header 透传类型。

说明

透传类型枚举值。

  • 透传所有:PASS_ALL。

  • 不透传:PASS_NOT。

  • 指定参数:PASS_ASSIGN。

PASS_NOT

PassThroughList

array

指定透传 Header 列表。

string

指定 Header 透传值。

x-forward

ParamMapsList

array

参数映射列表。

object

参数映射体。

ExtractKeySpec

string

入参位置。

说明

入参位置枚举值。

  • 请求参数:ALL_QUERY_PARAMETER

  • 请求头:ALL_HEADER

  • 请求路径:ALL_PATH

  • 请求体:ALL_BODY

ALL_QUERY_PARAMETER

ExtractKey

string

入参位提取 Key。

name

MappingType

string

后端参数类型。

java.lang.String

ServicePort

integer

Dubbo 端口。

20880

Id

integer

路由 ID。

139

DestinationType

string

目标服务类型。

Mock

DirectResponseJSON

object

Mock 内容。

Code

integer

Mock 返回码。

200

Body

string

Mock 返回值。

hello

GatewayUniqueId

string

网关唯一标识 ID。

gw-86575c0bc9f04ecfbacb92b8e392a2c4

DomainIdListJSON

string

关联域名。

[90]

RedirectJSON

object

重定向。

Code

integer

状态码。

302

Host

string

重定向主机名。

test.com

Path

string

重定向路径。

/test

EnableWaf deprecated

boolean

已废弃,请使用 UpdateGatewayRouteWafStatus 更新路由 WAF 状态。

false

Fallback

boolean

是否开启 Fallback 服务。

true

FallbackServices

array

Fallback 服务。

object

数据对象。

ServiceId

integer

服务 ID。

1

Percent

integer

权重百分比。

80

Version

string

服务版本。

v1

Name

string

名称。

name

SourceType

string

来源类型。

MSE

Namespace

string

服务所在命名空间。

Namespace

GroupName

string

服务分组名称。

test

AgreementType

string

协议类型。

DUBBO

ServicePort

integer

服务端口。

8848

Description

string

路由描述

a route for xxx

AcceptLanguage

string

返回信息的语言类型:

  • zh:中文

  • en:英文

zh

返回参数

名称

类型

描述

示例值

object

数据结构

RequestId

string

请求 ID

73785414-2C5B-5E28-BD91-B2C742269C48

HttpStatusCode

integer

HTTP 返回码。

200

Message

string

响应描述

请求处理成功

Code

integer

状态码

200

Success

boolean

请求结果,取值如下:

  • true:请求成功。

  • false:请求失败。

true

Data

integer

数据。

337

ErrorCode

string

错误码。

NoPermission

示例

正常返回示例

JSON格式

{
  "RequestId": "73785414-2C5B-5E28-BD91-B2C742269C48",
  "HttpStatusCode": 200,
  "Message": "请求处理成功",
  "Code": 200,
  "Success": true,
  "Data": 337,
  "ErrorCode": "NoPermission"
}

错误码

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

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

变更历史

更多信息,参考变更详情