{ "swagger": "2.0", "info": { "title": "BCS-Monitor OpenAPI", "contact": {} }, "basePath": "/bcsapi/v4/monitor/api/projects/:projectId/clusters/:clusterId", "paths": { "/cpu_request_usage": { "get": { "tags": [ "Metrics" ], "summary": "集群 CPU 装箱率", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/cpu_usage": { "get": { "tags": [ "Metrics" ], "summary": "集群 CPU 使用率", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/disk_usage": { "get": { "tags": [ "Metrics" ], "summary": "集群磁盘使用率", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/diskio_usage": { "get": { "tags": [ "Metrics" ], "summary": "集群磁盘IO使用率", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/log_collector/entrypoints": { "post": { "produces": [ "application/json" ], "tags": [ "LogCollectors" ], "summary": "获取容器日志采集日志查询入口", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "$ref": "#/definitions/pkg_api_logrule.Entrypoint" } } } } } }, "/log_collector/rules": { "get": { "produces": [ "application/json" ], "tags": [ "LogCollectors" ], "summary": "获取日志采集规则列表", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/pkg_api_logrule.GetLogRuleResp" } } } } }, "post": { "produces": [ "application/json" ], "tags": [ "LogCollectors" ], "summary": "创建日志采集规则", "responses": { "200": { "description": "OK" } } } }, "/log_collector/rules/:id": { "get": { "produces": [ "application/json" ], "tags": [ "LogCollectors" ], "summary": "获取日志采集规则详情", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/pkg_api_logrule.GetLogRuleResp" } } } }, "put": { "produces": [ "application/json" ], "tags": [ "LogCollectors" ], "summary": "更新日志采集规则", "responses": { "200": { "description": "OK" } } }, "delete": { "produces": [ "application/json" ], "tags": [ "LogCollectors" ], "summary": "删除日志采集规则", "responses": { "200": { "description": "OK" } } } }, "/log_collector/rules/:id/disable": { "post": { "produces": [ "application/json" ], "tags": [ "LogCollectors" ], "summary": "停用日志采集规则", "responses": { "200": { "description": "OK" } } } }, "/log_collector/rules/:id/enable": { "post": { "produces": [ "application/json" ], "tags": [ "LogCollectors" ], "summary": "启用日志采集规则", "responses": { "200": { "description": "OK" } } } }, "/log_collector/rules/:id/retry": { "post": { "produces": [ "application/json" ], "tags": [ "LogCollectors" ], "summary": "重试日志采集规则", "responses": { "200": { "description": "OK" } } } }, "/memory_request_usage": { "get": { "tags": [ "Metrics" ], "summary": "集群内存装箱率", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/memory_usage": { "get": { "tags": [ "Metrics" ], "summary": "集群内存使用率", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/namespaces/:namespace/pods/:pod/containers": { "get": { "produces": [ "application/json" ], "tags": [ "Logs" ], "summary": "获取 Pod 容器列表", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/k8sclient.Container" } } } } } }, "/namespaces/:namespace/pods/:pod/logs": { "get": { "produces": [ "application/json" ], "tags": [ "Logs" ], "summary": "查询容器日志", "parameters": [ { "type": "string", "description": "容器名称", "name": "container_name", "in": "query", "required": true }, { "type": "string", "description": "是否使用上一次日志, 异常退出使用", "name": "previous", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/k8sclient.Log" } } } } } }, "/namespaces/:namespace/pods/:pod/logs/download": { "get": { "produces": [ "application/octet-stream" ], "tags": [ "Logs" ], "summary": "下载日志", "parameters": [ { "type": "string", "description": "容器名称", "name": "container_name", "in": "query", "required": true }, { "type": "string", "description": "是否使用上一次日志, 异常退出使用", "name": "previous", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/namespaces/:namespace/pods/:pod/logs/stream": { "get": { "produces": [ "text/event-stream" ], "tags": [ "Logs" ], "summary": "SSE 实时日志流", "parameters": [ { "type": "string", "description": "容器名称", "name": "container_name", "in": "query", "required": true }, { "type": "string", "description": "开始时间", "name": "started_at", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/namespaces/:namespace/pods/cpu_usage": { "post": { "tags": [ "Metrics" ], "summary": "Pod CPU使用率", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/namespaces/:namespace/pods/memory_used": { "post": { "tags": [ "Metrics" ], "summary": "Pod 内存使用量", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/namespaces/:namespace/pods/network_receive": { "post": { "tags": [ "Metrics" ], "summary": "网络接收量", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/namespaces/:namespace/pods/network_transmit": { "post": { "tags": [ "Metrics" ], "summary": "Pod 网络发送量", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/namespaces/namespace/pods/:pod/containers/:container/cpu_limit": { "get": { "tags": [ "Metrics" ], "summary": "容器 CPU 限制", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/namespaces/namespace/pods/:pod/containers/:container/cpu_usage": { "get": { "tags": [ "Metrics" ], "summary": "容器 CPU 使用率", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/namespaces/namespace/pods/:pod/containers/:container/disk_read_total": { "get": { "tags": [ "Metrics" ], "summary": "容器磁盘读总量", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/namespaces/namespace/pods/:pod/containers/:container/disk_write_total": { "get": { "tags": [ "Metrics" ], "summary": "容器磁盘写总量", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/namespaces/namespace/pods/:pod/containers/:container/memory_limit": { "get": { "tags": [ "Metrics" ], "summary": "容器内存限制", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/namespaces/namespace/pods/:pod/containers/:container/memory_used": { "get": { "tags": [ "Metrics" ], "summary": "容器内存使用量", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/nodes/:node/cpu_request_usage": { "get": { "tags": [ "Metrics" ], "summary": "查询 CPU 装箱率", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/nodes/:node/cpu_usage": { "get": { "tags": [ "Metrics" ], "summary": "查询 CPU 使用率", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/nodes/:node/disk_usage": { "get": { "tags": [ "Metrics" ], "summary": "节点磁盘使用率", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/nodes/:node/diskio_usage": { "get": { "tags": [ "Metrics" ], "summary": "节点磁盘IO", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/nodes/:node/info": { "get": { "tags": [ "Metrics" ], "summary": "节点信息", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/nodes/:node/memory_request_usage": { "get": { "tags": [ "Metrics" ], "summary": "节点内存装箱率", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/nodes/:node/memory_usage": { "get": { "tags": [ "Metrics" ], "summary": "节点内存使用率", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/nodes/:node/network_receive": { "get": { "tags": [ "Metrics" ], "summary": "节点网络发送", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/nodes/:node/network_transmit": { "get": { "tags": [ "Metrics" ], "summary": "节点网络接收", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/nodes/:node/overview": { "get": { "tags": [ "Metrics" ], "summary": "查询节点概览", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/overview": { "get": { "tags": [ "Metrics" ], "summary": "集群概览数据", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/service_monitors/batchdelete": { "delete": { "tags": [ "Metrics" ], "summary": "批量删除ServiceMonitor", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/service_monitors/create/namespaces/:namespace/servicemonitors/:name": { "post": { "tags": [ "Metrics" ], "summary": "ServiceMonitor列表数据", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/service_monitors/namespaces/:namespace": { "get": { "tags": [ "Metrics" ], "summary": "ServiceMonitor列表数据", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/service_monitors/namespaces/:namespace/servicemonitors/:name": { "delete": { "tags": [ "Metrics" ], "summary": "删除ServiceMonitor", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/service_monitors/update/namespaces/:namespace/servicemonitors/:name": { "put": { "tags": [ "Metrics" ], "summary": "ServiceMonitor列表数据", "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } } }, "definitions": { "bklog.Conditions": { "type": "object", "properties": { "match_content": { "type": "string" }, "match_type": { "description": "include, exclude(开发中,暂不支持)", "type": "string" }, "separator": { "description": "分隔符,| 等", "type": "string" }, "separator_filters": { "description": "分隔符过滤条件", "type": "array", "items": { "$ref": "#/definitions/bklog.SeparatorFilters" } }, "type": { "description": "match, separator", "type": "string" } } }, "bklog.Container": { "type": "object", "properties": { "container_name": { "type": "string" }, "workload_name": { "type": "string" }, "workload_type": { "type": "string" } } }, "bklog.Expression": { "type": "object", "properties": { "key": { "type": "string" }, "operator": { "type": "string" }, "value": { "type": "string" } } }, "bklog.Label": { "type": "object", "properties": { "key": { "type": "string" }, "value": { "type": "string" } } }, "bklog.LabelSelector": { "type": "object", "properties": { "match_expressions": { "type": "array", "items": { "$ref": "#/definitions/bklog.Expression" } }, "match_labels": { "type": "array", "items": { "$ref": "#/definitions/bklog.Label" } } } }, "bklog.LogRule": { "type": "object", "properties": { "add_pod_label": { "type": "boolean" }, "config": { "$ref": "#/definitions/bklog.LogRuleContainer" }, "extra_labels": { "type": "array", "items": { "$ref": "#/definitions/bklog.Label" } } } }, "bklog.LogRuleContainer": { "type": "object", "properties": { "conditions": { "$ref": "#/definitions/bklog.Conditions" }, "container": { "$ref": "#/definitions/bklog.Container" }, "data_encoding": { "type": "string" }, "enable_stdout": { "type": "boolean" }, "label_selector": { "$ref": "#/definitions/bklog.LabelSelector" }, "namespaces": { "type": "array", "items": { "type": "string" } }, "paths": { "type": "array", "items": { "type": "string" } } } }, "bklog.SeparatorFilters": { "type": "object", "properties": { "fieldindex": { "description": "第几列", "type": "string" }, "logic_op": { "description": "and, or", "type": "string" }, "op": { "description": "=", "type": "string" }, "word": { "type": "string" } } }, "github.com_Tencent_bk-bcs_bcs-services_bcs-monitor_pkg_api_logrule.Entrypoint": { "type": "object", "properties": { "file_log_url": { "type": "string" }, "std_log_url": { "type": "string" } } }, "github.com_Tencent_bk-bcs_bcs-services_bcs-monitor_pkg_api_logrule.GetLogRuleResp": { "type": "object", "properties": { "created_at": { "$ref": "#/definitions/utils.JSONTime" }, "creator": { "type": "string" }, "description": { "type": "string" }, "entrypoint": { "$ref": "#/definitions/github.com_Tencent_bk-bcs_bcs-services_bcs-monitor_pkg_api_logrule.Entrypoint" }, "file_index_set_id": { "type": "integer" }, "id": { "type": "string" }, "message": { "type": "string" }, "name": { "type": "string" }, "new_rule_id": { "description": "当旧规则转换过新规则后,显示该字段", "type": "string" }, "old": { "type": "boolean" }, "rule": { "$ref": "#/definitions/bklog.LogRule" }, "rule_id": { "type": "integer" }, "rule_name": { "type": "string" }, "status": { "type": "string" }, "std_index_set_id": { "type": "integer" }, "updated_at": { "$ref": "#/definitions/utils.JSONTime" }, "updator": { "type": "string" } } }, "k8sclient.Container": { "type": "object", "properties": { "name": { "type": "string" } } }, "k8sclient.Log": { "type": "object", "properties": { "log": { "type": "string" }, "time": { "type": "string" } } }, "pkg_api_logrule.Entrypoint": { "type": "object", "properties": { "file_log_url": { "type": "string" }, "std_log_url": { "type": "string" } } }, "pkg_api_logrule.GetLogRuleResp": { "type": "object", "properties": { "created_at": { "$ref": "#/definitions/utils.JSONTime" }, "creator": { "type": "string" }, "description": { "type": "string" }, "entrypoint": { "$ref": "#/definitions/pkg_api_logrule.Entrypoint" }, "file_index_set_id": { "type": "integer" }, "id": { "type": "string" }, "message": { "type": "string" }, "name": { "type": "string" }, "new_rule_id": { "description": "当旧规则转换过新规则后,显示该字段", "type": "string" }, "old": { "type": "boolean" }, "rule": { "$ref": "#/definitions/bklog.LogRule" }, "rule_id": { "type": "integer" }, "rule_name": { "type": "string" }, "status": { "type": "string" }, "std_index_set_id": { "type": "integer" }, "updated_at": { "$ref": "#/definitions/utils.JSONTime" }, "updator": { "type": "string" } } }, "utils.JSONTime": { "type": "object", "properties": { "time.Time": { "type": "string" } } } } }