ListGatewayRoute - 网关路由列表

调用ListGatewayRoute接口查询网关路由列表。

调试

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

调试

授权信息

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

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
mse:ListGatewayRouteRead
  • MSE
    acs:mse:{#regionId}:{#accountId}:instance/*

请求参数

名称类型必填描述示例值
PageNumberinteger

页码。

1
PageSizeinteger

每页展示实例数。

10
OrderItemstring

排序属性。

GmtCreate
DescSortboolean

排序。该字段目前不可用,下线中。

false
FilterParamsobject

过滤条件,格式为{"key1":"value1"}。

GatewayIdlong

网关ID。

81
Namestring

网关名称。

test
Statusinteger

状态

1
DefaultServiceIdlong

缺省服务id。

1
RouteOrderinteger

顺序

1
DomainIdlong

域名id。

284
GatewayUniqueIdstring

网关唯一标识ID。

gw-30a0106924c94bca8712ec4e79fc5acc
DomainNamestring

关联域名

*.alites.com
AcceptLanguagestring

返回信息的语言类型:

  • zh:中文
  • en:英文
zh

返回参数

名称类型描述示例值
object

数据结构。

RequestIdstring

请求ID。

83F02EAB-ECDF-55C6-B332-8649E5E7AF2C
HttpStatusCodeinteger

HTTP状态码。

200
Messagestring

错误信息。

You are not authorized to perform this operation.
Codeinteger

代码。

200
Successboolean

请求结果,取值如下:

  • true:请求成功。
  • false:请求失败。
true
Dataobject

返回数据。

TotalSizelong

总条数。

36
PageNumberinteger

页码。

11
PageSizeinteger

分页大小。

10
Resultarray

数据结构。

object

返回集合。

Idlong

ID。

47
Namestring

名称。

test
GatewayUniqueIdstring

网关唯一标识。

gw-cf0e7f52ecc7429dbc7ba4d5e3656100
GatewayIdlong

网关ID。

496
Statusinteger

状态。

2
RouteOrderinteger

顺序

1
DefaultServiceNamestring

默认服务名称。

test
DefaultServiceIdlong

默认服务id。

1
Predicatesstring

匹配规则

{\"PathPredicates\":{\"Path\":\"/rpc/compute \",\"Type\":\"PRE\",\"IgnoreCase\":true}}
RoutePredicatesobject

匹配规则

PathPredicatesobject

路由Path匹配。

Pathstring

节点路径。

/getIp
Typestring

匹配类型。

PRE
IgnoreCaseboolean

忽略大小写

true
MethodPredicatesarray

HTTP方法匹配

string

方法

GET
HeaderPredicatesarray

Header匹配

object

Header列表

Keystring

Header KEY

userid
Valuestring

匹配值

test
Typestring

匹配类型

PRE
QueryPredicatesarray

参数匹配

object

参数列表

Keystring

参数名称

userid
Valuestring

匹配值

test
Typestring

匹配类型

PRE
GmtCreatestring

创建时间。

2022-01-25T07:14:01.817+0000
GmtModifiedstring

修改时间

2022-01-07 18:07:57
Servicesstring

服务。

[]
RouteServicesarray

服务。

object

服务列表

ServiceIdlong

服务ID

1563
ServiceNamestring

服务名称。

hu
Percentinteger

权重百分比

11
Versionstring

服务版本。

v1
Namestring

名称。

test
SourceTypestring

来源类型

MSE
Namespacestring

命名空间。

default
GroupNamestring

服务组名称。

api
AgreementTypestring

协议类型。

DUBBO
HttpDubboTranscoderobject

Dubbo协议转换体。

DubboServiceNamestring

Dubbo服务名称。

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

Dubbot服务版本。

0.0.0
MothedMapListarray

Dubbo转发规则列表。

object

方法映射体。

DubboMothedNamestring

Dubbo方法名。

sayHello
HttpMothedstring

Http方法。

说明支持http方法参数值。
  • ALL_GET
  • ALL_POST
  • ALL_PUT
  • ALL_DELETE
  • ALL_PATCH
  • ALL_GET
    Mothedpathstring

    方法匹配路径。

    /mytestzbk/sayhello
    PassThroughAllHeadersstring

    Header透传类型。

    说明透传类型枚举值。
  • 透传所有:PASS_ALL
  • 不透传:PASS_NOT
  • 指定参数:PASS_ASSIGN
  • PASS_NOT
    PassThroughListarray

    指定透传Header列表。

    string

    指定Header透传值。

    x-forward
    ParamMapsListarray

    参数映射列表。

    object

    参数映射体。

    ExtractKeySpecstring

    入参位置。

    说明入参位置枚举值。
  • 请求参数:ALL_QUERY_PARAMETER
  • 请求头:ALL_HEADER
  • 请求路径:ALL_PATH
  • 请求体:ALL_BODY
  • ALL_QUERY_PARAMETER
    ExtractKeystring

    入参位提取Key。

    name
    MappingTypestring

    后端参数类型。

    java.lang.String
    DubboServiceGroupstring

    Dubbo服务组。

    service group
    ServicePortinteger

    Dubbo端口。

    20880
    DomainIdlong

    域名ID。

    265
    DomainNamestring

    域名。

    y.com
    DestinationTypestring

    目标类型。

    Single
    DirectResponseobject

    Mock配置

    Codeinteger

    响应码。

    200
    Bodystring

    Mock返回值

    hello
    DomainIdListarray

    域名列表。

    long

    域名ID

    123
    DomainNameListarray

    域名列表。

    string

    域名

    test.com
    Redirectobject

    重定向

    Codeinteger

    响应码。

    200
    Hoststring

    重定向主机名

    test.com
    Pathstring

    路径。

    /test
    Typestring

    路由类型

    Op
    Commentobject

    路由备注(ingress)

    Statusstring

    状态。

    error
    EnableWafstring

    是否开启waf

    false
    Fallbackboolean

    是否开启Fallback服务。

    true
    FallbackServicesarray

    Fallback服务。

    object
    ServiceIdlong

    服务ID。

    353
    ServiceNamestring

    服务名称。

    service name
    Percentinteger

    权重百分比。

    100
    Versionstring

    服务版本。

    v1
    Namestring

    名称。

    name
    SourceTypestring

    来源类型。

    MSE
    Namespacestring

    服务所在命名空间。

    Namespace
    GroupNamestring

    服务分组名称。

    test
    AgreementTypestring

    协议类型。

    DUBBO
    ServicePortinteger

    服务端口。

    8848

    示例

    正常返回示例

    JSON格式

    {
      "RequestId": "83F02EAB-ECDF-55C6-B332-8649E5E7AF2C",
      "HttpStatusCode": 200,
      "Message": "You are not authorized to perform this operation.",
      "Code": 200,
      "Success": true,
      "Data": {
        "TotalSize": 36,
        "PageNumber": 11,
        "PageSize": 10,
        "Result": [
          {
            "Id": 47,
            "Name": "test",
            "GatewayUniqueId": "gw-cf0e7f52ecc7429dbc7ba4d5e3656100",
            "GatewayId": 496,
            "Status": 2,
            "RouteOrder": 1,
            "DefaultServiceName": "test",
            "DefaultServiceId": 1,
            "Predicates": "{\\\"PathPredicates\\\":{\\\"Path\\\":\\\"/rpc/compute \\\",\\\"Type\\\":\\\"PRE\\\",\\\"IgnoreCase\\\":true}}",
            "RoutePredicates": {
              "PathPredicates": {
                "Path": "/getIp",
                "Type": "PRE",
                "IgnoreCase": true
              },
              "MethodPredicates": [
                "GET"
              ],
              "HeaderPredicates": [
                {
                  "Key": "userid",
                  "Value": "test",
                  "Type": "PRE"
                }
              ],
              "QueryPredicates": [
                {
                  "Key": "userid",
                  "Value": "test",
                  "Type": "PRE"
                }
              ]
            },
            "GmtCreate": "2022-01-25T07:14:01.817+0000",
            "GmtModified": "2022-01-07 18:07:57",
            "Services": "[]",
            "RouteServices": [
              {
                "ServiceId": 1563,
                "ServiceName": "hu",
                "Percent": 11,
                "Version": "v1",
                "Name": "test",
                "SourceType": "MSE",
                "Namespace": "default",
                "GroupName": "api",
                "AgreementType": "DUBBO",
                "HttpDubboTranscoder": {
                  "DubboServiceName": "org.apache.dubbo.samples.basic.api.DemoService",
                  "DubboServiceVersion": "0.0.0",
                  "MothedMapList": [
                    {
                      "DubboMothedName": "sayHello",
                      "HttpMothed": "ALL_GET",
                      "Mothedpath": "/mytestzbk/sayhello",
                      "PassThroughAllHeaders": "PASS_NOT",
                      "PassThroughList": [
                        "x-forward"
                      ],
                      "ParamMapsList": [
                        {
                          "ExtractKeySpec": "ALL_QUERY_PARAMETER",
                          "ExtractKey": "name",
                          "MappingType": "java.lang.String"
                        }
                      ]
                    }
                  ],
                  "DubboServiceGroup": "service group"
                },
                "ServicePort": 20880
              }
            ],
            "DomainId": 265,
            "DomainName": "y.com",
            "DestinationType": "Single",
            "DirectResponse": {
              "Code": 200,
              "Body": "hello"
            },
            "DomainIdList": [
              123
            ],
            "DomainNameList": [
              "test.com"
            ],
            "Redirect": {
              "Code": 200,
              "Host": "test.com",
              "Path": "/test"
            },
            "Type": "Op",
            "Comment": {
              "Status": "error"
            },
            "EnableWaf": "false",
            "Fallback": true,
            "FallbackServices": [
              {
                "ServiceId": 353,
                "ServiceName": "service name",
                "Percent": 100,
                "Version": "v1",
                "Name": "name",
                "SourceType": "MSE\n",
                "Namespace": "Namespace",
                "GroupName": "test",
                "AgreementType": "DUBBO",
                "ServicePort": 8848
              }
            ]
          }
        ]
      }
    }

    错误码

    HTTP status code错误码错误信息描述
    400IllegalRequestInvalid request:%s非法请求: %s
    400InvalidParameterParameter error:%s请求参数错误:%s
    403NoPermissionYou are not authorized to perform this operation:%s没有权限使用此接口:%s
    404NotFoundNot found:%s资源不存在:%s
    500InternalErrorConsole error. Try again later:%s控制台错误.稍后重试:%s

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

    变更历史

    变更时间变更内容概要操作
    2022-07-28OpenAPI 返回结构发生变更
    变更项变更内容
    出参OpenAPI 返回结构发生变更
    2022-02-18新增 OpenAPI
    阿里云首页 微服务引擎 相关技术圈