调用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

创建(create)或者更新(update)。

  • 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"
}

错误码

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