{ "swagger": "2.0", "info": { "description": "bk unify-query swagger api", "title": "bk-unify-query", "contact": {}, "version": "1.0" }, "basePath": "/", "paths": { "/api/v1/relation/multi_resource": { "post": { "produces": [ "application/json" ], "summary": "query relation multi resource", "operationId": "relation_multi_resource_query", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cmdb.RelationMultiResourceRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/cmdb.RelationMultiResourceResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrResponse" } } } } }, "/api/v1/relation/multi_resource_range": { "post": { "produces": [ "application/json" ], "summary": "query relation multi resource", "operationId": "relation_multi_resource_query_range", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cmdb.RelationMultiResourceRangeRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/cmdb.RelationMultiResourceRangeResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.ErrResponse" } } } } }, "/check/query/ts": { "post": { "produces": [ "application/json" ], "summary": "query ts monitor check by ts", "operationId": "check_query_ts", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "type": "string", "default": "", "description": "是否跳过空间验证", "name": "X-Bk-Scope-Skip-Space", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/structured.QueryTs" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.CheckQueryTsDataResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } }, "/check/query/ts/promql": { "post": { "produces": [ "application/json" ], "summary": "query promql monitor check by ts", "operationId": "check_query_promql", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "type": "string", "default": "", "description": "是否跳过空间验证", "name": "X-Bk-Scope-Skip-Space", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/structured.QueryPromQL" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.CheckQueryTsDataResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } }, "/query/promql": { "post": { "produces": [ "application/json" ], "summary": "query monitor by promql", "operationId": "query_promql", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "username:goodman", "description": "来源", "name": "Bk-Query-Source", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "type": "string", "default": "", "description": "是否跳过空间验证", "name": "X-Bk-Scope-Skip-Space", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/structured.QueryPromQL" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.PromData" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } }, "/query/raw": { "post": { "produces": [ "application/json" ], "summary": "query monitor by raw data", "operationId": "query_raw", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "username:goodman", "description": "来源", "name": "Bk-Query-Source", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "type": "string", "default": "", "description": "是否跳过空间验证", "name": "X-Bk-Scope-Skip-Space", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/structured.QueryTs" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.ListData" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } }, "/query/raw_with_scroll": { "post": { "produces": [ "application/json" ], "summary": "query monitor by raw data with scroll", "operationId": "query_raw_with_scroll", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "username:goodman", "description": "来源", "name": "Bk-Query-Source", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "type": "string", "default": "", "description": "是否跳过空间验证", "name": "X-Bk-Scope-Skip-Space", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/structured.QueryTs" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.ListData" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } }, "/query/reference": { "post": { "produces": [ "application/json" ], "summary": "query monitor by reference", "operationId": "query_reference", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "username:goodman", "description": "来源", "name": "Bk-Query-Source", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "type": "string", "default": "", "description": "是否跳过空间验证", "name": "X-Bk-Scope-Skip-Space", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/structured.QueryTs" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.PromData" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } }, "/query/ts": { "post": { "produces": [ "application/json" ], "summary": "query monitor by ts", "operationId": "query_ts", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "username:goodman", "description": "来源", "name": "Bk-Query-Source", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "type": "string", "default": "", "description": "是否跳过空间验证", "name": "X-Bk-Scope-Skip-Space", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/structured.QueryTs" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.PromData" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } }, "/query/ts/exemplar": { "post": { "produces": [ "application/json" ], "summary": "query monitor by ts exemplar", "operationId": "query_ts_exemplar", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "username:goodman", "description": "来源", "name": "Bk-Query-Source", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "type": "string", "default": "", "description": "是否跳过空间验证", "name": "X-Bk-Scope-Skip-Space", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/structured.QueryTs" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.PromData" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } }, "/query/ts/info/field_keys": { "post": { "produces": [ "application/json" ], "summary": "info field keys", "operationId": "info_field_keys", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "username:goodman", "description": "来源", "name": "Bk-Query-Source", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "type": "string", "default": "", "description": "是否跳过空间验证", "name": "X-Bk-Scope-Skip-Space", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.Params" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "array", "items": { "type": "string" } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } }, "/query/ts/info/field_map": { "post": { "produces": [ "application/json" ], "summary": "info field map", "operationId": "info_field_map", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "username:goodman", "description": "来源", "name": "Bk-Query-Source", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "type": "string", "default": "", "description": "是否跳过空间验证", "name": "X-Bk-Scope-Skip-Space", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.Params" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/http.SeriesData" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } }, "/query/ts/info/series": { "post": { "produces": [ "application/json" ], "summary": "info series", "operationId": "info_series", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "username:goodman", "description": "来源", "name": "Bk-Query-Source", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "type": "string", "default": "", "description": "是否跳过空间验证", "name": "X-Bk-Scope-Skip-Space", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.Params" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/http.SeriesData" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } }, "/query/ts/info/tag_keys": { "post": { "produces": [ "application/json" ], "summary": "info tag keys", "operationId": "info_tag_keys", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "username:goodman", "description": "来源", "name": "Bk-Query-Source", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "type": "string", "default": "", "description": "是否跳过空间验证", "name": "X-Bk-Scope-Skip-Space", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.Params" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "array", "items": { "type": "string" } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } }, "/query/ts/info/tag_values": { "post": { "produces": [ "application/json" ], "summary": "info tag values", "operationId": "info_tag_values", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "username:goodman", "description": "来源", "name": "Bk-Query-Source", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "type": "string", "default": "", "description": "是否跳过空间验证", "name": "X-Bk-Scope-Skip-Space", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.Params" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.TagValuesData" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } }, "/query/ts/info/time_series": { "post": { "produces": [ "application/json" ], "summary": "info time series", "operationId": "info_time_series", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "username:goodman", "description": "来源", "name": "Bk-Query-Source", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "type": "string", "default": "", "description": "是否跳过空间验证", "name": "X-Bk-Scope-Skip-Space", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.Params" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/http.SeriesData" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } }, "/query/ts/label/{label_name}/values": { "get": { "produces": [ "application/json" ], "summary": "info label values", "operationId": "info_label_values", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "username:goodman", "description": "来源", "name": "Bk-Query-Source", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "type": "string", "default": "", "description": "是否跳过空间验证", "name": "X-Bk-Scope-Skip-Space", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.Params" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "array", "items": { "type": "string" } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } }, "/query/ts/promql_to_struct": { "post": { "produces": [ "application/json" ], "summary": "promql to struct", "operationId": "transform_promql_to_struct", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "username:goodman", "description": "来源", "name": "Bk-Query-Source", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/structured.QueryPromQL" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/structured.QueryTs" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } }, "/query/ts/struct_to_promql": { "post": { "produces": [ "application/json" ], "summary": "query struct to promql", "operationId": "transform_struct_to_promql", "parameters": [ { "type": "string", "default": "00-3967ac0f1648bf0216b27631730d7eb9-8e3c31d5109e78dd-01", "description": "TraceID", "name": "traceparent", "in": "header" }, { "type": "string", "default": "username:goodman", "description": "来源", "name": "Bk-Query-Source", "in": "header" }, { "type": "string", "default": "bkcc__2", "description": "空间UID", "name": "X-Bk-Scope-Space-Uid", "in": "header" }, { "description": "json data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/structured.QueryTs" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/structured.QueryPromQL" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/http.ErrResponse" } } } } } }, "definitions": { "api.ErrResponse": { "type": "object", "properties": { "error": { "type": "string" } } }, "cmdb.Matcher": { "type": "object", "additionalProperties": { "type": "string" } }, "cmdb.MatchersWithTimestamp": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/cmdb.Matcher" } }, "timestamp": { "type": "integer" } } }, "cmdb.RelationMultiResourceRangeRequest": { "type": "object", "properties": { "query_list": { "type": "array", "items": { "type": "object", "properties": { "end_time": { "type": "integer" }, "look_back_delta": { "type": "string" }, "path_resource": { "type": "array", "items": { "type": "string" } }, "source_expand_info": { "$ref": "#/definitions/cmdb.Matcher" }, "source_info": { "$ref": "#/definitions/cmdb.Matcher" }, "source_type": { "type": "string" }, "start_time": { "type": "integer" }, "step": { "type": "string" }, "target_info_show": { "type": "boolean" }, "target_type": { "type": "string" } } } } } }, "cmdb.RelationMultiResourceRangeResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/cmdb.RelationMultiResourceRangeResponseData" } }, "trace_id": { "type": "string" } } }, "cmdb.RelationMultiResourceRangeResponseData": { "type": "object", "properties": { "code": { "type": "integer" }, "message": { "type": "string" }, "path": { "type": "array", "items": { "type": "string" } }, "source_info": { "$ref": "#/definitions/cmdb.Matcher" }, "source_type": { "type": "string" }, "target_list": { "type": "array", "items": { "$ref": "#/definitions/cmdb.MatchersWithTimestamp" } }, "target_type": { "type": "string" } } }, "cmdb.RelationMultiResourceRequest": { "type": "object", "properties": { "query_list": { "type": "array", "items": { "type": "object", "properties": { "look_back_delta": { "type": "string" }, "path_resource": { "type": "array", "items": { "type": "string" } }, "source_expand_info": { "$ref": "#/definitions/cmdb.Matcher" }, "source_info": { "$ref": "#/definitions/cmdb.Matcher" }, "source_type": { "type": "string" }, "target_info_show": { "type": "boolean" }, "target_type": { "type": "string" }, "timestamp": { "type": "integer" } } } } } }, "cmdb.RelationMultiResourceResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/cmdb.RelationMultiResourceResponseData" } }, "trace_id": { "type": "string" } } }, "cmdb.RelationMultiResourceResponseData": { "type": "object", "properties": { "code": { "type": "integer" }, "message": { "type": "string" }, "path": { "type": "array", "items": { "type": "string" } }, "source_info": { "$ref": "#/definitions/cmdb.Matcher" }, "source_type": { "type": "string" }, "target_list": { "type": "array", "items": { "$ref": "#/definitions/cmdb.Matcher" } }, "target_type": { "type": "string" } } }, "http.CheckQueryTsDataResponse": { "type": "object", "properties": { "data": { "description": "Data 每项为子查询对应 tsdb.Instance.GetRequestBody(ctx) 的序列化结果。直查 VM 常为单元素 VmQueryCheckBody:metricql 由 vmCheckMetricql 生成后经 metadata.SetCheckPreviewMetricQL 写入,VM 实例在 GetRequestBody 中与 GetExpand 一并读出。非直查若某存储无预览体则该项不出现在 data 中。\nData 可为空:当仅有路由预览(RouteInfo 非空)且各存储未实现 GetRequestBody 预览体时,不调真实 TSDB 仍返回 200。", "type": "array", "items": {} }, "route_info": { "description": "RouteInfo 与 ToQueryReference 展开后的每条子查询一一对应,用于路由排障(如 table_id、db 是否为空)。与 data 是否为空无关。", "type": "array", "items": { "$ref": "#/definitions/metadata.RouteInfo" } }, "trace_id": { "description": "TraceID 链路 ID(与 trace span 一致)。", "type": "string" } } }, "http.ErrResponse": { "type": "object", "properties": { "error": { "type": "string" }, "trace_id": { "type": "string" } } }, "http.ListData": { "type": "object", "properties": { "done": { "type": "boolean" }, "list": { "type": "array", "items": { "type": "object", "additionalProperties": {} } }, "result_table_id": { "description": "ResultTableID 来自 QueryReference 路由解析结果,不随分页、scroll 或返回行裁剪。", "type": "array", "items": { "type": "string" } }, "result_table_options": { "$ref": "#/definitions/metadata.ResultTableOptions" }, "status": { "$ref": "#/definitions/metadata.Status" }, "total": { "type": "integer" }, "trace_id": { "type": "string" } } }, "http.Params": { "type": "object", "properties": { "conditions": { "$ref": "#/definitions/structured.Conditions" }, "data_source": { "type": "string" }, "end_time": { "type": "string" }, "is_regexp": { "description": "IsRegexp 指标是否使用正则查询", "type": "boolean", "example": false }, "keys": { "type": "array", "items": { "type": "string" } }, "limit": { "type": "integer" }, "metric_name": { "type": "string" }, "slimit": { "type": "integer" }, "start_time": { "type": "string" }, "table_id": { "type": "string" }, "table_id_conditions": { "description": "TableIDConditions 表标签条件;与 /query/ts 的 body.table_id_conditions 一致,\n仅在未指定 table_id / data_label 的全空间扫表场景下按结果表 Labels 收窄候选 RT。", "type": "array", "items": { "type": "array", "items": { "$ref": "#/definitions/structured.ConditionField" } } }, "timezone": { "type": "string", "example": "Asia/Shanghai" }, "tsdb_map": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/query.TsDBV2" } } } } }, "http.PromData": { "type": "object", "properties": { "is_partial": { "type": "boolean" }, "result_table_id": { "description": "ResultTableID 来自 QueryReference 路由解析结果;查询响应只暴露 RT 列表,不返回完整 RouteInfo。", "type": "array", "items": { "type": "string" } }, "series": { "type": "array", "items": { "$ref": "#/definitions/http.TablesItem" } }, "status": { "$ref": "#/definitions/metadata.Status" }, "trace_id": { "type": "string" } } }, "http.SeriesData": { "type": "object", "properties": { "keys": { "type": "array", "items": { "type": "string" } }, "measurement": { "type": "string" }, "series": { "type": "array", "items": { "type": "array", "items": { "type": "string" } } }, "trace_id": { "type": "string" } } }, "http.StatItem": { "type": "object", "properties": { "avg": { "$ref": "#/definitions/http.StatPoint" }, "count": { "$ref": "#/definitions/http.StatPoint" }, "last": { "$ref": "#/definitions/http.StatPoint" }, "max": { "$ref": "#/definitions/http.StatPoint" }, "min": { "$ref": "#/definitions/http.StatPoint" }, "sum": { "$ref": "#/definitions/http.StatPoint" } } }, "http.StatPoint": { "type": "object" }, "http.TablesItem": { "type": "object", "properties": { "columns": { "type": "array", "items": { "type": "string" } }, "group_keys": { "type": "array", "items": { "type": "string" } }, "group_values": { "type": "array", "items": { "type": "string" } }, "metric_name": { "type": "string" }, "name": { "type": "string" }, "stat": { "$ref": "#/definitions/http.StatItem" }, "types": { "type": "array", "items": { "type": "string" } }, "values": { "type": "array", "items": { "type": "array", "items": {} } } } }, "http.TagValuesData": { "type": "object", "properties": { "trace_id": { "type": "string" }, "values": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } } } }, "metadata.Collapse": { "type": "object", "properties": { "field": { "type": "string" } } }, "metadata.FieldAlias": { "type": "object", "additionalProperties": { "type": "string" } }, "metadata.HighLight": { "type": "object", "properties": { "enable": { "type": "boolean" }, "max_analyzed_offset": { "type": "integer" } } }, "metadata.ResultTableOption": { "type": "object", "properties": { "from": { "type": "integer" }, "result_schema": { "type": "array", "items": { "type": "object", "additionalProperties": {} } }, "scroll_id": { "type": "string" }, "search_after": { "type": "array", "items": {} }, "slice_index": { "type": "integer" }, "slice_max": { "type": "integer" }, "sql": { "type": "string" } } }, "metadata.ResultTableOptions": { "type": "object", "additionalProperties": { "$ref": "#/definitions/metadata.ResultTableOption" } }, "metadata.RouteInfo": { "type": "object", "properties": { "data_label": { "type": "string" }, "data_source": { "type": "string" }, "db": { "type": "string" }, "measurement": { "type": "string" }, "metric_name": { "type": "string" }, "reference_name": { "type": "string" }, "storage_id": { "type": "string" }, "storage_type": { "type": "string" }, "table_id": { "type": "string" } } }, "metadata.Status": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } } }, "metadata.TimeField": { "type": "object", "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "unit": { "type": "string" } } }, "query.Filter": { "type": "object", "additionalProperties": { "type": "string" } }, "query.Record": { "type": "object", "properties": { "enable_time": { "type": "integer" }, "storage_id": { "type": "string" }, "storage_type": { "type": "string" } } }, "query.TsDBV2": { "type": "object", "properties": { "cluster_name": { "type": "string" }, "cmdb_level_vm_rt": { "type": "string" }, "data_label": { "type": "string" }, "db": { "type": "string" }, "expand_metric_names": { "type": "array", "items": { "type": "string" } }, "field": { "type": "array", "items": { "type": "string" } }, "field_alias": { "$ref": "#/definitions/metadata.FieldAlias" }, "filters": { "type": "array", "items": { "$ref": "#/definitions/query.Filter" } }, "measurement": { "type": "string" }, "measurement_type": { "type": "string" }, "metric_name": { "description": "补充检索的元信息", "type": "string" }, "need_add_time": { "description": "NeedAddTime", "type": "boolean" }, "segmented_enable": { "type": "boolean" }, "source_type": { "description": "SourceType 数据来源", "type": "string" }, "storage_cluster_records": { "description": "StorageClusterRecords", "type": "array", "items": { "$ref": "#/definitions/query.Record" } }, "storage_id": { "description": "将存储信息合并在 TsDB 中", "type": "string" }, "storage_name": { "type": "string" }, "storage_type": { "type": "string" }, "table_id": { "type": "string" }, "tags_key": { "type": "array", "items": { "type": "string" } }, "time_field": { "description": "timeField", "allOf": [ { "$ref": "#/definitions/metadata.TimeField" } ] }, "vm_rt": { "type": "string" } } }, "structured.AggregateMethod": { "type": "object", "properties": { "dimensions": { "description": "Dimensions 聚合维度", "type": "array", "items": { "type": "string" }, "example": [ "bk_target_ip", "bk_target_cloud_id" ] }, "field": { "description": "Field 聚合字段,默认为指标字段,指定则会进行覆盖", "type": "string", "example": "field" }, "is_sub_query": { "description": "IsSubQuery 判断是否为子查询", "type": "boolean" }, "method": { "description": "Method 聚合方法", "type": "string", "example": "mean" }, "window": { "description": "Window 聚合周期", "type": "string", "example": "60s" }, "without": { "description": "Without", "type": "boolean" } } }, "structured.ConditionField": { "type": "object", "properties": { "field_name": { "description": "DimensionName 过滤字段", "type": "string", "example": "bk_biz_id" }, "is_prefix": { "description": "IsPrefix 是否是前缀", "type": "boolean" }, "is_suffix": { "description": "IsSuffix 是否是后缀", "type": "boolean" }, "is_wildcard": { "description": "IsWildcard 是否是通配符", "type": "boolean" }, "op": { "description": "Operator 操作符,包含:eq,ne,erq,nreq,contains,ncontains", "type": "string", "example": "contains" }, "value": { "description": "Value 查询值", "type": "array", "items": { "type": "string" }, "example": [ "2" ] } } }, "structured.Conditions": { "type": "object", "properties": { "condition_list": { "description": "ConditionList 组合条件,长度 = len(FieldList) - 1的数组,支持 and,or", "type": "array", "items": { "type": "string" }, "example": [ "and" ] }, "field_list": { "description": "FieldList 查询条件", "type": "array", "items": { "$ref": "#/definitions/structured.ConditionField" } } } }, "structured.Query": { "type": "object", "properties": { "collapse": { "description": "Collapse", "allOf": [ { "$ref": "#/definitions/metadata.Collapse" } ] }, "conditions": { "description": "Conditions 过滤条件", "allOf": [ { "$ref": "#/definitions/structured.Conditions" } ] }, "dimensions": { "description": "Dimensions promQL 使用维度", "type": "array", "items": { "type": "string" }, "example": [ "bk_target_ip", "bk_target_cloud_id" ] }, "field_name": { "description": "FieldName 查询指标", "type": "string", "example": "usage" }, "from": { "description": "From 翻页开启数字", "type": "integer", "example": 0 }, "function": { "description": "AggregateMethodList 维度聚合函数", "type": "array", "items": { "$ref": "#/definitions/structured.AggregateMethod" } }, "is_dom_sampled": { "description": "IsDomSampled 是否命中降采样算法", "type": "boolean" }, "is_prefix": { "description": "IsPrefix 是否启用前缀匹配", "type": "boolean" }, "is_regexp": { "description": "IsRegexp 指标是否使用正则查询", "type": "boolean", "example": false }, "limit": { "description": "Limit 点数限制数量", "type": "integer", "example": 0 }, "offset": { "description": "Offset 偏移量", "type": "string", "example": "" }, "offset_forward": { "description": "OffsetForward 偏移方向,默认 false 为向前偏移", "type": "boolean", "example": false }, "query_string": { "description": "QueryString 关键字查询", "type": "string" }, "reference_name": { "description": "ReferenceName 别名,用于表达式计算", "type": "string", "example": "a" }, "slimit": { "description": "Slimit 维度限制数量", "type": "integer", "example": 0 }, "sql": { "description": "SQL doris sql 解析", "type": "string" }, "start_or_end": { "description": "StartOrEnd @-modifier 标记,start or end", "type": "integer" }, "table_id": { "description": "TableID 数据实体ID,容器指标可以为空", "type": "string", "example": "system.cpu_summary" }, "table_id_conditions": { "description": "TableIDConditions 表标签条件(Body table_id_conditions 与 PromQL __bk_query_label_selector_\u003c维度\u003e 写入此字段,用于路由选表);AllConditions 形态,内层 AND、外层 OR。", "type": "array", "items": { "type": "array", "items": { "$ref": "#/definitions/structured.ConditionField" } } }, "time_aggregation": { "description": "TimeAggregation 时间聚合方法", "allOf": [ { "$ref": "#/definitions/structured.TimeAggregation" } ] }, "timestamp": { "description": "Timestamp @-modifier 标记", "type": "integer" }, "vector_offset": { "description": "VectorOffset", "allOf": [ { "$ref": "#/definitions/time.Duration" } ] } } }, "structured.QueryPromQL": { "type": "object", "properties": { "add_dimensions": { "description": "AddDimensions 额外添加的聚合维度,会与每个 function.dimensions 合并", "type": "array", "items": { "type": "string" } }, "bk_biz_ids": { "type": "array", "items": { "type": "string" } }, "down_sample_range": { "description": "DownSampleRange 降采样:大于Step才能生效,可以为空", "type": "string", "example": "5m" }, "end": { "type": "string" }, "instant": { "description": "瞬时数据", "type": "boolean" }, "is_verify_dimensions": { "type": "boolean" }, "limit": { "type": "integer" }, "look_back_delta": { "description": "LookBackDelta 偏移量", "type": "string" }, "match": { "type": "string" }, "max_source_resolution": { "type": "string" }, "not_align_influxdb": { "description": "不与influxdb对齐", "type": "boolean" }, "not_time_align": { "type": "boolean" }, "promql": { "type": "string" }, "reference": { "type": "boolean" }, "slimit": { "type": "integer" }, "start": { "type": "string" }, "step": { "type": "string" }, "timezone": { "description": "Timezone 时区", "type": "string", "example": "Asia/Shanghai" } } }, "structured.QueryTs": { "type": "object", "properties": { "add_dimensions": { "description": "AddDimensions 额外添加的聚合维度,会与每个 function.dimensions 合并", "type": "array", "items": { "type": "string" } }, "clear_cache": { "description": "ClearCache 是否强制清理已存在的缓存会话", "type": "boolean" }, "down_sample_range": { "description": "DownSampleRange 降采样:大于Step才能生效,可以为空", "type": "string", "example": "5m" }, "dry_run": { "description": "DryRun 是否启用 DryRun", "type": "boolean" }, "end_time": { "description": "End 结束时间:单位为任意长度的时间戳", "type": "string", "example": "1657851600" }, "from": { "description": "From 翻页开启数字", "type": "integer", "example": 0 }, "highlight": { "description": "HighLight 是否开启高亮", "allOf": [ { "$ref": "#/definitions/metadata.HighLight" } ] }, "instant": { "description": "Instant 瞬时数据", "type": "boolean" }, "is_merge_db": { "description": "IsMergeDB 是否启用合并 db 特性", "type": "boolean" }, "is_multi_from": { "description": "IsMultiFrom 是否启用 MultiFrom 查询", "type": "boolean" }, "is_search_after": { "description": "IsSearchAfter 是否启用 SearchAfter 查询", "type": "boolean" }, "limit": { "description": "增加公共限制\nLimit 点数限制数量", "type": "integer", "example": 0 }, "look_back_delta": { "description": "LookBackDelta 偏移量", "type": "string" }, "metric_merge": { "description": "MetricMerge 表达式:支持所有PromQL语法", "type": "string", "example": "a" }, "not_time_align": { "description": "NotTimeAlign 查询开始时间和聚合是否需要对齐\n例如\ntrue: range: 10:03 - 10:23 window: 10m -\u003e 10:03 - 10:13, 10:13 - 10:23\nfalse: range: 10:03 - 10:23 window: 10m -\u003e 10:00 - 10:10, 10:10 - 10:20, 10:20 - 10:23", "type": "boolean" }, "order_by": { "description": "OrderBy 排序字段列表,按顺序排序,负数代表倒序, [\"_time\", \"-_time\"]", "type": "array", "items": { "type": "string" } }, "query_list": { "description": "QueryList 查询实例", "type": "array", "items": { "$ref": "#/definitions/structured.Query" } }, "reference": { "description": "Reference 查询开始时间是否需要对齐,\n例如:\ntrue: range: 10:03 - 10:23 window: 10m -\u003e 10:03 - 10:10, 10:10 - 10:20, 10:20 - 10:23\nfalse: range: 10:03 - 10:23 window: 10m -\u003e 10:00 - 10:10, 10:10 - 10:20, 10:20 - 10:23", "type": "boolean" }, "result_table_options": { "$ref": "#/definitions/metadata.ResultTableOptions" }, "scroll": { "description": "Scroll 是否启用 Scroll 查询", "type": "string" }, "slice_max": { "description": "SliceMax 最大切片数量", "type": "integer" }, "space_uid": { "description": "SpaceUid 空间ID", "type": "string" }, "start_time": { "description": "Start 开始时间:单位为任意长度的时间戳", "type": "string", "example": "1657848000" }, "step": { "description": "Step 步长:最终返回的点数的时间间隔", "type": "string", "example": "1m" }, "timezone": { "description": "Timezone 时区", "type": "string", "example": "Asia/Shanghai" }, "tsdb_map": { "description": "TsDBMap 查询路由匹配中的 tsDB 列表 key:reference_name", "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/query.TsDBV2" } } } } }, "structured.TimeAggregation": { "type": "object", "properties": { "function": { "description": "Function 时间聚合方法", "type": "string", "example": "avg_over_time" }, "is_sub_query": { "description": "IsSubQuery 判断是否为子查询", "type": "boolean" }, "node_index": { "description": "NodeIndex 聚合函数的位置,用于还原 promql 的定位", "type": "integer" }, "window": { "description": "Window 聚合周期", "type": "string", "example": "60s" } } }, "time.Duration": { "type": "integer", "enum": [ -9223372036854775808, 9223372036854775807, 1, 1000, 1000000, 1000000000, 60000000000, 3600000000000, -9223372036854775808, 9223372036854775807, 1, 1000, 1000000, 1000000000, 60000000000, 3600000000000 ], "x-enum-varnames": [ "minDuration", "maxDuration", "Nanosecond", "Microsecond", "Millisecond", "Second", "Minute", "Hour", "minDuration", "maxDuration", "Nanosecond", "Microsecond", "Millisecond", "Second", "Minute", "Hour" ] } }, "securityDefinitions": { "BasicAuth": { "type": "basic" } } }