文档

GetGatewayRouteDetail - 查询网关路由详情

更新时间:

查询网关路由详情。

调试

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

授权信息

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

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

请求参数

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

路由 ID。

1050
GatewayUniqueIdstring

网关唯一标识 ID。

gw-5d3a78a53ec947aa928212d671d400ac
AcceptLanguagestring

返回信息的语言类型:

  • zh:中文
  • en:英文
zh

返回参数

名称类型描述示例值
object

数据结构。

RequestIdstring

请求 ID。

FDF2D16C-5D28-5FAA-A56B-30BDE3559880
HttpStatusCodeinteger

HTTP 状态码。

200
Messagestring

错误信息。

You are not authorized to perform this operation.
Codeinteger

状态码。说明 200 表示成功。

200
Successboolean

请求结果,取值如下:

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

返回数据。

Idlong

ID。

1050
Namestring

名称。

test
GatewayUniqueIdstring

网关唯一标识 ID。

gw-7ea3da97b96543e19f6c597c****
GatewayIdlong

网关 ID。

1
DefaultServiceIdlong

默认服务 ID。

3
DefaultServiceNamestring

默认服务名称。

test
Statusinteger

路由状态。

  • 未发布:0

  • 发布中:2

  • 已发布:3

  • 编辑中(有更新未发布):4

  • 下线中:5

  • 不可用:6

0
GmtCreatestring

创建时间。

2022-01-07 18:07:57
GmtModifiedstring

最后修改时间。

2022-01-07T10:07:57.000+0000
RouteOrderinteger

路由顺序。

1
Predicatesstring

匹配条件。

{}
RoutePredicatesobject

路由匹配。

PathPredicatesobject

路由匹配。

Pathstring

路径。

/api
Typestring

匹配类型。

PRE
IgnoreCaseboolean

是否忽略大小写。

true
MethodPredicatesarray

方法匹配。

string

方法。

GET
HeaderPredicatesobject []

头匹配。

Keystring

请求头 KEY。

id
Valuestring

匹配值。

200
Typestring

类型。

PRE
QueryPredicatesobject []

参数匹配。

Keystring

参数名称。

userid
Valuestring

匹配值。

test
Typestring

类型。

PRE
DomainIdlong

域名 ID。

235
DomainNamestring

域名。

123.com
Servicesstring

服务的配置信息。

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

服务。

ServiceIdlong

服务 ID。

782
ServiceNamestring

服务名称。

xkc-crm
Percentinteger

权重。

80
Versionstring

服务版本。

v1
Namestring

服务名称。

dubbo4
SourceTypestring

服务来源。

MSE
Namespacestring

命名空间。

acs_ecs_dashboard
GroupNamestring

服务组名称。

api
AgreementTypestring

协议类型。

DUBBO
HttpDubboTranscoderobject

Dubbo 协议转换体。

DubboServiceNamestring

Dubbo 服务名称。

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

Dubbo 服务版本。

0.0.0
MothedMapListobject []

