调用DescribeIstioGatewayRouteDetail查看网关路由详情。

调试

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

请求参数

名称 类型 是否必选 示例值 描述
Action String 是 DescribeIstioGatewayRouteDetail

系统规定参数。取值:DescribeIstioGatewayRouteDetail。

ServiceMeshId String 是 c08ba3fd1e6484b0f8cc1ad8fe10d****

服务网格实例ID。

IstioGatewayName String 否 ingressgateway

ASM网关名称。

RouteName String 否 demo-route

路由名称。

返回数据

名称 类型 示例值 描述
RouteDetail Object

路由详情

RouteName String demo-route

路由名称。

RouteType String HTTP

路由类型,取值HTTP、TLS、TCP。

MatchRequest Object

路由匹配规则。

URI Object

URI匹配规则 。

MatchingMode String prefix

路由规则匹配模式,取值:

  • exact:精准匹配。
  • prefix:前缀匹配。
  • regex:正则匹配。
MatchingContent String /ratings/v2/

用于匹配的内容。

Headers Array of header

用于判断是否匹配的请求头部列表。

Name String x-request-id

Header匹配的键。

MatchingMode String exact

Header值匹配方式,取值:

  • exact:精准匹配。
  • prefix:前缀匹配。
  • regex:正则匹配。
MatchingContent String v1

用于Header匹配的内容。

TLSMatchAttributes Array of tlsMatchAttribute

TLS连接匹配属性列表。

TLSPort Integer 443

TLS端口。

SNIHosts Array of String *.com

SNI值中可以使用通配符前缀,例如*.com将匹配foo.example.com和example.com。

说明 SNI值必须是相应虚拟服务主机的子集。
Ports Array of Integer 443

指定主机上要寻址的端口。

HTTPAdvancedOptions Object

HTTP路由高级配置选项。

HTTPRedirect Object

HTTP重定向。

Uri String /v1/getProductRatings

在重定向时,使用此值覆盖URL的路径部分。

Authority String newratings.default.svc.cluster.local

在重定向时,使用此值覆盖URL的Authority或Host部分。

RedirectCode Integer 301

在重定向上,指定要在重定向响应中使用的HTTP状态代码。默认响应代码为301。

Delegate Object

虚拟服务流量代理。

Name String reviews

名称。

Namespace String default

命名空间。

Rewrite Object

重写虚拟服务。

Uri String /v1/getProductRatings

用这个值重写URI的路径(或前缀)部分。

Authority String newratings.default.svc.cluster.local

使用此值重写Authority或Host头。

Timeout String 5s

超时时长。

Retries Object

请求重试配置。

Attempts Integer 3

给定请求允许的重试次数。

PerTryTimeout String 2s

请求的每次尝试超时时间。

RetryOn String connect-failure,refused-stream,503

用于指定重试发生的条件,例如connect-failure,refused-stream,503。

RetryRemoteLocalities Object

用于指定重试是否应重试到其他位置的标志。

Value Boolean false

用于指定重试是否应重试到其他位置的标志,取值:

  • true:其他位置也重试
  • false:其他位置不重试

默认false。

Fault Object

故障注入设置。

Delay Object

设置延迟。

FixedDelay String 5s

固定延迟时间。

ExponentialDelay String 3

指数型延迟等待时间,等待时间为2的x次方,x为输入参数。

Percentage Object

将注入延迟的请求的百分比。

Value Float 0.1

使用提供的错误码中止的请求的百分比,用小数表示。

Abort Object

提前中止带有预先指定的错误码的请求。

HttpStatus Integer 400

HTTP状态码。

Percentage Object

使用提供的错误码中止的请求的百分比。

Value Float 0.1

流量镜像百分比。用小数表示

Mirror Object

除了将请求转发到预期目标之外,还将HTTP通信镜像到另一个目标。

Host String reviews.default.svc.cluster.local

服务注册表中服务的名称。

Subset String v1

服务中子集的名称

MirrorPercentage Object

流量镜像百分比。

Value Float 0.2

流量镜像百分比,用小数表示。

RouteDestinations Array of routeDestination

L4路由规则加权目的地列表。

Destination Object

Destination唯一标识请求或连接应转发到的服务实例。

Host String reviews

服务注册表中服务的名称。

Subset String v1

服务中子集的名称。

Port Object

端口列表。

Number Integer 443

指定主机上要寻址的端口。

Weight Integer 80

流量权重,范围:1~100。

Headers Object

用于判断是否匹配的请求头部列表。

Request Object

用于判断是否匹配的请求头部。

Set Map

用给定值覆盖键指定的Header。

String key

输入Value值覆盖键Header。

Add Map

添加值到Header中。

Remove Array of String key

输入要删除的Key。

Response Object

返回响应前做的处理。

Set Map

用给定值覆盖键指定的Header。

Add Map

添加值到Header中。

Remove Array of String key

输入要删除的Key。

RequestId String 31d3a0f0-07ed-4f6e-9004-1804498c****

请求ID。

Priority Integer 1

路由优先级。整数,数字越小,优先级越高。

Status Integer 1

网关路由状态,取值:

  • 0:在线。
  • 1:下线。
  • 2:创建或更新错误。
Description String demo route

路由描述。

示例

请求示例

