调用CreateOrUpdateSwimLaneIngressRule,针对一个泳道在对应网关下(目前仅支持ASM网关)创建或者更新引流规则。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | CreateOrUpdateSwimLaneIngressRule |
系统规定参数。取值:CreateOrUpdateSwimLaneIngressRule。 |
ServiceMeshId | String | 是 | xxx |
服务网格ID。 |
SwimLaneName | String | 否 | s1 |
泳道名称。 |
GroupName | String | 否 | test |
泳道组名称。 |
IngressService | String | 否 | mocka |
入口服务,该字段已废弃。 |
IngressRule | String | 否 | [ { "Domains":[ "*" ], "RouteName":"r1", "MatchRequest":{ "Headers":[ { "Name":"x-asm-prefer-tag", "MatchingMode":"exact", "MatchingContent":"s1" } ], "URI":{ "MatchingMode":"exact", "MatchingContent":"/mock" } }] |
引流规则,对应一条或者多条路由定义。 |
Operator | String | 否 | create |
创建( |
-
IngressRule
引流规则对应一条或者多条路由,单条路由配置采用自定义路由规则格式,同CreateIstioGatewayRoutes接口。
引流规则(IngressRule) 样例如下:json [ { "Domains":[ "*" ], "RouteName":"r1", "MatchRequest":{ "Headers":[ { "Name":"x-asm-prefer-tag", "MatchingMode":"exact", "MatchingContent":"s1" } ], "URI":{ "MatchingMode":"exact", "MatchingContent":"/mock" } }, "RouteDestinations":[ { "Destination":{ "Host":"mocka.default.svc.cluster.local", "Subset":"s1" } } ] }, { "Domains":[ "*" ], "RouteName":"hello", "MatchRequest":{ "Headers":[ { "Name":"x-asm-prefer-tag", "MatchingMode":"exact", "MatchingContent":"s1" } ], "URI":{ "MatchingMode":"exact", "MatchingContent":"/mocktest" } }, "RouteDestinations":[ { "Destination":{ "Host":"mocka.default.svc.cluster.local", "Subset":"s1" } } ] } ]
- Operator
取值为create
或者update
, 分别对应创建和更新操作。
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | xxxxxx |
请求ID。 |
示例
请求示例
http(s)://[Endpoint]/?Action=CreateOrUpdateSwimLaneIngressRule
&ServiceMeshId=xxx
&SwimLaneName=s1
&GroupName=test
&IngressService=mocka
&IngressRule=[ { "Domains":[ "*" ], "RouteName":"r1", "MatchRequest":{ "Headers":[ { "Name":"x-asm-prefer-tag", "MatchingMode":"exact", "MatchingContent":"s1" } ], "URI":{ "MatchingMode":"exact", "MatchingContent":"/mock" } }]
&Operator=create
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateOrUpdateSwimLaneIngressRuleResponse>
<RequestId>xxxxxx</RequestId>
</CreateOrUpdateSwimLaneIngressRuleResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "xxxxxx"
}
错误码
访问错误中心查看更多错误码。