Dubbo 转发规则列表。

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
    ParamMapsListobject []

    参数映射列表。

    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

    服务端口。

    20880
    HealthStatusstring

    健康状态

    • Health

    • Unhealthy

    • Checking

    • Unknown

    Health
    UnhealthyEndpointsarray

    非健康 Endpoint 列表

    string

    非健康 Endpoint

    192.168.1.2
    HTTPRewriteobject

    重写策略信息。

    Statusstring

    开启状态。

    off
    Pathstring

    节点路径。

    /test/client
    Hoststring

    实例地址。

    aliyuncs.com
    PathTypestring

    重写类型。

    PRE
    Patternstring

    匹配 Pattern。

    /test
    Substitutionstring

    替换。

    test
    HeaderOpobject

    Header 设置信息。

    Statusstring

    状态。

    off
    HeaderOpItemsobject []

    头字段对象。

    DirectionTypestring

    请求或响应。

    Response
    OpTypestring

    操作类型。

    Add
    Keystring

    Header Key。

    debug
    Valuestring

    设置值。

    test
    DestinationTypestring

    目标服务类型。

    Single
    DirectResponseobject

    Mock 信息。

    Codeinteger

    响应码。

    200
    Bodystring

    Mock 返回值。

    {}
    Corsobject

    跨域配置。

    Statusstring

    状态。

    off
    AllowOriginsstring

    跨域。

    *
    AllowMethodsstring

    跨域方法。

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

    跨域 Header。

    *
    ExposeHeadersstring

    响应头。

    *
    TimeUnitstring

    时间单位。

    h
    UnitNumlong

    时间数。

    24
    AllowCredentialsboolean

    允许携带凭证。

    true
    Timeoutobject

    超时配置。

    UnitNuminteger

    时间数。

    10
    TimeUnitstring

    时间单位。

    s
    Statusstring

    状态。

    off
    Retryobject

    重试配置。

    Attemptsinteger

    重试次数。

    1
    RetryOnarray

    重试条件。

    string

    重试条件。

    5xx
    HttpCodesarray

    HTTP 状态码。

    string

    HTTP 状态码。

    500
    Statusstring

    重试状态。

    on
    DomainIdListarray

    域名列表

    long

    域名 ID 列表。

    1
    DomainNameListarray

    域名列表

    string

    域名列表。

    test.com
    Redirectobject

    重定向配置

    Codeinteger

    响应码。

    200
    Hoststring

    主机。

    16
    Pathstring

    路径。

    10111
    FlowMirrorobject

    流量镜像配置。

    TargetServiceIdlong

    目标服务 ID。

    21
    TargetServiceNamestring

    目标服务名称。

    test
    Portinteger

    目标服务端口。

    8790
    Percentageinteger

    流量复制比例(%),取值 0-100。

    90
    Statusstring

    开启状态,取值:

    • on:开启
    • off:关闭
    on
    EnableWafboolean

    是否开启 Waf。

    true
    AhasStatusinteger

    Ahas 状态。

    1
    Fallbackboolean

    是否开启 Fallback 服务。

    true
    FallbackServicesobject []

    Fallback 服务。

    ServiceIdlong

    服务 ID。

    1
    ServiceNamestring

    服务名称。

    name
    Percentinteger

    权重百分比。

    80
    Versionstring

    服务版本。

    v1
    Namestring

    名称。

    name
    SourceTypestring

    来源类型。

    MSE
    Namespacestring

    服务所在命名空间。

    namespace
    GroupNamestring

    服务分组名称。

    test
    AgreementTypestring

    协议类型。

    DUBBO
    ServicePortinteger

    服务端口。

    8848
    Policiesstring

    路由策略 Json 字符串。

    { "CORS": "{\"allowMethods\":\"GET,POST,PUT,DELETE,HEAD,OPTIONS,PATCH\",\"allowHeaders\":\"*\",\"exposeHeaders\":\"*\",\"unitNum\":12,\"allowCredentials\":true,\"status\":\"off\",\"allowOrigins\":\"*\",\"timeUnit\":\"h\"}", "Timeout": "{\"unitNum\":10,\"timeUnit\":\"s\",\"status\":\"off\"}", "Retry": "{\"attempts\":2,\"retryOn\":[\"5xx\"],\"status\":\"off\"}", "HTTPRewrite": "{\"pathType\":\"EQUAL\",\"path\":\"/o\",\"status\":\"off\"}", "Waf": "{\"enabled\":false}", "HeaderOp": "{\"status\":\"off\",\"headerOpItems\":[{\"directionType\":\"Request\",\"opType\":\"Add\",\"key\":\"kkk\",\"value\":\"ll\"}]}" }
    Descriptionstring

    路由描述

    a route for xxx

    示例

    正常返回示例

    JSON格式

    {
      "RequestId": "FDF2D16C-5D28-5FAA-A56B-30BDE3559880",
      "HttpStatusCode": 200,
      "Message": "You are not authorized to perform this operation.",
      "Code": 200,
      "Success": true,
      "Data": {
        "Id": 1050,
        "Name": "test",
        "GatewayUniqueId": "gw-7ea3da97b96543e19f6c597c****",
        "GatewayId": 1,
        "DefaultServiceId": 3,
        "DefaultServiceName": "test",
        "Status": 0,
        "GmtCreate": "2022-01-07 18:07:57",
        "GmtModified": "2022-01-07T10:07:57.000+0000",
        "RouteOrder": 1,
        "Predicates": "{}",
        "RoutePredicates": {
          "PathPredicates": {
            "Path": "/api",
            "Type": "PRE",
            "IgnoreCase": true
          },
          "MethodPredicates": [
            "GET"
          ],
          "HeaderPredicates": [
            {
              "Key": "id",
              "Value": "200",
              "Type": "PRE"
            }
          ],
          "QueryPredicates": [
            {
              "Key": "userid",
              "Value": "test",
              "Type": "PRE"
            }
          ]
        },
        "DomainId": 235,
        "DomainName": "123.com",
        "Services": "[{\\\"Percent\\\":100,\\\"ServiceId\\\":126}]",
        "RouteServices": [
          {
            "ServiceId": 782,
            "ServiceName": "xkc-crm",
            "Percent": 80,
            "Version": "v1",
            "Name": "dubbo4",
            "SourceType": "MSE",
            "Namespace": "acs_ecs_dashboard",
            "GroupName": "api",
            "AgreementType": "DUBBO",
            "HttpDubboTranscoder": {
              "DubboServiceName": "org.apache.dubbo.samples.basic.api.DemoService\n",
              "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,
            "HealthStatus": "Health",
            "UnhealthyEndpoints": [
              "192.168.1.2"
            ]
          }
        ],
        "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": "{}"
        },
        "Cors": {
          "Status": "off",
          "AllowOrigins": "*",
          "AllowMethods": "GET,POST,PUT,DELETE,HEAD,OPTIONS,PATCH",
          "AllowHeaders": "*",
          "ExposeHeaders": "*",
          "TimeUnit": "h",
          "UnitNum": 24,
          "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": "16",
          "Path": "10111"
        },
        "FlowMirror": {
          "TargetServiceId": 21,
          "TargetServiceName": "test",
          "Port": 8790,
          "Percentage": 90,
          "Status": "on"
        },
        "EnableWaf": true,
        "AhasStatus": 1,
        "Fallback": true,
        "FallbackServices": [
          {
            "ServiceId": 1,
            "ServiceName": "name",
            "Percent": 80,
            "Version": "v1",
            "Name": "name",
            "SourceType": "MSE",
            "Namespace": "namespace",
            "GroupName": "test",
            "AgreementType": "DUBBO",
            "ServicePort": 8848
          }
        ],
        "Policies": "{\n      \"CORS\": \"{\\\"allowMethods\\\":\\\"GET,POST,PUT,DELETE,HEAD,OPTIONS,PATCH\\\",\\\"allowHeaders\\\":\\\"*\\\",\\\"exposeHeaders\\\":\\\"*\\\",\\\"unitNum\\\":12,\\\"allowCredentials\\\":true,\\\"status\\\":\\\"off\\\",\\\"allowOrigins\\\":\\\"*\\\",\\\"timeUnit\\\":\\\"h\\\"}\",\n      \"Timeout\": \"{\\\"unitNum\\\":10,\\\"timeUnit\\\":\\\"s\\\",\\\"status\\\":\\\"off\\\"}\",\n      \"Retry\": \"{\\\"attempts\\\":2,\\\"retryOn\\\":[\\\"5xx\\\"],\\\"status\\\":\\\"off\\\"}\",\n      \"HTTPRewrite\": \"{\\\"pathType\\\":\\\"EQUAL\\\",\\\"path\\\":\\\"/o\\\",\\\"status\\\":\\\"off\\\"}\",\n      \"Waf\": \"{\\\"enabled\\\":false}\",\n      \"HeaderOp\": \"{\\\"status\\\":\\\"off\\\",\\\"headerOpItems\\\":[{\\\"directionType\\\":\\\"Request\\\",\\\"opType\\\":\\\"Add\\\",\\\"key\\\":\\\"kkk\\\",\\\"value\\\":\\\"ll\\\"}]}\"\n}",
        "Description": "a route for xxx"
      }
    }

    错误码

    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

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

    变更历史

    变更时间变更内容概要操作
    2024-01-29OpenAPI 返回结构发生变更看变更集
    变更项变更内容
    出参OpenAPI 返回结构发生变更
    2024-01-18OpenAPI 返回结构发生变更看变更集
    变更项变更内容
    出参OpenAPI 返回结构发生变更
    2023-08-22OpenAPI 返回结构发生变更看变更集
    变更项变更内容
    出参OpenAPI 返回结构发生变更
    2023-03-02OpenAPI 返回结构发生变更看变更集
    变更项变更内容
    出参OpenAPI 返回结构发生变更
    2022-02-18新增 OpenAPI看变更集
    • 本页导读 (1)
    文档反馈