新建自动发现配置¶
POST /api/v1/issue_auto_discovery/add
概述¶
Body 请求参数¶
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| name | string | Y | 标题名称 例子: name 允许为空: False 最大长度: 256 |
| description | string | 描述 例子: description 允许为空: False 允许为空字符串: True |
|
| dqlNamespace | string | Y | 数据范围 例子: rum 允许为空: False 可选值: ['keyevent'] |
| every | integer | Y | 检查频率(以秒为单位的时间长度) 例子: 300 允许为空: False $minValue: 300 $maxValue: 3600 可选值: [60, 300, 600, 900, 1800, 3600] |
| conditions | string | dql 查询过滤条件 中的 花括号内容部分 例子: source IN ['kube-controller'] 允许为空: False 允许为空字符串: True |
|
| dimensions | array | 维度字段列表 例子: ['chan_xxx1', 'chan_xxx2'] 允许为空: False $minLength: 1 |
|
| config | json | Y | Issue 定义配置 例子: {} 允许为空: False |
| config.name | string | Y | 标题名称 例子: name 允许为空: False 最大长度: 256 |
| config.level | string | 等级 例子: level 允许为空: False 允许为空字符串: True |
|
| config.channelUUIDs | array | 频道 UUID 列表 例子: ['chan_xxx1', 'chan_xxx2'] 允许为空: False |
|
| config.description | string | 描述 例子: description 允许为空: False |
|
| config.extend | json | 额外拓展信息,可参考 issue 新建中的 extend 字段,一般不建议 OpenAPI 侧进行设置 例子: {} 允许为空: True |
参数补充说明¶
请求例子¶
curl 'https://openapi.guance.com/api/v1/issue_auto_discovery/add' \
-H 'Content-Type: application/json' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw '{"name":"test-core-worker","description":"desc1","every":300,"dqlNamespace":"keyevent","conditions":"`source` = \"lwctest\"","dimensions":["name"],"config":{"name":"name1","description":"desc1","level":"system_level_0","extend":{"manager":["acnt_e52a5a7b6418464cb2acbeaa199e7fd1"]},"channelUUIDs":["chan_61367ab1e38744738eb0a219dbf8bac1"]}}' \
--insecure
响应¶
{"code":200,"content":{"conditions":"`source` = \\"lwctest\\"","config":{"channelUUIDs":["chan_xxx"],"description":"desc1","extend":{"manager":["acnt_xxx"]},"level":"system_level_0","name":"name1"},"createAt":1735893173,"creator":"wsak_xxxx","declaration":{"asd":"aa,bb,cc,1,True","asdasd":"dawdawd","business":"aaa","dd":"dd","fawf":"afawf","organization":"64fe7b4062f74d0007b46676"},"deleteAt":-1,"description":"desc1","dimensions":["name"],"dqlNamespace":"keyevent","every":300,"id":null,"name":"test-core-worker","status":0,"updateAt":null,"updator":null,"uuid":"iatdc_xxxx","workspaceUUID":"wksp_xxxx"},"errorCode":"","message":"","success":true,"traceId":"4483644685680847012"}