调用UpdateIstioGatewayRoutes更新网关路由。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
| 名称 | 类型 | 是否必选 | 示例值 | 描述 |
|---|---|---|---|---|
| Action | String | 是 | UpdateIstioGatewayRoutes |
系统规定参数。取值:UpdateIstioGatewayRoutes。 |
| ServiceMeshId | String | 是 | c08ba3fd1e6484b0f8cc1ad8fe10d**** |
服务网格实例ID。 |
| IstioGatewayName | String | 否 | ingressgateway |
ASM网关名称。 |
| GatewayRoute | Object | 否 |
网关路由信息。 |
|
| RouteName | String | 否 | reviews-v2-routes |
路由名称。 |
| RouteType | String | 否 | HTTP |
路由类型,取值: |
| MatchRequest | Object | 否 |
路由匹配规则。 |
|
| URI | Object | 否 |
URI匹配规则。 |
|
| MatchingMode | String | 否 | prefix |
路由规则匹配模式。取值:
|
| MatchingContent | String | 否 | /ratings/v2/ |
用于匹配的内容。 |
| Headers | Array | 否 |
用于判断是否匹配的请求头部列表。 |
|
| Name | String | 否 | x-request-id |
Header匹配的键。 |
| MatchingMode | String | 否 | exact |
Header值匹配方式,取值:
|
| MatchingContent | String | 否 | v1 |
用于Header匹配的内容。 |
| TLSMatchAttributes | Array | 否 |
TLS连接匹配属性列表。 |
|
| TLSPort | Integer | 否 | 443 |
TLS端口。 |
| SNIHosts | Array of String | 否 | *.com |
SNI值中可以使用通配符前缀,例如 说明 SNI值必须是相应虚拟服务主机的子集。
|
| Ports | Array of Integer | 否 | 443 |
指定主机上要寻址的端口.。 |
| RouteDestinations | Array | 否 |
L4路由规则加权目的地列表。 |
|
| Destination | Object | 否 |
Destination唯一标识请求或连接应转发到的服务实例。 |
|
| Host | String | 否 | reviews |
服务注册表中服务的名称。 |
| Subset | String | 否 | v1 |
服务中子集的名称。 |
| Weight | Integer | 否 | 80 |
服务子集权重。 |
| 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 |
给定请求允许的重试次数。 |
| RetryOn | String | 否 | connect-failure,refused-stream,503 |
用于指定重试是否应重试到其他位置的标志,例如 |
| RetryRemoteLocalities | Object | 否 |
用于指定重试是否应重试到其他位置的标志。 |
|
| Value | Boolean | 否 | false |
用于指定重试是否应重试到其他位置的标志,取值:
默认 |
| PerTryTimeout | String | 否 | 2s |
请求的每次尝试超时时间。 |
| Fault | Object | 否 |
故障注入设置。 |
|
| Delay | Object | 否 |
设置延迟。 |
|
| FixedDelay | String | 否 | 5s |
固定延迟时间。 |
| 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 |
流量镜像百分比,用小数表示。 |
| Namespace | String | 否 | default |
命名空间 |
| Priority | Integer | 否 | 1 |
路由优先级。整数,数字越小,优先级越高。 |
| Status | Integer | 否 | 1 |
网关路由状态,取值:
|
| Description | String | 否 | demo route |
路由描述。 |
返回数据
| 名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| RequestId | String | 31d3a0f0-07ed-4f6e-9004-1804498c**** |
请求ID。 |
示例
请求示例
http(s)://[Endpoint]/?Action=UpdateIstioGatewayRoutes
&ServiceMeshId=c08ba3fd1e6484b0f8cc1ad8fe10d****
&IstioGatewayName=ingressgateway
&GatewayRoute={"RouteName":"reviews-v2-routes","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]},"RouteDestinations":[{"Destination":{"Host":"reviews","Subset":"v1"},"Weight":80}],"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,"RetryOn":"connect-failure,refused-stream,503","RetryRemoteLocalities":{"Value":false},"PerTryTimeout":"2s"},"Fault":{"Delay":{"FixedDelay":"5s","Percentage":{"Value":0.1}},"Abort":{"HttpStatus":400,"Percentage":{"Value":0.1}}},"Mirror":{"Host":"reviews.default.svc.cluster.local","Subset":"v1"},"MirrorPercentage":{"Value":0.2}},"Namespace":"default"}
&Priority=1
&Status=1
&Description=demo route
&公共请求参数
正常返回示例
XML格式
HTTP/1.1 200 OK
Content-Type:application/xml
<UpdateIstioGatewayRoutesResponse>
<RequestId>31d3a0f0-07ed-4f6e-9004-1804498c****</RequestId>
</UpdateIstioGatewayRoutesResponse>
JSON格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "31d3a0f0-07ed-4f6e-9004-1804498c****"
}
错误码
访问错误中心查看更多错误码。