Created
April 23, 2022 02:12
-
-
Save leveryd/5ae3ce4940831464d43945f42c68b4c0 to your computer and use it in GitHub Desktop.
tidb-dashboard生成的swagger文件
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT | |
| // This file was generated by swaggo/swag | |
| package swaggerspec | |
| import ( | |
| "bytes" | |
| "encoding/json" | |
| "strings" | |
| "github.com/alecthomas/template" | |
| "github.com/swaggo/swag" | |
| ) | |
| var doc = `{ | |
| "schemes": {{ marshal .Schemes }}, | |
| "swagger": "2.0", | |
| "info": { | |
| "description": "{{.Description}}", | |
| "title": "{{.Title}}", | |
| "contact": {}, | |
| "license": { | |
| "name": "Apache 2.0", | |
| "url": "http://www.apache.org/licenses/LICENSE-2.0.html" | |
| }, | |
| "version": "{{.Version}}" | |
| }, | |
| "host": "{{.Host}}", | |
| "basePath": "{{.BasePath}}", | |
| "paths": { | |
| "/configuration/all": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get all configurations", | |
| "operationId": "configurationGetAll", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/configuration.AllConfigItems" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "403": { | |
| "description": "Forbidden", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/configuration/edit": { | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Edit a configuration", | |
| "operationId": "configurationEdit", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/configuration.EditRequest" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/configuration.EditResponse" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "403": { | |
| "description": "Forbidden", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/continuous_profiling/action_token": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get action token for download or view profile", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "target query string", | |
| "name": "q", | |
| "in": "query", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "string" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/continuous_profiling/components": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get current scraping components", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/conprof.Component" | |
| } | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/continuous_profiling/config": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get Continuous Profiling Config", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/conprof.NgMonitoringConfig" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Update Continuous Profiling Config", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/conprof.NgMonitoringConfig" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "ok", | |
| "schema": { | |
| "type": "string" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/continuous_profiling/download": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "produces": [ | |
| "application/x-gzip" | |
| ], | |
| "summary": "Download Group Profile files", | |
| "parameters": [ | |
| { | |
| "type": "number", | |
| "description": "timestamp", | |
| "name": "ts", | |
| "in": "query", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/continuous_profiling/estimate_size": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get Estimate Size", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/conprof.EstimateSizeRes" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/continuous_profiling/group_profile/detail": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get Group Profile Detail", | |
| "parameters": [ | |
| { | |
| "type": "number", | |
| "description": "timestamp", | |
| "name": "ts", | |
| "in": "query", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/conprof.GroupProfileDetail" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/continuous_profiling/group_profiles": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get Group Profiles", | |
| "parameters": [ | |
| { | |
| "type": "integer", | |
| "name": "begin_time", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "integer", | |
| "name": "end_time", | |
| "in": "query" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/conprof.GroupProfiles" | |
| } | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/continuous_profiling/single_profile/view": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "produces": [ | |
| "text/html" | |
| ], | |
| "summary": "View Single Profile files", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "name": "address", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "component", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "profile_type", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "integer", | |
| "name": "ts", | |
| "in": "query" | |
| } | |
| ], | |
| "responses": { | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/debug_api/download": { | |
| "get": { | |
| "summary": "Download a finished request result", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "download token", | |
| "name": "token", | |
| "in": "query", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "string" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/debug_api/endpoint": { | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Send request remote endpoint and return a token for downloading results", | |
| "operationId": "debugAPIRequestEndpoint", | |
| "parameters": [ | |
| { | |
| "description": "request payload", | |
| "name": "req", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/endpoint.RequestPayload" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "string" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/debug_api/endpoints": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get all endpoints", | |
| "operationId": "debugAPIGetEndpoints", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/endpoint.APIDefinition" | |
| } | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/diagnose/diagnosis": { | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "Generate sql diagnosis report", | |
| "produces": [ | |
| "application/json" | |
| ], | |
| "summary": "SQL diagnosis report", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/diagnose.GenDiagnosisReportRequest" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/diagnose.TableDef" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/diagnose/metrics_relation/generate": { | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Generate metrics relationship graph.", | |
| "operationId": "diagnoseGenerateMetricsRelationship", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/diagnose.GenerateMetricsRelationRequest" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "string" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/diagnose/metrics_relation/view": { | |
| "get": { | |
| "produces": [ | |
| "image/svg" | |
| ], | |
| "summary": "View metrics relationship graph.", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "token", | |
| "name": "token", | |
| "in": "query", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/diagnose/reports": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "Get sql diagnosis reports history", | |
| "summary": "SQL diagnosis reports history", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/diagnose.Report" | |
| } | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "Generate sql diagnosis report", | |
| "summary": "SQL diagnosis report", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/diagnose.GenerateReportRequest" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "integer" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/diagnose/reports/{id}/data.js": { | |
| "get": { | |
| "description": "Get sql diagnosis report data", | |
| "produces": [ | |
| "text/javascript" | |
| ], | |
| "summary": "SQL diagnosis report data", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "report id", | |
| "name": "id", | |
| "in": "path", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/diagnose/reports/{id}/detail": { | |
| "get": { | |
| "description": "Get sql diagnosis report HTML", | |
| "produces": [ | |
| "text/html" | |
| ], | |
| "summary": "SQL diagnosis report", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "report id", | |
| "name": "id", | |
| "in": "path", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/diagnose/reports/{id}/status": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "Get diagnosis report status", | |
| "summary": "Diagnosis report status", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "report id", | |
| "name": "id", | |
| "in": "path", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/diagnose.Report" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/host/all": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get information of all hosts", | |
| "operationId": "clusterInfoGetHostsInfo", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/clusterinfo.GetHostsInfoResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/host/statistics": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get cluster statistics", | |
| "operationId": "clusterInfoGetStatistics", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/clusterinfo.ClusterStatistics" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/info/databases": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "List all databases", | |
| "operationId": "infoListDatabases", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/info/info": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get information about this TiDB Dashboard", | |
| "operationId": "infoGet", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/info.InfoResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/info/tables": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "List tables by database name", | |
| "operationId": "infoListTables", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "Database name", | |
| "name": "database_name", | |
| "in": "query" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/info.tableSchema" | |
| } | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/info/whoami": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get information about current session", | |
| "operationId": "infoWhoami", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/info.WhoAmIResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/keyvisual/config": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get Key Visual Dynamic Config", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/config.KeyVisualConfig" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "put": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Set Key Visual Dynamic Config", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/config.KeyVisualConfig" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/config.KeyVisualConfig" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/keyvisual/heatmaps": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "Heatmaps in a given range to visualize TiKV usage", | |
| "summary": "Key Visual Heatmaps", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "The start of the key range", | |
| "name": "startkey", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "description": "The end of the key range", | |
| "name": "endkey", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "integer", | |
| "description": "The start of the time range (Unix)", | |
| "name": "starttime", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "integer", | |
| "description": "The end of the time range (Unix)", | |
| "name": "endtime", | |
| "in": "query" | |
| }, | |
| { | |
| "enum": [ | |
| "written_bytes", | |
| "read_bytes", | |
| "written_keys", | |
| "read_keys", | |
| "integration" | |
| ], | |
| "type": "string", | |
| "description": "Main types of data", | |
| "name": "type", | |
| "in": "query" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/matrix.Matrix" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/logs/download": { | |
| "get": { | |
| "produces": [ | |
| "application/x-tar", | |
| "application/zip" | |
| ], | |
| "summary": "Download logs", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "download token", | |
| "name": "token", | |
| "in": "query", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/logs/download/acquire_token": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "produces": [ | |
| "text/plain" | |
| ], | |
| "summary": "Generate a download token for downloading logs", | |
| "parameters": [ | |
| { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| }, | |
| "collectionFormat": "csv", | |
| "description": "task id", | |
| "name": "id", | |
| "in": "query" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "xxx", | |
| "schema": { | |
| "type": "string" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/logs/taskgroup": { | |
| "put": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Create and run a new log search task group", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/logsearch.CreateTaskGroupRequest" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/logsearch.TaskGroupResponse" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/logs/taskgroups": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "List all log search task groups", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/logsearch.TaskGroupModel" | |
| } | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/logs/taskgroups/{id}": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "List tasks in a log search task group", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "Task Group ID", | |
| "name": "id", | |
| "in": "path", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/logsearch.TaskGroupResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "delete": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Delete a log search task group", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "task group id", | |
| "name": "id", | |
| "in": "path", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/rest.EmptyResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/logs/taskgroups/{id}/cancel": { | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Cancel running tasks in a log search task group", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "task group id", | |
| "name": "id", | |
| "in": "path", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/rest.EmptyResponse" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/logs/taskgroups/{id}/preview": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Preview a log search task group", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "task group id", | |
| "name": "id", | |
| "in": "path", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/logsearch.PreviewModel" | |
| } | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/logs/taskgroups/{id}/retry": { | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Retry failed tasks in a log search task group", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "task group id", | |
| "name": "id", | |
| "in": "path", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/rest.EmptyResponse" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/metrics/prom_address": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get the Prometheus address cluster config", | |
| "operationId": "metricsGetPromAddress", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/metrics.GetPromAddressConfigResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "put": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Set or clear the customized Prometheus address", | |
| "operationId": "metricsSetCustomPromAddress", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/metrics.PutCustomPromAddressRequest" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/metrics.PutCustomPromAddressResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/metrics/query": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "Query metrics in the given range", | |
| "summary": "Query metrics", | |
| "parameters": [ | |
| { | |
| "type": "integer", | |
| "name": "end_time_sec", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "query", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "integer", | |
| "name": "start_time_sec", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "integer", | |
| "name": "step_sec", | |
| "in": "query" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/metrics.QueryResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/profiling/action_token": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "Get token with a given group ID or task ID and action type", | |
| "produces": [ | |
| "text/plain" | |
| ], | |
| "summary": "Get action token for download or view", | |
| "operationId": "getActionToken", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "group or task ID", | |
| "name": "id", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "description": "action", | |
| "name": "action", | |
| "in": "query" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "string" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/profiling/config": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get Profiling Dynamic Config", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/config.ProfilingConfig" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "put": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Set Profiling Dynamic Config", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/config.ProfilingConfig" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/config.ProfilingConfig" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/profiling/group/cancel/{groupId}": { | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "Cancel all profling tasks with a given group ID", | |
| "summary": "Cancel all tasks with a given group ID", | |
| "operationId": "cancelProfilingGroup", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "group ID", | |
| "name": "groupId", | |
| "in": "path", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/rest.EmptyResponse" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/profiling/group/delete/{groupId}": { | |
| "delete": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "Delete all finished profiling tasks with a given group ID", | |
| "summary": "Delete all tasks with a given group ID", | |
| "operationId": "deleteProfilingGroup", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "group ID", | |
| "name": "groupId", | |
| "in": "path", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/rest.EmptyResponse" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/profiling/group/detail/{groupId}": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "List all profiling tasks with a given group ID", | |
| "summary": "List all tasks with a given group ID", | |
| "operationId": "getProfilingGroupDetail", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "group ID", | |
| "name": "groupId", | |
| "in": "path", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/profiling.GroupDetailResponse" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/profiling/group/download": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "Download all finished profiling results of a task group", | |
| "produces": [ | |
| "application/x-gzip" | |
| ], | |
| "summary": "Download all results of a task group", | |
| "operationId": "downloadProfilingGroup", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "download token", | |
| "name": "token", | |
| "in": "query", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/profiling/group/list": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "List all profiling groups", | |
| "summary": "List all profiling groups", | |
| "operationId": "getProfilingGroups", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/profiling.TaskGroupModel" | |
| } | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/profiling/group/start": { | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "Start a profiling task group", | |
| "summary": "Start profiling", | |
| "operationId": "startProfiling", | |
| "parameters": [ | |
| { | |
| "description": "profiling request", | |
| "name": "req", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/profiling.StartRequest" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "task group", | |
| "schema": { | |
| "$ref": "#/definitions/profiling.TaskGroupModel" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/profiling/single/download": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "Download the finished profiling result of a task", | |
| "produces": [ | |
| "application/x-gzip" | |
| ], | |
| "summary": "Download the result of a task", | |
| "operationId": "downloadProfilingSingle", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "download token", | |
| "name": "token", | |
| "in": "query", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/profiling/single/view": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "View the finished profiling result of a task", | |
| "produces": [ | |
| "text/html" | |
| ], | |
| "summary": "View the result of a task", | |
| "operationId": "viewProfilingSingle", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "download token", | |
| "name": "token", | |
| "in": "query", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/query_editor/run": { | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Run statements", | |
| "operationId": "queryEditorRun", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/queryeditor.RunRequest" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/queryeditor.RunResponse" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "403": { | |
| "description": "Forbidden", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/slow_query/detail": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get details of a slow query", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "TODO: Switch back to uint64 when modern browser as well as Swagger handles BigInt well.", | |
| "name": "connect_id", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "digest", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "number", | |
| "name": "timestamp", | |
| "in": "query" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/slowquery.Model" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/slow_query/download": { | |
| "get": { | |
| "produces": [ | |
| "text/csv" | |
| ], | |
| "summary": "Download slow query statements", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "download token", | |
| "name": "token", | |
| "in": "query", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/slow_query/download/token": { | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "produces": [ | |
| "text/plain" | |
| ], | |
| "summary": "Generate a download token for exported slow query statements", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/slowquery.GetListRequest" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "xxx", | |
| "schema": { | |
| "type": "string" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/slow_query/list": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "List all slow queries", | |
| "parameters": [ | |
| { | |
| "type": "integer", | |
| "name": "begin_time", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| }, | |
| "collectionFormat": "multi", | |
| "name": "db", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "boolean", | |
| "name": "desc", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "digest", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "integer", | |
| "name": "end_time", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "description": "example: \"Query,Digest\"", | |
| "name": "fields", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "integer", | |
| "name": "limit", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "orderBy", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| }, | |
| "collectionFormat": "multi", | |
| "description": "for showing slow queries in the statement detail page", | |
| "name": "plans", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "text", | |
| "in": "query" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/slowquery.Model" | |
| } | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/slow_query/table_columns": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "Query slowquery table columns", | |
| "summary": "Query table columns", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/statements/config": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get statement configurations", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/statement.EditableConfig" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Update statement configurations", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/statement.EditableConfig" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "204": { | |
| "description": "No Content", | |
| "schema": { | |
| "type": "string" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/statements/download": { | |
| "get": { | |
| "produces": [ | |
| "text/csv" | |
| ], | |
| "summary": "Download statements", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "download token", | |
| "name": "token", | |
| "in": "query", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/statements/download/token": { | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "produces": [ | |
| "text/plain" | |
| ], | |
| "summary": "Generate a download token for exported statements", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/statement.GetStatementsRequest" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "xxx", | |
| "schema": { | |
| "type": "string" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/statements/list": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get a list of statements", | |
| "parameters": [ | |
| { | |
| "type": "integer", | |
| "name": "begin_time", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "integer", | |
| "name": "end_time", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "fields", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| }, | |
| "collectionFormat": "multi", | |
| "name": "schemas", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| }, | |
| "collectionFormat": "multi", | |
| "name": "stmt_types", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "text", | |
| "in": "query" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/statement.Model" | |
| } | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/statements/plan/detail": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get details of a statement in an execution plan", | |
| "parameters": [ | |
| { | |
| "type": "integer", | |
| "name": "begin_time", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "digest", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "integer", | |
| "name": "end_time", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| }, | |
| "collectionFormat": "multi", | |
| "name": "plans", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "schema_name", | |
| "in": "query" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/statement.Model" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/statements/plans": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get execution plans of a statement", | |
| "parameters": [ | |
| { | |
| "type": "integer", | |
| "name": "begin_time", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "digest", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "integer", | |
| "name": "end_time", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "schema_name", | |
| "in": "query" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/statement.Model" | |
| } | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/statements/stmt_types": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get all statement types", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/statements/table_columns": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "description": "Query statements table columns", | |
| "summary": "Query table columns", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/statements/time_ranges": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get available statement time ranges", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/statement.TimeRange" | |
| } | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/topology/alertmanager": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get AlertManager instance", | |
| "operationId": "getAlertManagerTopology", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/topology.AlertManagerInfo" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/topology/alertmanager/{address}/count": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get current alert count from AlertManager", | |
| "operationId": "getAlertManagerCounts", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "ip:port", | |
| "name": "address", | |
| "in": "path", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "integer" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/topology/grafana": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get Grafana instance", | |
| "operationId": "getGrafanaTopology", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/topology.GrafanaInfo" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/topology/pd": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get all PD instances", | |
| "operationId": "getPDTopology", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/topology.PDInfo" | |
| } | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/topology/store": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get all TiKV / TiFlash instances", | |
| "operationId": "getStoreTopology", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/clusterinfo.StoreTopologyResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/topology/store_location": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get location labels of all TiKV / TiFlash instances", | |
| "operationId": "getStoreLocationTopology", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/topology.StoreLocation" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/topology/tidb": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get all TiDB instances", | |
| "operationId": "getTiDBTopology", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/topology.TiDBInfo" | |
| } | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/topology/tidb/{address}": { | |
| "delete": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Hide a TiDB instance", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "description": "ip:port", | |
| "name": "address", | |
| "in": "path", | |
| "required": true | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "delete ok" | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/topsql/config": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get Top SQL config", | |
| "responses": { | |
| "200": { | |
| "description": "ok", | |
| "schema": { | |
| "$ref": "#/definitions/topsql.EditableConfig" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Update Top SQL config", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/topsql.EditableConfig" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "204": { | |
| "description": "No Content", | |
| "schema": { | |
| "type": "string" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/topsql/instances": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get availiable instances", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "name": "end", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "start", | |
| "in": "query" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "ok", | |
| "schema": { | |
| "$ref": "#/definitions/topsql.InstanceResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/topsql/summary": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get summaries", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "name": "end", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "instance", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "instance_type", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "start", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "top", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "window", | |
| "in": "query" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "ok", | |
| "schema": { | |
| "$ref": "#/definitions/topsql.SummaryResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/user/login": { | |
| "post": { | |
| "summary": "Log in", | |
| "operationId": "userLogin", | |
| "parameters": [ | |
| { | |
| "description": "Credentials", | |
| "name": "message", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/user.AuthenticateForm" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/user.TokenResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/user/login_info": { | |
| "get": { | |
| "summary": "Get log in information, like supported authenticate types", | |
| "operationId": "userGetLoginInfo", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/user.GetLoginInfoResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/user/share/code": { | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Share current session and generate a sharing code", | |
| "operationId": "userShareSession", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/code.ShareRequest" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/code.ShareResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/user/sign_out_info": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get sign out info", | |
| "operationId": "userGetSignOutInfo", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "name": "redirect_url", | |
| "in": "query" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/user.SignOutInfo" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/user/sso/auth_url": { | |
| "get": { | |
| "summary": "Get SSO Auth URL", | |
| "operationId": "userSSOGetAuthURL", | |
| "parameters": [ | |
| { | |
| "type": "string", | |
| "name": "code_verifier", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "redirect_url", | |
| "in": "query" | |
| }, | |
| { | |
| "type": "string", | |
| "name": "state", | |
| "in": "query" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/user/sso/config": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Get SSO config", | |
| "operationId": "userSSOGetConfig", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/config.SSOCoreConfig" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "put": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Set SSO config", | |
| "operationId": "userSSOSetConfig", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/sso.SetConfigRequest" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/config.SSOCoreConfig" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/user/sso/impersonation": { | |
| "post": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "Create an impersonation", | |
| "operationId": "userSSOCreateImpersonation", | |
| "parameters": [ | |
| { | |
| "description": "Request body", | |
| "name": "request", | |
| "in": "body", | |
| "required": true, | |
| "schema": { | |
| "$ref": "#/definitions/sso.CreateImpersonationRequest" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "$ref": "#/definitions/sso.SSOImpersonationModel" | |
| } | |
| }, | |
| "400": { | |
| "description": "Bad Request", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "500": { | |
| "description": "Internal Server Error", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/user/sso/impersonations/list": { | |
| "get": { | |
| "security": [ | |
| { | |
| "JwtAuth": [] | |
| } | |
| ], | |
| "summary": "List all impersonations", | |
| "operationId": "userSSOListImpersonations", | |
| "responses": { | |
| "200": { | |
| "description": "OK", | |
| "schema": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/sso.SSOImpersonationModel" | |
| } | |
| } | |
| }, | |
| "401": { | |
| "description": "Unauthorized", | |
| "schema": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "definitions": { | |
| "clusterinfo.ClusterStatistics": { | |
| "type": "object", | |
| "properties": { | |
| "probe_failure_hosts": { | |
| "type": "integer" | |
| }, | |
| "stats_by_instance_kind": { | |
| "type": "object", | |
| "additionalProperties": { | |
| "$ref": "#/definitions/clusterinfo.ClusterStatisticsPartial" | |
| } | |
| }, | |
| "total_stats": { | |
| "type": "object", | |
| "$ref": "#/definitions/clusterinfo.ClusterStatisticsPartial" | |
| }, | |
| "versions": { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| }, | |
| "clusterinfo.ClusterStatisticsPartial": { | |
| "type": "object", | |
| "properties": { | |
| "number_of_hosts": { | |
| "type": "integer" | |
| }, | |
| "number_of_instances": { | |
| "type": "integer" | |
| }, | |
| "total_logical_cores": { | |
| "type": "integer" | |
| }, | |
| "total_memory_capacity_bytes": { | |
| "type": "integer" | |
| }, | |
| "total_physical_cores": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "clusterinfo.GetHostsInfoResponse": { | |
| "type": "object", | |
| "properties": { | |
| "hosts": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/hostinfo.Info" | |
| } | |
| }, | |
| "warning": { | |
| "type": "object", | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| }, | |
| "clusterinfo.StoreTopologyResponse": { | |
| "type": "object", | |
| "properties": { | |
| "tiflash": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/topology.StoreInfo" | |
| } | |
| }, | |
| "tikv": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/topology.StoreInfo" | |
| } | |
| } | |
| } | |
| }, | |
| "code.ShareRequest": { | |
| "type": "object", | |
| "properties": { | |
| "expire_in_sec": { | |
| "type": "integer" | |
| }, | |
| "revoke_write_priv": { | |
| "type": "boolean" | |
| } | |
| } | |
| }, | |
| "code.ShareResponse": { | |
| "type": "object", | |
| "properties": { | |
| "code": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "config.KeyVisualConfig": { | |
| "type": "object", | |
| "properties": { | |
| "auto_collection_disabled": { | |
| "type": "boolean" | |
| }, | |
| "policy": { | |
| "type": "string" | |
| }, | |
| "policy_kv_separator": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "config.ProfilingConfig": { | |
| "type": "object", | |
| "properties": { | |
| "auto_collection_duration_secs": { | |
| "type": "integer" | |
| }, | |
| "auto_collection_interval_secs": { | |
| "type": "integer" | |
| }, | |
| "auto_collection_targets": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/model.RequestTargetNode" | |
| } | |
| } | |
| } | |
| }, | |
| "config.SSOCoreConfig": { | |
| "type": "object", | |
| "properties": { | |
| "client_id": { | |
| "type": "string" | |
| }, | |
| "discovery_url": { | |
| "type": "string" | |
| }, | |
| "enabled": { | |
| "type": "boolean" | |
| }, | |
| "is_read_only": { | |
| "type": "boolean" | |
| } | |
| } | |
| }, | |
| "configuration.AllConfigItems": { | |
| "type": "object", | |
| "properties": { | |
| "errors": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| }, | |
| "items": { | |
| "type": "object", | |
| "additionalProperties": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/configuration.Item" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "configuration.EditRequest": { | |
| "type": "object", | |
| "properties": { | |
| "id": { | |
| "type": "string" | |
| }, | |
| "kind": { | |
| "type": "string" | |
| }, | |
| "new_value": { | |
| "type": "object" | |
| } | |
| } | |
| }, | |
| "configuration.EditResponse": { | |
| "type": "object", | |
| "properties": { | |
| "warnings": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/rest.ErrorResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "configuration.Item": { | |
| "type": "object", | |
| "properties": { | |
| "id": { | |
| "type": "string" | |
| }, | |
| "is_editable": { | |
| "type": "boolean" | |
| }, | |
| "is_multi_value": { | |
| "description": "TODO: Support per-instance config", | |
| "type": "boolean" | |
| }, | |
| "value": { | |
| "description": "When multi value present, this contains one of the value", | |
| "type": "object" | |
| } | |
| } | |
| }, | |
| "conprof.Component": { | |
| "type": "object", | |
| "properties": { | |
| "ip": { | |
| "type": "string" | |
| }, | |
| "name": { | |
| "type": "string" | |
| }, | |
| "port": { | |
| "type": "integer" | |
| }, | |
| "status_port": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "conprof.ComponentNum": { | |
| "type": "object", | |
| "properties": { | |
| "pd": { | |
| "type": "integer" | |
| }, | |
| "tidb": { | |
| "type": "integer" | |
| }, | |
| "tiflash": { | |
| "type": "integer" | |
| }, | |
| "tikv": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "conprof.ContinuousProfilingConfig": { | |
| "type": "object", | |
| "properties": { | |
| "data_retention_seconds": { | |
| "type": "integer" | |
| }, | |
| "enable": { | |
| "type": "boolean" | |
| }, | |
| "interval_seconds": { | |
| "type": "integer" | |
| }, | |
| "profile_seconds": { | |
| "type": "integer" | |
| }, | |
| "timeout_seconds": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "conprof.EstimateSizeRes": { | |
| "type": "object", | |
| "properties": { | |
| "instance_count": { | |
| "type": "integer" | |
| }, | |
| "profile_size": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "conprof.GetGroupProfileReq": { | |
| "type": "object", | |
| "properties": { | |
| "begin_time": { | |
| "type": "integer" | |
| }, | |
| "end_time": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "conprof.GroupProfileDetail": { | |
| "type": "object", | |
| "properties": { | |
| "profile_duration_secs": { | |
| "type": "integer" | |
| }, | |
| "state": { | |
| "type": "string" | |
| }, | |
| "target_profiles": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/conprof.ProfileDetail" | |
| } | |
| }, | |
| "ts": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "conprof.GroupProfiles": { | |
| "type": "object", | |
| "properties": { | |
| "component_num": { | |
| "type": "object", | |
| "$ref": "#/definitions/conprof.ComponentNum" | |
| }, | |
| "profile_duration_secs": { | |
| "type": "integer" | |
| }, | |
| "state": { | |
| "type": "string" | |
| }, | |
| "ts": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "conprof.NgMonitoringConfig": { | |
| "type": "object", | |
| "properties": { | |
| "continuous_profiling": { | |
| "type": "object", | |
| "$ref": "#/definitions/conprof.ContinuousProfilingConfig" | |
| } | |
| } | |
| }, | |
| "conprof.ProfileDetail": { | |
| "type": "object", | |
| "properties": { | |
| "error": { | |
| "type": "string" | |
| }, | |
| "profile_type": { | |
| "type": "string" | |
| }, | |
| "state": { | |
| "type": "string" | |
| }, | |
| "target": { | |
| "type": "object", | |
| "$ref": "#/definitions/conprof.Target" | |
| } | |
| } | |
| }, | |
| "conprof.Target": { | |
| "type": "object", | |
| "properties": { | |
| "address": { | |
| "type": "string" | |
| }, | |
| "component": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "conprof.ViewSingleProfileReq": { | |
| "type": "object", | |
| "properties": { | |
| "address": { | |
| "type": "string" | |
| }, | |
| "component": { | |
| "type": "string" | |
| }, | |
| "profile_type": { | |
| "type": "string" | |
| }, | |
| "ts": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "decorator.LabelKey": { | |
| "type": "object", | |
| "required": [ | |
| "key", | |
| "labels" | |
| ], | |
| "properties": { | |
| "key": { | |
| "type": "string" | |
| }, | |
| "labels": { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| }, | |
| "diagnose.GenDiagnosisReportRequest": { | |
| "type": "object", | |
| "properties": { | |
| "end_time": { | |
| "type": "integer" | |
| }, | |
| "kind": { | |
| "description": "values: config, error, performance", | |
| "type": "string" | |
| }, | |
| "start_time": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "diagnose.GenerateMetricsRelationRequest": { | |
| "type": "object", | |
| "properties": { | |
| "end_time": { | |
| "type": "integer" | |
| }, | |
| "start_time": { | |
| "type": "integer" | |
| }, | |
| "type": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "diagnose.GenerateReportRequest": { | |
| "type": "object", | |
| "properties": { | |
| "compare_end_time": { | |
| "type": "integer" | |
| }, | |
| "compare_start_time": { | |
| "type": "integer" | |
| }, | |
| "end_time": { | |
| "type": "integer" | |
| }, | |
| "start_time": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "diagnose.Report": { | |
| "type": "object", | |
| "properties": { | |
| "compare_end_time": { | |
| "type": "string" | |
| }, | |
| "compare_start_time": { | |
| "type": "string" | |
| }, | |
| "content": { | |
| "type": "string" | |
| }, | |
| "created_at": { | |
| "type": "string" | |
| }, | |
| "end_time": { | |
| "type": "string" | |
| }, | |
| "id": { | |
| "type": "string" | |
| }, | |
| "progress": { | |
| "description": "0~100", | |
| "type": "integer" | |
| }, | |
| "start_time": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "diagnose.TableDef": { | |
| "type": "object", | |
| "properties": { | |
| "category": { | |
| "description": "The category of the table, such as [TiDB]", | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| }, | |
| "column": { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| }, | |
| "comment": { | |
| "type": "string" | |
| }, | |
| "rows": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/diagnose.TableRowDef" | |
| } | |
| }, | |
| "title": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "diagnose.TableRowDef": { | |
| "type": "object", | |
| "properties": { | |
| "comment": { | |
| "type": "string" | |
| }, | |
| "sub_values": { | |
| "description": "SubValues need fold default.", | |
| "type": "array", | |
| "items": { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "values": { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| }, | |
| "endpoint.APIDefinition": { | |
| "type": "object", | |
| "properties": { | |
| "component": { | |
| "type": "string" | |
| }, | |
| "id": { | |
| "type": "string" | |
| }, | |
| "method": { | |
| "type": "string" | |
| }, | |
| "path": { | |
| "type": "string" | |
| }, | |
| "path_params": { | |
| "description": "e.g. /stats/dump/{db}/{table} -\u003e db, table", | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/endpoint.APIParamDefinition" | |
| } | |
| }, | |
| "query_params": { | |
| "description": "e.g. /debug/pprof?seconds=1 -\u003e seconds", | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/endpoint.APIParamDefinition" | |
| } | |
| } | |
| } | |
| }, | |
| "endpoint.APIParamDefinition": { | |
| "type": "object", | |
| "properties": { | |
| "name": { | |
| "type": "string" | |
| }, | |
| "required": { | |
| "type": "boolean" | |
| }, | |
| "ui_kind": { | |
| "type": "string" | |
| }, | |
| "ui_props": { | |
| "description": "varies by different ui kinds", | |
| "type": "object" | |
| } | |
| } | |
| }, | |
| "endpoint.RequestPayload": { | |
| "type": "object", | |
| "properties": { | |
| "api_id": { | |
| "type": "string" | |
| }, | |
| "host": { | |
| "type": "string" | |
| }, | |
| "param_values": { | |
| "type": "object", | |
| "additionalProperties": { | |
| "type": "string" | |
| } | |
| }, | |
| "port": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "hostinfo.CPUInfo": { | |
| "type": "object", | |
| "properties": { | |
| "arch": { | |
| "type": "string" | |
| }, | |
| "logical_cores": { | |
| "type": "integer" | |
| }, | |
| "physical_cores": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "hostinfo.CPUUsageInfo": { | |
| "type": "object", | |
| "properties": { | |
| "idle": { | |
| "type": "number" | |
| }, | |
| "system": { | |
| "type": "number" | |
| } | |
| } | |
| }, | |
| "hostinfo.Info": { | |
| "type": "object", | |
| "properties": { | |
| "cpu_info": { | |
| "type": "object", | |
| "$ref": "#/definitions/hostinfo.CPUInfo" | |
| }, | |
| "cpu_usage": { | |
| "type": "object", | |
| "$ref": "#/definitions/hostinfo.CPUUsageInfo" | |
| }, | |
| "host": { | |
| "type": "string" | |
| }, | |
| "instances": { | |
| "description": "Instances in the current host. The key is instance address", | |
| "type": "object", | |
| "additionalProperties": { | |
| "$ref": "#/definitions/hostinfo.InstanceInfo" | |
| } | |
| }, | |
| "memory_usage": { | |
| "type": "object", | |
| "$ref": "#/definitions/hostinfo.MemoryUsageInfo" | |
| }, | |
| "partitions": { | |
| "description": "Containing unused partitions. The key is path in lower case.\nNote: deviceName is not used as the key, since TiDB and TiKV may return different deviceName for the same device.", | |
| "type": "object", | |
| "additionalProperties": { | |
| "$ref": "#/definitions/hostinfo.PartitionInfo" | |
| } | |
| } | |
| } | |
| }, | |
| "hostinfo.InstanceInfo": { | |
| "type": "object", | |
| "properties": { | |
| "partition_path_lower": { | |
| "type": "string" | |
| }, | |
| "type": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "hostinfo.MemoryUsageInfo": { | |
| "type": "object", | |
| "properties": { | |
| "total": { | |
| "type": "integer" | |
| }, | |
| "used": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "hostinfo.PartitionInfo": { | |
| "type": "object", | |
| "properties": { | |
| "free": { | |
| "type": "integer" | |
| }, | |
| "fstype": { | |
| "type": "string" | |
| }, | |
| "path": { | |
| "type": "string" | |
| }, | |
| "total": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "info.InfoResponse": { | |
| "type": "object", | |
| "properties": { | |
| "enable_experimental": { | |
| "type": "boolean" | |
| }, | |
| "enable_telemetry": { | |
| "type": "boolean" | |
| }, | |
| "ngm_state": { | |
| "type": "string" | |
| }, | |
| "supported_features": { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| }, | |
| "version": { | |
| "type": "object", | |
| "$ref": "#/definitions/version.Info" | |
| } | |
| } | |
| }, | |
| "info.WhoAmIResponse": { | |
| "type": "object", | |
| "properties": { | |
| "display_name": { | |
| "type": "string" | |
| }, | |
| "is_shareable": { | |
| "type": "boolean" | |
| }, | |
| "is_writeable": { | |
| "type": "boolean" | |
| } | |
| } | |
| }, | |
| "info.tableSchema": { | |
| "type": "object", | |
| "properties": { | |
| "table_id": { | |
| "type": "string" | |
| }, | |
| "table_name": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "logsearch.CreateTaskGroupRequest": { | |
| "type": "object", | |
| "required": [ | |
| "request", | |
| "targets" | |
| ], | |
| "properties": { | |
| "request": { | |
| "type": "object", | |
| "$ref": "#/definitions/logsearch.SearchLogRequest" | |
| }, | |
| "targets": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/model.RequestTargetNode" | |
| } | |
| } | |
| } | |
| }, | |
| "logsearch.PreviewModel": { | |
| "type": "object", | |
| "properties": { | |
| "id": { | |
| "type": "integer" | |
| }, | |
| "level": { | |
| "type": "string" | |
| }, | |
| "message": { | |
| "type": "string" | |
| }, | |
| "task_group_id": { | |
| "type": "integer" | |
| }, | |
| "task_id": { | |
| "type": "integer" | |
| }, | |
| "time": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "logsearch.SearchLogRequest": { | |
| "type": "object", | |
| "properties": { | |
| "end_time": { | |
| "type": "integer" | |
| }, | |
| "min_level": { | |
| "type": "integer" | |
| }, | |
| "patterns": { | |
| "description": "We use a string array to represent multiple CNF pattern sceniaor like:\nSELECT * FROM t WHERE c LIKE '%s%' and c REGEXP '.*a.*' because\nGolang and Rust don't support perl-like (?=re1)(?=re2)", | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| }, | |
| "start_time": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "logsearch.TaskGroupModel": { | |
| "type": "object", | |
| "properties": { | |
| "id": { | |
| "type": "integer" | |
| }, | |
| "log_store_dir": { | |
| "type": "string" | |
| }, | |
| "search_request": { | |
| "type": "object", | |
| "$ref": "#/definitions/logsearch.SearchLogRequest" | |
| }, | |
| "state": { | |
| "type": "integer" | |
| }, | |
| "target_stats": { | |
| "type": "object", | |
| "$ref": "#/definitions/model.RequestTargetStatistics" | |
| } | |
| } | |
| }, | |
| "logsearch.TaskGroupResponse": { | |
| "type": "object", | |
| "properties": { | |
| "task_group": { | |
| "type": "object", | |
| "$ref": "#/definitions/logsearch.TaskGroupModel" | |
| }, | |
| "tasks": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/logsearch.TaskModel" | |
| } | |
| } | |
| } | |
| }, | |
| "logsearch.TaskModel": { | |
| "type": "object", | |
| "properties": { | |
| "error": { | |
| "type": "string" | |
| }, | |
| "id": { | |
| "type": "integer" | |
| }, | |
| "log_store_path": { | |
| "type": "string" | |
| }, | |
| "size": { | |
| "type": "integer" | |
| }, | |
| "slow_log_store_path": { | |
| "type": "string" | |
| }, | |
| "state": { | |
| "type": "integer" | |
| }, | |
| "target": { | |
| "type": "object", | |
| "$ref": "#/definitions/model.RequestTargetNode" | |
| }, | |
| "task_group_id": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "matrix.Matrix": { | |
| "type": "object", | |
| "required": [ | |
| "data", | |
| "keyAxis", | |
| "timeAxis" | |
| ], | |
| "properties": { | |
| "data": { | |
| "type": "object", | |
| "additionalProperties": { | |
| "type": "array", | |
| "items": { | |
| "type": "array", | |
| "items": { | |
| "type": "integer" | |
| } | |
| } | |
| } | |
| }, | |
| "keyAxis": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/decorator.LabelKey" | |
| } | |
| }, | |
| "timeAxis": { | |
| "type": "array", | |
| "items": { | |
| "type": "integer" | |
| } | |
| } | |
| } | |
| }, | |
| "metrics.GetPromAddressConfigResponse": { | |
| "type": "object", | |
| "properties": { | |
| "customized_addr": { | |
| "type": "string" | |
| }, | |
| "deployed_addr": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "metrics.PutCustomPromAddressRequest": { | |
| "type": "object", | |
| "properties": { | |
| "address": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "metrics.PutCustomPromAddressResponse": { | |
| "type": "object", | |
| "properties": { | |
| "normalized_address": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "metrics.QueryRequest": { | |
| "type": "object", | |
| "properties": { | |
| "end_time_sec": { | |
| "type": "integer" | |
| }, | |
| "query": { | |
| "type": "string" | |
| }, | |
| "start_time_sec": { | |
| "type": "integer" | |
| }, | |
| "step_sec": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "metrics.QueryResponse": { | |
| "type": "object", | |
| "properties": { | |
| "data": { | |
| "type": "object", | |
| "additionalProperties": true | |
| }, | |
| "status": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "model.RequestTargetNode": { | |
| "type": "object", | |
| "properties": { | |
| "display_name": { | |
| "type": "string", | |
| "example": "127.0.0.1:4000" | |
| }, | |
| "ip": { | |
| "type": "string", | |
| "example": "127.0.0.1" | |
| }, | |
| "kind": { | |
| "type": "string", | |
| "example": "tidb" | |
| }, | |
| "port": { | |
| "type": "integer", | |
| "example": 4000 | |
| } | |
| } | |
| }, | |
| "model.RequestTargetStatistics": { | |
| "type": "object", | |
| "properties": { | |
| "num_pd_nodes": { | |
| "type": "integer" | |
| }, | |
| "num_tidb_nodes": { | |
| "type": "integer" | |
| }, | |
| "num_tiflash_nodes": { | |
| "type": "integer" | |
| }, | |
| "num_tikv_nodes": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "profiling.GroupDetailResponse": { | |
| "type": "object", | |
| "properties": { | |
| "server_time": { | |
| "type": "integer" | |
| }, | |
| "task_group_status": { | |
| "type": "object", | |
| "$ref": "#/definitions/profiling.TaskGroupModel" | |
| }, | |
| "tasks_status": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/profiling.TaskModel" | |
| } | |
| } | |
| } | |
| }, | |
| "profiling.StartRequest": { | |
| "type": "object", | |
| "properties": { | |
| "duration_secs": { | |
| "type": "integer" | |
| }, | |
| "requsted_profiling_types": { | |
| "type": "object", | |
| "$ref": "#/definitions/profiling.TaskProfilingTypeList" | |
| }, | |
| "targets": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/model.RequestTargetNode" | |
| } | |
| } | |
| } | |
| }, | |
| "profiling.TaskGroupModel": { | |
| "type": "object", | |
| "properties": { | |
| "id": { | |
| "type": "integer" | |
| }, | |
| "profile_duration_secs": { | |
| "type": "integer" | |
| }, | |
| "requsted_profiling_types": { | |
| "type": "object", | |
| "$ref": "#/definitions/profiling.TaskProfilingTypeList" | |
| }, | |
| "started_at": { | |
| "type": "integer" | |
| }, | |
| "state": { | |
| "type": "integer" | |
| }, | |
| "target_stats": { | |
| "type": "object", | |
| "$ref": "#/definitions/model.RequestTargetStatistics" | |
| } | |
| } | |
| }, | |
| "profiling.TaskModel": { | |
| "type": "object", | |
| "properties": { | |
| "error": { | |
| "type": "string" | |
| }, | |
| "id": { | |
| "type": "integer" | |
| }, | |
| "profiling_type": { | |
| "type": "string" | |
| }, | |
| "raw_data_type": { | |
| "type": "string" | |
| }, | |
| "started_at": { | |
| "description": "The start running time, reset when retry. Used to estimate approximate profiling progress.", | |
| "type": "integer" | |
| }, | |
| "state": { | |
| "type": "integer" | |
| }, | |
| "target": { | |
| "type": "object", | |
| "$ref": "#/definitions/model.RequestTargetNode" | |
| }, | |
| "task_group_id": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "profiling.TaskProfilingTypeList": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/profiling.TaskProfilingType" | |
| } | |
| }, | |
| "queryeditor.RunRequest": { | |
| "type": "object", | |
| "properties": { | |
| "max_rows": { | |
| "type": "integer", | |
| "example": 1000 | |
| }, | |
| "statements": { | |
| "type": "string", | |
| "example": "show databases;" | |
| } | |
| } | |
| }, | |
| "queryeditor.RunResponse": { | |
| "type": "object", | |
| "properties": { | |
| "actual_rows": { | |
| "type": "integer" | |
| }, | |
| "column_names": { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| }, | |
| "error_msg": { | |
| "type": "string" | |
| }, | |
| "execution_ms": { | |
| "type": "integer" | |
| }, | |
| "rows": { | |
| "type": "array", | |
| "items": { | |
| "type": "array", | |
| "items": { | |
| "type": "object" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "rest.EmptyResponse": { | |
| "type": "object" | |
| }, | |
| "rest.ErrorResponse": { | |
| "type": "object", | |
| "properties": { | |
| "code": { | |
| "type": "string" | |
| }, | |
| "error": { | |
| "type": "boolean" | |
| }, | |
| "full_text": { | |
| "type": "string" | |
| }, | |
| "message": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "slowquery.GetDetailRequest": { | |
| "type": "object", | |
| "properties": { | |
| "connect_id": { | |
| "description": "TODO: Switch back to uint64 when modern browser as well as Swagger handles BigInt well.", | |
| "type": "string" | |
| }, | |
| "digest": { | |
| "type": "string" | |
| }, | |
| "timestamp": { | |
| "type": "number" | |
| } | |
| } | |
| }, | |
| "slowquery.GetListRequest": { | |
| "type": "object", | |
| "properties": { | |
| "begin_time": { | |
| "type": "integer" | |
| }, | |
| "db": { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| }, | |
| "desc": { | |
| "type": "boolean" | |
| }, | |
| "digest": { | |
| "type": "string" | |
| }, | |
| "end_time": { | |
| "type": "integer" | |
| }, | |
| "fields": { | |
| "description": "example: \"Query,Digest\"", | |
| "type": "string" | |
| }, | |
| "limit": { | |
| "type": "integer" | |
| }, | |
| "orderBy": { | |
| "type": "string" | |
| }, | |
| "plans": { | |
| "description": "for showing slow queries in the statement detail page", | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| }, | |
| "text": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "slowquery.Model": { | |
| "type": "object", | |
| "properties": { | |
| "backoff_time": { | |
| "type": "number" | |
| }, | |
| "backoff_types": { | |
| "type": "string" | |
| }, | |
| "commit_backoff_time": { | |
| "type": "number" | |
| }, | |
| "commit_time": { | |
| "type": "number" | |
| }, | |
| "compile_time": { | |
| "type": "number" | |
| }, | |
| "connection_id": { | |
| "description": "TODO: Switch back to uint64 when modern browser as well as Swagger handles BigInt well.", | |
| "type": "string" | |
| }, | |
| "cop_proc_addr": { | |
| "type": "string" | |
| }, | |
| "cop_proc_avg": { | |
| "type": "number" | |
| }, | |
| "cop_proc_max": { | |
| "type": "number" | |
| }, | |
| "cop_proc_p90": { | |
| "type": "number" | |
| }, | |
| "cop_time": { | |
| "type": "number" | |
| }, | |
| "cop_wait_addr": { | |
| "type": "string" | |
| }, | |
| "cop_wait_avg": { | |
| "type": "number" | |
| }, | |
| "cop_wait_max": { | |
| "type": "number" | |
| }, | |
| "cop_wait_p90": { | |
| "type": "number" | |
| }, | |
| "db": { | |
| "type": "string" | |
| }, | |
| "digest": { | |
| "type": "string" | |
| }, | |
| "disk_max": { | |
| "type": "integer" | |
| }, | |
| "exec_retry_time": { | |
| "type": "number" | |
| }, | |
| "get_commit_ts_time": { | |
| "type": "number" | |
| }, | |
| "host": { | |
| "type": "string" | |
| }, | |
| "index_names": { | |
| "type": "string" | |
| }, | |
| "instance": { | |
| "type": "string" | |
| }, | |
| "is_internal": { | |
| "description": "Basic", | |
| "type": "integer" | |
| }, | |
| "local_latch_wait_time": { | |
| "type": "number" | |
| }, | |
| "lock_keys_time": { | |
| "type": "number" | |
| }, | |
| "memory_max": { | |
| "type": "integer" | |
| }, | |
| "optimize_time": { | |
| "type": "number" | |
| }, | |
| "parse_time": { | |
| "type": "number" | |
| }, | |
| "plan": { | |
| "type": "string" | |
| }, | |
| "preproc_subqueries_time": { | |
| "type": "number" | |
| }, | |
| "prev_stmt": { | |
| "description": "Detail", | |
| "type": "string" | |
| }, | |
| "prewrite_region": { | |
| "type": "integer" | |
| }, | |
| "prewrite_time": { | |
| "type": "number" | |
| }, | |
| "process_keys": { | |
| "type": "integer" | |
| }, | |
| "process_time": { | |
| "description": "Time", | |
| "type": "number" | |
| }, | |
| "query": { | |
| "type": "string" | |
| }, | |
| "query_time": { | |
| "description": "latency", | |
| "type": "number" | |
| }, | |
| "request_count": { | |
| "description": "Coprocessor", | |
| "type": "integer" | |
| }, | |
| "resolve_lock_time": { | |
| "type": "number" | |
| }, | |
| "rewrite_time": { | |
| "type": "number" | |
| }, | |
| "rocksdb_block_cache_hit_count": { | |
| "type": "integer" | |
| }, | |
| "rocksdb_block_read_byte": { | |
| "type": "integer" | |
| }, | |
| "rocksdb_block_read_count": { | |
| "type": "integer" | |
| }, | |
| "rocksdb_delete_skipped_count": { | |
| "description": "RocksDB", | |
| "type": "integer" | |
| }, | |
| "rocksdb_key_skipped_count": { | |
| "type": "integer" | |
| }, | |
| "stats": { | |
| "type": "string" | |
| }, | |
| "success": { | |
| "type": "integer" | |
| }, | |
| "timestamp": { | |
| "description": "finish time", | |
| "type": "number" | |
| }, | |
| "total_keys": { | |
| "type": "integer" | |
| }, | |
| "txn_retry": { | |
| "type": "integer" | |
| }, | |
| "txn_start_ts": { | |
| "description": "TODO: Switch back to uint64 when modern browser as well as Swagger handles BigInt well.", | |
| "type": "string" | |
| }, | |
| "user": { | |
| "description": "Connection", | |
| "type": "string" | |
| }, | |
| "wait_prewrite_binlog_time": { | |
| "type": "number" | |
| }, | |
| "wait_time": { | |
| "type": "number" | |
| }, | |
| "wait_ts": { | |
| "type": "number" | |
| }, | |
| "write_keys": { | |
| "description": "Transaction", | |
| "type": "integer" | |
| }, | |
| "write_size": { | |
| "type": "integer" | |
| }, | |
| "write_sql_response_total": { | |
| "type": "number" | |
| } | |
| } | |
| }, | |
| "sso.CreateImpersonationRequest": { | |
| "type": "object", | |
| "properties": { | |
| "password": { | |
| "type": "string" | |
| }, | |
| "sql_user": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "sso.GetAuthURLRequest": { | |
| "type": "object", | |
| "properties": { | |
| "code_verifier": { | |
| "type": "string" | |
| }, | |
| "redirect_url": { | |
| "type": "string" | |
| }, | |
| "state": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "sso.SSOImpersonationModel": { | |
| "type": "object", | |
| "properties": { | |
| "last_impersonate_status": { | |
| "type": "string" | |
| }, | |
| "sql_user": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "sso.SetConfigRequest": { | |
| "type": "object", | |
| "properties": { | |
| "config": { | |
| "type": "object", | |
| "$ref": "#/definitions/config.SSOCoreConfig" | |
| } | |
| } | |
| }, | |
| "statement.EditableConfig": { | |
| "type": "object", | |
| "properties": { | |
| "enable": { | |
| "type": "boolean" | |
| }, | |
| "history_size": { | |
| "type": "integer" | |
| }, | |
| "internal_query": { | |
| "type": "boolean" | |
| }, | |
| "max_size": { | |
| "type": "integer" | |
| }, | |
| "refresh_interval": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "statement.GetPlanDetailRequest": { | |
| "type": "object", | |
| "properties": { | |
| "begin_time": { | |
| "type": "integer" | |
| }, | |
| "digest": { | |
| "type": "string" | |
| }, | |
| "end_time": { | |
| "type": "integer" | |
| }, | |
| "plans": { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| }, | |
| "schema_name": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "statement.GetPlansRequest": { | |
| "type": "object", | |
| "properties": { | |
| "begin_time": { | |
| "type": "integer" | |
| }, | |
| "digest": { | |
| "type": "string" | |
| }, | |
| "end_time": { | |
| "type": "integer" | |
| }, | |
| "schema_name": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "statement.GetStatementsRequest": { | |
| "type": "object", | |
| "properties": { | |
| "begin_time": { | |
| "type": "integer" | |
| }, | |
| "end_time": { | |
| "type": "integer" | |
| }, | |
| "fields": { | |
| "type": "string" | |
| }, | |
| "schemas": { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| }, | |
| "stmt_types": { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| }, | |
| "text": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "statement.Model": { | |
| "type": "object", | |
| "properties": { | |
| "avg_affected_rows": { | |
| "type": "integer" | |
| }, | |
| "avg_backoff_time": { | |
| "description": "avg total back off time per sql", | |
| "type": "integer" | |
| }, | |
| "avg_commit_backoff_time": { | |
| "type": "integer" | |
| }, | |
| "avg_commit_time": { | |
| "type": "integer" | |
| }, | |
| "avg_compile_latency": { | |
| "type": "integer" | |
| }, | |
| "avg_cop_process_time": { | |
| "description": "avg process time per copr task", | |
| "type": "integer" | |
| }, | |
| "avg_cop_wait_time": { | |
| "description": "avg wait time per copr task", | |
| "type": "integer" | |
| }, | |
| "avg_disk": { | |
| "type": "integer" | |
| }, | |
| "avg_get_commit_ts_time": { | |
| "type": "integer" | |
| }, | |
| "avg_latency": { | |
| "type": "integer" | |
| }, | |
| "avg_local_latch_wait_time": { | |
| "type": "integer" | |
| }, | |
| "avg_mem": { | |
| "type": "integer" | |
| }, | |
| "avg_parse_latency": { | |
| "type": "integer" | |
| }, | |
| "avg_prewrite_regions": { | |
| "type": "integer" | |
| }, | |
| "avg_prewrite_time": { | |
| "type": "integer" | |
| }, | |
| "avg_process_time": { | |
| "description": "avg total process time per sql", | |
| "type": "integer" | |
| }, | |
| "avg_processed_keys": { | |
| "type": "integer" | |
| }, | |
| "avg_resolve_lock_time": { | |
| "type": "integer" | |
| }, | |
| "avg_rocksdb_block_cache_hit_count": { | |
| "type": "integer" | |
| }, | |
| "avg_rocksdb_block_read_byte": { | |
| "type": "integer" | |
| }, | |
| "avg_rocksdb_block_read_count": { | |
| "type": "integer" | |
| }, | |
| "avg_rocksdb_delete_skipped_count": { | |
| "type": "integer" | |
| }, | |
| "avg_rocksdb_key_skipped_count": { | |
| "type": "integer" | |
| }, | |
| "avg_total_keys": { | |
| "type": "integer" | |
| }, | |
| "avg_txn_retry": { | |
| "type": "integer" | |
| }, | |
| "avg_wait_time": { | |
| "description": "avg total wait time per sql", | |
| "type": "integer" | |
| }, | |
| "avg_write_keys": { | |
| "type": "integer" | |
| }, | |
| "avg_write_size": { | |
| "type": "integer" | |
| }, | |
| "digest": { | |
| "type": "string" | |
| }, | |
| "digest_text": { | |
| "type": "string" | |
| }, | |
| "exec_count": { | |
| "type": "integer" | |
| }, | |
| "first_seen": { | |
| "type": "integer" | |
| }, | |
| "index_names": { | |
| "type": "string" | |
| }, | |
| "last_seen": { | |
| "type": "integer" | |
| }, | |
| "max_backoff_time": { | |
| "description": "max back off time per sql", | |
| "type": "integer" | |
| }, | |
| "max_commit_backoff_time": { | |
| "type": "integer" | |
| }, | |
| "max_commit_time": { | |
| "type": "integer" | |
| }, | |
| "max_compile_latency": { | |
| "type": "integer" | |
| }, | |
| "max_cop_process_time": { | |
| "description": "max process time per copr task", | |
| "type": "integer" | |
| }, | |
| "max_cop_wait_time": { | |
| "description": "max wait time per copr task", | |
| "type": "integer" | |
| }, | |
| "max_disk": { | |
| "type": "integer" | |
| }, | |
| "max_get_commit_ts_time": { | |
| "type": "integer" | |
| }, | |
| "max_latency": { | |
| "type": "integer" | |
| }, | |
| "max_local_latch_wait_time": { | |
| "type": "integer" | |
| }, | |
| "max_mem": { | |
| "type": "integer" | |
| }, | |
| "max_parse_latency": { | |
| "type": "integer" | |
| }, | |
| "max_prewrite_regions": { | |
| "type": "integer" | |
| }, | |
| "max_prewrite_time": { | |
| "type": "integer" | |
| }, | |
| "max_process_time": { | |
| "description": "max process time per sql", | |
| "type": "integer" | |
| }, | |
| "max_processed_keys": { | |
| "type": "integer" | |
| }, | |
| "max_resolve_lock_time": { | |
| "type": "integer" | |
| }, | |
| "max_rocksdb_block_cache_hit_count": { | |
| "type": "integer" | |
| }, | |
| "max_rocksdb_block_read_byte": { | |
| "type": "integer" | |
| }, | |
| "max_rocksdb_block_read_count": { | |
| "type": "integer" | |
| }, | |
| "max_rocksdb_delete_skipped_count": { | |
| "description": "RocksDB", | |
| "type": "integer" | |
| }, | |
| "max_rocksdb_key_skipped_count": { | |
| "type": "integer" | |
| }, | |
| "max_total_keys": { | |
| "type": "integer" | |
| }, | |
| "max_txn_retry": { | |
| "type": "integer" | |
| }, | |
| "max_wait_time": { | |
| "description": "max wait time per sql", | |
| "type": "integer" | |
| }, | |
| "max_write_keys": { | |
| "type": "integer" | |
| }, | |
| "max_write_size": { | |
| "type": "integer" | |
| }, | |
| "min_latency": { | |
| "type": "integer" | |
| }, | |
| "plan": { | |
| "type": "string" | |
| }, | |
| "plan_count": { | |
| "type": "integer" | |
| }, | |
| "plan_digest": { | |
| "type": "string" | |
| }, | |
| "prev_sample_text": { | |
| "type": "string" | |
| }, | |
| "query_sample_text": { | |
| "type": "string" | |
| }, | |
| "related_schemas": { | |
| "description": "Computed fields", | |
| "type": "string" | |
| }, | |
| "sample_user": { | |
| "type": "string" | |
| }, | |
| "schema_name": { | |
| "type": "string" | |
| }, | |
| "sum_backoff_times": { | |
| "type": "integer" | |
| }, | |
| "sum_cop_task_num": { | |
| "type": "integer" | |
| }, | |
| "sum_errors": { | |
| "type": "integer" | |
| }, | |
| "sum_latency": { | |
| "type": "integer" | |
| }, | |
| "sum_warnings": { | |
| "type": "integer" | |
| }, | |
| "table_names": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "statement.TimeRange": { | |
| "type": "object", | |
| "properties": { | |
| "begin_time": { | |
| "type": "integer" | |
| }, | |
| "end_time": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "topology.AlertManagerInfo": { | |
| "type": "object", | |
| "properties": { | |
| "ip": { | |
| "type": "string" | |
| }, | |
| "port": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "topology.GrafanaInfo": { | |
| "type": "object", | |
| "properties": { | |
| "ip": { | |
| "type": "string" | |
| }, | |
| "port": { | |
| "type": "integer" | |
| } | |
| } | |
| }, | |
| "topology.PDInfo": { | |
| "type": "object", | |
| "properties": { | |
| "deploy_path": { | |
| "type": "string" | |
| }, | |
| "git_hash": { | |
| "type": "string" | |
| }, | |
| "ip": { | |
| "type": "string" | |
| }, | |
| "port": { | |
| "type": "integer" | |
| }, | |
| "start_timestamp": { | |
| "description": "Ts = 0 means unknown", | |
| "type": "integer" | |
| }, | |
| "status": { | |
| "type": "integer" | |
| }, | |
| "version": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "topology.StoreInfo": { | |
| "type": "object", | |
| "properties": { | |
| "deploy_path": { | |
| "type": "string" | |
| }, | |
| "git_hash": { | |
| "type": "string" | |
| }, | |
| "ip": { | |
| "type": "string" | |
| }, | |
| "labels": { | |
| "type": "object", | |
| "additionalProperties": { | |
| "type": "string" | |
| } | |
| }, | |
| "port": { | |
| "type": "integer" | |
| }, | |
| "start_timestamp": { | |
| "type": "integer" | |
| }, | |
| "status": { | |
| "type": "integer" | |
| }, | |
| "status_port": { | |
| "type": "integer" | |
| }, | |
| "version": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "topology.StoreLabels": { | |
| "type": "object", | |
| "properties": { | |
| "address": { | |
| "type": "string" | |
| }, | |
| "labels": { | |
| "type": "object", | |
| "additionalProperties": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| }, | |
| "topology.StoreLocation": { | |
| "type": "object", | |
| "properties": { | |
| "location_labels": { | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| } | |
| }, | |
| "stores": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/topology.StoreLabels" | |
| } | |
| } | |
| } | |
| }, | |
| "topology.TiDBInfo": { | |
| "type": "object", | |
| "properties": { | |
| "deploy_path": { | |
| "type": "string" | |
| }, | |
| "git_hash": { | |
| "type": "string" | |
| }, | |
| "ip": { | |
| "type": "string" | |
| }, | |
| "port": { | |
| "type": "integer" | |
| }, | |
| "start_timestamp": { | |
| "type": "integer" | |
| }, | |
| "status": { | |
| "type": "integer" | |
| }, | |
| "status_port": { | |
| "type": "integer" | |
| }, | |
| "version": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "topsql.EditableConfig": { | |
| "type": "object", | |
| "properties": { | |
| "enable": { | |
| "type": "boolean" | |
| } | |
| } | |
| }, | |
| "topsql.GetInstancesRequest": { | |
| "type": "object", | |
| "properties": { | |
| "end": { | |
| "type": "string" | |
| }, | |
| "start": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "topsql.GetSummaryRequest": { | |
| "type": "object", | |
| "properties": { | |
| "end": { | |
| "type": "string" | |
| }, | |
| "instance": { | |
| "type": "string" | |
| }, | |
| "instance_type": { | |
| "type": "string" | |
| }, | |
| "start": { | |
| "type": "string" | |
| }, | |
| "top": { | |
| "type": "string" | |
| }, | |
| "window": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "topsql.InstanceItem": { | |
| "type": "object", | |
| "properties": { | |
| "instance": { | |
| "type": "string" | |
| }, | |
| "instance_type": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "topsql.InstanceResponse": { | |
| "type": "object", | |
| "properties": { | |
| "data": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/topsql.InstanceItem" | |
| } | |
| } | |
| } | |
| }, | |
| "topsql.SummaryItem": { | |
| "type": "object", | |
| "properties": { | |
| "cpu_time_ms": { | |
| "type": "integer" | |
| }, | |
| "duration_per_exec_ms": { | |
| "type": "number" | |
| }, | |
| "exec_count_per_sec": { | |
| "type": "number" | |
| }, | |
| "is_other": { | |
| "type": "boolean" | |
| }, | |
| "plans": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/topsql.SummaryPlanItem" | |
| } | |
| }, | |
| "scan_indexes_per_sec": { | |
| "type": "number" | |
| }, | |
| "scan_records_per_sec": { | |
| "type": "number" | |
| }, | |
| "sql_digest": { | |
| "type": "string" | |
| }, | |
| "sql_text": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "topsql.SummaryPlanItem": { | |
| "type": "object", | |
| "properties": { | |
| "cpu_time_ms": { | |
| "type": "array", | |
| "items": { | |
| "type": "integer" | |
| } | |
| }, | |
| "duration_per_exec_ms": { | |
| "type": "number" | |
| }, | |
| "exec_count_per_sec": { | |
| "type": "number" | |
| }, | |
| "plan_digest": { | |
| "type": "string" | |
| }, | |
| "plan_text": { | |
| "type": "string" | |
| }, | |
| "scan_indexes_per_sec": { | |
| "type": "number" | |
| }, | |
| "scan_records_per_sec": { | |
| "type": "number" | |
| }, | |
| "timestamp_sec": { | |
| "type": "array", | |
| "items": { | |
| "type": "integer" | |
| } | |
| } | |
| } | |
| }, | |
| "topsql.SummaryResponse": { | |
| "type": "object", | |
| "properties": { | |
| "data": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/topsql.SummaryItem" | |
| } | |
| } | |
| } | |
| }, | |
| "user.AuthenticateForm": { | |
| "type": "object", | |
| "properties": { | |
| "extra": { | |
| "description": "FIXME: Use strong type", | |
| "type": "string" | |
| }, | |
| "password": { | |
| "type": "string" | |
| }, | |
| "type": { | |
| "type": "integer", | |
| "example": 0 | |
| }, | |
| "username": { | |
| "description": "Does not present for AuthTypeSharingCode", | |
| "type": "string", | |
| "example": "root" | |
| } | |
| } | |
| }, | |
| "user.GetLoginInfoResponse": { | |
| "type": "object", | |
| "properties": { | |
| "supported_auth_types": { | |
| "type": "array", | |
| "items": { | |
| "type": "integer" | |
| } | |
| } | |
| } | |
| }, | |
| "user.GetSignOutInfoRequest": { | |
| "type": "object", | |
| "properties": { | |
| "redirect_url": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "user.SignOutInfo": { | |
| "type": "object", | |
| "properties": { | |
| "end_session_url": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "user.TokenResponse": { | |
| "type": "object", | |
| "properties": { | |
| "expire": { | |
| "type": "string" | |
| }, | |
| "token": { | |
| "type": "string" | |
| } | |
| } | |
| }, | |
| "version.Info": { | |
| "type": "object", | |
| "properties": { | |
| "build_git_hash": { | |
| "type": "string" | |
| }, | |
| "build_time": { | |
| "type": "string" | |
| }, | |
| "internal_version": { | |
| "type": "string" | |
| }, | |
| "pd_version": { | |
| "type": "string" | |
| }, | |
| "standalone": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| }, | |
| "securityDefinitions": { | |
| "JwtAuth": { | |
| "type": "apiKey", | |
| "name": "Authorization", | |
| "in": "header" | |
| } | |
| } | |
| }` | |
| type swaggerInfo struct { | |
| Version string | |
| Host string | |
| BasePath string | |
| Schemes []string | |
| Title string | |
| Description string | |
| } | |
| // SwaggerInfo holds exported Swagger Info so clients can modify it | |
| var SwaggerInfo = swaggerInfo{ | |
| Version: "1.0", | |
| Host: "", | |
| BasePath: "/dashboard/api", | |
| Schemes: []string{}, | |
| Title: "Dashboard API", | |
| Description: "", | |
| } | |
| type s struct{} | |
| func (s *s) ReadDoc() string { | |
| sInfo := SwaggerInfo | |
| sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) | |
| t, err := template.New("swagger_info").Funcs(template.FuncMap{ | |
| "marshal": func(v interface{}) string { | |
| a, _ := json.Marshal(v) | |
| return string(a) | |
| }, | |
| }).Parse(doc) | |
| if err != nil { | |
| return doc | |
| } | |
| var tpl bytes.Buffer | |
| if err := t.Execute(&tpl, sInfo); err != nil { | |
| return doc | |
| } | |
| return tpl.String() | |
| } | |
| func init() { | |
| swag.Register(swag.Name, &s{}) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment