diff --git a/models_gen.go b/models_gen.go index 1d36a16..a821ac7 100644 --- a/models_gen.go +++ b/models_gen.go @@ -5763,6 +5763,8 @@ type InvestigationTarget struct { Dashboard DashboardInvestigationTarget `json:"dashboard,omitzero" toon:"dashboard,omitempty"` // Entry kind: `dashboard` opens a dashboard panel, `query` opens an Explore query. It decides whether `dashboard` or `query` must be supplied; supplying the other one is rejected. Kind string `json:"kind" toon:"kind"` + // One-sentence plain text explaining what this entry helps confirm during investigation. Literal text, not a template, and not part of the alert identity. At most 512 bytes; control characters are rejected. + Purpose string `json:"purpose,omitempty" toon:"purpose,omitempty"` // Configuration for the `query` kind; required when `kind` is `query`, and rejected when `kind` is `dashboard`. Query QueryInvestigationTarget `json:"query,omitzero" toon:"query,omitempty"` // Window around the event time, required on every saved entry. A zero-length window is rejected; defaults belong to the editor. @@ -7793,8 +7795,8 @@ type QueryFramesResult struct { // QueryInvestigationTarget is generated from the Flashduty OpenAPI schema. type QueryInvestigationTarget struct { - // Data source the query runs against. - DatasourceID int64 `json:"datasource_id" toon:"datasource_id"` + // Data source the query runs against. Omit (or set 0) to run on the alert event's own datasource. + DatasourceID int64 `json:"datasource_id,omitempty" toon:"datasource_id,omitempty"` // Query payload. Query DashboardQuery `json:"query" toon:"query"` } diff --git a/openapi/openapi.en.json b/openapi/openapi.en.json index d7d57a3..bab6114 100644 --- a/openapi/openapi.en.json +++ b/openapi/openapi.en.json @@ -29229,6 +29229,11 @@ ], "description": "Entry kind: `dashboard` opens a dashboard panel, `query` opens an Explore query. It decides whether `dashboard` or `query` must be supplied; supplying the other one is rejected." }, + "purpose": { + "type": "string", + "maxLength": 512, + "description": "One-sentence plain text explaining what this entry helps confirm during investigation. Literal text, not a template, and not part of the alert identity. At most 512 bytes; control characters are rejected." + }, "time_range": { "$ref": "#/components/schemas/InvestigationTimeRange", "description": "Window around the event time, required on every saved entry. A zero-length window is rejected; defaults belong to the editor." @@ -29303,9 +29308,9 @@ "datasource_id": { "type": "integer", "format": "int64", - "minimum": 1, + "minimum": 0, "maximum": 9007199254740991, - "description": "Data source the query runs against." + "description": "Data source the query runs against. Omit (or set 0) to run on the alert event's own datasource." }, "query": { "$ref": "#/components/schemas/DashboardQuery", @@ -29313,7 +29318,6 @@ } }, "required": [ - "datasource_id", "query" ] }, diff --git a/openapi/openapi.zh.json b/openapi/openapi.zh.json index 171481a..bbbf579 100644 --- a/openapi/openapi.zh.json +++ b/openapi/openapi.zh.json @@ -29229,6 +29229,11 @@ ], "description": "入口类型:`dashboard` 打开仪表盘面板,`query` 打开 Explore 查询。它决定必须提供 `dashboard` 还是 `query`,提供另一个会被拒绝。" }, + "purpose": { + "type": "string", + "maxLength": 512, + "description": "一句话纯文本,说明该入口帮助确认什么排查意图。不是模板,也不参与告警身份计算。不超过 512 字节;不允许包含控制字符。" + }, "time_range": { "$ref": "#/components/schemas/InvestigationTimeRange", "description": "事件时间前后的取数窗口,每个已保存的入口都必填。长度为 0 的窗口会被拒绝;默认值由前端编辑器提供。" @@ -29303,9 +29308,9 @@ "datasource_id": { "type": "integer", "format": "int64", - "minimum": 1, + "minimum": 0, "maximum": 9007199254740991, - "description": "查询所用的数据源。" + "description": "查询所用的数据源。省略(或填 0)表示使用告警事件自身的数据源。" }, "query": { "$ref": "#/components/schemas/DashboardQuery", @@ -29313,7 +29318,6 @@ } }, "required": [ - "datasource_id", "query" ] },