http(s)://[Endpoint]/?Action=DescribeIstioGatewayRouteDetail
&ServiceMeshId=c08ba3fd1e6484b0f8cc1ad8fe10d****
&IstioGatewayName=ingressgateway
&RouteName=demo-route
&公共请求参数

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeIstioGatewayRouteDetailResponse>
    <RouteDetail>
        <RouteName>demo-route</RouteName>
        <RouteType>HTTP</RouteType>
        <MatchRequest>
            <URI>
                <MatchingMode>prefix</MatchingMode>
                <MatchingContent>/ratings/v2/</MatchingContent>
            </URI>
            <Headers>
                <Name>x-request-id</Name>
                <MatchingMode>exact</MatchingMode>
                <MatchingContent>v1</MatchingContent>
            </Headers>
            <TLSMatchAttributes>
                <TLSPort>443</TLSPort>
                <SNIHosts>*.com</SNIHosts>
            </TLSMatchAttributes>
            <Ports>443</Ports>
        </MatchRequest>
        <HTTPAdvancedOptions>
            <HTTPRedirect>
                <Uri>/v1/getProductRatings</Uri>
                <Authority>newratings.default.svc.cluster.local</Authority>
                <RedirectCode>301</RedirectCode>
            </HTTPRedirect>
            <Delegate>
                <Name>reviews</Name>
                <Namespace>default</Namespace>
            </Delegate>
            <Rewrite>
                <Uri>/v1/getProductRatings</Uri>
                <Authority>newratings.default.svc.cluster.local</Authority>
            </Rewrite>
            <Timeout>5s</Timeout>
            <Retries>
                <Attempts>3</Attempts>
                <PerTryTimeout>2s</PerTryTimeout>
                <RetryOn>connect-failure,refused-stream,503</RetryOn>
                <RetryRemoteLocalities>
                    <Value>false</Value>
                </RetryRemoteLocalities>
            </Retries>
            <Fault>
                <Delay>
                    <FixedDelay>5s</FixedDelay>
                    <ExponentialDelay>3</ExponentialDelay>
                    <Percentage>
                        <Value>0.1</Value>
                    </Percentage>
                </Delay>
                <Abort>
                    <HttpStatus>400</HttpStatus>
                    <Percentage>
                        <Value>0.1</Value>
                    </Percentage>
                </Abort>
            </Fault>
            <Mirror>
                <Host>reviews.default.svc.cluster.local</Host>
                <Subset>v1</Subset>
            </Mirror>
            <MirrorPercentage>
                <Value>0.2</Value>
            </MirrorPercentage>
        </HTTPAdvancedOptions>
        <RouteDestinations>
            <Destination>
                <Host>reviews</Host>
                <Subset>v1</Subset>
                <Port>
                    <Number>443</Number>
                </Port>
            </Destination>
            <Weight>80</Weight>
            <Headers>
                <Request>
                    <Set>
                        <key>key</key>
                    </Set>
                    <Remove>key</Remove>
                </Request>
                <Response>
                    <Remove>key</Remove>
                </Response>
            </Headers>
        </RouteDestinations>
    </RouteDetail>
    <RequestId>31d3a0f0-07ed-4f6e-9004-1804498c****</RequestId>
    <Priority>1</Priority>
    <Status>1</Status>
    <Description>demo route</Description>
</DescribeIstioGatewayRouteDetailResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RouteDetail" : {
    "RouteName" : "demo-route",
    "RouteType" : "HTTP",
    "MatchRequest" : {
      "URI" : {
        "MatchingMode" : "prefix",
        "MatchingContent" : "/ratings/v2/"
      },
      "Headers" : {
        "Name" : "x-request-id",
        "MatchingMode" : "exact",
        "MatchingContent" : "v1"
      },
      "TLSMatchAttributes" : {
        "TLSPort" : 443,
        "SNIHosts" : "*.com"
      },
      "Ports" : 443
    },
    "HTTPAdvancedOptions" : {
      "HTTPRedirect" : {
        "Uri" : "/v1/getProductRatings",
        "Authority" : "newratings.default.svc.cluster.local",
        "RedirectCode" : 301
      },
      "Delegate" : {
        "Name" : "reviews",
        "Namespace" : "default"
      },
      "Rewrite" : {
        "Uri" : "/v1/getProductRatings",
        "Authority" : "newratings.default.svc.cluster.local"
      },
      "Timeout" : "5s",
      "Retries" : {
        "Attempts" : 3,
        "PerTryTimeout" : "2s",
        "RetryOn" : "connect-failure,refused-stream,503",
        "RetryRemoteLocalities" : {
          "Value" : false
        }
      },
      "Fault" : {
        "Delay" : {
          "FixedDelay" : "5s",
          "ExponentialDelay" : 3,
          "Percentage" : {
            "Value" : 0.1
          }
        },
        "Abort" : {
          "HttpStatus" : 400,
          "Percentage" : {
            "Value" : 0.1
          }
        }
      },
      "Mirror" : {
        "Host" : "reviews.default.svc.cluster.local",
        "Subset" : "v1"
      },
      "MirrorPercentage" : {
        "Value" : 0.2
      }
    },
    "RouteDestinations" : {
      "Destination" : {
        "Host" : "reviews",
        "Subset" : "v1",
        "Port" : {
          "Number" : 443
        }
      },
      "Weight" : 80,
      "Headers" : {
        "Request" : {
          "Set" : {
            "key" : "key"
          },
          "Remove" : "key"
        },
        "Response" : {
          "Remove" : "key"
        }
      }
    }
  },
  "RequestId" : "31d3a0f0-07ed-4f6e-9004-1804498c****",
  "Priority" : 1,
  "Status" : 1,
  "Description" : "demo route"
}

错误码

HttpCode 错误码 错误信息 描述
500 ERR500 An internal server error occurred. 后端服务异常

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