apache / dubbo-admin

The ops and reference implementation for Apache Dubbo
https://dubbo.apache.org
Apache License 2.0
3.99k stars 2.17k forks source link

"流量灰度" 功能前端交互解析 #1157

Closed chickenlj closed 1 year ago

chickenlj commented 1 year ago

image

上面第一条示例中,灰度环境有:graypre,灰度环境来源于 tags 下的数组。

type Gray struct {
    Application string `json:"application" binding:"required"`
    Tags        []Tag  `json:"tags" binding:"required"`
}

‘新建’ 按钮中灰度名称、匹配条件两部分,分别对应 Tag 中的 name 和 match 部分。

type Tag struct {
    Name      string       `json:"name" yaml:"name" binding:"required"`
    Match     []ParamMatch `json:"match" yaml:"match" binding:"required,omitempty"`
}
chickenlj commented 1 year ago

新建规则时的数据格式

{
    "application": "demo",
    "tags": [{
        "name": "pre",
        "match": {
            "key": "xxx",
            "value": {
                "exact": "xxx"
            }
        }
    }]
}