From e719dc4ea23267b66c15005742aa49eab191dffd Mon Sep 17 00:00:00 2001 From: actiontech-zihan Date: Thu, 20 Aug 2026 18:25:45 +0800 Subject: [PATCH 1/5] feat: add ops type column to global workflow export layouts Insert WFExportOpsType into Common/SQLRelease/DataExport global headers and row builders; keep project layout frozen and prune empty optional cols. Co-authored-by: Cursor --- sqle/server/workflowexport/export.go | 39 ++++++++- sqle/server/workflowexport/export_test.go | 98 +++++++++++++++++++++-- 2 files changed, 130 insertions(+), 7 deletions(-) diff --git a/sqle/server/workflowexport/export.go b/sqle/server/workflowexport/export.go index 69b7ba506..21c134bed 100644 --- a/sqle/server/workflowexport/export.go +++ b/sqle/server/workflowexport/export.go @@ -110,11 +110,22 @@ func BuildGlobalSQLReleaseExport(ctx context.Context, workflowIDs []string, proj return nil, nil, err } header := buildGlobalSQLReleaseHeader(ctx) + opsTypeNameByProject := map[string]map[string]string{} rows := make([][]string, 0) for _, workflow := range workflows { + projectUID := string(workflow.ProjectId) projectName := "" if projectNameByUID != nil { - projectName = projectNameByUID[string(workflow.ProjectId)] + projectName = projectNameByUID[projectUID] + } + opsTypeNameByUID, ok := opsTypeNameByProject[projectUID] + if !ok { + opsTypeNameByUID = dms.BuildOpsTypeNameMap(ctx, projectUID) + opsTypeNameByProject[projectUID] = opsTypeNameByUID + } + opsTypeName := "" + if ot := dms.ResolveOpsTypeFromMap(workflow.OpsTypeUID, opsTypeNameByUID); ot != nil { + opsTypeName = ot.Name } auditRecord := formatAuditRecordFromSQLSteps(ctx, workflow.AuditStepList()) for _, instanceRecord := range workflow.Record.InstanceRecords { @@ -124,6 +135,7 @@ func BuildGlobalSQLReleaseExport(ctx context.Context, workflowIDs []string, proj workflow.WorkflowId, workflow.Subject, workflow.Desc, + opsTypeName, instanceName, workflow.Model.CreatedAt.Format(timeLayout), dms.GetUserNameWithDelTag(workflow.CreateUserId), @@ -153,6 +165,7 @@ type DataExportExportRecord struct { CreatedAt string CreatorName string UnifiedStatus string + OpsTypeName string AuditRecord string SQLContent string ExportExecTime string @@ -173,6 +186,9 @@ func FromListDataExportWorkflow(r *dmsV1.ListDataExportWorkflow) DataExportExpor out.ProjectName = r.ProjectInfo.ProjectName out.ProjectUID = r.ProjectInfo.ProjectUid } + if r.OpsType != nil { + out.OpsTypeName = r.OpsType.Name + } for _, db := range r.DBServiceInfos { if db == nil { continue @@ -235,6 +251,7 @@ func BuildGlobalDataExportExport(ctx context.Context, records []DataExportExport r.WorkflowID, r.WorkflowName, r.Description, + r.OpsTypeName, strings.Join(r.DBServiceNames, ","), r.CreatedAt, r.CreatorName, @@ -258,6 +275,7 @@ type CommonExportRow struct { CreatorName string CreatedAt string Status string + OpsTypeName string DataSource string SQLContent string SortKey string @@ -277,6 +295,7 @@ func BuildGlobalCommonExport(ctx context.Context, rowsIn []CommonExportRow) ([]s r.CreatorName, r.CreatedAt, r.Status, + r.OpsTypeName, r.DataSource, r.SQLContent, }) @@ -363,6 +382,7 @@ func buildGlobalSQLReleaseHeader(ctx context.Context) []string { locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportWorkflowNumber), locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportWorkflowName), locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportWorkflowDescription), + locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportOpsType), locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportDataSource), locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportCreateTime), locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportCreator), @@ -382,6 +402,7 @@ func buildGlobalDataExportHeader(ctx context.Context) []string { locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportWorkflowNumber), locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportWorkflowName), locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportWorkflowDescription), + locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportOpsType), locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportDataSource), locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportCreateTime), locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportCreator), @@ -403,6 +424,7 @@ func buildGlobalCommonHeader(ctx context.Context) []string { locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportCreator), locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportCreateTime), locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportTaskOrderStatus), + locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportOpsType), locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportDataSource), locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportSQLContentPlain), } @@ -608,6 +630,7 @@ func BuildCommonRowsFromSQLRelease(ctx context.Context, workflowIDs []string, pr return nil, err } typeLabel := LocalizeWorkflowTypeSQLRelease(ctx) + opsTypeNameByProject := map[string]map[string]string{} out := make([]CommonExportRow, 0, len(workflows)) for _, workflow := range workflows { names := make([]string, 0, len(workflow.Record.InstanceRecords)) @@ -620,9 +643,19 @@ func BuildCommonRowsFromSQLRelease(ctx context.Context, workflowIDs []string, pr sqlBuilder.WriteString(getExecuteSqlList(ir.Task.ExecuteSQLs)) } } + projectUID := string(workflow.ProjectId) projectName := "" if projectNameByUID != nil { - projectName = projectNameByUID[string(workflow.ProjectId)] + projectName = projectNameByUID[projectUID] + } + opsTypeNameByUID, ok := opsTypeNameByProject[projectUID] + if !ok { + opsTypeNameByUID = dms.BuildOpsTypeNameMap(ctx, projectUID) + opsTypeNameByProject[projectUID] = opsTypeNameByUID + } + opsTypeName := "" + if ot := dms.ResolveOpsTypeFromMap(workflow.OpsTypeUID, opsTypeNameByUID); ot != nil { + opsTypeName = ot.Name } created := workflow.Model.CreatedAt.Format(timeLayout) out = append(out, CommonExportRow{ @@ -634,6 +667,7 @@ func BuildCommonRowsFromSQLRelease(ctx context.Context, workflowIDs []string, pr CreatorName: dms.GetUserNameWithDelTag(workflow.CreateUserId), CreatedAt: created, Status: localizeUnifiedStatus(ctx, mapSQLWorkflowStatus(workflow.Record.Status)), + OpsTypeName: opsTypeName, DataSource: strings.Join(names, ","), SQLContent: sqlBuilder.String(), SortKey: created, @@ -656,6 +690,7 @@ func BuildCommonRowsFromDataExport(ctx context.Context, records []DataExportExpo CreatorName: r.CreatorName, CreatedAt: r.CreatedAt, Status: localizeUnifiedStatus(ctx, r.UnifiedStatus), + OpsTypeName: r.OpsTypeName, DataSource: strings.Join(r.DBServiceNames, ","), SQLContent: r.SQLContent, SortKey: r.CreatedAt, diff --git a/sqle/server/workflowexport/export_test.go b/sqle/server/workflowexport/export_test.go index 38910504f..2adb73218 100644 --- a/sqle/server/workflowexport/export_test.go +++ b/sqle/server/workflowexport/export_test.go @@ -47,6 +47,15 @@ func TestBuildHeaderForLayoutGlobalSQLRelease(t *testing.T) { if header[0] != locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportProjectName) { t.Fatalf("first col want project name, got %s", header[0]) } + if header[3] != locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportWorkflowDescription) { + t.Fatalf("col4 want description, got %s", header[3]) + } + if header[4] != locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportOpsType) { + t.Fatalf("col5 want ops type after description, got %s", header[4]) + } + if header[5] != locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportDataSource) { + t.Fatalf("col6 want data source after ops type, got %s", header[5]) + } if header[len(header)-1] != locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportSQLContent) { t.Fatalf("last col want SQL content, got %s", header[len(header)-1]) } @@ -87,8 +96,8 @@ func TestBuildHeaderForLayoutProjectFrozen(t *testing.T) { func TestBuildGlobalCommonHeader(t *testing.T) { ctx := context.Background() header := BuildHeaderForLayout(ctx, LayoutGlobalCommon, 0) - if len(header) != 10 { - t.Fatalf("common header len=%d want 10: %v", len(header), header) + if len(header) != 11 { + t.Fatalf("common header len=%d want 11: %v", len(header), header) } if header[1] != locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportWorkflowType) { t.Fatalf("col2 want workflow type, got %s", header[1]) @@ -96,8 +105,17 @@ func TestBuildGlobalCommonHeader(t *testing.T) { if header[4] != locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportWorkflowDescription) { t.Fatalf("col5 want description, got %s", header[4]) } - if header[9] != locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportSQLContentPlain) { - t.Fatalf("last col want SQL content plain, got %s", header[9]) + if header[7] != locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportTaskOrderStatus) { + t.Fatalf("col8 want status, got %s", header[7]) + } + if header[8] != locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportOpsType) { + t.Fatalf("col9 want ops type after status, got %s", header[8]) + } + if header[9] != locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportDataSource) { + t.Fatalf("col10 want data source after ops type, got %s", header[9]) + } + if header[10] != locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportSQLContentPlain) { + t.Fatalf("last col want SQL content plain, got %s", header[10]) } } @@ -105,6 +123,15 @@ func TestBuildGlobalDataExportHeader(t *testing.T) { ctx := context.Background() header := BuildHeaderForLayout(ctx, LayoutGlobalDataExport, 1) joined := strings.Join(header, "|") + if header[3] != locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportWorkflowDescription) { + t.Fatalf("col4 want description, got %s", header[3]) + } + if header[4] != locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportOpsType) { + t.Fatalf("col5 want ops type after description, got %s", header[4]) + } + if header[5] != locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportDataSource) { + t.Fatalf("col6 want data source after ops type, got %s", header[5]) + } if !strings.Contains(joined, locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportDataExportExecTime)) { t.Fatalf("want export exec time col") } @@ -163,10 +190,13 @@ func TestBuildGlobalDataExportPrunesEmptyOptionalCols(t *testing.T) { CreatorName: "u", UnifiedStatus: "completed", SQLContent: "SELECT 1", - // AuditRecord / ExportExecTime / ExportResult empty → pruned + // OpsTypeName / AuditRecord / ExportExecTime / ExportResult empty → pruned }, }) joined := strings.Join(header, "|") + if strings.Contains(joined, locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportOpsType)) { + t.Fatalf("empty ops type col should be pruned: %v", header) + } if strings.Contains(joined, locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportAuditRecord)) { t.Fatalf("empty audit col should be pruned: %v", header) } @@ -181,6 +211,64 @@ func TestBuildGlobalDataExportPrunesEmptyOptionalCols(t *testing.T) { } } +func TestBuildGlobalDataExportKeepsOpsTypeWhenPresent(t *testing.T) { + ctx := context.Background() + opsType := "共享运维类型-导出验收" + header, rows := BuildGlobalDataExportExport(ctx, []DataExportExportRecord{ + { + ProjectName: "p", + WorkflowID: "1", + WorkflowName: "n", + Description: "d", + OpsTypeName: opsType, + DBServiceNames: []string{"db"}, + CreatedAt: "2026-01-01 00:00:00", + CreatorName: "u", + UnifiedStatus: "completed", + SQLContent: "SELECT 1", + }, + { + ProjectName: "p2", + WorkflowID: "2", + WorkflowName: "n2", + Description: "d2", + OpsTypeName: "", + DBServiceNames: []string{"db2"}, + CreatedAt: "2026-01-02 00:00:00", + CreatorName: "u2", + UnifiedStatus: "completed", + SQLContent: "SELECT 2", + }, + }) + opsCol := locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportOpsType) + descCol := locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportWorkflowDescription) + dsCol := locale.Bundle.LocalizeMsgByCtx(ctx, locale.WFExportDataSource) + opsIdx, descIdx, dsIdx := -1, -1, -1 + for i, h := range header { + switch h { + case opsCol: + opsIdx = i + case descCol: + descIdx = i + case dsCol: + dsIdx = i + } + } + if opsIdx < 0 { + t.Fatalf("ops type col must remain when any row has value: %v", header) + } + if !(descIdx >= 0 && opsIdx == descIdx+1 && dsIdx == opsIdx+1) { + t.Fatalf("want description, ops type, data source consecutive, got desc=%d ops=%d ds=%d header=%v", + descIdx, opsIdx, dsIdx, header) + } + if rows[0][opsIdx] != opsType { + t.Fatalf("row0 ops=%q want %q", rows[0][opsIdx], opsType) + } + if rows[1][opsIdx] != "" { + t.Fatalf("row1 empty ops must be empty cell, got %q", rows[1][opsIdx]) + } +} + func TestMapSQLWorkflowStatusToUnified(t *testing.T) { cases := []struct { native string From 24d9d48a48e156e7073e9a34fa3fbc126bc40780 Mon Sep 17 00:00:00 2001 From: actiontech-zihan Date: Thu, 20 Aug 2026 18:25:45 +0800 Subject: [PATCH 2/5] feat: add filter_by_ops_type_uid to global export request Extend ExportGlobalWorkflowReqV2 with optional query so export filtering aligns with the global workflow list. Co-authored-by: Cursor --- sqle/api/controller/v2/dashboard/workflow_manage.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sqle/api/controller/v2/dashboard/workflow_manage.go b/sqle/api/controller/v2/dashboard/workflow_manage.go index 67eeb9fed..edc2aa542 100644 --- a/sqle/api/controller/v2/dashboard/workflow_manage.go +++ b/sqle/api/controller/v2/dashboard/workflow_manage.go @@ -120,6 +120,8 @@ type ExportGlobalWorkflowReqV2 struct { FilterCreateTimeTo string `json:"filter_create_time_to" query:"filter_create_time_to"` FilterUpdateTimeFrom string `json:"filter_update_time_from" query:"filter_update_time_from"` FilterUpdateTimeTo string `json:"filter_update_time_to" query:"filter_update_time_to"` + // FilterByOpsTypeUID 按运维类型单选筛选(空则不筛;不提供「未设置」;对 SQL 上线与数据导出均生效;语义与 GetGlobalWorkflowListReqV2 对齐) + FilterByOpsTypeUID string `json:"filter_by_ops_type_uid" query:"filter_by_ops_type_uid"` FilterCard dashboard_svc.GlobalWorkflowFilterCard `json:"filter_card" query:"filter_card" valid:"omitempty,oneof=archived pending_for_me initiated_by_me view_all" enums:"archived,pending_for_me,initiated_by_me,view_all"` @@ -148,6 +150,7 @@ type ExportGlobalWorkflowReqV2 struct { // @Param filter_create_user_id query string false "filter by create user id" // @Param filter_create_time_from query string false "filter create time from" // @Param filter_create_time_to query string false "filter create time to" +// @Param filter_by_ops_type_uid query string false "filter by ops type dictionary item uid; empty means no filter; applies to sql_release and data_export; same semantics as GET /v2/dashboard/workflows" // @Param export_format query string false "export format: csv or excel, default csv" Enums(csv,excel) // @Success 200 {file} file "export workflow" // @Router /v2/dashboard/workflows/exports [get] From 19dd2edf3c111f2fd773fc1221c5823af336803e Mon Sep 17 00:00:00 2001 From: actiontech-zihan Date: Thu, 20 Aug 2026 18:25:45 +0800 Subject: [PATCH 3/5] docs: sync swagger for global export ops type filter Regenerate OpenAPI artifacts for filter_by_ops_type_uid on dashboard export. Co-authored-by: Cursor --- sqle/docs/docs.go | 6 + sqle/docs/swagger.json | 51065 +++++++++++++++++++-------------------- sqle/docs/swagger.yaml | 5 + 3 files changed, 25289 insertions(+), 25787 deletions(-) diff --git a/sqle/docs/docs.go b/sqle/docs/docs.go index 28a9eb8eb..18f3ee856 100644 --- a/sqle/docs/docs.go +++ b/sqle/docs/docs.go @@ -11677,6 +11677,12 @@ var doc = `{ "name": "filter_create_time_to", "in": "query" }, + { + "type": "string", + "description": "filter by ops type dictionary item uid; empty means no filter; applies to sql_release and data_export; same semantics as GET /v2/dashboard/workflows", + "name": "filter_by_ops_type_uid", + "in": "query" + }, { "enum": [ "csv", diff --git a/sqle/docs/swagger.json b/sqle/docs/swagger.json index 3e3b735fa..53959244f 100644 --- a/sqle/docs/swagger.json +++ b/sqle/docs/swagger.json @@ -1,25916 +1,25407 @@ { - "swagger": "2.0", - "info": { - "description": "This is a sample server for dev.", - "title": "Sqle API Docs", - "contact": {}, - "license": {}, - "version": "1.0" - }, - "basePath": "/sqle", - "paths": { - "/v1/ai_hub/banner": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "返回按模块分组的Banner卡片列表(模块类型、Banner卡片列表)", - "produces": [ - "application/json" - ], - "tags": [ - "ai_hub" - ], - "summary": "获取AI智能中心Banner", - "operationId": "GetAIHubBanner", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAIHubBannerResp" - } - } - } - } - }, - "/v1/ai_hub/execution_data": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "返回最新10条执行数据记录(来源项目、SQL片段、功能模块、价值维度、处理状态、预估提升、时间)", - "produces": [ - "application/json" - ], - "tags": [ - "ai_hub" - ], - "summary": "获取AI智能中心执行数据", - "operationId": "GetAIHubExecutionData", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAIHubExecutionDataResp" - } - } - } - } - }, - "/v1/ai_hub/management_view": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "返回按模块分组的分析数据(模块类型、项目组投入产出分析、Top问题分布)", - "produces": [ - "application/json" - ], - "tags": [ - "ai_hub" - ], - "summary": "获取AI智能中心管理视图", - "operationId": "GetAIHubManagementView", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAIHubManagementViewResp" - } - } - } - } - }, - "/v1/ai_hub/strategic_value": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "返回AI战略洞察(标题、描述)和效能卡片列表(效能指标、效能评价、具体指标、价值描述)", - "produces": [ - "application/json" - ], - "tags": [ - "ai_hub" - ], - "summary": "获取AI智能中心战略价值", - "operationId": "GetAIHubStrategicValue", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAIHubStrategicValueResp" - } - } - } - } - }, - "/v1/audit_files": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Direct audit sql from SQL files and MyBatis files", - "tags": [ - "sql_audit" - ], - "summary": "直接从文件内容提取SQL并审核,SQL文件暂时只支持一次解析一个文件", - "operationId": "directAuditFilesV1", - "parameters": [ - { - "description": "files that should be audited", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.DirectAuditFileReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.DirectAuditResV1" - } - } - } - } - }, - "/v1/audit_plan_metas": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan metas", - "tags": [ - "audit_plan" - ], - "summary": "获取扫描任务元信息", - "operationId": "getAuditPlanMetasV1", - "parameters": [ - { - "type": "string", - "description": "filter instance type", - "name": "filter_instance_type", - "in": "query" - }, - { - "type": "string", - "description": "filter instance id", - "name": "filter_instance_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditPlanMetasResV1" - } - } - } - } - }, - "/v1/audit_plan_types": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan types", - "tags": [ - "audit_plan" - ], - "summary": "获取扫描任务类型", - "operationId": "getAuditPlanTypesV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditPlanTypesResV1" - } - } - } - } - }, - "/v1/company_notice": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get company notice info", - "tags": [ - "companyNotice" - ], - "summary": "获取企业公告", - "operationId": "getCompanyNotice", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetCompanyNoticeResp" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update company notice info", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "companyNotice" - ], - "summary": "更新企业公告", - "operationId": "updateCompanyNotice", - "parameters": [ - { - "description": "company notice", - "name": "companyNotice", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateCompanyNoticeReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/configurations/coding": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get coding configuration", - "tags": [ - "configuration" - ], - "summary": "获取Coding审核配置", - "operationId": "getCodingConfigurationV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetCodingConfigurationResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update coding configuration", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "添加或更新Coding配置", - "operationId": "UpdateCodingConfigurationV1", - "parameters": [ - { - "description": "update coding configuration req", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateCodingConfigurationReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/configurations/coding/test": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "test coding configuration", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "测试Coding配置", - "operationId": "testCodingConfigV1", - "parameters": [ - { - "description": "test coding configuration req", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.TestCodingConfigurationReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.TestCodingConfigResV1" - } - } - } - } - }, - "/v1/configurations/ding_talk": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get dingTalk configuration", - "tags": [ - "configuration" - ], - "summary": "获取 dingTalk 配置", - "operationId": "getDingTalkConfigurationV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetDingTalkConfigurationResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update DingTalk configuration", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "添加或更新 DingTalk 配置", - "operationId": "updateDingTalkConfigurationV1", - "parameters": [ - { - "description": "update DingTalk configuration req", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateDingTalkConfigurationReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/configurations/ding_talk/test": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "test DingTalk configuration", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "测试 DingTalk 配置", - "operationId": "testDingTalkConfigV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.TestDingTalkConfigResV1" - } - } - } - } - }, - "/v1/configurations/drivers": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get drivers", - "tags": [ - "configuration" - ], - "summary": "获取当前 server 支持的审核类型", - "operationId": "getDriversV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetDriversResV1" - } - } - } - } - }, - "/v1/configurations/feishu_audit": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get feishu audit configuration", - "tags": [ - "configuration" - ], - "summary": "获取飞书审核配置", - "operationId": "getFeishuAuditConfigurationV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetFeishuAuditConfigurationResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update feishu audit configuration", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "添加或更新飞书配置", - "operationId": "updateFeishuAuditConfigurationV1", - "parameters": [ - { - "description": "update feishu audit configuration req", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateFeishuConfigurationReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/configurations/feishu_audit/test": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "test feishu audit configuration", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "测试飞书审批配置", - "operationId": "testFeishuAuditConfigV1", - "parameters": [ - { - "description": "test feishu configuration req", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.TestFeishuConfigurationReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.TestFeishuConfigResV1" - } - } - } - } - }, - "/v1/configurations/git/test": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "test git connection", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "测试Git联通性", - "operationId": "TestGitConnectionV1", - "parameters": [ - { - "description": "test git configuration req", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.TestGitConnectionReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.TestGitConnectionResV1" - } - } - } - } - }, - "/v1/configurations/license": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sqle license", - "tags": [ - "configuration" - ], - "summary": "获取 sqle license", - "operationId": "getSQLELicenseV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetLicenseResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "set sqle license", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "configuration" - ], - "summary": "导入 sqle license", - "operationId": "setSQLELicenseV1", - "parameters": [ - { - "type": "file", - "description": "SQLE license file", - "name": "license_file", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/configurations/license/check": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "parse and check sqle license", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "configuration" - ], - "summary": "解析和校验 sqle license", - "operationId": "checkSQLELicenseV1", - "parameters": [ - { - "type": "file", - "description": "SQLE license file", - "name": "license_file", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.CheckLicenseResV1" - } - } - } - } - }, - "/v1/configurations/license/info": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get the information needed to generate the sqle license", - "tags": [ - "configuration" - ], - "summary": "获取生成 sqle license需要的的信息", - "operationId": "GetSQLELicenseInfoV1", - "responses": { - "200": { - "description": "server info", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/configurations/ssh_key": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get ssh public key", - "tags": [ - "configuration" - ], - "summary": "获取SSH公钥", - "operationId": "getSSHPublicKey", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.SSHPublicKeyInfoV1Rsp" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "gen ssh key", - "tags": [ - "configuration" - ], - "summary": "生成SSH密钥对", - "operationId": "genSSHPublicKey", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/configurations/wechat_audit": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get wechat audit configuration", - "tags": [ - "configuration" - ], - "summary": "获取微信审核配置", - "operationId": "getWechatAuditConfigurationV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWechatAuditConfigurationResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update wechat audit configuration", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "添加或更新微信配置", - "operationId": "updateWechatAuditConfigurationV1", - "parameters": [ - { - "description": "update wechat audit configuration req", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateWechatConfigurationReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/configurations/wechat_audit/test": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "test wechat audit configuration", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "测试微信审批配置", - "operationId": "testWechatAuditConfigV1", - "parameters": [ - { - "description": "test wechat configuration req", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.TestWechatConfigurationReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.TestWechatConfigResV1" - } - } - } - } - }, - "/v1/configurations/workflows/schedule/default_option": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get scheduled task default option", - "tags": [ - "workflow" - ], - "summary": "获取工单定时上线二次确认默认选项", - "operationId": "getScheduledTaskDefaultOptionV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.ScheduledTaskDefaultOptionV1Rsp" - } - } - } - } - }, - "/v1/custom_rules": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get all custom rule template", - "tags": [ - "rule_template" - ], - "summary": "自定义规则列表", - "operationId": "getCustomRulesV1", - "parameters": [ - { - "type": "string", - "description": "filter db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "filter desc", - "name": "filter_desc", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetCustomRulesResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create custom rule", - "tags": [ - "rule_template" - ], - "summary": "添加自定义规则", - "operationId": "createCustomRuleV1", - "parameters": [ - { - "description": "add custom rule", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.CreateCustomRuleReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/custom_rules/{db_type}/rule_types": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get rule type by db type", - "tags": [ - "rule_template" - ], - "summary": "获取规则分类", - "operationId": "getRuleTypeByDBTypeV1", - "parameters": [ - { - "type": "string", - "description": "db type", - "name": "db_type", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetRuleTypeByDBTypeResV1" - } - } - } - } - }, - "/v1/custom_rules/{rule_id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get custom rule by rule_id", - "tags": [ - "rule_template" - ], - "summary": "获取自定义规则", - "operationId": "getCustomRuleV1", - "parameters": [ - { - "type": "string", - "description": "rule id", - "name": "rule_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetCustomRuleResV1" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete custom rule", - "tags": [ - "rule_template" - ], - "summary": "删除自定义规则", - "operationId": "deleteCustomRuleV1", - "parameters": [ - { - "type": "string", - "description": "rule id", - "name": "rule_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update custom rule", - "tags": [ - "rule_template" - ], - "summary": "更新自定义规则", - "operationId": "updateCustomRuleV1", - "parameters": [ - { - "type": "string", - "description": "rule id", - "name": "rule_id", - "in": "path", - "required": true - }, - { - "description": "update custom rule", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateCustomRuleReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/dashboard": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get dashboard info", - "produces": [ - "application/json" - ], - "tags": [ - "dashboard" - ], - "summary": "获取 dashboard 信息", - "operationId": "getDashboardV1", - "parameters": [ - { - "type": "string", - "description": "filter project name", - "name": "filter_project_name", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetDashboardResV1" - } - } - } - } - }, - "/v1/dashboard/data_export_workflows": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global data export workflows list", - "tags": [ - "workflow" - ], - "summary": "获取全局导出工单列表", - "operationId": "getGlobalDataExportWorkflowsV1", - "parameters": [ - { - "type": "string", - "description": "filter create user id", - "name": "filter_create_user_id", - "in": "query" - }, - { - "enum": [ - "wait_for_approve", - "wait_for_export", - "exporting", - "failed", - "rejected", - "cancel", - "finish" - ], - "type": "array", - "items": { - "type": "string" - }, - "description": "filter by workflow status,support using many status", - "name": "filter_status_list", - "in": "query" - }, - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id in project", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "high", - "medium", - "low" - ], - "type": "string", - "description": "filter by project priority", - "name": "filter_project_priority", - "in": "query" - }, - { - "type": "string", - "description": "filter current step assignee user id", - "name": "filter_current_step_assignee_user_id", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowsResV1" - } - } - } - } - }, - "/v1/dashboard/data_export_workflows/statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global data export workflows statistics", - "tags": [ - "workflow" - ], - "summary": "获取全局导出工单统计数据", - "operationId": "getGlobalDataExportWorkflowStatisticsV1", - "parameters": [ - { - "type": "string", - "description": "filter create user id", - "name": "filter_create_user_id", - "in": "query" - }, - { - "enum": [ - "wait_for_approve", - "wait_for_export", - "exporting", - "failed", - "rejected", - "cancel", - "finish" - ], - "type": "array", - "items": { - "type": "string" - }, - "description": "filter by workflow status,support using many status", - "name": "filter_status_list", - "in": "query" - }, - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id in project", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "high", - "medium", - "low" - ], - "type": "string", - "description": "filter by project priority", - "name": "filter_project_priority", - "in": "query" - }, - { - "type": "string", - "description": "filter current step assignee user id", - "name": "filter_current_step_assignee_user_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GlobalWorkflowStatisticsResV1" - } - } - } - } - }, - "/v1/dashboard/sql_manages": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global sql manage list", - "tags": [ - "SqlManage" - ], - "summary": "获取全局管控sql列表", - "operationId": "GetGlobalSqlManageList", - "parameters": [ - { - "type": "string", - "description": "project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "high", - "medium", - "low" - ], - "type": "string", - "description": "project priority", - "name": "filter_project_priority", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetGlobalSqlManageListResp" - } - } - } - } - }, - "/v1/dashboard/sql_manages/statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global sql manage statistics", - "tags": [ - "SqlManage" - ], - "summary": "获取全局管控sql统计信息", - "operationId": "GetGlobalSqlManageStatistics", - "parameters": [ - { - "type": "string", - "description": "project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "high", - "medium", - "low" - ], - "type": "string", - "description": "project priority", - "name": "filter_project_priority", - "in": "query" - }, - { - "type": "string", - "description": "filter current step assignee user id", - "name": "filter_current_step_assignee_user_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetGlobalSqlManageStatisticsResp" - } - } - } - } - }, - "/v1/dashboard/workflows": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global workflow list", - "tags": [ - "workflow" - ], - "summary": "获取全局工单列表", - "operationId": "getGlobalWorkflowsV1", - "parameters": [ - { - "type": "string", - "description": "filter create user id", - "name": "filter_create_user_id", - "in": "query" - }, - { - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "executing", - "canceled", - "exec_failed", - "finished" - ], - "type": "array", - "items": { - "type": "string" - }, - "description": "filter by workflow status,, support using many status", - "name": "filter_status_list", - "in": "query" - }, - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id in project", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "high", - "medium", - "low" - ], - "type": "string", - "description": "filter by project priority", - "name": "filter_project_priority", - "in": "query" - }, - { - "type": "string", - "description": "filter current step assignee user id", - "name": "filter_current_step_assignee_user_id", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowsResV1" - } - } - } - } - }, - "/v1/dashboard/workflows/statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global workflow statistics", - "tags": [ - "workflow" - ], - "summary": "获取全局工单统计数据", - "operationId": "GetGlobalWorkflowStatistics", - "parameters": [ - { - "type": "string", - "description": "filter create user id", - "name": "filter_create_user_id", - "in": "query" - }, - { - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "executing", - "canceled", - "exec_failed", - "finished" - ], - "type": "array", - "items": { - "type": "string" - }, - "description": "filter by workflow status,, support using many status", - "name": "filter_status_list", - "in": "query" - }, - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id in project", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "high", - "medium", - "low" - ], - "type": "string", - "description": "filter by project priority", - "name": "filter_project_priority", - "in": "query" - }, - { - "type": "string", - "description": "filter current step assignee user id", - "name": "filter_current_step_assignee_user_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GlobalWorkflowStatisticsResV1" - } - } - } - } - }, - "/v1/database_driver_logos": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get database driver logos", - "tags": [ - "instance" - ], - "summary": "获取数据库插件的Logo图片", - "operationId": "GetDatabaseDriverLogos", - "parameters": [ - { - "type": "array", - "items": { - "type": "string" - }, - "description": "MySQL,Oracle", - "name": "db_types", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetDatabaseDriverLogosResV1" - } - } - } - } - }, - "/v1/database_driver_options": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get database driver options", - "tags": [ - "instance" - ], - "summary": "获取实例的额外属性列表", - "operationId": "getDatabaseDriverOptions", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetDatabaseDriverOptionsResV1" - } - } - } - } - }, - "/v1/import_rule_template": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get rule template file", - "tags": [ - "rule_template" - ], - "summary": "获取规则模板文件", - "operationId": "getRuleTemplateFileV1", - "parameters": [ - { - "type": "string", - "description": "instance type", - "name": "instance_type", - "in": "query", - "required": true - }, - { - "enum": [ - "csv", - "json" - ], - "type": "string", - "description": "file type", - "name": "file_type", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "sqle rule template file", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/knowledge_bases": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get knowledge base list", - "tags": [ - "knowledge_base" - ], - "summary": "获取知识库列表", - "operationId": "getKnowledgeBaseList", - "parameters": [ - { - "type": "string", - "description": "keywords", - "name": "keywords", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "description": "tags", - "name": "tags", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetKnowledgeBaseListRes" - } - } - } - } - }, - "/v1/knowledge_bases/graph": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get knowledge graph", - "tags": [ - "knowledge_base" - ], - "summary": "获取知识库知识图谱", - "operationId": "getKnowledgeGraph", - "parameters": [ - { - "type": "string", - "description": "filter by rule name", - "name": "filter_by_rule_name", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetKnowledgeGraphResp" - } - } - } - } - }, - "/v1/knowledge_bases/tags": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get tag list of knowledge base", - "tags": [ - "knowledge_base" - ], - "summary": "获取知识库标签列表", - "operationId": "getKnowledgeBaseTagList", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetKnowledgeBaseTagListRes" - } - } - } - } - }, - "/v1/operations": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get permission operations", - "tags": [ - "operation" - ], - "summary": "获取权限动作列表", - "operationId": "GetOperationsV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetOperationsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan info list", - "tags": [ - "audit_plan" - ], - "summary": "获取扫描任务信息列表", - "operationId": "getAuditPlansV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "filter audit plan db type", - "name": "filter_audit_plan_db_type", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search audit plan name", - "name": "fuzzy_search_audit_plan_name", - "in": "query" - }, - { - "type": "string", - "description": "filter audit plan type", - "name": "filter_audit_plan_type", - "in": "query" - }, - { - "type": "string", - "description": "filter audit plan instance name", - "name": "filter_audit_plan_instance_name", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditPlansResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create audit plan", - "consumes": [ - "application/json" - ], - "tags": [ - "audit_plan" - ], - "summary": "添加扫描任务", - "operationId": "createAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "create audit plan", - "name": "audit_plan", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.CreateAuditPlanReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan", - "tags": [ - "audit_plan" - ], - "summary": "获取指定扫描任务", - "operationId": "getAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditPlanResV1" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete audit plan", - "tags": [ - "audit_plan" - ], - "summary": "删除扫描任务", - "operationId": "deleteAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update audit plan", - "tags": [ - "audit_plan" - ], - "summary": "更新扫描任务", - "operationId": "updateAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "description": "update audit plan", - "name": "audit_plan", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateAuditPlanReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/notify_config": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan notify config", - "tags": [ - "audit_plan" - ], - "summary": "获取扫描任务消息推送设置", - "operationId": "getAuditPlanNotifyConfigV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditPlanNotifyConfigResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update audit plan notify config", - "tags": [ - "audit_plan" - ], - "summary": "更新扫描任务通知设置", - "operationId": "updateAuditPlanNotifyConfigV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "description": "update audit plan notify config", - "name": "config", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateAuditPlanNotifyConfigReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/notify_config/test": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Test audit task message push", - "tags": [ - "audit_plan" - ], - "summary": "测试扫描任务消息推送", - "operationId": "testAuditPlanNotifyConfigV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.TestAuditPlanNotifyConfigResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan report list", - "tags": [ - "audit_plan" - ], - "summary": "获取指定扫描任务的报告列表", - "operationId": "getAuditPlanReportsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditPlanReportsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan report", - "tags": [ - "audit_plan" - ], - "summary": "获取指定扫描任务的SQL扫描记录统计信息", - "operationId": "getAuditPlanReportV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan report id", - "name": "audit_plan_report_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditPlanReportResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/export": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "export audit plan report as csv", - "tags": [ - "audit_plan" - ], - "summary": "以csv的形式导出扫描报告", - "operationId": "exportAuditPlanReportV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan report id", - "name": "audit_plan_report_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "get export audit plan report", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan report SQLs", - "tags": [ - "audit_plan" - ], - "summary": "获取指定扫描任务的SQL扫描详情", - "operationId": "getAuditPlanReportsSQLsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan report id", - "name": "audit_plan_report_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditPlanReportSQLsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls/{number}/analysis": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get SQL explain and related table metadata for analysis", - "tags": [ - "audit_plan" - ], - "summary": "获取task相关的SQL执行计划和表元数据", - "operationId": "getTaskAnalysisData", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan report id", - "name": "audit_plan_report_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql number", - "name": "number", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditPlanAnalysisDataResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan SQLs", - "tags": [ - "audit_plan" - ], - "summary": "获取指定扫描任务的SQLs信息(不包括扫描结果)", - "operationId": "getAuditPlanSQLsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditPlanSQLsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/full": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "full sync audit plan SQLs", - "tags": [ - "audit_plan" - ], - "summary": "全量同步SQL到扫描任务", - "operationId": "fullSyncAuditPlanSQLsV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "description": "full sync audit plan SQLs request", - "name": "sqls", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.FullSyncAuditPlanSQLsReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/partial": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "partial sync audit plan SQLs", - "tags": [ - "audit_plan" - ], - "summary": "增量同步SQL到扫描任务", - "operationId": "partialSyncAuditPlanSQLsV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "description": "partial sync audit plan SQLs request", - "name": "sqls", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.PartialSyncAuditPlanSQLsReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/trigger": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "trigger audit plan", - "tags": [ - "audit_plan" - ], - "summary": "触发扫描任务", - "operationId": "triggerAuditPlanV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.TriggerAuditPlanResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_whitelist": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get all whitelist", - "tags": [ - "audit_whitelist" - ], - "summary": "获取Sql审核白名单", - "operationId": "getAuditWhitelistV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy value", - "name": "fuzzy_search_value", - "in": "query" - }, - { - "type": "string", - "description": "match type", - "name": "filter_match_type", - "in": "query" - }, - { - "type": "string", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "page size", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditWhitelistResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create a sql whitelist", - "consumes": [ - "application/json" - ], - "tags": [ - "audit_whitelist" - ], - "summary": "添加SQL白名单", - "operationId": "createAuditWhitelistV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "add sql whitelist req", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.CreateAuditWhitelistReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_whitelist/{audit_whitelist_id}/": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "remove sql white", - "tags": [ - "audit_whitelist" - ], - "summary": "删除SQL白名单信息", - "operationId": "deleteAuditWhitelistByIdV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit whitelist id", - "name": "audit_whitelist_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update sql whitelist by id", - "consumes": [ - "application/json" - ], - "tags": [ - "audit_whitelist" - ], - "summary": "更新SQL白名单", - "operationId": "UpdateAuditWhitelistByIdV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql audit whitelist id", - "name": "audit_whitelist_id", - "in": "path", - "required": true - }, - { - "description": "update sql whitelist req", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateAuditWhitelistReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/blacklist": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get blacklist", - "tags": [ - "blacklist" - ], - "summary": "获取黑名单列表", - "operationId": "getBlacklistV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "enum": [ - "sql", - "fp_sql", - "ip", - "cidr", - "host", - "instance" - ], - "type": "string", - "description": "filter type", - "name": "filter_type", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search content", - "name": "fuzzy_search_content", - "in": "query" - }, - { - "type": "string", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "page size", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetBlacklistResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create a blacklist", - "consumes": [ - "application/json" - ], - "tags": [ - "blacklist" - ], - "summary": "添加黑名单", - "operationId": "createBlacklistV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "add blacklist req", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.CreateBlacklistReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/blacklist/{blacklist_id}/": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete a blacklist", - "tags": [ - "blacklist" - ], - "operationId": "deleteBlackList", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "blacklist id", - "name": "blacklist_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update a blacklist", - "consumes": [ - "application/json" - ], - "tags": [ - "blacklist" - ], - "summary": "更新黑名单", - "operationId": "updateBlacklistV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "blacklist id", - "name": "blacklist_id", - "in": "path", - "required": true - }, - { - "description": "update blacklist req", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateBlacklistReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/database_comparison/comparison_statements": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get database comparison detail", - "consumes": [ - "application/json" - ], - "tags": [ - "database_comparison" - ], - "summary": "获取对比语句", - "operationId": "getComparisonStatementV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "get database comparison statement request", - "name": "database_comparison_object", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.GetComparisonStatementsReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.DatabaseComparisonStatementsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/database_comparison/execute_comparison": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get database comparison", - "consumes": [ - "application/json" - ], - "tags": [ - "database_comparison" - ], - "summary": "执行数据库结构对比并获取结果", - "operationId": "executeDatabaseComparisonV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "get database comparison request", - "name": "database_comparison", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.GetDatabaseComparisonReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.DatabaseComparisonResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/database_comparison/modify_sql_statements": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "generate database diff modify sqls", - "consumes": [ - "application/json" - ], - "tags": [ - "database_comparison" - ], - "summary": "生成变更SQL", - "operationId": "genDatabaseDiffModifySQLsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "generate database diff modify sqls request", - "name": "gen_modify_sql", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.GenModifylSQLReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GenModifySQLResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance audit plan info list", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取实例扫描任务列表", - "operationId": "getInstanceAuditPlansV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "filter by business", - "name": "filter_by_business", - "in": "query" - }, - { - "type": "string", - "description": "filter by environment tag", - "name": "filter_by_environment_tag", - "in": "query" - }, - { - "type": "string", - "description": "filter by db type", - "name": "filter_by_db_type", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_by_instance_id", - "in": "query" - }, - { - "type": "string", - "description": "filter instance audit plan type", - "name": "filter_by_audit_plan_type", - "in": "query" - }, - { - "type": "string", - "description": "filter instance audit plan active status", - "name": "filter_by_active_status", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search", - "name": "fuzzy_search", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetInstanceAuditPlansResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create instance audit plan", - "consumes": [ - "application/json" - ], - "tags": [ - "instance_audit_plan" - ], - "summary": "添加实例扫描任务", - "operationId": "createInstanceAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "create instance audit plan", - "name": "instannce_audit_plan", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.CreateInstanceAuditPlanReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.CreatInstanceAuditPlanResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance audit plan detail", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取实例扫描任务详情", - "operationId": "getInstanceAuditPlanDetailV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetInstanceAuditPlanDetailResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update instance audit plan", - "tags": [ - "instance_audit_plan" - ], - "summary": "更新实例扫描任务配置", - "operationId": "updateInstanceAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "description": "update instance audit plan", - "name": "audit_plan", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateInstanceAuditPlanReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete instance audit plan", - "tags": [ - "instance_audit_plan" - ], - "summary": "删除实例扫描任务", - "operationId": "deleteInstanceAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "stop/start instance audit plan", - "tags": [ - "instance_audit_plan" - ], - "summary": "更新实例扫描任务状态", - "operationId": "updateInstanceAuditPlanStatusV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "description": "update instance audit plan", - "name": "audit_plan", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateInstanceAuditPlanStatusReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan overview", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取实例扫描任务概览", - "operationId": "getInstanceAuditPlanOverviewV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetInstanceAuditPlanOverviewResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete audit plan by type", - "tags": [ - "instance_audit_plan" - ], - "summary": "删除扫描任务", - "operationId": "deleteAuditPlanByTypeV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan id", - "name": "audit_plan_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "stop/start audit plan", - "tags": [ - "instance_audit_plan" - ], - "summary": "更新扫描任务状态", - "operationId": "updateAuditPlanStatusV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan id", - "name": "audit_plan_id", - "in": "path", - "required": true - }, - { - "description": "update audit plan status", - "name": "audit_plan", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateAuditPlanStatusReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/audit": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "audit plan trigger sql audit", - "tags": [ - "instance_audit_plan" - ], - "summary": "扫描任务触发sql审核", - "operationId": "auditPlanTriggerSqlAuditV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan id", - "name": "audit_plan_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/sql_data": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan SQLs", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取指定扫描任务的SQL列表", - "operationId": "getInstanceAuditPlanSQLDataV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan id", - "name": "audit_plan_id", - "in": "path", - "required": true - }, - { - "description": "audit plan sql data request", - "name": "audit_plan_sql_request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.GetAuditPlanSQLDataReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditPlanSQLDataResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/sql_export": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "export audit plan SQL report as CSV or Excel", - "tags": [ - "instance_audit_plan" - ], - "summary": "导出指定扫描任务的 SQL 列表", - "operationId": "getInstanceAuditPlanSQLExportV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan id", - "name": "audit_plan_id", - "in": "path", - "required": true - }, - { - "description": "audit plan sql export request", - "name": "audit_plan_sql_request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.GetAuditPlanSQLExportReqV1" - } - } - ], - "responses": { - "200": { - "description": "export audit plan sql report", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/sql_meta": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan SQL meta", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取指定扫描任务的SQL列表元信息", - "operationId": "getInstanceAuditPlanSQLMetaV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan id", - "name": "audit_plan_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditPlanSQLMetaResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan SQLs", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取指定扫描任务的SQLs信息", - "operationId": "getInstanceAuditPlanSQLsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan id", - "name": "audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditPlanSQLsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/sqls/{id}/analysis": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get SQL explain and related table metadata for analysis", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取扫描任务相关的SQL执行计划和表元数据", - "operationId": "getAuditPlanSqlAnalysisDataV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan sql id", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "whether to calculate and return affected rows, default is true", - "name": "affectRowsEnabled", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSqlManageSqlAnalysisResp" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/token": { - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "refresh audit plan token", - "tags": [ - "instance_audit_plan" - ], - "summary": "重置扫描任务token", - "operationId": "refreshAuditPlanTokenV1", - "parameters": [ - { - "description": "update instance audit plan token", - "name": "audit_plan", - "in": "body", - "schema": { - "$ref": "#/definitions/v1.RefreshAuditPlanTokenReqV1" - } - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_tips": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance tip list", - "tags": [ - "instance" - ], - "summary": "获取实例提示列表", - "operationId": "getInstanceTipListV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "filter db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "filter by business", - "name": "filter_by_business", - "in": "query" - }, - { - "type": "string", - "description": "filter workflow template id", - "name": "filter_workflow_template_id", - "in": "query" - }, - { - "enum": [ - "create_audit_plan", - "create_workflow", - "sql_manage", - "create_optimization", - "create_pipeline" - ], - "type": "string", - "description": "functional module", - "name": "functional_module", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetInstanceTipsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instances/connections": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "batch test instance db connections", - "tags": [ - "instance" - ], - "summary": "批量测试实例连通性(实例提交后)", - "operationId": "batchCheckInstanceIsConnectableByName", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "instances", - "name": "instances", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.BatchCheckInstanceConnectionsReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.BatchGetInstanceConnectionsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instances/{instance_name}/connection": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "test instance db connection", - "tags": [ - "instance" - ], - "summary": "实例连通性测试(实例提交后)", - "operationId": "checkInstanceIsConnectableByNameV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetInstanceConnectableResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instances/{instance_name}/rules": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance all rule", - "tags": [ - "instance" - ], - "summary": "获取实例应用的规则列表", - "operationId": "getInstanceRuleListV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetRulesResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instances/{instance_name}/schemas": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "instance schema list", - "tags": [ - "instance" - ], - "summary": "实例 Schema 列表", - "operationId": "getInstanceSchemasV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetInstanceSchemaResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instances/{instance_name}/schemas/{schema_name}/tables": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "list table by schema", - "tags": [ - "instance" - ], - "summary": "获取数据库下的所有表", - "operationId": "listTableBySchema", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "schema name", - "name": "schema_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.ListTableBySchemaResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instances/{instance_name}/schemas/{schema_name}/tables/{table_name}/metadata": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get table metadata", - "tags": [ - "instance" - ], - "summary": "获取表元数据", - "operationId": "getTableMetadata", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "schema name", - "name": "schema_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "table name", - "name": "table_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetTableMetadataResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/pipelines": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get pipeline list", - "tags": [ - "pipeline" - ], - "summary": "获取流水线列表", - "operationId": "getPipelinesV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy search pipeline name and description", - "name": "fuzzy_search_name_desc", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetPipelinesResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create pipeline", - "consumes": [ - "application/json" - ], - "tags": [ - "pipeline" - ], - "summary": "创建流水线", - "operationId": "createPipelineV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "create pipeline", - "name": "pipeline", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.CreatePipelineReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.CreatePipelineResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/pipelines/{pipeline_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get pipeline detail", - "tags": [ - "pipeline" - ], - "summary": "获取流水线详情", - "operationId": "getPipelineDetailV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "pipeline id", - "name": "pipeline_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetPipelineDetailResV1" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete pipeline", - "tags": [ - "pipeline" - ], - "summary": "删除流水线", - "operationId": "deletePipelineV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "pipeline id", - "name": "pipeline_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update pipeline", - "tags": [ - "pipeline" - ], - "summary": "更新流水线", - "operationId": "updatePipelineV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "pipeline id", - "name": "pipeline_id", - "in": "path", - "required": true - }, - { - "description": "update pipeline", - "name": "pipeline", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdatePipelineReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/pipelines/{pipeline_id}/token/{node_id}/": { - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "refresh pipeline token", - "tags": [ - "pipeline" - ], - "summary": "刷新流水线节点token", - "operationId": "refreshPipelineNodeTokenV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "pipeline id", - "name": "pipeline_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "node id", - "name": "node_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/report_push_configs": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Get report push config list", - "tags": [ - "ReportPushConfig" - ], - "summary": "获取消息推送配置列表", - "operationId": "GetReportPushConfigList", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetReportPushConfigsListResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/report_push_configs/{report_push_config_id}/": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update report push config", - "tags": [ - "ReportPushConfig" - ], - "summary": "更新消息推送配置", - "operationId": "UpdateReportPushConfig", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "report push config id", - "name": "report_push_config_id", - "in": "path", - "required": true - }, - { - "description": "update report push config request", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateReportPushConfigReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/rule_template_tips": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get rule template tips in project", - "tags": [ - "rule_template" - ], - "summary": "获取项目规则模板提示", - "operationId": "getProjectRuleTemplateTipsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "filter db type", - "name": "filter_db_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetRuleTemplateTipsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/rule_templates": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get all rule template in a project", - "tags": [ - "rule_template" - ], - "summary": "项目规则模板列表", - "operationId": "getProjectRuleTemplateListV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetProjectRuleTemplatesResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create a rule template in project", - "consumes": [ - "application/json" - ], - "tags": [ - "rule_template" - ], - "summary": "添加项目规则模板", - "operationId": "createProjectRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "add rule template request", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.CreateProjectRuleTemplateReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/rule_templates/{rule_template_name}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get rule template detail in project", - "tags": [ - "rule_template" - ], - "summary": "获取项目规则模板信息", - "operationId": "getProjectRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy rule,keyword for desc and annotation", - "name": "fuzzy_keyword_rule", - "in": "query" - }, - { - "type": "string", - "description": "tags for rule", - "name": "tags", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetProjectRuleTemplateResV1" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete rule template in project", - "tags": [ - "rule_template" - ], - "summary": "删除项目规则模板", - "operationId": "deleteProjectRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update rule template in project", - "tags": [ - "rule_template" - ], - "summary": "更新项目规则模板", - "operationId": "updateProjectRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - }, - { - "description": "update rule template request", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateProjectRuleTemplateReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/rule_templates/{rule_template_name}/clone": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "clone a rule template in project", - "consumes": [ - "application/json" - ], - "tags": [ - "rule_template" - ], - "summary": "克隆项目规则模板", - "operationId": "cloneProjectRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - }, - { - "description": "clone rule template request", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.CloneProjectRuleTemplateReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/rule_templates/{rule_template_name}/export": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "export rule template in a project", - "tags": [ - "rule_template" - ], - "summary": "导出项目规则模板", - "operationId": "exportProjectRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - }, - { - "enum": [ - "csv", - "json" - ], - "type": "string", - "description": "export type", - "name": "export_type", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "sqle rule template file", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_audit_records": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql audit records", - "tags": [ - "sql_audit_record" - ], - "summary": "获取SQL审核记录列表", - "operationId": "getSQLAuditRecordsV1", - "parameters": [ - { - "type": "string", - "description": "fuzzy search tags", - "name": "fuzzy_search_tags", - "in": "query" - }, - { - "enum": [ - "auditing", - "successfully" - ], - "type": "string", - "description": "filter sql audit status", - "name": "filter_sql_audit_status", - "in": "query" - }, - { - "type": "integer", - "description": "filter instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "type": "string", - "description": "filter create time from", - "name": "filter_create_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter create time to", - "name": "filter_create_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter sql audit record ids", - "name": "filter_sql_audit_record_ids", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSQLAuditRecordsResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "SQL audit\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.\n4. file[input_zip_file]: it is ZIP file that sql will be parsed from xml or sql file inside it.\n5. formData[git_http_url]:the url which scheme is http(s) and end with .git.\n6. formData[git_user_name]:The name of the user who owns the repository read access.\n7. formData[git_branch_name]:The name of the repository branch.\n8. formData[git_user_password]:The password corresponding to git_user_name.", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sql_audit_record" - ], - "summary": "SQL审核", - "operationId": "CreateSQLAuditRecordV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "formData" - }, - { - "type": "string", - "description": "schema of instance", - "name": "instance_schema", - "in": "formData" - }, - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "formData" - }, - { - "type": "string", - "description": "db type of instance", - "name": "db_type", - "in": "formData" - }, - { - "type": "string", - "description": "sqls for audit", - "name": "sqls", - "in": "formData" - }, - { - "type": "file", - "description": "input SQL file", - "name": "input_sql_file", - "in": "formData" - }, - { - "type": "file", - "description": "input mybatis XML file", - "name": "input_mybatis_xml_file", - "in": "formData" - }, - { - "type": "file", - "description": "input ZIP file", - "name": "input_zip_file", - "in": "formData" - }, - { - "type": "string", - "description": "git repository url", - "name": "git_http_url", - "in": "formData" - }, - { - "type": "string", - "description": "the name of user to clone the repository", - "name": "git_user_name", - "in": "formData" - }, - { - "type": "string", - "description": "the name of repository branch", - "name": "git_branch_name", - "in": "formData" - }, - { - "type": "string", - "description": "the password corresponding to git_user_name", - "name": "git_user_password", - "in": "formData" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.CreateSQLAuditRecordResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_audit_records/tag_tips": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql audit record tag tips", - "tags": [ - "sql_audit_record" - ], - "summary": "获取SQL审核记录标签列表", - "operationId": "GetSQLAuditRecordTagTipsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSQLAuditRecordTagTipsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_audit_records/{sql_audit_record_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql audit record info", - "tags": [ - "sql_audit_record" - ], - "summary": "获取SQL审核记录信息", - "operationId": "getSQLAuditRecordV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql audit record id", - "name": "sql_audit_record_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSQLAuditRecordResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update SQL audit record", - "consumes": [ - "application/json" - ], - "tags": [ - "sql_audit_record" - ], - "summary": "更新SQL审核记录", - "operationId": "updateSQLAuditRecordV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql audit record id", - "name": "sql_audit_record_id", - "in": "path", - "required": true - }, - { - "description": "update SQL audit record", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateSQLAuditRecordReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_dev_records": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql dev record list", - "tags": [ - "SqlDEVRecord" - ], - "summary": "获取开发sql记录", - "operationId": "GetSqlDEVRecordList", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy search sql fingerprint", - "name": "fuzzy_search_sql_fingerprint", - "in": "query" - }, - { - "type": "string", - "description": "instance name", - "name": "filter_instance_name", - "in": "query" - }, - { - "enum": [ - "ide_plugin" - ], - "type": "string", - "description": "source", - "name": "filter_source", - "in": "query" - }, - { - "type": "string", - "description": "creator name", - "name": "filter_creator", - "in": "query" - }, - { - "type": "string", - "description": "last receive time from", - "name": "filter_last_receive_time_from", - "in": "query" - }, - { - "type": "string", - "description": "last receive time to", - "name": "filter_last_receive_time_to", - "in": "query" - }, - { - "enum": [ - "first_appear_timestamp", - "last_receive_timestamp", - "fp_count" - ], - "type": "string", - "description": "sort field", - "name": "sort_field", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "sort order", - "name": "sort_order", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSqlDEVRecordListResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_manages": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql manage list", - "tags": [ - "SqlManage" - ], - "summary": "获取管控sql列表", - "operationId": "GetSqlManageList", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy search sql fingerprint", - "name": "fuzzy_search_sql_fingerprint", - "in": "query" - }, - { - "type": "string", - "description": "assignee", - "name": "filter_assignee", - "in": "query" - }, - { - "type": "string", - "description": "instance name", - "name": "filter_instance_name", - "in": "query" - }, - { - "enum": [ - "audit_plan", - "sql_audit_record" - ], - "type": "string", - "description": "source", - "name": "filter_source", - "in": "query" - }, - { - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "type": "string", - "description": "audit level", - "name": "filter_audit_level", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time from", - "name": "filter_last_audit_start_time_from", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time to", - "name": "filter_last_audit_start_time_to", - "in": "query" - }, - { - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited" - ], - "type": "string", - "description": "status", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "rule name", - "name": "filter_rule_name", - "in": "query" - }, - { - "type": "string", - "description": "db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search endpoint", - "name": "fuzzy_search_endpoint", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search schema name", - "name": "fuzzy_search_schema_name", - "in": "query" - }, - { - "enum": [ - "first_appear_timestamp", - "last_receive_timestamp", - "fp_count" - ], - "type": "string", - "description": "sort field", - "name": "sort_field", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "sort order", - "name": "sort_order", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSqlManageListResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_manages/abnormal_audit_plan_instance": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get the instance of audit plan execution abnormal", - "tags": [ - "SqlManage" - ], - "summary": "获取执行异常的扫描任务实例", - "operationId": "getAbnormalInstanceAuditPlansV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAbnormalAuditPlanInstancesResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_manages/batch": { - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "batch update sql manage", - "tags": [ - "SqlManage" - ], - "summary": "批量更新SQL管控", - "operationId": "BatchUpdateSqlManage", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "batch update sql manage request", - "name": "BatchUpdateSqlManageReq", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.BatchUpdateSqlManageReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_manages/exports": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "export sql manage", - "tags": [ - "SqlManage" - ], - "summary": "导出SQL管控", - "operationId": "exportSqlManageV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy search sql fingerprint", - "name": "fuzzy_search_sql_fingerprint", - "in": "query" - }, - { - "type": "string", - "description": "assignee", - "name": "filter_assignee", - "in": "query" - }, - { - "type": "string", - "description": "filter by business", - "name": "filter_business", - "in": "query" - }, - { - "enum": [ - "high", - "low" - ], - "type": "string", - "description": "priority", - "name": "filter_priority", - "in": "query" - }, - { - "type": "string", - "description": "instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "audit_plan", - "sql_audit_record" - ], - "type": "string", - "description": "source", - "name": "filter_source", - "in": "query" - }, - { - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "type": "string", - "description": "audit level", - "name": "filter_audit_level", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time from", - "name": "filter_last_audit_start_time_from", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time to", - "name": "filter_last_audit_start_time_to", - "in": "query" - }, - { - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited" - ], - "type": "string", - "description": "status", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "rule name", - "name": "filter_rule_name", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search endpoint", - "name": "fuzzy_search_endpoint", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search schema name", - "name": "fuzzy_search_schema_name", - "in": "query" - }, - { - "enum": [ - "first_appear_timestamp", - "last_receive_timestamp", - "fp_count" - ], - "type": "string", - "description": "sort field", - "name": "sort_field", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "sort order", - "name": "sort_order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "export sql manage", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_manages/rule_tips": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql manage rule tips", - "tags": [ - "SqlManage" - ], - "summary": "获取管控规则tips", - "operationId": "GetSqlManageRuleTips", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSqlManageRuleTipsResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_manages/send": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql manage analysis", - "tags": [ - "SqlManage" - ], - "summary": "推送SQL管控结果到外部系统", - "operationId": "SendSqlManage", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "batch update sql manage request", - "name": "SqlManageCodingReq", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.SqlManageCodingReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.PostSqlManageCodingResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_manages/{sql_manage_id}/sql_analysis": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql manage analysis", - "tags": [ - "SqlManage" - ], - "summary": "获取SQL管控SQL分析", - "operationId": "GetSqlManageSqlAnalysisV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql manage id", - "name": "sql_manage_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "whether to calculate and return affected rows, default is true", - "name": "affectRowsEnabled", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSqlManageSqlAnalysisResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_manages/{sql_manage_id}/sql_analysis_chart": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql manage analysis", - "tags": [ - "SqlManage" - ], - "summary": "获取SQL管控SQL执行计划Cost趋势图表", - "operationId": "GetSqlManageSqlAnalysisChartV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql manage id", - "name": "sql_manage_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "latest_point_enabled", - "name": "latest_point_enabled", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "start time", - "name": "start_time", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "end time", - "name": "end_time", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "metric_name", - "name": "metric_name", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.SqlManageAnalysisChartResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_optimization_records": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql optimization records", - "tags": [ - "sql_optimization" - ], - "summary": "获取SQL优化记录列表", - "operationId": "getOptimizationRecords", - "parameters": [ - { - "type": "string", - "description": "fuzzy search for optimization_id or create_username", - "name": "fuzzy_search", - "in": "query" - }, - { - "type": "string", - "description": "filter instance name", - "name": "filter_instance_name", - "in": "query" - }, - { - "type": "string", - "description": "filter create time from", - "name": "filter_create_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter create time to", - "name": "filter_create_time_to", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetOptimizationRecordsRes" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "optimize sql\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.\n4. file[input_zip_file]: it is ZIP file that sql will be parsed from xml or sql file inside it.\n5. formData[git_http_url]:the url which scheme is http(s) and end with .git.\n6. formData[git_user_name]:The name of the user who owns the repository read access.\n7. formData[git_user_password]:The password corresponding to git_user_name.", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sql_optimization" - ], - "summary": "优化SQL", - "operationId": "OptimizeSQLReq", - "parameters": [ - { - "description": "sqls that should be optimization", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.OptimizeSQLReq" - } - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "formData" - }, - { - "type": "string", - "description": "schema of instance", - "name": "schema_name", - "in": "formData" - }, - { - "type": "string", - "description": "db type of instance", - "name": "db_type", - "in": "formData" - }, - { - "type": "string", - "description": "sqls for audit", - "name": "sql_content", - "in": "formData" - }, - { - "type": "string", - "description": "optimization name", - "name": "optimization_name", - "in": "formData", - "required": true - }, - { - "type": "file", - "description": "input SQL file", - "name": "input_sql_file", - "in": "formData" - }, - { - "type": "file", - "description": "input mybatis XML file", - "name": "input_mybatis_xml_file", - "in": "formData" - }, - { - "type": "file", - "description": "input ZIP file", - "name": "input_zip_file", - "in": "formData" - }, - { - "type": "string", - "description": "git repository url", - "name": "git_http_url", - "in": "formData" - }, - { - "type": "string", - "description": "the name of user to clone the repository", - "name": "git_user_name", - "in": "formData" - }, - { - "type": "string", - "description": "the password corresponding to git_user_name", - "name": "git_user_password", - "in": "formData" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.OptimizeSQLRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_optimization_records/{optimization_record_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql optimization record", - "tags": [ - "sql_optimization" - ], - "summary": "获取SQL优化记录", - "operationId": "GetOptimizationRecordReq", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql optimization record id", - "name": "optimization_record_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql", - "name": "sql", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetOptimizationRecordRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_optimization_records/{optimization_record_id}/sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql optimization sqls", - "tags": [ - "sql_optimization" - ], - "summary": "获取SQL优化语句列表", - "operationId": "getOptimizationSQLs", - "parameters": [ - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "optimization record id", - "name": "optimization_record_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetOptimizationSQLsRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_optimization_records/{optimization_record_id}/sqls/{number}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql optimization record", - "tags": [ - "sql_optimization" - ], - "summary": "获取SQL优化语句详情", - "operationId": "GetOptimizationReq", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql optimization record id", - "name": "optimization_record_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "optimization record sql number", - "name": "number", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetOptimizationSQLRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_performance_insights": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql manage sql performance insights", - "tags": [ - "SqlInsight" - ], - "summary": "获取SQL管控SQL性能洞察图表数据", - "operationId": "GetSqlPerformanceInsights", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "enum": [ - "comprehensive_trend", - "slow_sql_trend", - "top_sql_trend", - "active_session_trend" - ], - "type": "string", - "description": "metric name", - "name": "metric_name", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "start time", - "name": "start_time", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "end time", - "name": "end_time", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "instance id", - "name": "instance_id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSqlPerformanceInsightsResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_performance_insights/related_sql": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Get related SQL for the selected time range in SQL performance insights", - "tags": [ - "SqlInsight" - ], - "summary": "获取sql洞察 时间选区 的关联SQL", - "operationId": "GetSqlPerformanceInsightsRelatedSQL", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance id", - "name": "instance_id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "start time", - "name": "start_time", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "end time", - "name": "end_time", - "in": "query", - "required": true - }, - { - "enum": [ - "workflow", - "sql_manage", - "workbench" - ], - "type": "string", - "description": "filter by SQL source", - "name": "filter_source", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "order by field", - "name": "order_by", - "in": "query" - }, - { - "type": "boolean", - "description": "is ascending order", - "name": "is_asc", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSqlPerformanceInsightsRelatedSQLResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_performance_insights/related_sql/related_transaction": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Get related transaction for the selected SQL in SQL performance insights", - "tags": [ - "SqlInsight" - ], - "summary": "获取sql洞察 相关SQL中具体一条SQL 的关联事务", - "operationId": "GetSqlPerformanceInsightsRelatedTransaction", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance id", - "name": "instance_id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "sql id", - "name": "sql_id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSqlPerformanceInsightsRelatedTransactionResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_versions": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "sql version list", - "consumes": [ - "application/json" - ], - "tags": [ - "sql_version" - ], - "summary": "获取SQL版本列表", - "operationId": "getSqlVersionListV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "filter by created at from", - "name": "filter_by_created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "filter by created at to", - "name": "filter_by_created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "filter by lock time from", - "name": "filter_by_lock_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter by lock time to", - "name": "filter_by_lock_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter by version status", - "name": "filter_by_version_status", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search", - "name": "fuzzy_search", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSqlVersionListResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create sql version", - "consumes": [ - "application/json" - ], - "tags": [ - "sql_version" - ], - "summary": "创建SQL版本记录", - "operationId": "createSqlVersionV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "create sql version request", - "name": "sql_version", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.CreateSqlVersionReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.CreateSqlVersionResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_versions/{sql_version_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql version detail", - "tags": [ - "sql_version" - ], - "summary": "获取SQL版本详情", - "operationId": "getSqlVersionDetailV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSqlVersionDetailResV1" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete sql version", - "tags": [ - "sql_version" - ], - "summary": "删除SQL版本", - "operationId": "deleteSqlVersionV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update sql version", - "tags": [ - "sql_version" - ], - "summary": "更新SQL版本信息", - "operationId": "updateSqlVersionV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - }, - { - "description": "update sql version request", - "name": "sql_version", - "in": "body", - "schema": { - "$ref": "#/definitions/v1.UpdateSqlVersionReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_versions/{sql_version_id}/batch_execute_workflows": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "batch execute workflows", - "tags": [ - "sql_version" - ], - "summary": "工单批量上线", - "operationId": "batchExecuteWorkflowsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - }, - { - "description": "batch execute workflows request", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.BatchExecuteWorkflowsReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_versions/{sql_version_id}/batch_release_workflows": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "batch release workflow", - "tags": [ - "sql_version" - ], - "summary": "批量发布工单(在版本的下一阶段创建工单)", - "operationId": "batchReleaseWorkflowsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - }, - { - "description": "batch release workflow request", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.BatchReleaseWorkflowReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_versions/{sql_version_id}/lock": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "lock sql version", - "tags": [ - "sql_version" - ], - "summary": "锁定SQL版本", - "operationId": "lockSqlVersionV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - }, - { - "description": "lock sql version request", - "name": "sql_version", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.LockSqlVersionReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_versions/{sql_version_id}/sql_version_stages/{sql_version_stage_id}/associate_workflows": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflows that can be associated to version", - "tags": [ - "sql_version" - ], - "summary": "获取可与版本关联的工单", - "operationId": "GetWorkflowsThatCanBeAssociatedToVersionV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version stage id", - "name": "sql_version_stage_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowsThatCanBeAssociatedToVersionResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "batch associate workflows with version", - "tags": [ - "sql_version" - ], - "summary": "批量关联工单到版本", - "operationId": "batchAssociateWorkflowsWithVersionV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version stage id", - "name": "sql_version_stage_id", - "in": "path", - "required": true - }, - { - "description": "batch associate workflows with version request", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.BatchAssociateWorkflowsWithVersionReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_versions/{sql_version_id}/sql_version_stages/{sql_version_stage_id}/dependencies": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get dependencies between stage instance", - "tags": [ - "sql_version" - ], - "summary": "获取当前阶段与下一阶段实例的依赖信息", - "operationId": "getDependenciesBetweenStageInstanceV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version stage id", - "name": "sql_version_stage_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetDepBetweenStageInstanceResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/audit_plans": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "statistic audit plan", - "tags": [ - "statistic" - ], - "summary": "获取各类型数据源上的扫描任务数量", - "operationId": "statisticAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.StatisticAuditPlanResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/audited_sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "statistics audited sql", - "tags": [ - "statistic" - ], - "summary": "获取审核SQL总数,以及触发审核规则的SQL数量", - "operationId": "statisticsAuditedSQLV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.StatisticsAuditedSQLResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/instance_health": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance health", - "tags": [ - "statistic" - ], - "summary": "获取各类型数据源的健康情况", - "operationId": "GetInstanceHealthV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetInstanceHealthResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/optimization_performance_improve_overview": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get db optimization performance improvements", - "tags": [ - "sql_optimization" - ], - "summary": "获取实例性能提升概览", - "operationId": "getDBPerformanceImproveOverview", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetDBPerformanceImproveOverviewResp" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/optimization_record_overview": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql optimization record overview", - "tags": [ - "sql_optimization" - ], - "summary": "获取SQL优化记录概览", - "operationId": "getOptimizationOverview", - "parameters": [ - { - "type": "string", - "description": "create time from", - "name": "filter_create_time_from", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "create time to", - "name": "filter_create_time_to", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetOptimizationOverviewResp" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/project_score": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get project score", - "tags": [ - "statistic" - ], - "summary": "获取项目分数", - "operationId": "GetProjectScoreV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetProjectScoreResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/risk_audit_plans": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get risk audit plan", - "tags": [ - "statistic" - ], - "summary": "获取扫描任务报告评分低于60的扫描任务", - "operationId": "getRiskAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetRiskAuditPlanResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/risk_workflow": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "statistic risk workflow", - "tags": [ - "statistic" - ], - "summary": "获取存在风险的工单", - "operationId": "statisticRiskWorkflowV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.StatisticRiskWorkflowResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/role_user": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get role user count", - "tags": [ - "statistic" - ], - "summary": "获取各角色类型对应的成员数量", - "operationId": "getRoleUserCountV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetRoleUserCountResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/workflow_status": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "statistic workflow status", - "tags": [ - "statistic" - ], - "summary": "获取项目下工单各个状态的数量", - "operationId": "statisticWorkflowStatusV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowStatusCountResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get project statistics", - "tags": [ - "statistic" - ], - "summary": "获取项目统计信息", - "operationId": "getProjectStatisticsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetProjectStatisticsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/task_groups": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create tasks group.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "task" - ], - "summary": "创建审核任务组", - "operationId": "createAuditTasksV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "parameters for creating audit tasks group", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.CreateAuditTasksGroupReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.CreateAuditTasksGroupResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/tasks/audits": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create and audit a task, you can upload sql content in three ways, any one can be used, but only one is effective.\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "task" - ], - "summary": "创建Sql扫描任务并提交审核", - "operationId": "createAndAuditTaskV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "schema of instance", - "name": "instance_schema", - "in": "formData" - }, - { - "type": "boolean", - "description": "enable backup", - "name": "enable_backup", - "in": "formData" - }, - { - "type": "integer", - "description": "backup max rows", - "name": "backup_max_rows", - "in": "formData" - }, - { - "type": "string", - "description": "sqls for audit", - "name": "sql", - "in": "formData" - }, - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "formData" - }, - { - "type": "file", - "description": "input SQL file", - "name": "input_sql_file", - "in": "formData" - }, - { - "type": "file", - "description": "input mybatis XML file", - "name": "input_mybatis_xml_file", - "in": "formData" - }, - { - "type": "file", - "description": "input ZIP file", - "name": "input_zip_file", - "in": "formData" - }, - { - "type": "string", - "description": "exec mode", - "name": "exec_mode", - "in": "formData" - }, - { - "type": "string", - "description": "file order method", - "name": "file_order_method", - "in": "formData" - }, - { - "description": "create and audit task", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.CreateAuditTaskReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditTaskResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/workflow_template": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow template detail; query by workflow_template_id or by workflow_type default template", - "tags": [ - "workflow" - ], - "summary": "获取审批流程模板详情", - "operationId": "getWorkflowTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "enum": [ - "workflow", - "data_export" - ], - "type": "string", - "description": "filter workflow type", - "name": "workflow_type", - "in": "query" - }, - { - "type": "integer", - "description": "workflow template id", - "name": "workflow_template_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowTemplateResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/workflow_template/{workflow_type}/": { - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update the workflow template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "更新Sql审批流程模板", - "operationId": "updateWorkflowTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "enum": [ - "workflow", - "data_export" - ], - "type": "string", - "description": "workflow type", - "name": "workflow_type", - "in": "path", - "required": true - }, - { - "description": "create workflow template", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateWorkflowTemplateReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflow_templates": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow template list", - "tags": [ - "workflow" - ], - "summary": "获取审批流程模板列表", - "operationId": "getWorkflowTemplateListV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "enum": [ - "workflow", - "data_export" - ], - "type": "string", - "description": "filter workflow type", - "name": "workflow_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowTemplateListResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create workflow template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "创建审批流程模板", - "operationId": "createWorkflowTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "create workflow template", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.CreateWorkflowTemplateReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowTemplateResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/workflow_templates/{workflow_template_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow template by id", - "tags": [ - "workflow" - ], - "summary": "根据ID获取审批流程模板详情", - "operationId": "getWorkflowTemplateByIdV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "workflow template id", - "name": "workflow_template_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowTemplateResV1" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete workflow template by id", - "tags": [ - "workflow" - ], - "summary": "删除审批流程模板", - "operationId": "deleteWorkflowTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "workflow template id", - "name": "workflow_template_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update workflow template by id", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "根据ID更新审批流程模板", - "operationId": "updateWorkflowTemplateByIdV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "workflow template id", - "name": "workflow_template_id", - "in": "path", - "required": true - }, - { - "description": "update workflow template", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateWorkflowTemplateByIdReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow list", - "tags": [ - "workflow" - ], - "summary": "获取工单列表", - "operationId": "getWorkflowsV1", - "parameters": [ - { - "type": "string", - "description": "filter subject", - "name": "filter_subject", - "in": "query" - }, - { - "type": "string", - "description": "filter by workflow_id", - "name": "filter_workflow_id", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search by workflow description", - "name": "fuzzy_search_workflow_desc", - "in": "query" - }, - { - "type": "string", - "description": "filter create time from", - "name": "filter_create_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter create time to", - "name": "filter_create_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter_task_execute_start_time_from", - "name": "filter_task_execute_start_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter_task_execute_start_time_to", - "name": "filter_task_execute_start_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter create user id", - "name": "filter_create_user_id", - "in": "query" - }, - { - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "executing", - "canceled", - "exec_failed", - "finished" - ], - "type": "string", - "description": "filter workflow status", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "filter current step assignee user id", - "name": "filter_current_step_assignee_user_id", - "in": "query" - }, - { - "type": "string", - "description": "filter instance id", - "name": "filter_task_instance_id", - "in": "query" - }, - { - "type": "string", - "description": "filter sql version id", - "name": "filter_sql_version_id", - "in": "query" - }, - { - "type": "integer", - "description": "filter workflow template id", - "name": "filter_workflow_template_id", - "in": "query" - }, - { - "type": "string", - "description": "filter by ops type dictionary item uid; empty means no filter", - "name": "filter_by_ops_type_uid", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy matching subject/workflow_id", - "name": "fuzzy_keyword", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowsResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create workflow", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "创建工单", - "operationId": "createWorkflowV1", - "deprecated": true, - "parameters": [ - { - "description": "create workflow request", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.CreateWorkflowReqV1" - } - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/auto_create_and_execute": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "auto create task group, audit SQL, create workflow, approve and execute workflow (sys user only)", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "自动创建工单、审核SQL、审批和上线工单(仅sys用户)", - "operationId": "autoCreateAndExecuteWorkflowV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instances JSON array", - "name": "instances", - "in": "formData", - "required": true - }, - { - "enum": [ - "sql_file", - "sqls" - ], - "type": "string", - "description": "exec mode", - "name": "exec_mode", - "in": "formData" - }, - { - "type": "string", - "description": "file order method", - "name": "file_order_method", - "in": "formData" - }, - { - "type": "string", - "description": "sqls for audit", - "name": "sql", - "in": "formData" - }, - { - "type": "string", - "description": "workflow subject", - "name": "workflow_subject", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "workflow description", - "name": "desc", - "in": "formData" - }, - { - "type": "file", - "description": "input SQL file", - "name": "input_sql_file", - "in": "formData" - }, - { - "type": "file", - "description": "input mybatis XML file", - "name": "input_mybatis_xml_file", - "in": "formData" - }, - { - "type": "file", - "description": "input ZIP file", - "name": "input_zip_file", - "in": "formData" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.AutoCreateAndExecuteWorkflowResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/cancel": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "batch cancel workflows", - "tags": [ - "workflow" - ], - "summary": "批量取消工单", - "operationId": "batchCancelWorkflowsV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "batch cancel workflows request", - "name": "BatchCancelWorkflowsReqV1", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.BatchCancelWorkflowsReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/complete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "this api will directly change the work order status to finished without real online operation", - "tags": [ - "workflow" - ], - "summary": "批量完成工单", - "operationId": "batchCompleteWorkflowsV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "batch complete workflows request", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.BatchCompleteWorkflowsReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/exports": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "export workflow as CSV or Excel", - "tags": [ - "workflow" - ], - "summary": "导出工单", - "operationId": "exportWorkflowV1", - "parameters": [ - { - "type": "string", - "description": "filter subject", - "name": "filter_subject", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search by workflow description", - "name": "fuzzy_search_workflow_desc", - "in": "query" - }, - { - "type": "string", - "description": "filter create time from", - "name": "filter_create_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter create time to", - "name": "filter_create_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter_task_execute_start_time_from", - "name": "filter_task_execute_start_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter_task_execute_start_time_to", - "name": "filter_task_execute_start_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter create user id", - "name": "filter_create_user_id", - "in": "query" - }, - { - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "executing", - "canceled", - "exec_failed", - "finished" - ], - "type": "string", - "description": "filter workflow status", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "filter current step assignee user id", - "name": "filter_current_step_assignee_user_id", - "in": "query" - }, - { - "type": "string", - "description": "filter instance id", - "name": "filter_task_instance_id", - "in": "query" - }, - { - "type": "string", - "description": "filter by ops type dictionary item uid; empty means no filter", - "name": "filter_by_ops_type_uid", - "in": "query" - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy matching subject/workflow_id/desc", - "name": "fuzzy_keyword", - "in": "query" - }, - { - "enum": [ - "csv", - "excel" - ], - "type": "string", - "description": "export format", - "name": "export_format", - "in": "query" - } - ], - "responses": { - "200": { - "description": "export workflow", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_id}/backup_sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get backup sql list", - "tags": [ - "workflow" - ], - "summary": "获取工单下所有回滚SQL的列表", - "operationId": "GetBackupSqlListV1", - "parameters": [ - { - "enum": [ - "initialized", - "doing", - "succeeded", - "failed", - "manually_executed", - "terminating", - "terminate_succeeded", - "terminate_failed", - "execute_rollback" - ], - "type": "string", - "description": "filter: exec status of task sql", - "name": "filter_exec_status", - "in": "query" - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "filter: instance id in workflow", - "name": "filter_instance_id", - "in": "query" - }, - { - "type": "string", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "page size", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.BackupSqlListRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_id}/create_rollback_workflow": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create rollback workflow", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "创建回滚工单", - "operationId": "CreateRollbackWorkflow", - "parameters": [ - { - "description": "create rollback workflow request", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.CreateRollbackWorkflowReq" - } - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "origin workflow id to rollback", - "name": "workflow_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.CreateRollbackWorkflowRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/terminate": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "terminate multiple task by project and workflow", - "tags": [ - "workflow" - ], - "summary": "终止工单下多个上线任务", - "operationId": "terminateMultipleTaskByWorkflowV1", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/attachment": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow attachment", - "tags": [ - "workflow" - ], - "summary": "获取工单的task附件", - "operationId": "getWorkflowAttachment", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "get workflow attachment", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/backup_files/download": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "download SQL back up file for the audit task", - "tags": [ - "task" - ], - "summary": "下载工单中的SQL备份", - "operationId": "downloadBackupFileV1", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "sql file", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/order_file": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update sql file order", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "task" - ], - "summary": "修改文件上线顺序", - "operationId": "updateSqlFileOrderV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "description": "instance body v1.UpdateSqlFileOrderV1Req true", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateSqlFileOrderV1Req" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSqlFileOrderMethodResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/re_execute": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "re-execute task on workflow", - "tags": [ - "workflow" - ], - "summary": "单数据源SQL重新上线", - "operationId": "reExecuteTaskOnWorkflowV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "description": "re-execute task on workflow request", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.ReExecuteTaskOnWorkflowReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/terminate": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "execute one task on workflow", - "tags": [ - "workflow" - ], - "summary": "终止单个上线任务", - "operationId": "terminateSingleTaskByWorkflowV1", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_name}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow detail", - "tags": [ - "workflow" - ], - "summary": "获取工单详情", - "operationId": "getWorkflowV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update workflow when it is rejected to creator.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "更新工单(驳回后才可更新)", - "operationId": "updateWorkflowV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "update workflow request", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateWorkflowReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_name}/cancel": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "cancel workflow", - "tags": [ - "workflow" - ], - "summary": "审批关闭(中止)", - "operationId": "cancelWorkflowV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_name}/steps/{workflow_step_id}/approve": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "approve workflow", - "tags": [ - "workflow" - ], - "summary": "审批通过", - "operationId": "approveWorkflowV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow step id", - "name": "workflow_step_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_name}/steps/{workflow_step_id}/reject": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "reject workflow", - "tags": [ - "workflow" - ], - "summary": "审批驳回", - "operationId": "rejectWorkflowV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow step id", - "name": "workflow_step_id", - "in": "path", - "required": true - }, - { - "description": "workflow approve request", - "name": "workflow_approve", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.RejectWorkflowReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_name}/tasks": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get summary of workflow instance tasks", - "tags": [ - "workflow" - ], - "summary": "获取工单数据源任务概览", - "operationId": "getSummaryOfInstanceTasksV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowTasksResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_name}/tasks/execute": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "execute tasks on workflow", - "tags": [ - "workflow" - ], - "summary": "多数据源批量上线", - "operationId": "executeTasksOnWorkflowV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_name}/tasks/{task_id}/execute": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "execute one task on workflow", - "tags": [ - "workflow" - ], - "summary": "工单提交单个数据源上线", - "operationId": "executeOneTaskOnWorkflowV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_name}/tasks/{task_id}/schedule": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update workflow schedule.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "设置工单数据源定时上线时间(设置为空则代表取消定时时间,需要SQL审核流程都通过后才可以设置)", - "operationId": "updateWorkflowScheduleV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "update workflow schedule request", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateWorkflowScheduleReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/rule_knowledge/db_types/{db_type}/custom_rules/{rule_name}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get custom rule knowledge", - "tags": [ - "rule_template" - ], - "summary": "查看自定义规则知识库", - "operationId": "getCustomRuleKnowledgeV1", - "parameters": [ - { - "type": "string", - "description": "rule name", - "name": "rule_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "db type of rule", - "name": "db_type", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetRuleKnowledgeResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update custom rule knowledge", - "tags": [ - "rule_template" - ], - "summary": "更新自定义规则知识库", - "operationId": "updateCustomRuleKnowledge", - "parameters": [ - { - "type": "string", - "description": "rule name", - "name": "rule_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "db type of rule", - "name": "db_type", - "in": "path", - "required": true - }, - { - "description": "update rule knowledge", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateRuleKnowledgeReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/rule_knowledge/db_types/{db_type}/rules/{rule_name}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get rule knowledge", - "tags": [ - "rule_template" - ], - "summary": "查看规则知识库", - "operationId": "getRuleKnowledgeV1", - "parameters": [ - { - "type": "string", - "description": "rule name", - "name": "rule_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "db type of rule", - "name": "db_type", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetRuleKnowledgeResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update rule knowledge", - "tags": [ - "rule_template" - ], - "summary": "更新规则知识库", - "operationId": "updateRuleKnowledge", - "parameters": [ - { - "type": "string", - "description": "rule name", - "name": "rule_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "db type of rule", - "name": "db_type", - "in": "path", - "required": true - }, - { - "description": "update rule knowledge", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateRuleKnowledgeReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/rule_template_tips": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global rule template tips", - "tags": [ - "rule_template" - ], - "summary": "获取全局规则模板提示", - "operationId": "getRuleTemplateTipsV1", - "parameters": [ - { - "type": "string", - "description": "filter db type", - "name": "filter_db_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetRuleTemplateTipsResV1" - } - } - } - } - }, - "/v1/rule_templates": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get all global rule template", - "tags": [ - "rule_template" - ], - "summary": "全局规则模板列表", - "operationId": "getRuleTemplateListV1", - "parameters": [ - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetRuleTemplatesResV1" - } - } - } + "swagger": "2.0", + "info": { + "description": "This is a sample server for dev.", + "title": "Sqle API Docs", + "contact": {}, + "license": {}, + "version": "1.0" + }, + "basePath": "/sqle", + "paths": { + "/v1/ai_hub/banner": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "返回按模块分组的Banner卡片列表(模块类型、Banner卡片列表)", + "produces": [ + "application/json" + ], + "tags": [ + "ai_hub" + ], + "summary": "获取AI智能中心Banner", + "operationId": "GetAIHubBanner", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAIHubBannerResp" + } + } + } + } + }, + "/v1/ai_hub/execution_data": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "返回最新10条执行数据记录(来源项目、SQL片段、功能模块、价值维度、处理状态、预估提升、时间)", + "produces": [ + "application/json" + ], + "tags": [ + "ai_hub" + ], + "summary": "获取AI智能中心执行数据", + "operationId": "GetAIHubExecutionData", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAIHubExecutionDataResp" + } + } + } + } + }, + "/v1/ai_hub/management_view": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "返回按模块分组的分析数据(模块类型、项目组投入产出分析、Top问题分布)", + "produces": [ + "application/json" + ], + "tags": [ + "ai_hub" + ], + "summary": "获取AI智能中心管理视图", + "operationId": "GetAIHubManagementView", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAIHubManagementViewResp" + } + } + } + } + }, + "/v1/ai_hub/strategic_value": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "返回AI战略洞察(标题、描述)和效能卡片列表(效能指标、效能评价、具体指标、价值描述)", + "produces": [ + "application/json" + ], + "tags": [ + "ai_hub" + ], + "summary": "获取AI智能中心战略价值", + "operationId": "GetAIHubStrategicValue", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAIHubStrategicValueResp" + } + } + } + } + }, + "/v1/audit_files": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Direct audit sql from SQL files and MyBatis files", + "tags": [ + "sql_audit" + ], + "summary": "直接从文件内容提取SQL并审核,SQL文件暂时只支持一次解析一个文件", + "operationId": "directAuditFilesV1", + "parameters": [ + { + "description": "files that should be audited", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DirectAuditFileReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DirectAuditResV1" + } + } + } + } + }, + "/v1/audit_plan_metas": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan metas", + "tags": [ + "audit_plan" + ], + "summary": "获取扫描任务元信息", + "operationId": "getAuditPlanMetasV1", + "parameters": [ + { + "type": "string", + "description": "filter instance type", + "name": "filter_instance_type", + "in": "query" + }, + { + "type": "string", + "description": "filter instance id", + "name": "filter_instance_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditPlanMetasResV1" + } + } + } + } + }, + "/v1/audit_plan_types": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan types", + "tags": [ + "audit_plan" + ], + "summary": "获取扫描任务类型", + "operationId": "getAuditPlanTypesV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditPlanTypesResV1" + } + } + } + } + }, + "/v1/company_notice": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get company notice info", + "tags": [ + "companyNotice" + ], + "summary": "获取企业公告", + "operationId": "getCompanyNotice", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetCompanyNoticeResp" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update company notice info", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "companyNotice" + ], + "summary": "更新企业公告", + "operationId": "updateCompanyNotice", + "parameters": [ + { + "description": "company notice", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateCompanyNoticeReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/configurations/coding": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get coding configuration", + "tags": [ + "configuration" + ], + "summary": "获取Coding审核配置", + "operationId": "getCodingConfigurationV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetCodingConfigurationResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update coding configuration", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "添加或更新Coding配置", + "operationId": "UpdateCodingConfigurationV1", + "parameters": [ + { + "description": "update coding configuration req", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateCodingConfigurationReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/configurations/coding/test": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "test coding configuration", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "测试Coding配置", + "operationId": "testCodingConfigV1", + "parameters": [ + { + "description": "test coding configuration req", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TestCodingConfigurationReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/TestCodingConfigResV1" + } + } + } + } + }, + "/v1/configurations/ding_talk": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get dingTalk configuration", + "tags": [ + "configuration" + ], + "summary": "获取 dingTalk 配置", + "operationId": "getDingTalkConfigurationV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetDingTalkConfigurationResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update DingTalk configuration", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "添加或更新 DingTalk 配置", + "operationId": "updateDingTalkConfigurationV1", + "parameters": [ + { + "description": "update DingTalk configuration req", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateDingTalkConfigurationReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/configurations/ding_talk/test": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "test DingTalk configuration", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "测试 DingTalk 配置", + "operationId": "testDingTalkConfigV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/TestDingTalkConfigResV1" + } + } + } + } + }, + "/v1/configurations/drivers": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get drivers", + "tags": [ + "configuration" + ], + "summary": "获取当前 server 支持的审核类型", + "operationId": "getDriversV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetDriversResV1" + } + } + } + } + }, + "/v1/configurations/feishu_audit": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get feishu audit configuration", + "tags": [ + "configuration" + ], + "summary": "获取飞书审核配置", + "operationId": "getFeishuAuditConfigurationV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetFeishuAuditConfigurationResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update feishu audit configuration", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "添加或更新飞书配置", + "operationId": "updateFeishuAuditConfigurationV1", + "parameters": [ + { + "description": "update feishu audit configuration req", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateFeishuConfigurationReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/configurations/feishu_audit/test": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "test feishu audit configuration", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "测试飞书审批配置", + "operationId": "testFeishuAuditConfigV1", + "parameters": [ + { + "description": "test feishu configuration req", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TestFeishuConfigurationReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/TestFeishuConfigResV1" + } + } + } + } + }, + "/v1/configurations/git/test": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "test git connection", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "测试Git联通性", + "operationId": "TestGitConnectionV1", + "parameters": [ + { + "description": "test git configuration req", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TestGitConnectionReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/TestGitConnectionResV1" + } + } + } + } + }, + "/v1/configurations/license": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sqle license", + "tags": [ + "configuration" + ], + "summary": "获取 sqle license", + "operationId": "getSQLELicenseV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetLicenseResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "set sqle license", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "configuration" + ], + "summary": "导入 sqle license", + "operationId": "setSQLELicenseV1", + "parameters": [ + { + "type": "file", + "description": "SQLE license file", + "name": "license_file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/configurations/license/check": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "parse and check sqle license", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "configuration" + ], + "summary": "解析和校验 sqle license", + "operationId": "checkSQLELicenseV1", + "parameters": [ + { + "type": "file", + "description": "SQLE license file", + "name": "license_file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/CheckLicenseResV1" + } + } + } + } + }, + "/v1/configurations/license/info": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get the information needed to generate the sqle license", + "tags": [ + "configuration" + ], + "summary": "获取生成 sqle license需要的的信息", + "operationId": "GetSQLELicenseInfoV1", + "responses": { + "200": { + "description": "server info", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/configurations/ssh_key": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get ssh public key", + "tags": [ + "configuration" + ], + "summary": "获取SSH公钥", + "operationId": "getSSHPublicKey", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SSHPublicKeyInfoV1Rsp" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "gen ssh key", + "tags": [ + "configuration" + ], + "summary": "生成SSH密钥对", + "operationId": "genSSHPublicKey", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/configurations/wechat_audit": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get wechat audit configuration", + "tags": [ + "configuration" + ], + "summary": "获取微信审核配置", + "operationId": "getWechatAuditConfigurationV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWechatAuditConfigurationResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update wechat audit configuration", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "添加或更新微信配置", + "operationId": "updateWechatAuditConfigurationV1", + "parameters": [ + { + "description": "update wechat audit configuration req", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateWechatConfigurationReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/configurations/wechat_audit/test": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "test wechat audit configuration", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "测试微信审批配置", + "operationId": "testWechatAuditConfigV1", + "parameters": [ + { + "description": "test wechat configuration req", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TestWechatConfigurationReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/TestWechatConfigResV1" + } + } + } + } + }, + "/v1/configurations/workflows/schedule/default_option": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get scheduled task default option", + "tags": [ + "workflow" + ], + "summary": "获取工单定时上线二次确认默认选项", + "operationId": "getScheduledTaskDefaultOptionV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ScheduledTaskDefaultOptionV1Rsp" + } + } + } + } + }, + "/v1/custom_rules": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get all custom rule template", + "tags": [ + "rule_template" + ], + "summary": "自定义规则列表", + "operationId": "getCustomRulesV1", + "parameters": [ + { + "type": "string", + "description": "filter db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "filter desc", + "name": "filter_desc", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetCustomRulesResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create custom rule", + "tags": [ + "rule_template" + ], + "summary": "添加自定义规则", + "operationId": "createCustomRuleV1", + "parameters": [ + { + "description": "add custom rule", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateCustomRuleReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/custom_rules/{db_type}/rule_types": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get rule type by db type", + "tags": [ + "rule_template" + ], + "summary": "获取规则分类", + "operationId": "getRuleTypeByDBTypeV1", + "parameters": [ + { + "type": "string", + "description": "db type", + "name": "db_type", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetRuleTypeByDBTypeResV1" + } + } + } + } + }, + "/v1/custom_rules/{rule_id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get custom rule by rule_id", + "tags": [ + "rule_template" + ], + "summary": "获取自定义规则", + "operationId": "getCustomRuleV1", + "parameters": [ + { + "type": "string", + "description": "rule id", + "name": "rule_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetCustomRuleResV1" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete custom rule", + "tags": [ + "rule_template" + ], + "summary": "删除自定义规则", + "operationId": "deleteCustomRuleV1", + "parameters": [ + { + "type": "string", + "description": "rule id", + "name": "rule_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update custom rule", + "tags": [ + "rule_template" + ], + "summary": "更新自定义规则", + "operationId": "updateCustomRuleV1", + "parameters": [ + { + "type": "string", + "description": "rule id", + "name": "rule_id", + "in": "path", + "required": true + }, + { + "description": "update custom rule", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateCustomRuleReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/dashboard": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get dashboard info", + "produces": [ + "application/json" + ], + "tags": [ + "dashboard" + ], + "summary": "获取 dashboard 信息", + "operationId": "getDashboardV1", + "parameters": [ + { + "type": "string", + "description": "filter project name", + "name": "filter_project_name", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetDashboardResV1" + } + } + } + } + }, + "/v1/dashboard/data_export_workflows": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global data export workflows list", + "tags": [ + "workflow" + ], + "summary": "获取全局导出工单列表", + "operationId": "getGlobalDataExportWorkflowsV1", + "parameters": [ + { + "type": "string", + "description": "filter create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "enum": [ + "wait_for_approve", + "wait_for_export", + "exporting", + "failed", + "rejected", + "cancel", + "finish" + ], + "type": "array", + "items": { + "type": "string" }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create a global rule template", - "consumes": [ - "application/json" - ], - "tags": [ - "rule_template" - ], - "summary": "添加全局规则模板", - "operationId": "createRuleTemplateV1", - "parameters": [ - { - "description": "add rule template request", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.CreateRuleTemplateReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/rule_templates/parse": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "parse rule template", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "rule_template" - ], - "summary": "解析规则模板文件", - "operationId": "importProjectRuleTemplateV1", - "parameters": [ - { - "enum": [ - "csv", - "json" - ], - "type": "string", - "description": "file type", - "name": "file_type", - "in": "formData", - "required": true - }, - { - "type": "file", - "description": "SQLE rule template file", - "name": "rule_template_file", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.ParseProjectRuleTemplateFileResV1" - } - }, - "400": { - "description": "return error file", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/rule_templates/{rule_template_name}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global rule template", - "tags": [ - "rule_template" - ], - "summary": "获取全局规则模板信息", - "operationId": "getRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy rule,keyword for desc and annotation", - "name": "fuzzy_keyword_rule", - "in": "query" - }, - { - "type": "string", - "description": "tags for rule", - "name": "tags", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetRuleTemplateResV1" - } - } - } + "description": "filter by workflow status,support using many status", + "name": "filter_status_list", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id in project", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "high", + "medium", + "low" + ], + "type": "string", + "description": "filter by project priority", + "name": "filter_project_priority", + "in": "query" + }, + { + "type": "string", + "description": "filter current step assignee user id", + "name": "filter_current_step_assignee_user_id", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowsResV1" + } + } + } + } + }, + "/v1/dashboard/data_export_workflows/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global data export workflows statistics", + "tags": [ + "workflow" + ], + "summary": "获取全局导出工单统计数据", + "operationId": "getGlobalDataExportWorkflowStatisticsV1", + "parameters": [ + { + "type": "string", + "description": "filter create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "enum": [ + "wait_for_approve", + "wait_for_export", + "exporting", + "failed", + "rejected", + "cancel", + "finish" + ], + "type": "array", + "items": { + "type": "string" }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete global rule template", - "tags": [ - "rule_template" - ], - "summary": "删除全局规则模板", - "operationId": "deleteRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } + "description": "filter by workflow status,support using many status", + "name": "filter_status_list", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id in project", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "high", + "medium", + "low" + ], + "type": "string", + "description": "filter by project priority", + "name": "filter_project_priority", + "in": "query" + }, + { + "type": "string", + "description": "filter current step assignee user id", + "name": "filter_current_step_assignee_user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GlobalWorkflowStatisticsResV1" + } + } + } + } + }, + "/v1/dashboard/sql_manages": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global sql manage list", + "tags": [ + "SqlManage" + ], + "summary": "获取全局管控sql列表", + "operationId": "GetGlobalSqlManageList", + "parameters": [ + { + "type": "string", + "description": "project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "high", + "medium", + "low" + ], + "type": "string", + "description": "project priority", + "name": "filter_project_priority", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetGlobalSqlManageListResp" + } + } + } + } + }, + "/v1/dashboard/sql_manages/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global sql manage statistics", + "tags": [ + "SqlManage" + ], + "summary": "获取全局管控sql统计信息", + "operationId": "GetGlobalSqlManageStatistics", + "parameters": [ + { + "type": "string", + "description": "project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "high", + "medium", + "low" + ], + "type": "string", + "description": "project priority", + "name": "filter_project_priority", + "in": "query" + }, + { + "type": "string", + "description": "filter current step assignee user id", + "name": "filter_current_step_assignee_user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetGlobalSqlManageStatisticsResp" + } + } + } + } + }, + "/v1/dashboard/workflows": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global workflow list", + "tags": [ + "workflow" + ], + "summary": "获取全局工单列表", + "operationId": "getGlobalWorkflowsV1", + "parameters": [ + { + "type": "string", + "description": "filter create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "executing", + "canceled", + "exec_failed", + "finished" + ], + "type": "array", + "items": { + "type": "string" }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update global rule template", - "tags": [ - "rule_template" - ], - "summary": "更新全局规则模板", - "operationId": "updateRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - }, - { - "description": "update rule template request", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateRuleTemplateReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/rule_templates/{rule_template_name}/clone": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "clone a rule template", - "consumes": [ - "application/json" - ], - "tags": [ - "rule_template" - ], - "summary": "克隆全局规则模板", - "operationId": "CloneRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - }, - { - "description": "clone rule template request", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.CloneRuleTemplateReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/rule_templates/{rule_template_name}/export": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "export rule template", - "tags": [ - "rule_template" - ], - "summary": "导出全局规则模板", - "operationId": "exportRuleTemplateV1", - "parameters": [ - { - "enum": [ - "csv", - "json" - ], - "type": "string", - "description": "export type", - "name": "export_type", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "sqle rule template file", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/rules": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get all rule template", - "tags": [ - "rule_template" - ], - "summary": "规则列表", - "operationId": "getRuleListV1", - "parameters": [ - { - "type": "string", - "description": "filter db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy rule,keyword for desc and annotation", - "name": "fuzzy_keyword_rule", - "in": "query" - }, - { - "type": "string", - "description": "filter global rule template name", - "name": "filter_global_rule_template_name", - "in": "query" - }, - { - "type": "string", - "description": "filter rule name list", - "name": "filter_rule_names", - "in": "query" - }, - { - "type": "integer", - "description": "filter rule version", - "name": "filter_rule_version", - "in": "query" - }, - { - "type": "string", - "description": "filter tags", - "name": "tags", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetRulesResV1" - } - } - } - } - }, - "/v1/rules/categoryStatistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get all rule category statistics", - "tags": [ - "rule_template" - ], - "summary": "获取规则分类统计信息", - "operationId": "getCategoryStatistics", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetRuleCategoryStatisticResV1" - } - } - } - } - }, - "/v1/rules_version_tips": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get the rule versions contained in plugins", - "tags": [ - "rule_template" - ], - "summary": "获取插件包含的规则版本", - "operationId": "GetDriverRuleVersionTips", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetDriverRuleVersionTipsResV1" - } - } - } - } - }, - "/v1/sql_analysis": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Direct get sql analysis result", - "tags": [ - "sql_analysis" - ], - "summary": "直接获取SQL分析结果", - "operationId": "directGetSQLAnalysisV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "schema name", - "name": "schema_name", - "in": "query" - }, - { - "type": "string", - "description": "sql", - "name": "sql", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.DirectGetSQLAnalysisResV1" - } - } - } - } - }, - "/v1/sql_audit": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Direct audit sql", - "tags": [ - "sql_audit" - ], - "summary": "直接审核SQL", - "operationId": "directAuditV1", - "deprecated": true, - "parameters": [ - { - "description": "sqls that should be audited", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.DirectAuditReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.DirectAuditResV1" - } - } - } - } - }, - "/v1/sql_lineage_analysis": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Analyze SQL and return column-level lineage", - "tags": [ - "sql_analysis" - ], - "summary": "SQL列级血缘分析", - "operationId": "sqlLineageAnalyzeV1", - "parameters": [ - { - "description": "sql lineage analyze request", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.SQLLineageAnalyzeReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.SQLLineageAnalyzeResV1" - } - } - } - } - }, - "/v1/statistic/instances/resource_overview_statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance overview statistics including average score, high priority SQL count and pending workflow count", - "tags": [ - "statistic" - ], - "summary": "获取实例概览统计信息", - "operationId": "getInstanceOverviewStatisticsV1", - "parameters": [ - { - "type": "array", - "items": { - "type": "string" - }, - "description": "filter by db service ids", - "name": "filter_by_db_service_ids", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetInstanceOverviewStatisticsRes" - } - } - } - } - }, - "/v1/statistic/instances/sql_average_execution_time": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get average execution time of sql", - "tags": [ - "statistic" - ], - "summary": "获取sql上线平均耗时,按平均耗时降序排列", - "operationId": "getSqlAverageExecutionTimeV1", - "parameters": [ - { - "type": "integer", - "description": "the limit of result item number", - "name": "limit", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSqlAverageExecutionTimeResV1" - } - } - } - } - }, - "/v1/statistic/instances/sql_execution_fail_percent": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql execution fail percent", - "tags": [ - "statistic" - ], - "summary": "获取SQL上线失败率,按失败率降序排列", - "operationId": "getSqlExecutionFailPercentV1", - "parameters": [ - { - "type": "integer", - "description": "the limit of result item number", - "name": "limit", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSqlExecutionFailPercentResV1" - } - } - } - } - }, - "/v1/statistic/instances/type_percent": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get database instances' types percent", - "tags": [ - "statistic" - ], - "summary": "获取数据源类型百分比", - "operationId": "getInstancesTypePercentV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetInstancesTypePercentResV1" - } - } - } - } - }, - "/v1/statistic/license/usage": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get usage of license", - "tags": [ - "statistic" - ], - "summary": "获取License使用情况", - "operationId": "getLicenseUsageV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetLicenseUsageResV1" - } - } - } - } - }, - "/v1/statistic/workflows/audit_pass_percent": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow audit pass percent", - "tags": [ - "statistic" - ], - "summary": "获取工单审核通过率", - "operationId": "getWorkflowAuditPassPercentV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowAuditPassPercentResV1" - } - } - } - } - }, - "/v1/statistic/workflows/counts": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow counts", - "tags": [ - "statistic" - ], - "summary": "获取工单数量统计数据", - "operationId": "getWorkflowCountV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowCountsResV1" - } - } - } - } - }, - "/v1/statistic/workflows/duration_of_waiting_for_audit": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get duration from workflow being created to audited", - "tags": [ - "statistic" - ], - "summary": "获取工单从创建到审核结束的平均时长", - "operationId": "getWorkflowDurationOfWaitingForAuditV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowDurationOfWaitingForAuditResV1" - } - } - } - } - }, - "/v1/statistic/workflows/duration_of_waiting_for_execution": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get duration from workflow being created to executed", - "tags": [ - "statistic" - ], - "summary": "获取工单各从审核完毕到执行上线的平均时长", - "operationId": "getWorkflowDurationOfWaitingForExecutionV1", - "deprecated": true, - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowDurationOfWaitingForExecutionResV1" - } - } - } - } - }, - "/v1/statistic/workflows/each_day_counts": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get counts of created workflow each day", - "tags": [ - "statistic" - ], - "summary": "获取每天工单创建数量", - "operationId": "getWorkflowCreatedCountEachDayV1", - "parameters": [ - { - "type": "string", - "description": "filter date from.(format:yyyy-mm-dd)", - "name": "filter_date_from", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "filter date to.(format:yyyy-mm-dd)", - "name": "filter_date_to", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowCreatedCountsEachDayResV1" - } - } - } - } - }, - "/v1/statistic/workflows/instance_type_percent": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflows percent counted by instance type", - "tags": [ - "statistic" - ], - "summary": "获取按数据源类型统计的工单百分比", - "operationId": "getWorkflowPercentCountedByInstanceTypeV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowPercentCountedByInstanceTypeResV1" - } - } - } - } - }, - "/v1/statistic/workflows/pass_percent": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow pass percent", - "tags": [ - "statistic" - ], - "summary": "获取工单通过率", - "operationId": "getWorkflowPassPercentV1", - "deprecated": true, - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowPassPercentResV1" - } - } - } - } - }, - "/v1/statistic/workflows/rejected_percent_group_by_creator": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflows rejected percent group by creator. The result will be sorted by rejected percent in descending order", - "tags": [ - "statistic" - ], - "summary": "获取各个用户提交的工单驳回率,按驳回率降序排列", - "operationId": "getWorkflowRejectedPercentGroupByCreatorV1", - "parameters": [ - { - "type": "integer", - "description": "the limit of result item number", - "name": "limit", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowRejectedPercentGroupByCreatorResV1" - } - } - } - } - }, - "/v1/statistic/workflows/rejected_percent_group_by_instance": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow rejected percent group by instance. The result will be sorted by rejected percent in descending order", - "tags": [ - "statistic" - ], - "summary": "获取各个数据源相关的工单驳回率,按驳回率降序排列", - "operationId": "getWorkflowRejectedPercentGroupByInstanceV1", - "deprecated": true, - "parameters": [ - { - "type": "integer", - "description": "the limit of result item number", - "name": "limit", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowRejectedPercentGroupByInstanceResV1" - } - } - } - } - }, - "/v1/statistic/workflows/status_count": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get count of workflow status", - "tags": [ - "statistic" - ], - "summary": "获取各种状态工单的数量", - "operationId": "getWorkflowStatusCountV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowStatusCountResV1" - } - } - } - } - }, - "/v1/system/module_red_dots": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get the red dot prompt information in the system", - "tags": [ - "system" - ], - "summary": "查询系统各模块的红点提示信息", - "operationId": "GetSystemModuleRedDots", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSystemModuleRedDotsRes" - } - } - } - } - }, - "/v1/system/module_status": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get module status for module in the system", - "tags": [ - "system" - ], - "summary": "查询系统功能支持情况信息", - "operationId": "getSystemModuleStatus", - "parameters": [ - { - "enum": [ - "MySQL", - "Oracle", - "TiDB", - "OceanBase For MySQL", - "PostgreSQL", - "DB2", - "SQL Server" - ], - "type": "string", - "description": "db type", - "name": "db_type", - "in": "query" - }, - { - "enum": [ - "execute_sql_file_mode", - "sql_optimization", - "backup", - "knowledge_base" - ], - "type": "string", - "description": "module name", - "name": "module_name", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetModuleStatusResV1" - } - } - } - } - }, - "/v1/task_groups/audit": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "audit task group.\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.\n4. file[input_zip_file]: it is zip file, sql will be parsed from it.", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "task" - ], - "summary": "审核任务组", - "operationId": "auditTaskGroupIdV1", - "parameters": [ - { - "type": "integer", - "description": "group id of tasks", - "name": "task_group_id", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "sqls for audit", - "name": "sql", - "in": "formData" - }, - { - "type": "boolean", - "description": "enable backup", - "name": "enable_backup", - "in": "formData" - }, - { - "type": "integer", - "description": "backup max rows", - "name": "backup_max_rows", - "in": "formData" - }, - { - "type": "string", - "description": "file order method", - "name": "file_order_method", - "in": "formData" - }, - { - "type": "file", - "description": "input SQL file", - "name": "input_sql_file", - "in": "formData" - }, - { - "type": "file", - "description": "input mybatis XML file", - "name": "input_mybatis_xml_file", - "in": "formData" - }, - { - "type": "file", - "description": "input ZIP file", - "name": "input_zip_file", - "in": "formData" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.AuditTaskGroupResV1" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get task", - "tags": [ - "task" - ], - "summary": "获取Sql扫描任务信息", - "operationId": "getAuditTaskV1", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditTaskResV1" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/backup_strategy": { - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update back up strategy for all sqls in task", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "更新工单中数据源对应所有SQL的备份策略", - "operationId": "UpdateTaskBackupStrategyV1", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "description": "update back up strategy for sqls in workflow", - "name": "strategy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateTaskBackupStrategyReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/origin_file": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get SQL origin file of the audit task", - "tags": [ - "task" - ], - "summary": "获取指定审核任务的原始文件", - "operationId": "DownloadAuditFile", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sql_content": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get SQL content for the audit task", - "tags": [ - "task" - ], - "summary": "获取指定扫描任务的SQL内容", - "operationId": "getAuditTaskSQLContentV1", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditTaskSQLContentResV1" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sql_file": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "download SQL file for the audit task", - "tags": [ - "task" - ], - "summary": "下载指定扫描任务的SQL文件", - "operationId": "downloadAuditTaskSQLFileV1", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "sql file", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sql_report": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "download report file of all SQLs information belong to the specified audit task", - "tags": [ - "task" - ], - "summary": "下载指定扫描任务的SQLs信息报告", - "operationId": "downloadAuditTaskSQLReportV1", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "select unique (fingerprint and audit result) for task sql", - "name": "no_duplicate", - "in": "query" - } - ], - "responses": { - "200": { - "description": "sql report csv file", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get information of all SQLs belong to the specified audit task", - "tags": [ - "task" - ], - "summary": "获取指定扫描任务的SQLs信息", - "operationId": "getAuditTaskSQLsV1", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "enum": [ - "initialized", - "doing", - "succeeded", - "failed", - "manually_executed", - "execute_rollback" - ], - "type": "string", - "description": "filter: exec status of task sql", - "name": "filter_exec_status", - "in": "query" - }, - { - "enum": [ - "initialized", - "doing", - "finished" - ], - "type": "string", - "description": "filter: audit status of task sql", - "name": "filter_audit_status", - "in": "query" - }, - { - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "type": "string", - "description": "filter: audit level of task sql", - "name": "filter_audit_level", - "in": "query" - }, - { - "type": "boolean", - "description": "select unique (fingerprint and audit result) for task sql", - "name": "no_duplicate", - "in": "query" - }, - { - "type": "string", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "page size", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetAuditTaskSQLsResV1" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sqls/{number}": { - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "modify the relevant information of a certain SQL in the audit task", - "consumes": [ - "application/json" - ], - "tags": [ - "task" - ], - "summary": "修改扫描任务中某条SQL的相关信息", - "operationId": "updateAuditTaskSQLsV1", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql number", - "name": "number", - "in": "path", - "required": true - }, - { - "description": "modify the relevant information of a certain SQL in the audit task", - "name": "audit_plan", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateAuditTaskSQLsReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sqls/{number}/analysis": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get SQL explain and related table metadata for analysis", - "tags": [ - "task" - ], - "summary": "获取task相关的SQL执行计划和表元数据", - "operationId": "getTaskAnalysisData", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "sql number", - "name": "number", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetTaskAnalysisDataResV1" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sqls/{number}/rewrite": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "启动特定任务中某条SQL语句的异步重写任务,返回任务状态", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "task" - ], - "summary": "启动异步SQL重写任务", - "operationId": "RewriteSQL", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "sql number", - "name": "number", - "in": "path", - "required": true - }, - { - "description": "request body", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.RewriteSQLReq" - } - } - ], - "responses": { - "200": { - "description": "成功启动异步重写任务", - "schema": { - "$ref": "#/definitions/v1.AsyncRewriteTaskStatusRes" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sqls/{number}/rewrite/status": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取特定任务中某条SQL语句的异步重写任务状态", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "task" - ], - "summary": "获取异步重写任务状态", - "operationId": "GetAsyncRewriteTaskStatus", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "sql number", - "name": "number", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "成功返回任务状态", - "schema": { - "$ref": "#/definitions/v1.AsyncRewriteTaskStatusRes" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sqls/{sql_id}/backup_strategy": { - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update back up strategy for one sql in workflow", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "更新单条SQL的备份策略", - "operationId": "UpdateSqlBackupStrategyV1", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql id", - "name": "sql_id", - "in": "path", - "required": true - }, - { - "description": "update back up strategy for one sql in workflow", - "name": "strategy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1.UpdateSqlBackupStrategyReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v1/tasks/file_order_methods": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get file order method", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "task" - ], - "summary": "获取文件上线排序方式", - "operationId": "getSqlFileOrderMethodV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetSqlFileOrderMethodResV1" - } - } - } - } - }, - "/v1/user_tips": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get user tip list", - "tags": [ - "user" - ], - "summary": "获取用户提示列表", - "operationId": "getUserTipListV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "filter_project", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetUserTipsResV1" - } - } - } - } - }, - "/v1/workflows/statistic_of_instances": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Get Workflows Statistic Of Instances", - "tags": [ - "workflow" - ], - "summary": "获取实例上工单的统计信息", - "operationId": "GetWorkflowStatisticOfInstances", - "parameters": [ - { - "type": "string", - "description": "instance id", - "name": "instance_id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1.GetWorkflowStatisticOfInstancesResV1" - } - } - } - } - }, - "/v2/audit_files": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Direct audit sql from SQL files and MyBatis files", - "tags": [ - "sql_audit" - ], - "summary": "直接从文件内容提取SQL并审核,SQL文件暂时只支持一次解析一个文件", - "operationId": "directAuditFilesV2", - "parameters": [ - { - "description": "files that should be audited", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v2.DirectAuditFileReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.DirectAuditResV2" - } - } - } - } - }, - "/v2/configurations/drivers": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get drivers", - "tags": [ - "configuration" - ], - "summary": "获取当前 server 支持的审核类型", - "operationId": "getDriversV2", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetDriversRes" - } - } - } - } - }, - "/v2/dashboard/accounts": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global account list with filtering and pagination.\nPagination: page_index is 1-based; offset is (page_index-1)*page_size. Values of page_index less than 1 are normalized to 1; page_size less than 1 may fall back to a default on the server.", - "tags": [ - "GlobalDashboard" - ], - "summary": "获取全局账号管理列表", - "operationId": "GetGlobalAccountListV2", - "parameters": [ - { - "type": "integer", - "description": "1-based page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "Number of items per page", - "name": "page_size", - "in": "query", - "required": true - }, - { - "enum": [ - "expiring_soon", - "active" - ], - "type": "string", - "description": "filter by card; expiring_soon 即将过期, active 我的可用账号", - "name": "filter_card", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search keyword", - "name": "keyword", - "in": "query" - }, - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_instance_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dashboard.GlobalAccountListResV2" - } - } - } - } - }, - "/v2/dashboard/accounts/statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global account statistics;", - "tags": [ - "GlobalDashboard" - ], - "summary": "获取全局账号管理统计数据", - "operationId": "GetGlobalAccountStatisticsV2", - "parameters": [ - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_instance_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dashboard.GlobalAccountStatisticsResV2" - } - } - } - } - }, - "/v2/dashboard/sql_manage/statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global sql manage statistics;", - "tags": [ - "GlobalDashboard" - ], - "summary": "获取全局 SQL 治理统计看板", - "operationId": "GetGlobalSqlManageStatisticsV2", - "parameters": [ - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_instance_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dashboard.GlobalSqlManageStatisticsResV2" - } - } - } - } - }, - "/v2/dashboard/sql_manage/tasks": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global sql manage task list with filtering and pagination.\nPagination: 1-based page_index with offset (page_index-1)*page_size; page_index and page_size are required query parameters (non-zero).", - "tags": [ - "GlobalDashboard" - ], - "summary": "获取全局 SQL 治理任务列表", - "operationId": "GetGlobalSqlManageTaskListV2", - "parameters": [ - { - "type": "integer", - "description": "1-based page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "Number of items per page", - "name": "page_size", - "in": "query", - "required": true - }, - { - "enum": [ - "pending", - "optimized" - ], - "type": "string", - "description": "filter by card; pending 待我优化, optimized 优化完成", - "name": "filter_card", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search keyword", - "name": "keyword", - "in": "query" - }, - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_instance_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dashboard.GlobalSqlManageTaskListResV2" - } - } - } - } - }, - "/v2/dashboard/workflows": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global workflow list with filtering and pagination.\nPagination uses two mutually exclusive modes. Aggregate mode (omit workflow_type): merge sql_release and data_export ordered by time; use cursor (empty on first request, then data.next_cursor from the previous response) and page_size; page_index is not used for paging. Single-type mode (workflow_type set): list only that type with standard page_index (1-based) and page_size; cursor is ignored. Do not rely on mixing cursor tokens with workflow_type in one flow.", - "tags": [ - "GlobalDashboard" - ], - "summary": "获取全局工单管理列表", - "operationId": "GetGlobalWorkflowListV2", - "parameters": [ - { - "type": "string", - "description": "Aggregate mode only (omit workflow_type): opaque cursor string; leave empty on the first request, then pass the previous response's data.next_cursor. Ignored when workflow_type is set.", - "name": "cursor", - "in": "query" - }, - { - "type": "integer", - "description": "Page size; required in both aggregate and single-type modes.", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "Single-type mode only (workflow_type set): 1-based page index. When workflow_type is omitted, this value is ignored for pagination (use cursor instead).", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "fuzzy search keyword", - "name": "keyword", - "in": "query" - }, - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "archived", - "pending_for_me", - "initiated_by_me", - "view_all" - ], - "type": "string", - "description": "filter by card type; archived 已完成工单, pending_for_me 待我处理, initiated_by_me 我发起, view_all 查看全部", - "name": "filter_card", - "in": "query" - }, - { - "enum": [ - "sql_release", - "data_export" - ], - "type": "string", - "description": "filter by workflow type; sql_release SQL上线工单, data_export 数据导出工单", - "name": "workflow_type", - "in": "query" - }, - { - "enum": [ - "pending_approval", - "pending_action", - "in_progress", - "exporting", - "rejected", - "cancelled", - "failed", - "completed", - "unknown" - ], - "type": "string", - "description": "filter by unified workflow status; intersects with the card status set, applied to both sql_release and data_export workflows", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "filter by update time from", - "name": "filter_update_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter by update time to", - "name": "filter_update_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter by create user id", - "name": "filter_create_user_id", - "in": "query" - }, - { - "type": "string", - "description": "filter create time from", - "name": "filter_create_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter create time to", - "name": "filter_create_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter by ops type dictionary item uid; empty means no filter; applies to sql_release and data_export", - "name": "filter_by_ops_type_uid", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dashboard.GlobalWorkflowListResV2" - } - } - } - } - }, - "/v2/dashboard/workflows/exports": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "export global dashboard workflows as CSV or Excel; filter/permission semantics match GET /v2/dashboard/workflows (no pagination). workflow_type=sql_release|data_export|omit(common columns with workflow type). First column includes project name for global layouts. Max 10000 workflows (sum of both types when workflow_type omitted).", - "tags": [ - "GlobalDashboard" - ], - "summary": "导出全局工单管理列表", - "operationId": "ExportGlobalWorkflowsV2", - "parameters": [ - { - "type": "string", - "description": "fuzzy search keyword", - "name": "keyword", - "in": "query" - }, - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "archived", - "pending_for_me", - "initiated_by_me", - "view_all" - ], - "type": "string", - "description": "filter by card type; archived 已完成工单, pending_for_me 待我处理, initiated_by_me 我发起, view_all 查看全部", - "name": "filter_card", - "in": "query" - }, - { - "enum": [ - "sql_release", - "data_export" - ], - "type": "string", - "description": "sql_release SQL上线完整列; data_export 数据导出列; omit/empty 全量公共列(含工单类型)", - "name": "workflow_type", - "in": "query" - }, - { - "enum": [ - "pending_approval", - "pending_action", - "in_progress", - "exporting", - "rejected", - "cancelled", - "failed", - "completed", - "unknown" - ], - "type": "string", - "description": "filter by unified workflow status", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "filter by update time from", - "name": "filter_update_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter by update time to", - "name": "filter_update_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter by create user id", - "name": "filter_create_user_id", - "in": "query" - }, - { - "type": "string", - "description": "filter create time from", - "name": "filter_create_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter create time to", - "name": "filter_create_time_to", - "in": "query" - }, - { - "enum": [ - "csv", - "excel" - ], - "type": "string", - "description": "export format: csv or excel, default csv", - "name": "export_format", - "in": "query" - } - ], - "responses": { - "200": { - "description": "export workflow", - "schema": { - "type": "file" - } - } - } - } - }, - "/v2/dashboard/workflows/statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global workflow statistics, returns archived, pending_for_me, initiated_by_me, and view_all counts", - "tags": [ - "GlobalDashboard" - ], - "summary": "获取全局工单管理统计数据", - "operationId": "GetGlobalWorkflowStatisticsV2", - "parameters": [ - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_instance_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dashboard.GlobalWorkflowStatisticsResV2" - } - } - } - } - }, - "/v2/projects/{project_name}/audit_plans": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan info list", - "tags": [ - "audit_plan" - ], - "summary": "获取扫描任务信息列表", - "operationId": "getAuditPlansV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "filter audit plan db type", - "name": "filter_audit_plan_db_type", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search audit plan name", - "name": "fuzzy_search_audit_plan_name", - "in": "query" - }, - { - "type": "string", - "description": "filter audit plan type", - "name": "filter_audit_plan_type", - "in": "query" - }, - { - "type": "string", - "description": "filter audit plan instance name", - "name": "filter_audit_plan_instance_name", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetAuditPlansResV2" - } - } - } - } - }, - "/v2/projects/{project_name}/audit_plans/{audit_plan_id}/sqls/upload": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "upload intance audit plan SQLs", - "tags": [ - "instance_audit_plan" - ], - "summary": "同步SQL到扫描任务", - "operationId": "UploadInstanceAuditPlanSQLsV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan id", - "name": "audit_plan_id", - "in": "path", - "required": true - }, - { - "description": "upload instance audit plan SQLs request", - "name": "sqls", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v2.UploadInstanceAuditPlanSQLsReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan report SQLs", - "tags": [ - "audit_plan" - ], - "summary": "获取指定扫描任务的SQL扫描详情", - "operationId": "getAuditPlanReportsSQLs", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan report id", - "name": "audit_plan_report_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetAuditPlanReportSQLsResV2" - } - } - } - } - }, - "/v2/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls/{number}/analysis": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get SQL explain and related table metadata for analysis", - "tags": [ - "audit_plan" - ], - "summary": "获取task相关的SQL执行计划和表元数据", - "operationId": "getAuditPlantAnalysisDataV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan report id", - "name": "audit_plan_report_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql number", - "name": "number", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetAuditPlanAnalysisDataResV2" - } - } - } - } - }, - "/v2/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/full": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "full sync audit plan SQLs", - "tags": [ - "audit_plan" - ], - "summary": "全量同步SQL到扫描任务", - "operationId": "fullSyncAuditPlanSQLsV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "description": "full sync audit plan SQLs request", - "name": "sqls", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v2.FullSyncAuditPlanSQLsReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/partial": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "partial sync audit plan SQLs", - "tags": [ - "audit_plan" - ], - "summary": "增量同步SQL到扫描任务", - "operationId": "partialSyncAuditPlanSQLsV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "description": "partial sync audit plan SQLs request", - "name": "sqls", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v2.PartialSyncAuditPlanSQLsReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/instance_audit_plans": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance audit plan info list", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取实例扫描任务列表", - "operationId": "getInstanceAuditPlansV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "filter by environment tag", - "name": "filter_by_environment_tag", - "in": "query" - }, - { - "type": "string", - "description": "filter by db type", - "name": "filter_by_db_type", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_by_instance_id", - "in": "query" - }, - { - "type": "string", - "description": "filter instance audit plan type", - "name": "filter_by_audit_plan_type", - "in": "query" - }, - { - "type": "string", - "description": "filter instance audit plan active status", - "name": "filter_by_active_status", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search", - "name": "fuzzy_search", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetInstanceAuditPlansRes" - } - } - } - } - }, - "/v2/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance audit plan detail", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取实例扫描任务详情", - "operationId": "getInstanceAuditPlanDetailV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetInstanceAuditPlanDetailRes" - } - } - } - } - }, - "/v2/projects/{project_name}/instance_tips": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance tip list", - "tags": [ - "instance" - ], - "summary": "获取实例提示列表", - "operationId": "getInstanceTipListV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "filter db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "filter by environment tag", - "name": "filter_by_environment_tag", - "in": "query" - }, - { - "type": "string", - "description": "filter workflow template id", - "name": "filter_workflow_template_id", - "in": "query" - }, - { - "enum": [ - "create_audit_plan", - "create_workflow", - "sql_manage", - "create_optimization", - "create_pipeline", - "create_version", - "view_sql_insight" - ], - "type": "string", - "description": "functional module", - "name": "functional_module", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetInstanceTipsResV2" - } - } - } - } - }, - "/v2/projects/{project_name}/instances/{instance_name}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance db", - "tags": [ - "instance" - ], - "summary": "获取实例信息", - "operationId": "getInstanceV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetInstanceResV2" - } - } - } - } - }, - "/v2/projects/{project_name}/sql_manages": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql manage list", - "tags": [ - "SqlManage" - ], - "summary": "获取管控sql列表", - "operationId": "GetSqlManageListV2", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy search sql fingerprint", - "name": "fuzzy_search_sql_fingerprint", - "in": "query" - }, - { - "type": "string", - "description": "assignee", - "name": "filter_assignee", - "in": "query" - }, - { - "type": "string", - "description": "instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "audit_plan", - "sql_audit_record" - ], - "type": "string", - "description": "source", - "name": "filter_source", - "in": "query" - }, - { - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "type": "string", - "description": "audit level", - "name": "filter_audit_level", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time from", - "name": "filter_last_audit_start_time_from", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time to", - "name": "filter_last_audit_start_time_to", - "in": "query" - }, - { - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited", - "sent" - ], - "type": "string", - "description": "status", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "rule name", - "name": "filter_rule_name", - "in": "query" - }, - { - "type": "string", - "description": "db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "filter by business", - "name": "filter_business", - "in": "query" - }, - { - "type": "string", - "description": "filter by environment tag", - "name": "filter_by_environment_tag", - "in": "query" - }, - { - "enum": [ - "high", - "low" - ], - "type": "string", - "description": "priority", - "name": "filter_priority", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search endpoint", - "name": "fuzzy_search_endpoint", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search schema name", - "name": "fuzzy_search_schema_name", - "in": "query" - }, - { - "enum": [ - "first_appear_timestamp", - "last_receive_timestamp", - "fp_count" - ], - "type": "string", - "description": "sort field", - "name": "sort_field", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "sort order", - "name": "sort_order", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetSqlManageListResp" - } - } - } - } - }, - "/v2/projects/{project_name}/sql_manages/exports": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "export sql manage as CSV or Excel", - "tags": [ - "SqlManage" - ], - "summary": "导出SQL管控", - "operationId": "exportSqlManageV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy search sql fingerprint", - "name": "fuzzy_search_sql_fingerprint", - "in": "query" - }, - { - "type": "string", - "description": "assignee", - "name": "filter_assignee", - "in": "query" - }, - { - "type": "string", - "description": "filter by environment tag", - "name": "filter_by_environment_tag", - "in": "query" - }, - { - "enum": [ - "high", - "low" - ], - "type": "string", - "description": "priority", - "name": "filter_priority", - "in": "query" - }, - { - "type": "string", - "description": "instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "audit_plan", - "sql_audit_record" - ], - "type": "string", - "description": "source", - "name": "filter_source", - "in": "query" - }, - { - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "type": "string", - "description": "audit level", - "name": "filter_audit_level", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time from", - "name": "filter_last_audit_start_time_from", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time to", - "name": "filter_last_audit_start_time_to", - "in": "query" - }, - { - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited" - ], - "type": "string", - "description": "status", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "rule name", - "name": "filter_rule_name", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search endpoint", - "name": "fuzzy_search_endpoint", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search schema name", - "name": "fuzzy_search_schema_name", - "in": "query" - }, - { - "enum": [ - "first_appear_timestamp", - "last_receive_timestamp", - "fp_count" - ], - "type": "string", - "description": "sort field", - "name": "sort_field", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "sort order", - "name": "sort_order", - "in": "query" - }, - { - "enum": [ - "csv", - "excel" - ], - "type": "string", - "description": "export format", - "name": "export_format", - "in": "query" - } - ], - "responses": { - "200": { - "description": "export sql manage", - "schema": { - "type": "file" - } - } - } - } - }, - "/v2/projects/{project_name}/sql_optimization_records": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql optimization records", - "tags": [ - "sql_optimization" - ], - "summary": "获取SQL优化记录列表", - "operationId": "GetOptimizationRecordsV2", - "parameters": [ - { - "type": "string", - "description": "fuzzy search for optimization_id or create_username", - "name": "fuzzy_search", - "in": "query" - }, - { - "type": "string", - "description": "filter instance name", - "name": "filter_instance_name", - "in": "query" - }, - { - "type": "string", - "description": "filter create time from", - "name": "filter_create_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter create time to", - "name": "filter_create_time_to", - "in": "query" - }, - { - "enum": [ - "optimizing", - "failed", - "finish" - ], - "type": "string", - "description": "filter status", - "name": "filter_status", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetOptimizationRecordsRes" - } - } - } + "description": "filter by workflow status,, support using many status", + "name": "filter_status_list", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id in project", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "high", + "medium", + "low" + ], + "type": "string", + "description": "filter by project priority", + "name": "filter_project_priority", + "in": "query" + }, + { + "type": "string", + "description": "filter current step assignee user id", + "name": "filter_current_step_assignee_user_id", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowsResV1" + } + } + } + } + }, + "/v1/dashboard/workflows/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global workflow statistics", + "tags": [ + "workflow" + ], + "summary": "获取全局工单统计数据", + "operationId": "GetGlobalWorkflowStatistics", + "parameters": [ + { + "type": "string", + "description": "filter create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "executing", + "canceled", + "exec_failed", + "finished" + ], + "type": "array", + "items": { + "type": "string" }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "optimize sql\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.\n4. file[input_zip_file]: it is ZIP file that sql will be parsed from xml or sql file inside it.\n5. formData[git_http_url]:the url which scheme is http(s) and end with .git.\n6. formData[git_user_name]:The name of the user who owns the repository read access.\n7. formData[git_user_password]:The password corresponding to git_user_name.", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sql_optimization" - ], - "summary": "优化SQL", - "operationId": "SQLOptimizeV2", - "parameters": [ - { - "description": "sqls that should be optimization", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v2.OptimizeSQLReq" - } - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "formData" - }, - { - "type": "string", - "description": "schema of instance", - "name": "schema_name", - "in": "formData" - }, - { - "type": "string", - "description": "db type of instance", - "name": "db_type", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "optimization name", - "name": "optimization_name", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "sqls for audit", - "name": "sql_content", - "in": "formData" - }, - { - "type": "string", - "description": "explain info", - "name": "explain_info", - "in": "formData" - }, - { - "type": "string", - "description": "metadata", - "name": "metadata", - "in": "formData" - }, - { - "type": "boolean", - "description": "enable high analysis", - "name": "enable_high_analysis", - "in": "formData" - }, - { - "type": "file", - "description": "input SQL file", - "name": "input_sql_file", - "in": "formData" - }, - { - "type": "file", - "description": "input ZIP file", - "name": "input_zip_file", - "in": "formData" - }, - { - "type": "file", - "description": "input mybatis XML file", - "name": "input_mybatis_xml_file", - "in": "formData" - }, - { - "type": "string", - "description": "git repository url", - "name": "git_http_url", - "in": "formData" - }, - { - "type": "string", - "description": "the name of user to clone the repository", - "name": "git_user_name", - "in": "formData" - }, - { - "type": "string", - "description": "the password corresponding to git_user_name", - "name": "git_user_password", - "in": "formData" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.OptimizeSQLRes" - } - } - } - } - }, - "/v2/projects/{project_name}/sql_optimization_records/{optimization_record_id}/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql optimization record", - "tags": [ - "sql_optimization" - ], - "summary": "获取SQL优化语句详情", - "operationId": "GetOptimizationSQLDetailV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql optimization record id", - "name": "optimization_record_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetOptimizationDetailRes" - } - } - } - } - }, - "/v2/projects/{project_name}/sql_optimization_records/{optimization_record_id}/feedback": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "add optimized sql feedback", - "consumes": [ - "application/json" - ], - "tags": [ - "sql_optimization" - ], - "summary": "添加SQL优化语句反馈", - "operationId": "AddOptimizedSQLFeedback", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql optimization record id", - "name": "optimization_record_id", - "in": "path", - "required": true - }, - { - "description": "add optimized sql feedback req", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v2.OptimizedSQLFeedbackReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/sql_optimization_records/{optimization_record_id}/feedback/{feedback_id}/": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete optimized sql feedback", - "tags": [ - "sql_optimization" - ], - "summary": "删除SQL优化语句反馈", - "operationId": "DeleteOptimizedSQLFeedback", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql optimization record id", - "name": "optimization_record_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "feedback id", - "name": "feedback_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } + "description": "filter by workflow status,, support using many status", + "name": "filter_status_list", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id in project", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "high", + "medium", + "low" + ], + "type": "string", + "description": "filter by project priority", + "name": "filter_project_priority", + "in": "query" + }, + { + "type": "string", + "description": "filter current step assignee user id", + "name": "filter_current_step_assignee_user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GlobalWorkflowStatisticsResV1" + } + } + } + } + }, + "/v1/database_driver_logos": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get database driver logos", + "tags": [ + "instance" + ], + "summary": "获取数据库插件的Logo图片", + "operationId": "GetDatabaseDriverLogos", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update optimized sql feedback", - "consumes": [ - "application/json" - ], - "tags": [ - "sql_optimization" - ], - "summary": "更新SQL优化语句反馈", - "operationId": "UpdateOptimizedSQLFeedback", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql optimization record id", - "name": "optimization_record_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "feedback id", - "name": "feedback_id", - "in": "path", - "required": true - }, - { - "description": "update optimized sql feedback req", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v2.UpdateOptimizedSQLFeedbackReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create workflow", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "创建工单", - "operationId": "createWorkflowV2", - "parameters": [ - { - "description": "create workflow request", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v2.CreateWorkflowReqV2" - } - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.CreateWorkflowResV2" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/cancel": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "batch cancel workflows", - "tags": [ - "workflow" - ], - "summary": "批量取消工单", - "operationId": "batchCancelWorkflowsV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "batch cancel workflows request", - "name": "BatchCancelWorkflowsReqV2", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v2.BatchCancelWorkflowsReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/complete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "this api will directly change the work order status to finished without real online operation", - "tags": [ - "workflow" - ], - "summary": "批量完成工单", - "operationId": "batchCompleteWorkflowsV2", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "batch complete workflows request", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v2.BatchCompleteWorkflowsReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/{workflow_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow detail", - "tags": [ - "workflow" - ], - "summary": "获取工单详情", - "operationId": "getWorkflowV2", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetWorkflowResV2" - } - } - } + "description": "MySQL,Oracle", + "name": "db_types", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetDatabaseDriverLogosResV1" + } + } + } + } + }, + "/v1/database_driver_options": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get database driver options", + "tags": [ + "instance" + ], + "summary": "获取实例的额外属性列表", + "operationId": "getDatabaseDriverOptions", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetDatabaseDriverOptionsResV1" + } + } + } + } + }, + "/v1/import_rule_template": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get rule template file", + "tags": [ + "rule_template" + ], + "summary": "获取规则模板文件", + "operationId": "getRuleTemplateFileV1", + "parameters": [ + { + "type": "string", + "description": "instance type", + "name": "instance_type", + "in": "query", + "required": true + }, + { + "enum": [ + "csv", + "json" + ], + "type": "string", + "description": "file type", + "name": "file_type", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "sqle rule template file", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/knowledge_bases": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get knowledge base list", + "tags": [ + "knowledge_base" + ], + "summary": "获取知识库列表", + "operationId": "getKnowledgeBaseList", + "parameters": [ + { + "type": "string", + "description": "keywords", + "name": "keywords", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update workflow when it is rejected to creator.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "更新工单(工单被驳回、工单被关闭、执行成功、执行失败后才可更新)", - "operationId": "updateWorkflowV2", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "update workflow request", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v2.UpdateWorkflowReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/{workflow_id}/cancel": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "cancel workflow", - "tags": [ - "workflow" - ], - "summary": "审批关闭(中止)", - "operationId": "cancelWorkflowV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/{workflow_id}/steps/{workflow_step_id}/approve": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "approve workflow", - "tags": [ - "workflow" - ], - "summary": "审批通过", - "operationId": "approveWorkflowV2", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow step id", - "name": "workflow_step_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "workflow approve request", - "name": "workflow_approve", - "in": "body", - "schema": { - "$ref": "#/definitions/v2.ApproveWorkflowReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/{workflow_id}/steps/{workflow_step_id}/reject": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "reject workflow", - "tags": [ - "workflow" - ], - "summary": "审批驳回", - "operationId": "rejectWorkflowV2", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow step id", - "name": "workflow_step_id", - "in": "path", - "required": true - }, - { - "description": "workflow approve request", - "name": "workflow_approve", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v2.RejectWorkflowReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/{workflow_id}/tasks": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get summary of workflow instance tasks", - "tags": [ - "workflow" - ], - "summary": "获取工单数据源任务概览", - "operationId": "getSummaryOfInstanceTasksV2", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetWorkflowTasksResV2" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/{workflow_id}/tasks/execute": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "execute tasks on workflow", - "tags": [ - "workflow" - ], - "summary": "多数据源批量上线", - "operationId": "executeTasksOnWorkflowV2", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/execute": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "execute one task on workflow", - "tags": [ - "workflow" - ], - "summary": "工单提交单个数据源上线", - "operationId": "executeOneTaskOnWorkflowV2", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/schedule": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update workflow schedule.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "设置工单数据源定时上线时间(设置为空则代表取消定时时间,需要SQL审核流程都通过后才可以设置)", - "operationId": "updateWorkflowScheduleV2", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "update workflow schedule request", - "name": "instance", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v2.UpdateWorkflowScheduleReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - }, - "/v2/sql_audit": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Direct audit sql", - "tags": [ - "sql_audit" - ], - "summary": "直接审核SQL", - "operationId": "directAuditV2", - "parameters": [ - { - "description": "sqls that should be audited", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v2.DirectAuditReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.DirectAuditResV2" - } - } - } - } - }, - "/v2/tasks/audits/{task_id}/files": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit task file list", - "tags": [ - "task" - ], - "summary": "获取审核任务文件概览列表", - "operationId": "getAuditFileList", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "page size", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetAuditFileListRes" - } - } - } - } - }, - "/v2/tasks/audits/{task_id}/files/{file_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit task file execute statistic", - "tags": [ - "task" - ], - "summary": "获取审核任务文件执行概览", - "operationId": "getAuditFileExecStatistic", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "file id", - "name": "file_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetAuditFileExecStatisticRes" - } - } - } - } - }, - "/v2/tasks/audits/{task_id}/sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get information of all SQLs belong to the specified audit task", - "tags": [ - "task" - ], - "summary": "获取指定扫描任务的SQLs信息", - "operationId": "getAuditTaskSQLsV2", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "enum": [ - "initialized", - "doing", - "succeeded", - "failed", - "manually_executed", - "terminating", - "terminate_succeeded", - "terminate_failed", - "execute_rollback", - "not_executed" - ], - "type": "string", - "description": "filter: exec status of task sql", - "name": "filter_exec_status", - "in": "query" - }, - { - "enum": [ - "initialized", - "doing", - "finished" - ], - "type": "string", - "description": "filter: audit status of task sql", - "name": "filter_audit_status", - "in": "query" - }, - { - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "type": "string", - "description": "filter: audit level of task sql", - "name": "filter_audit_level", - "in": "query" - }, - { - "type": "boolean", - "description": "select unique (fingerprint and audit result) for task sql", - "name": "no_duplicate", - "in": "query" - }, - { - "type": "integer", - "description": "filter: audit file id of task", - "name": "filter_audit_file_id", - "in": "query" - }, - { - "type": "string", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "page size", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetAuditTaskSQLsResV2" - } - } - } - } - }, - "/v2/tasks/audits/{task_id}/sqls/{number}/analysis": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get SQL explain and related table metadata for analysis", - "tags": [ - "task" - ], - "summary": "获取task相关的SQL执行计划和表元数据", - "operationId": "getTaskAnalysisDataV2", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "sql number", - "name": "number", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "whether to calculate and return affected rows, default is true", - "name": "affectRowsEnabled", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v2.GetTaskAnalysisDataResV2" - } - } - } - } - }, - "/v3/projects/{project_name}/sql_manages": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql manage list", - "tags": [ - "SqlManage" - ], - "summary": "获取SQL管控列表", - "operationId": "GetSqlManageListV3", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy search sql fingerprint", - "name": "fuzzy_search_sql_fingerprint", - "in": "query" - }, - { - "type": "string", - "description": "assignee", - "name": "filter_assignee", - "in": "query" - }, - { - "type": "string", - "description": "instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "audit_plan", - "sql_audit_record" - ], - "type": "string", - "description": "source", - "name": "filter_source", - "in": "query" - }, - { - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "type": "string", - "description": "audit level", - "name": "filter_audit_level", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time from", - "name": "filter_last_audit_start_time_from", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time to", - "name": "filter_last_audit_start_time_to", - "in": "query" - }, - { - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited", - "sent" - ], - "type": "string", - "description": "status", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "rule name", - "name": "filter_rule_name", - "in": "query" - }, - { - "type": "string", - "description": "db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "filter by name of environment tag", - "name": "filter_by_environment_tag", - "in": "query" - }, - { - "enum": [ - "high", - "low" - ], - "type": "string", - "description": "priority", - "name": "filter_priority", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search endpoint", - "name": "fuzzy_search_endpoint", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search schema name", - "name": "fuzzy_search_schema_name", - "in": "query" - }, - { - "enum": [ - "first_appear_timestamp", - "last_receive_timestamp", - "fp_count" - ], - "type": "string", - "description": "sort field", - "name": "sort_field", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "sort order", - "name": "sort_order", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v3.GetSqlManageListResp" - } - } - } - } - }, - "/v3/projects/{project_name}/workflows/complete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "this api will directly change the work order status to finished without real online operation", - "tags": [ - "workflow" - ], - "summary": "批量完成工单", - "operationId": "batchCompleteWorkflowsV3", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "batch complete workflows request", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v3.BatchCompleteWorkflowsReqV3" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.BaseRes" - } - } - } - } - } - }, - "definitions": { - "controller.BaseRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "dashboard.GlobalAccountListDataV2": { - "type": "object", - "properties": { - "accounts": { - "type": "array", - "items": { - "$ref": "#/definitions/dashboard.GlobalAccountListItemV2" - } - }, - "can_manage": { - "description": "是否有管理权限", - "type": "boolean" - } - } - }, - "dashboard.GlobalAccountListItemV2": { - "type": "object", - "properties": { - "account_name": { - "description": "账号名称", - "type": "string" - }, - "account_uid": { - "description": "账号ID", - "type": "string" - }, - "expired_time": { - "description": "过期时间,前端应显示剩余时间,若小于7天则需要用警告图标配合加粗红色文字警示", - "type": "string" - }, - "instance_id": { - "description": "实例ID", - "type": "string" - }, - "instance_name": { - "description": "实例名称", - "type": "string" - }, - "project_name": { - "description": "项目名称", - "type": "string" - }, - "project_uid": { - "description": "项目ID", - "type": "string" - }, - "status": { - "description": "状态展示: 活跃,临期,已过期,已锁定", - "type": "string", - "enum": [ - "active", - "expiring", - "expired", - "locked" - ] - } - } - }, - "dashboard.GlobalAccountListResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/dashboard.GlobalAccountListDataV2" - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "dashboard.GlobalAccountStatisticsData": { - "type": "object", - "properties": { - "active_account_count": { - "description": "我的可用账号卡片,展示我的可用账号数量", - "type": "integer" - }, - "expiring_soon_count": { - "description": "即将过期卡片,展示即将过期的账号数量", - "type": "integer" - } - } - }, - "dashboard.GlobalAccountStatisticsResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "description": "统计数据", - "type": "object", - "$ref": "#/definitions/dashboard.GlobalAccountStatisticsData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "dashboard.GlobalSqlManageStatisticsResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/dashboard.GlobalSqlManageStatisticsV2" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "dashboard.GlobalSqlManageStatisticsV2": { - "type": "object", - "properties": { - "optimized_this_week_count": { - "description": "优化完成卡片,展示历史优化完成的SQL数量", - "type": "integer" - }, - "pending_sql_count": { - "description": "待我优化卡片,展示需要我处理的SQL数量", - "type": "integer" - } - } - }, - "dashboard.GlobalSqlManageTaskItemV2": { - "type": "object", - "properties": { - "avg_time": { - "description": "平均耗时(秒),来自采集 info;无慢日志等指标时 JSON 为 null(非 0)", - "type": "number" - }, - "count": { - "description": "执行频次;info 中无 counter 等时为 null(非 0)", - "type": "integer" - }, - "instance_id": { - "description": "实例ID", - "type": "string" - }, - "instance_name": { - "description": "实例名称", - "type": "string" - }, - "last_seen_at": { - "description": "最后一次捕捉时间", - "type": "string" - }, - "project_name": { - "description": "项目名称", - "type": "string" - }, - "project_uid": { - "description": "项目ID", - "type": "string" - }, - "source": { - "description": "来源,如:慢日志、库表元数据等,根据数据源id和项目id跳转到智能扫描详情", - "type": "string" - }, - "sql_fingerprint": { - "description": "SQL 指纹", - "type": "string" - }, - "status": { - "description": "SQL治理任务状态:待处理,已优化,已忽略,人工审核中,已分配", - "type": "string", - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited", - "sent" - ] - }, - "suggestion": { - "description": "管理员派单备注;无备注时为空字符串", - "type": "string" - } - } - }, - "dashboard.GlobalSqlManageTaskListResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/dashboard.GlobalSqlManageTaskItemV2" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "dashboard.GlobalWorkflowListData": { - "type": "object", - "properties": { - "has_more": { - "description": "是否还有更多数据", - "type": "boolean" - }, - "next_cursor": { - "description": "游标分页:下一页游标", - "type": "string" - }, - "total_nums": { - "description": "总条数", - "type": "integer" - }, - "workflows": { - "description": "工单列表", - "type": "array", - "items": { - "$ref": "#/definitions/dashboard.GlobalWorkflowListItem" - } - } - } - }, - "dashboard.GlobalWorkflowListItem": { - "type": "object", - "properties": { - "assignee": { - "description": "当前处理人姓名", - "type": "string" - }, - "create_user_name": { - "type": "string" - }, - "created_at": { - "description": "创建时间", - "type": "string" - }, - "current_step_assignee_user_name_list": { - "description": "当前处理人姓名列表", - "type": "array", - "items": { - "type": "string" - } - }, - "instance_id": { - "description": "实例ID", - "type": "string" - }, - "instance_name": { - "description": "实例名称", - "type": "string" - }, - "ops_type": { - "description": "OpsType 运维类型(跨项目按工单所属项目字典批量解析);未设置或字典项已删时省略", - "type": "object", - "$ref": "#/definitions/dms.OpsType" - }, - "priority": { - "description": "High, Medium, Low", - "type": "string" - }, - "project_name": { - "description": "项目名称", - "type": "string" - }, - "project_uid": { - "description": "项目ID", - "type": "string" - }, - "status": { - "description": "工单状态", - "type": "string", - "enum": [ - "pending_approval", - "pending_action", - "in_progress", - "exporting", - "rejected", - "cancelled", - "failed", - "completed", - "unknown" - ] - }, - "updated_at": { - "description": "更新时间", - "type": "string" - }, - "workflow_desc": { - "description": "工单描述", - "type": "string" - }, - "workflow_id": { - "description": "工单ID", - "type": "string" - }, - "workflow_name": { - "description": "工单名称", - "type": "string" - }, - "workflow_type": { - "description": "工单类型", - "type": "string", - "enum": [ - "sql_release", - "data_export" - ] - } - } - }, - "dashboard.GlobalWorkflowListResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/dashboard.GlobalWorkflowListData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "dashboard.GlobalWorkflowStatisticsResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/dashboard.GlobalWorkflowStatisticsV2" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "dashboard.GlobalWorkflowStatisticsV2": { - "type": "object", - "properties": { - "archived_count": { - "description": "已完成的工单数量", - "type": "integer" - }, - "initiated_by_me_count": { - "description": "我发起的工单数量", - "type": "integer" - }, - "pending_for_me_count": { - "description": "待我处理的工单数量", - "type": "integer" - }, - "view_all_count": { - "description": "查看全部的工单数量", - "type": "integer" - } - } - }, - "dms.OpsType": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "uid": { - "type": "string" - } - } + "description": "tags", + "name": "tags", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetKnowledgeBaseListRes" + } + } + } + } + }, + "/v1/knowledge_bases/graph": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get knowledge graph", + "tags": [ + "knowledge_base" + ], + "summary": "获取知识库知识图谱", + "operationId": "getKnowledgeGraph", + "parameters": [ + { + "type": "string", + "description": "filter by rule name", + "name": "filter_by_rule_name", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetKnowledgeGraphResp" + } + } + } + } + }, + "/v1/knowledge_bases/tags": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get tag list of knowledge base", + "tags": [ + "knowledge_base" + ], + "summary": "获取知识库标签列表", + "operationId": "getKnowledgeBaseTagList", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetKnowledgeBaseTagListRes" + } + } + } + } + }, + "/v1/operations": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get permission operations", + "tags": [ + "operation" + ], + "summary": "获取权限动作列表", + "operationId": "GetOperationsV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetOperationsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan info list", + "tags": [ + "audit_plan" + ], + "summary": "获取扫描任务信息列表", + "operationId": "getAuditPlansV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter audit plan db type", + "name": "filter_audit_plan_db_type", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search audit plan name", + "name": "fuzzy_search_audit_plan_name", + "in": "query" + }, + { + "type": "string", + "description": "filter audit plan type", + "name": "filter_audit_plan_type", + "in": "query" + }, + { + "type": "string", + "description": "filter audit plan instance name", + "name": "filter_audit_plan_instance_name", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditPlansResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create audit plan", + "consumes": [ + "application/json" + ], + "tags": [ + "audit_plan" + ], + "summary": "添加扫描任务", + "operationId": "createAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "create audit plan", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateAuditPlanReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan", + "tags": [ + "audit_plan" + ], + "summary": "获取指定扫描任务", + "operationId": "getAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditPlanResV1" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete audit plan", + "tags": [ + "audit_plan" + ], + "summary": "删除扫描任务", + "operationId": "deleteAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update audit plan", + "tags": [ + "audit_plan" + ], + "summary": "更新扫描任务", + "operationId": "updateAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "description": "update audit plan", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAuditPlanReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/notify_config": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan notify config", + "tags": [ + "audit_plan" + ], + "summary": "获取扫描任务消息推送设置", + "operationId": "getAuditPlanNotifyConfigV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditPlanNotifyConfigResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update audit plan notify config", + "tags": [ + "audit_plan" + ], + "summary": "更新扫描任务通知设置", + "operationId": "updateAuditPlanNotifyConfigV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "description": "update audit plan notify config", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAuditPlanNotifyConfigReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/notify_config/test": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Test audit task message push", + "tags": [ + "audit_plan" + ], + "summary": "测试扫描任务消息推送", + "operationId": "testAuditPlanNotifyConfigV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/TestAuditPlanNotifyConfigResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan report list", + "tags": [ + "audit_plan" + ], + "summary": "获取指定扫描任务的报告列表", + "operationId": "getAuditPlanReportsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditPlanReportsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan report", + "tags": [ + "audit_plan" + ], + "summary": "获取指定扫描任务的SQL扫描记录统计信息", + "operationId": "getAuditPlanReportV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan report id", + "name": "audit_plan_report_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditPlanReportResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/export": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "export audit plan report as csv", + "tags": [ + "audit_plan" + ], + "summary": "以csv的形式导出扫描报告", + "operationId": "exportAuditPlanReportV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan report id", + "name": "audit_plan_report_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "get export audit plan report", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan report SQLs", + "tags": [ + "audit_plan" + ], + "summary": "获取指定扫描任务的SQL扫描详情", + "operationId": "getAuditPlanReportsSQLsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan report id", + "name": "audit_plan_report_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditPlanReportSQLsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls/{number}/analysis": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get SQL explain and related table metadata for analysis", + "tags": [ + "audit_plan" + ], + "summary": "获取task相关的SQL执行计划和表元数据", + "operationId": "getTaskAnalysisData", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan report id", + "name": "audit_plan_report_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql number", + "name": "number", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditPlanAnalysisDataResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan SQLs", + "tags": [ + "audit_plan" + ], + "summary": "获取指定扫描任务的SQLs信息(不包括扫描结果)", + "operationId": "getAuditPlanSQLsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditPlanSQLsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/full": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "full sync audit plan SQLs", + "tags": [ + "audit_plan" + ], + "summary": "全量同步SQL到扫描任务", + "operationId": "fullSyncAuditPlanSQLsV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "description": "full sync audit plan SQLs request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/FullSyncAuditPlanSQLsReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/partial": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "partial sync audit plan SQLs", + "tags": [ + "audit_plan" + ], + "summary": "增量同步SQL到扫描任务", + "operationId": "partialSyncAuditPlanSQLsV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "description": "partial sync audit plan SQLs request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PartialSyncAuditPlanSQLsReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/trigger": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "trigger audit plan", + "tags": [ + "audit_plan" + ], + "summary": "触发扫描任务", + "operationId": "triggerAuditPlanV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/TriggerAuditPlanResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_whitelist": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get all whitelist", + "tags": [ + "audit_whitelist" + ], + "summary": "获取Sql审核白名单", + "operationId": "getAuditWhitelistV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy value", + "name": "fuzzy_search_value", + "in": "query" + }, + { + "type": "string", + "description": "match type", + "name": "filter_match_type", + "in": "query" + }, + { + "type": "string", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "page size", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditWhitelistResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create a sql whitelist", + "consumes": [ + "application/json" + ], + "tags": [ + "audit_whitelist" + ], + "summary": "添加SQL白名单", + "operationId": "createAuditWhitelistV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "add sql whitelist req", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateAuditWhitelistReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_whitelist/{audit_whitelist_id}/": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "remove sql white", + "tags": [ + "audit_whitelist" + ], + "summary": "删除SQL白名单信息", + "operationId": "deleteAuditWhitelistByIdV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit whitelist id", + "name": "audit_whitelist_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update sql whitelist by id", + "consumes": [ + "application/json" + ], + "tags": [ + "audit_whitelist" + ], + "summary": "更新SQL白名单", + "operationId": "UpdateAuditWhitelistByIdV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql audit whitelist id", + "name": "audit_whitelist_id", + "in": "path", + "required": true + }, + { + "description": "update sql whitelist req", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAuditWhitelistReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/blacklist": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get blacklist", + "tags": [ + "blacklist" + ], + "summary": "获取黑名单列表", + "operationId": "getBlacklistV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "enum": [ + "sql", + "fp_sql", + "ip", + "cidr", + "host", + "instance" + ], + "type": "string", + "description": "filter type", + "name": "filter_type", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search content", + "name": "fuzzy_search_content", + "in": "query" + }, + { + "type": "string", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "page size", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetBlacklistResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create a blacklist", + "consumes": [ + "application/json" + ], + "tags": [ + "blacklist" + ], + "summary": "添加黑名单", + "operationId": "createBlacklistV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "add blacklist req", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateBlacklistReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/blacklist/{blacklist_id}/": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete a blacklist", + "tags": [ + "blacklist" + ], + "operationId": "deleteBlackList", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "blacklist id", + "name": "blacklist_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update a blacklist", + "consumes": [ + "application/json" + ], + "tags": [ + "blacklist" + ], + "summary": "更新黑名单", + "operationId": "updateBlacklistV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "blacklist id", + "name": "blacklist_id", + "in": "path", + "required": true + }, + { + "description": "update blacklist req", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateBlacklistReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/database_comparison/comparison_statements": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get database comparison detail", + "consumes": [ + "application/json" + ], + "tags": [ + "database_comparison" + ], + "summary": "获取对比语句", + "operationId": "getComparisonStatementV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "get database comparison statement request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GetComparisonStatementsReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DatabaseComparisonStatementsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/database_comparison/execute_comparison": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get database comparison", + "consumes": [ + "application/json" + ], + "tags": [ + "database_comparison" + ], + "summary": "执行数据库结构对比并获取结果", + "operationId": "executeDatabaseComparisonV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "get database comparison request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GetDatabaseComparisonReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DatabaseComparisonResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/database_comparison/modify_sql_statements": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "generate database diff modify sqls", + "consumes": [ + "application/json" + ], + "tags": [ + "database_comparison" + ], + "summary": "生成变更SQL", + "operationId": "genDatabaseDiffModifySQLsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "generate database diff modify sqls request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GenModifylSQLReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GenModifySQLResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance audit plan info list", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取实例扫描任务列表", + "operationId": "getInstanceAuditPlansV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter by business", + "name": "filter_by_business", + "in": "query" + }, + { + "type": "string", + "description": "filter by environment tag", + "name": "filter_by_environment_tag", + "in": "query" + }, + { + "type": "string", + "description": "filter by db type", + "name": "filter_by_db_type", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_by_instance_id", + "in": "query" + }, + { + "type": "string", + "description": "filter instance audit plan type", + "name": "filter_by_audit_plan_type", + "in": "query" + }, + { + "type": "string", + "description": "filter instance audit plan active status", + "name": "filter_by_active_status", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search", + "name": "fuzzy_search", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetInstanceAuditPlansResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create instance audit plan", + "consumes": [ + "application/json" + ], + "tags": [ + "instance_audit_plan" + ], + "summary": "添加实例扫描任务", + "operationId": "createInstanceAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "create instance audit plan", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateInstanceAuditPlanReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/CreatInstanceAuditPlanResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance audit plan detail", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取实例扫描任务详情", + "operationId": "getInstanceAuditPlanDetailV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetInstanceAuditPlanDetailResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update instance audit plan", + "tags": [ + "instance_audit_plan" + ], + "summary": "更新实例扫描任务配置", + "operationId": "updateInstanceAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "description": "update instance audit plan", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateInstanceAuditPlanReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete instance audit plan", + "tags": [ + "instance_audit_plan" + ], + "summary": "删除实例扫描任务", + "operationId": "deleteInstanceAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "stop/start instance audit plan", + "tags": [ + "instance_audit_plan" + ], + "summary": "更新实例扫描任务状态", + "operationId": "updateInstanceAuditPlanStatusV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "description": "update instance audit plan", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateInstanceAuditPlanStatusReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan overview", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取实例扫描任务概览", + "operationId": "getInstanceAuditPlanOverviewV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetInstanceAuditPlanOverviewResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete audit plan by type", + "tags": [ + "instance_audit_plan" + ], + "summary": "删除扫描任务", + "operationId": "deleteAuditPlanByTypeV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan id", + "name": "audit_plan_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "stop/start audit plan", + "tags": [ + "instance_audit_plan" + ], + "summary": "更新扫描任务状态", + "operationId": "updateAuditPlanStatusV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan id", + "name": "audit_plan_id", + "in": "path", + "required": true + }, + { + "description": "update audit plan status", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAuditPlanStatusReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/audit": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "audit plan trigger sql audit", + "tags": [ + "instance_audit_plan" + ], + "summary": "扫描任务触发sql审核", + "operationId": "auditPlanTriggerSqlAuditV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan id", + "name": "audit_plan_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/sql_data": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan SQLs", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取指定扫描任务的SQL列表", + "operationId": "getInstanceAuditPlanSQLDataV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan id", + "name": "audit_plan_id", + "in": "path", + "required": true + }, + { + "description": "audit plan sql data request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GetAuditPlanSQLDataReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditPlanSQLDataResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/sql_export": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "export audit plan SQL report as CSV or Excel", + "tags": [ + "instance_audit_plan" + ], + "summary": "导出指定扫描任务的 SQL 列表", + "operationId": "getInstanceAuditPlanSQLExportV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan id", + "name": "audit_plan_id", + "in": "path", + "required": true + }, + { + "description": "audit plan sql export request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GetAuditPlanSQLExportReqV1" + } + } + ], + "responses": { + "200": { + "description": "export audit plan sql report", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/sql_meta": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan SQL meta", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取指定扫描任务的SQL列表元信息", + "operationId": "getInstanceAuditPlanSQLMetaV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan id", + "name": "audit_plan_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditPlanSQLMetaResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan SQLs", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取指定扫描任务的SQLs信息", + "operationId": "getInstanceAuditPlanSQLsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan id", + "name": "audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditPlanSQLsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/sqls/{id}/analysis": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get SQL explain and related table metadata for analysis", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取扫描任务相关的SQL执行计划和表元数据", + "operationId": "getAuditPlanSqlAnalysisDataV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan sql id", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "whether to calculate and return affected rows, default is true", + "name": "affectRowsEnabled", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSqlManageSqlAnalysisResp" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/token": { + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "refresh audit plan token", + "tags": [ + "instance_audit_plan" + ], + "summary": "重置扫描任务token", + "operationId": "refreshAuditPlanTokenV1", + "parameters": [ + { + "description": "update instance audit plan token", + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/RefreshAuditPlanTokenReqV1" + } + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_tips": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance tip list", + "tags": [ + "instance" + ], + "summary": "获取实例提示列表", + "operationId": "getInstanceTipListV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "filter by business", + "name": "filter_by_business", + "in": "query" + }, + { + "type": "string", + "description": "filter workflow template id", + "name": "filter_workflow_template_id", + "in": "query" + }, + { + "enum": [ + "create_audit_plan", + "create_workflow", + "sql_manage", + "create_optimization", + "create_pipeline" + ], + "type": "string", + "description": "functional module", + "name": "functional_module", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetInstanceTipsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instances/connections": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "batch test instance db connections", + "tags": [ + "instance" + ], + "summary": "批量测试实例连通性(实例提交后)", + "operationId": "batchCheckInstanceIsConnectableByName", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "instances", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BatchCheckInstanceConnectionsReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BatchGetInstanceConnectionsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instances/{instance_name}/connection": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "test instance db connection", + "tags": [ + "instance" + ], + "summary": "实例连通性测试(实例提交后)", + "operationId": "checkInstanceIsConnectableByNameV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetInstanceConnectableResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instances/{instance_name}/rules": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance all rule", + "tags": [ + "instance" + ], + "summary": "获取实例应用的规则列表", + "operationId": "getInstanceRuleListV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetRulesResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instances/{instance_name}/schemas": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "instance schema list", + "tags": [ + "instance" + ], + "summary": "实例 Schema 列表", + "operationId": "getInstanceSchemasV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetInstanceSchemaResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instances/{instance_name}/schemas/{schema_name}/tables": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "list table by schema", + "tags": [ + "instance" + ], + "summary": "获取数据库下的所有表", + "operationId": "listTableBySchema", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "schema name", + "name": "schema_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ListTableBySchemaResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instances/{instance_name}/schemas/{schema_name}/tables/{table_name}/metadata": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get table metadata", + "tags": [ + "instance" + ], + "summary": "获取表元数据", + "operationId": "getTableMetadata", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "schema name", + "name": "schema_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "table name", + "name": "table_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetTableMetadataResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/pipelines": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get pipeline list", + "tags": [ + "pipeline" + ], + "summary": "获取流水线列表", + "operationId": "getPipelinesV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy search pipeline name and description", + "name": "fuzzy_search_name_desc", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetPipelinesResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create pipeline", + "consumes": [ + "application/json" + ], + "tags": [ + "pipeline" + ], + "summary": "创建流水线", + "operationId": "createPipelineV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "create pipeline", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreatePipelineReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/CreatePipelineResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/pipelines/{pipeline_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get pipeline detail", + "tags": [ + "pipeline" + ], + "summary": "获取流水线详情", + "operationId": "getPipelineDetailV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "pipeline id", + "name": "pipeline_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetPipelineDetailResV1" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete pipeline", + "tags": [ + "pipeline" + ], + "summary": "删除流水线", + "operationId": "deletePipelineV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "pipeline id", + "name": "pipeline_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update pipeline", + "tags": [ + "pipeline" + ], + "summary": "更新流水线", + "operationId": "updatePipelineV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "pipeline id", + "name": "pipeline_id", + "in": "path", + "required": true + }, + { + "description": "update pipeline", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePipelineReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/pipelines/{pipeline_id}/token/{node_id}/": { + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "refresh pipeline token", + "tags": [ + "pipeline" + ], + "summary": "刷新流水线节点token", + "operationId": "refreshPipelineNodeTokenV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "pipeline id", + "name": "pipeline_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "node id", + "name": "node_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/report_push_configs": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Get report push config list", + "tags": [ + "ReportPushConfig" + ], + "summary": "获取消息推送配置列表", + "operationId": "GetReportPushConfigList", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetReportPushConfigsListResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/report_push_configs/{report_push_config_id}/": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update report push config", + "tags": [ + "ReportPushConfig" + ], + "summary": "更新消息推送配置", + "operationId": "UpdateReportPushConfig", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "report push config id", + "name": "report_push_config_id", + "in": "path", + "required": true + }, + { + "description": "update report push config request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateReportPushConfigReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/rule_template_tips": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get rule template tips in project", + "tags": [ + "rule_template" + ], + "summary": "获取项目规则模板提示", + "operationId": "getProjectRuleTemplateTipsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter db type", + "name": "filter_db_type", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetRuleTemplateTipsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/rule_templates": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get all rule template in a project", + "tags": [ + "rule_template" + ], + "summary": "项目规则模板列表", + "operationId": "getProjectRuleTemplateListV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetProjectRuleTemplatesResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create a rule template in project", + "consumes": [ + "application/json" + ], + "tags": [ + "rule_template" + ], + "summary": "添加项目规则模板", + "operationId": "createProjectRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "add rule template request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateProjectRuleTemplateReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/rule_templates/{rule_template_name}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get rule template detail in project", + "tags": [ + "rule_template" + ], + "summary": "获取项目规则模板信息", + "operationId": "getProjectRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy rule,keyword for desc and annotation", + "name": "fuzzy_keyword_rule", + "in": "query" + }, + { + "type": "string", + "description": "tags for rule", + "name": "tags", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetProjectRuleTemplateResV1" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete rule template in project", + "tags": [ + "rule_template" + ], + "summary": "删除项目规则模板", + "operationId": "deleteProjectRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update rule template in project", + "tags": [ + "rule_template" + ], + "summary": "更新项目规则模板", + "operationId": "updateProjectRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + }, + { + "description": "update rule template request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateProjectRuleTemplateReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/rule_templates/{rule_template_name}/clone": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "clone a rule template in project", + "consumes": [ + "application/json" + ], + "tags": [ + "rule_template" + ], + "summary": "克隆项目规则模板", + "operationId": "cloneProjectRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + }, + { + "description": "clone rule template request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CloneProjectRuleTemplateReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/rule_templates/{rule_template_name}/export": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "export rule template in a project", + "tags": [ + "rule_template" + ], + "summary": "导出项目规则模板", + "operationId": "exportProjectRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + }, + { + "enum": [ + "csv", + "json" + ], + "type": "string", + "description": "export type", + "name": "export_type", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "sqle rule template file", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_audit_records": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql audit records", + "tags": [ + "sql_audit_record" + ], + "summary": "获取SQL审核记录列表", + "operationId": "getSQLAuditRecordsV1", + "parameters": [ + { + "type": "string", + "description": "fuzzy search tags", + "name": "fuzzy_search_tags", + "in": "query" + }, + { + "enum": [ + "auditing", + "successfully" + ], + "type": "string", + "description": "filter sql audit status", + "name": "filter_sql_audit_status", + "in": "query" + }, + { + "type": "integer", + "description": "filter instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "type": "string", + "description": "filter create time from", + "name": "filter_create_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter create time to", + "name": "filter_create_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter sql audit record ids", + "name": "filter_sql_audit_record_ids", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSQLAuditRecordsResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "SQL audit\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.\n4. file[input_zip_file]: it is ZIP file that sql will be parsed from xml or sql file inside it.\n5. formData[git_http_url]:the url which scheme is http(s) and end with .git.\n6. formData[git_user_name]:The name of the user who owns the repository read access.\n7. formData[git_branch_name]:The name of the repository branch.\n8. formData[git_user_password]:The password corresponding to git_user_name.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sql_audit_record" + ], + "summary": "SQL审核", + "operationId": "CreateSQLAuditRecordV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "formData" + }, + { + "type": "string", + "description": "schema of instance", + "name": "instance_schema", + "in": "formData" + }, + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "formData" + }, + { + "type": "string", + "description": "db type of instance", + "name": "db_type", + "in": "formData" + }, + { + "type": "string", + "description": "sqls for audit", + "name": "sqls", + "in": "formData" + }, + { + "type": "file", + "description": "input SQL file", + "name": "input_sql_file", + "in": "formData" + }, + { + "type": "file", + "description": "input mybatis XML file", + "name": "input_mybatis_xml_file", + "in": "formData" + }, + { + "type": "file", + "description": "input ZIP file", + "name": "input_zip_file", + "in": "formData" + }, + { + "type": "string", + "description": "git repository url", + "name": "git_http_url", + "in": "formData" + }, + { + "type": "string", + "description": "the name of user to clone the repository", + "name": "git_user_name", + "in": "formData" + }, + { + "type": "string", + "description": "the name of repository branch", + "name": "git_branch_name", + "in": "formData" + }, + { + "type": "string", + "description": "the password corresponding to git_user_name", + "name": "git_user_password", + "in": "formData" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/CreateSQLAuditRecordResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_audit_records/tag_tips": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql audit record tag tips", + "tags": [ + "sql_audit_record" + ], + "summary": "获取SQL审核记录标签列表", + "operationId": "GetSQLAuditRecordTagTipsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSQLAuditRecordTagTipsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_audit_records/{sql_audit_record_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql audit record info", + "tags": [ + "sql_audit_record" + ], + "summary": "获取SQL审核记录信息", + "operationId": "getSQLAuditRecordV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql audit record id", + "name": "sql_audit_record_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSQLAuditRecordResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update SQL audit record", + "consumes": [ + "application/json" + ], + "tags": [ + "sql_audit_record" + ], + "summary": "更新SQL审核记录", + "operationId": "updateSQLAuditRecordV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql audit record id", + "name": "sql_audit_record_id", + "in": "path", + "required": true + }, + { + "description": "update SQL audit record", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateSQLAuditRecordReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_dev_records": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql dev record list", + "tags": [ + "SqlDEVRecord" + ], + "summary": "获取开发sql记录", + "operationId": "GetSqlDEVRecordList", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy search sql fingerprint", + "name": "fuzzy_search_sql_fingerprint", + "in": "query" + }, + { + "type": "string", + "description": "instance name", + "name": "filter_instance_name", + "in": "query" + }, + { + "enum": [ + "ide_plugin" + ], + "type": "string", + "description": "source", + "name": "filter_source", + "in": "query" + }, + { + "type": "string", + "description": "creator name", + "name": "filter_creator", + "in": "query" + }, + { + "type": "string", + "description": "last receive time from", + "name": "filter_last_receive_time_from", + "in": "query" + }, + { + "type": "string", + "description": "last receive time to", + "name": "filter_last_receive_time_to", + "in": "query" + }, + { + "enum": [ + "first_appear_timestamp", + "last_receive_timestamp", + "fp_count" + ], + "type": "string", + "description": "sort field", + "name": "sort_field", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "sort order", + "name": "sort_order", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSqlDEVRecordListResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_manages": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql manage list", + "tags": [ + "SqlManage" + ], + "summary": "获取管控sql列表", + "operationId": "GetSqlManageList", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy search sql fingerprint", + "name": "fuzzy_search_sql_fingerprint", + "in": "query" + }, + { + "type": "string", + "description": "assignee", + "name": "filter_assignee", + "in": "query" + }, + { + "type": "string", + "description": "instance name", + "name": "filter_instance_name", + "in": "query" + }, + { + "enum": [ + "audit_plan", + "sql_audit_record" + ], + "type": "string", + "description": "source", + "name": "filter_source", + "in": "query" + }, + { + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "type": "string", + "description": "audit level", + "name": "filter_audit_level", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time from", + "name": "filter_last_audit_start_time_from", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time to", + "name": "filter_last_audit_start_time_to", + "in": "query" + }, + { + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited" + ], + "type": "string", + "description": "status", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "rule name", + "name": "filter_rule_name", + "in": "query" + }, + { + "type": "string", + "description": "db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search endpoint", + "name": "fuzzy_search_endpoint", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search schema name", + "name": "fuzzy_search_schema_name", + "in": "query" + }, + { + "enum": [ + "first_appear_timestamp", + "last_receive_timestamp", + "fp_count" + ], + "type": "string", + "description": "sort field", + "name": "sort_field", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "sort order", + "name": "sort_order", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSqlManageListResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_manages/abnormal_audit_plan_instance": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get the instance of audit plan execution abnormal", + "tags": [ + "SqlManage" + ], + "summary": "获取执行异常的扫描任务实例", + "operationId": "getAbnormalInstanceAuditPlansV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAbnormalAuditPlanInstancesResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_manages/batch": { + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "batch update sql manage", + "tags": [ + "SqlManage" + ], + "summary": "批量更新SQL管控", + "operationId": "BatchUpdateSqlManage", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "batch update sql manage request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BatchUpdateSqlManageReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_manages/exports": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "export sql manage", + "tags": [ + "SqlManage" + ], + "summary": "导出SQL管控", + "operationId": "exportSqlManageV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy search sql fingerprint", + "name": "fuzzy_search_sql_fingerprint", + "in": "query" + }, + { + "type": "string", + "description": "assignee", + "name": "filter_assignee", + "in": "query" + }, + { + "type": "string", + "description": "filter by business", + "name": "filter_business", + "in": "query" + }, + { + "enum": [ + "high", + "low" + ], + "type": "string", + "description": "priority", + "name": "filter_priority", + "in": "query" + }, + { + "type": "string", + "description": "instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "audit_plan", + "sql_audit_record" + ], + "type": "string", + "description": "source", + "name": "filter_source", + "in": "query" + }, + { + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "type": "string", + "description": "audit level", + "name": "filter_audit_level", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time from", + "name": "filter_last_audit_start_time_from", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time to", + "name": "filter_last_audit_start_time_to", + "in": "query" + }, + { + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited" + ], + "type": "string", + "description": "status", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "rule name", + "name": "filter_rule_name", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search endpoint", + "name": "fuzzy_search_endpoint", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search schema name", + "name": "fuzzy_search_schema_name", + "in": "query" + }, + { + "enum": [ + "first_appear_timestamp", + "last_receive_timestamp", + "fp_count" + ], + "type": "string", + "description": "sort field", + "name": "sort_field", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "sort order", + "name": "sort_order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "export sql manage", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_manages/rule_tips": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql manage rule tips", + "tags": [ + "SqlManage" + ], + "summary": "获取管控规则tips", + "operationId": "GetSqlManageRuleTips", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSqlManageRuleTipsResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_manages/send": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql manage analysis", + "tags": [ + "SqlManage" + ], + "summary": "推送SQL管控结果到外部系统", + "operationId": "SendSqlManage", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "batch update sql manage request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SqlManageCodingReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/PostSqlManageCodingResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_manages/{sql_manage_id}/sql_analysis": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql manage analysis", + "tags": [ + "SqlManage" + ], + "summary": "获取SQL管控SQL分析", + "operationId": "GetSqlManageSqlAnalysisV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql manage id", + "name": "sql_manage_id", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "whether to calculate and return affected rows, default is true", + "name": "affectRowsEnabled", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSqlManageSqlAnalysisResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_manages/{sql_manage_id}/sql_analysis_chart": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql manage analysis", + "tags": [ + "SqlManage" + ], + "summary": "获取SQL管控SQL执行计划Cost趋势图表", + "operationId": "GetSqlManageSqlAnalysisChartV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql manage id", + "name": "sql_manage_id", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "latest_point_enabled", + "name": "latest_point_enabled", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "start time", + "name": "start_time", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "end time", + "name": "end_time", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "metric_name", + "name": "metric_name", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SqlManageAnalysisChartResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_optimization_records": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql optimization records", + "tags": [ + "sql_optimization" + ], + "summary": "获取SQL优化记录列表", + "operationId": "getOptimizationRecords", + "parameters": [ + { + "type": "string", + "description": "fuzzy search for optimization_id or create_username", + "name": "fuzzy_search", + "in": "query" + }, + { + "type": "string", + "description": "filter instance name", + "name": "filter_instance_name", + "in": "query" + }, + { + "type": "string", + "description": "filter create time from", + "name": "filter_create_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter create time to", + "name": "filter_create_time_to", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetOptimizationRecordsRes" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "optimize sql\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.\n4. file[input_zip_file]: it is ZIP file that sql will be parsed from xml or sql file inside it.\n5. formData[git_http_url]:the url which scheme is http(s) and end with .git.\n6. formData[git_user_name]:The name of the user who owns the repository read access.\n7. formData[git_user_password]:The password corresponding to git_user_name.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sql_optimization" + ], + "summary": "优化SQL", + "operationId": "OptimizeSQLReq", + "parameters": [ + { + "description": "sqls that should be optimization", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/OptimizeSQLReq" + } + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "formData" + }, + { + "type": "string", + "description": "schema of instance", + "name": "schema_name", + "in": "formData" + }, + { + "type": "string", + "description": "db type of instance", + "name": "db_type", + "in": "formData" + }, + { + "type": "string", + "description": "sqls for audit", + "name": "sql_content", + "in": "formData" + }, + { + "type": "string", + "description": "optimization name", + "name": "optimization_name", + "in": "formData", + "required": true + }, + { + "type": "file", + "description": "input SQL file", + "name": "input_sql_file", + "in": "formData" + }, + { + "type": "file", + "description": "input mybatis XML file", + "name": "input_mybatis_xml_file", + "in": "formData" + }, + { + "type": "file", + "description": "input ZIP file", + "name": "input_zip_file", + "in": "formData" + }, + { + "type": "string", + "description": "git repository url", + "name": "git_http_url", + "in": "formData" + }, + { + "type": "string", + "description": "the name of user to clone the repository", + "name": "git_user_name", + "in": "formData" + }, + { + "type": "string", + "description": "the password corresponding to git_user_name", + "name": "git_user_password", + "in": "formData" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/OptimizeSQLRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_optimization_records/{optimization_record_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql optimization record", + "tags": [ + "sql_optimization" + ], + "summary": "获取SQL优化记录", + "operationId": "GetOptimizationRecordReq", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql optimization record id", + "name": "optimization_record_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql", + "name": "sql", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetOptimizationRecordRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_optimization_records/{optimization_record_id}/sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql optimization sqls", + "tags": [ + "sql_optimization" + ], + "summary": "获取SQL优化语句列表", + "operationId": "getOptimizationSQLs", + "parameters": [ + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "optimization record id", + "name": "optimization_record_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetOptimizationSQLsRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_optimization_records/{optimization_record_id}/sqls/{number}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql optimization record", + "tags": [ + "sql_optimization" + ], + "summary": "获取SQL优化语句详情", + "operationId": "GetOptimizationReq", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql optimization record id", + "name": "optimization_record_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "optimization record sql number", + "name": "number", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetOptimizationSQLRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_performance_insights": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql manage sql performance insights", + "tags": [ + "SqlInsight" + ], + "summary": "获取SQL管控SQL性能洞察图表数据", + "operationId": "GetSqlPerformanceInsights", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "enum": [ + "comprehensive_trend", + "slow_sql_trend", + "top_sql_trend", + "active_session_trend" + ], + "type": "string", + "description": "metric name", + "name": "metric_name", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "start time", + "name": "start_time", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "end time", + "name": "end_time", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "instance id", + "name": "instance_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSqlPerformanceInsightsResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_performance_insights/related_sql": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Get related SQL for the selected time range in SQL performance insights", + "tags": [ + "SqlInsight" + ], + "summary": "获取sql洞察 时间选区 的关联SQL", + "operationId": "GetSqlPerformanceInsightsRelatedSQL", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance id", + "name": "instance_id", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "start time", + "name": "start_time", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "end time", + "name": "end_time", + "in": "query", + "required": true + }, + { + "enum": [ + "workflow", + "sql_manage", + "workbench" + ], + "type": "string", + "description": "filter by SQL source", + "name": "filter_source", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "order by field", + "name": "order_by", + "in": "query" + }, + { + "type": "boolean", + "description": "is ascending order", + "name": "is_asc", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSqlPerformanceInsightsRelatedSQLResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_performance_insights/related_sql/related_transaction": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Get related transaction for the selected SQL in SQL performance insights", + "tags": [ + "SqlInsight" + ], + "summary": "获取sql洞察 相关SQL中具体一条SQL 的关联事务", + "operationId": "GetSqlPerformanceInsightsRelatedTransaction", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance id", + "name": "instance_id", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "sql id", + "name": "sql_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSqlPerformanceInsightsRelatedTransactionResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_versions": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "sql version list", + "consumes": [ + "application/json" + ], + "tags": [ + "sql_version" + ], + "summary": "获取SQL版本列表", + "operationId": "getSqlVersionListV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter by created at from", + "name": "filter_by_created_at_from", + "in": "query" + }, + { + "type": "string", + "description": "filter by created at to", + "name": "filter_by_created_at_to", + "in": "query" + }, + { + "type": "string", + "description": "filter by lock time from", + "name": "filter_by_lock_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter by lock time to", + "name": "filter_by_lock_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter by version status", + "name": "filter_by_version_status", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search", + "name": "fuzzy_search", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSqlVersionListResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create sql version", + "consumes": [ + "application/json" + ], + "tags": [ + "sql_version" + ], + "summary": "创建SQL版本记录", + "operationId": "createSqlVersionV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "create sql version request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateSqlVersionReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/CreateSqlVersionResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_versions/{sql_version_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql version detail", + "tags": [ + "sql_version" + ], + "summary": "获取SQL版本详情", + "operationId": "getSqlVersionDetailV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSqlVersionDetailResV1" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete sql version", + "tags": [ + "sql_version" + ], + "summary": "删除SQL版本", + "operationId": "deleteSqlVersionV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update sql version", + "tags": [ + "sql_version" + ], + "summary": "更新SQL版本信息", + "operationId": "updateSqlVersionV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + }, + { + "description": "update sql version request", + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/UpdateSqlVersionReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_versions/{sql_version_id}/batch_execute_workflows": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "batch execute workflows", + "tags": [ + "sql_version" + ], + "summary": "工单批量上线", + "operationId": "batchExecuteWorkflowsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + }, + { + "description": "batch execute workflows request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BatchExecuteWorkflowsReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_versions/{sql_version_id}/batch_release_workflows": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "batch release workflow", + "tags": [ + "sql_version" + ], + "summary": "批量发布工单(在版本的下一阶段创建工单)", + "operationId": "batchReleaseWorkflowsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + }, + { + "description": "batch release workflow request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BatchReleaseWorkflowReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_versions/{sql_version_id}/lock": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "lock sql version", + "tags": [ + "sql_version" + ], + "summary": "锁定SQL版本", + "operationId": "lockSqlVersionV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + }, + { + "description": "lock sql version request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/LockSqlVersionReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_versions/{sql_version_id}/sql_version_stages/{sql_version_stage_id}/associate_workflows": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflows that can be associated to version", + "tags": [ + "sql_version" + ], + "summary": "获取可与版本关联的工单", + "operationId": "GetWorkflowsThatCanBeAssociatedToVersionV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version stage id", + "name": "sql_version_stage_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowsThatCanBeAssociatedToVersionResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "batch associate workflows with version", + "tags": [ + "sql_version" + ], + "summary": "批量关联工单到版本", + "operationId": "batchAssociateWorkflowsWithVersionV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version stage id", + "name": "sql_version_stage_id", + "in": "path", + "required": true + }, + { + "description": "batch associate workflows with version request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BatchAssociateWorkflowsWithVersionReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_versions/{sql_version_id}/sql_version_stages/{sql_version_stage_id}/dependencies": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get dependencies between stage instance", + "tags": [ + "sql_version" + ], + "summary": "获取当前阶段与下一阶段实例的依赖信息", + "operationId": "getDependenciesBetweenStageInstanceV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version stage id", + "name": "sql_version_stage_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetDepBetweenStageInstanceResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/audit_plans": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "statistic audit plan", + "tags": [ + "statistic" + ], + "summary": "获取各类型数据源上的扫描任务数量", + "operationId": "statisticAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/StatisticAuditPlanResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/audited_sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "statistics audited sql", + "tags": [ + "statistic" + ], + "summary": "获取审核SQL总数,以及触发审核规则的SQL数量", + "operationId": "statisticsAuditedSQLV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/StatisticsAuditedSQLResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/instance_health": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance health", + "tags": [ + "statistic" + ], + "summary": "获取各类型数据源的健康情况", + "operationId": "GetInstanceHealthV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetInstanceHealthResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/optimization_performance_improve_overview": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get db optimization performance improvements", + "tags": [ + "sql_optimization" + ], + "summary": "获取实例性能提升概览", + "operationId": "getDBPerformanceImproveOverview", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetDBPerformanceImproveOverviewResp" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/optimization_record_overview": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql optimization record overview", + "tags": [ + "sql_optimization" + ], + "summary": "获取SQL优化记录概览", + "operationId": "getOptimizationOverview", + "parameters": [ + { + "type": "string", + "description": "create time from", + "name": "filter_create_time_from", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "create time to", + "name": "filter_create_time_to", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetOptimizationOverviewResp" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/project_score": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get project score", + "tags": [ + "statistic" + ], + "summary": "获取项目分数", + "operationId": "GetProjectScoreV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetProjectScoreResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/risk_audit_plans": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get risk audit plan", + "tags": [ + "statistic" + ], + "summary": "获取扫描任务报告评分低于60的扫描任务", + "operationId": "getRiskAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetRiskAuditPlanResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/risk_workflow": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "statistic risk workflow", + "tags": [ + "statistic" + ], + "summary": "获取存在风险的工单", + "operationId": "statisticRiskWorkflowV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/StatisticRiskWorkflowResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/role_user": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get role user count", + "tags": [ + "statistic" + ], + "summary": "获取各角色类型对应的成员数量", + "operationId": "getRoleUserCountV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetRoleUserCountResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/workflow_status": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "statistic workflow status", + "tags": [ + "statistic" + ], + "summary": "获取项目下工单各个状态的数量", + "operationId": "statisticWorkflowStatusV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowStatusCountResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get project statistics", + "tags": [ + "statistic" + ], + "summary": "获取项目统计信息", + "operationId": "getProjectStatisticsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetProjectStatisticsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/task_groups": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create tasks group.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "创建审核任务组", + "operationId": "createAuditTasksV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "parameters for creating audit tasks group", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateAuditTasksGroupReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/CreateAuditTasksGroupResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/tasks/audits": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create and audit a task, you can upload sql content in three ways, any one can be used, but only one is effective.\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "创建Sql扫描任务并提交审核", + "operationId": "createAndAuditTaskV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "schema of instance", + "name": "instance_schema", + "in": "formData" + }, + { + "type": "boolean", + "description": "enable backup", + "name": "enable_backup", + "in": "formData" + }, + { + "type": "integer", + "description": "backup max rows", + "name": "backup_max_rows", + "in": "formData" + }, + { + "type": "string", + "description": "sqls for audit", + "name": "sql", + "in": "formData" + }, + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "formData" + }, + { + "type": "file", + "description": "input SQL file", + "name": "input_sql_file", + "in": "formData" + }, + { + "type": "file", + "description": "input mybatis XML file", + "name": "input_mybatis_xml_file", + "in": "formData" + }, + { + "type": "file", + "description": "input ZIP file", + "name": "input_zip_file", + "in": "formData" + }, + { + "type": "string", + "description": "exec mode", + "name": "exec_mode", + "in": "formData" + }, + { + "type": "string", + "description": "file order method", + "name": "file_order_method", + "in": "formData" + }, + { + "description": "create and audit task", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateAuditTaskReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditTaskResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/workflow_template": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow template detail; query by workflow_template_id or by workflow_type default template", + "tags": [ + "workflow" + ], + "summary": "获取审批流程模板详情", + "operationId": "getWorkflowTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "enum": [ + "workflow", + "data_export" + ], + "type": "string", + "description": "filter workflow type", + "name": "workflow_type", + "in": "query" + }, + { + "type": "integer", + "description": "workflow template id", + "name": "workflow_template_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowTemplateResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/workflow_template/{workflow_type}/": { + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update the workflow template", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "更新Sql审批流程模板", + "operationId": "updateWorkflowTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "enum": [ + "workflow", + "data_export" + ], + "type": "string", + "description": "workflow type", + "name": "workflow_type", + "in": "path", + "required": true + }, + { + "description": "create workflow template", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateWorkflowTemplateReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflow_templates": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow template list", + "tags": [ + "workflow" + ], + "summary": "获取审批流程模板列表", + "operationId": "getWorkflowTemplateListV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "enum": [ + "workflow", + "data_export" + ], + "type": "string", + "description": "filter workflow type", + "name": "workflow_type", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowTemplateListResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create workflow template", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "创建审批流程模板", + "operationId": "createWorkflowTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "create workflow template", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateWorkflowTemplateReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowTemplateResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/workflow_templates/{workflow_template_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow template by id", + "tags": [ + "workflow" + ], + "summary": "根据ID获取审批流程模板详情", + "operationId": "getWorkflowTemplateByIdV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "workflow template id", + "name": "workflow_template_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowTemplateResV1" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete workflow template by id", + "tags": [ + "workflow" + ], + "summary": "删除审批流程模板", + "operationId": "deleteWorkflowTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "workflow template id", + "name": "workflow_template_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update workflow template by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "根据ID更新审批流程模板", + "operationId": "updateWorkflowTemplateByIdV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "workflow template id", + "name": "workflow_template_id", + "in": "path", + "required": true + }, + { + "description": "update workflow template", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateWorkflowTemplateByIdReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow list", + "tags": [ + "workflow" + ], + "summary": "获取工单列表", + "operationId": "getWorkflowsV1", + "parameters": [ + { + "type": "string", + "description": "filter subject", + "name": "filter_subject", + "in": "query" + }, + { + "type": "string", + "description": "filter by workflow_id", + "name": "filter_workflow_id", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search by workflow description", + "name": "fuzzy_search_workflow_desc", + "in": "query" + }, + { + "type": "string", + "description": "filter create time from", + "name": "filter_create_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter create time to", + "name": "filter_create_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter_task_execute_start_time_from", + "name": "filter_task_execute_start_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter_task_execute_start_time_to", + "name": "filter_task_execute_start_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "executing", + "canceled", + "exec_failed", + "finished" + ], + "type": "string", + "description": "filter workflow status", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "filter current step assignee user id", + "name": "filter_current_step_assignee_user_id", + "in": "query" + }, + { + "type": "string", + "description": "filter instance id", + "name": "filter_task_instance_id", + "in": "query" + }, + { + "type": "string", + "description": "filter sql version id", + "name": "filter_sql_version_id", + "in": "query" + }, + { + "type": "integer", + "description": "filter workflow template id", + "name": "filter_workflow_template_id", + "in": "query" + }, + { + "type": "string", + "description": "filter by ops type dictionary item uid; empty means no filter", + "name": "filter_by_ops_type_uid", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy matching subject/workflow_id", + "name": "fuzzy_keyword", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowsResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create workflow", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "创建工单", + "operationId": "createWorkflowV1", + "deprecated": true, + "parameters": [ + { + "description": "create workflow request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateWorkflowReqV1" + } + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/auto_create_and_execute": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "auto create task group, audit SQL, create workflow, approve and execute workflow (sys user only)", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "自动创建工单、审核SQL、审批和上线工单(仅sys用户)", + "operationId": "autoCreateAndExecuteWorkflowV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instances JSON array", + "name": "instances", + "in": "formData", + "required": true + }, + { + "enum": [ + "sql_file", + "sqls" + ], + "type": "string", + "description": "exec mode", + "name": "exec_mode", + "in": "formData" + }, + { + "type": "string", + "description": "file order method", + "name": "file_order_method", + "in": "formData" + }, + { + "type": "string", + "description": "sqls for audit", + "name": "sql", + "in": "formData" + }, + { + "type": "string", + "description": "workflow subject", + "name": "workflow_subject", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "workflow description", + "name": "desc", + "in": "formData" + }, + { + "type": "file", + "description": "input SQL file", + "name": "input_sql_file", + "in": "formData" + }, + { + "type": "file", + "description": "input mybatis XML file", + "name": "input_mybatis_xml_file", + "in": "formData" + }, + { + "type": "file", + "description": "input ZIP file", + "name": "input_zip_file", + "in": "formData" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/AutoCreateAndExecuteWorkflowResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/cancel": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "batch cancel workflows", + "tags": [ + "workflow" + ], + "summary": "批量取消工单", + "operationId": "batchCancelWorkflowsV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "batch cancel workflows request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BatchCancelWorkflowsReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/complete": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "this api will directly change the work order status to finished without real online operation", + "tags": [ + "workflow" + ], + "summary": "批量完成工单", + "operationId": "batchCompleteWorkflowsV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "batch complete workflows request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BatchCompleteWorkflowsReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/exports": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "export workflow as CSV or Excel", + "tags": [ + "workflow" + ], + "summary": "导出工单", + "operationId": "exportWorkflowV1", + "parameters": [ + { + "type": "string", + "description": "filter subject", + "name": "filter_subject", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search by workflow description", + "name": "fuzzy_search_workflow_desc", + "in": "query" + }, + { + "type": "string", + "description": "filter create time from", + "name": "filter_create_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter create time to", + "name": "filter_create_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter_task_execute_start_time_from", + "name": "filter_task_execute_start_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter_task_execute_start_time_to", + "name": "filter_task_execute_start_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "executing", + "canceled", + "exec_failed", + "finished" + ], + "type": "string", + "description": "filter workflow status", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "filter current step assignee user id", + "name": "filter_current_step_assignee_user_id", + "in": "query" + }, + { + "type": "string", + "description": "filter instance id", + "name": "filter_task_instance_id", + "in": "query" + }, + { + "type": "string", + "description": "filter by ops type dictionary item uid; empty means no filter", + "name": "filter_by_ops_type_uid", + "in": "query" + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy matching subject/workflow_id/desc", + "name": "fuzzy_keyword", + "in": "query" + }, + { + "enum": [ + "csv", + "excel" + ], + "type": "string", + "description": "export format", + "name": "export_format", + "in": "query" + } + ], + "responses": { + "200": { + "description": "export workflow", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_id}/backup_sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get backup sql list", + "tags": [ + "workflow" + ], + "summary": "获取工单下所有回滚SQL的列表", + "operationId": "GetBackupSqlListV1", + "parameters": [ + { + "enum": [ + "initialized", + "doing", + "succeeded", + "failed", + "manually_executed", + "terminating", + "terminate_succeeded", + "terminate_failed", + "execute_rollback" + ], + "type": "string", + "description": "filter: exec status of task sql", + "name": "filter_exec_status", + "in": "query" + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "filter: instance id in workflow", + "name": "filter_instance_id", + "in": "query" + }, + { + "type": "string", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "page size", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BackupSqlListRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_id}/create_rollback_workflow": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create rollback workflow", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "创建回滚工单", + "operationId": "CreateRollbackWorkflow", + "parameters": [ + { + "description": "create rollback workflow request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateRollbackWorkflowReq" + } + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "origin workflow id to rollback", + "name": "workflow_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/CreateRollbackWorkflowRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/terminate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "terminate multiple task by project and workflow", + "tags": [ + "workflow" + ], + "summary": "终止工单下多个上线任务", + "operationId": "terminateMultipleTaskByWorkflowV1", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/attachment": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow attachment", + "tags": [ + "workflow" + ], + "summary": "获取工单的task附件", + "operationId": "getWorkflowAttachment", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "get workflow attachment", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/backup_files/download": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "download SQL back up file for the audit task", + "tags": [ + "task" + ], + "summary": "下载工单中的SQL备份", + "operationId": "downloadBackupFileV1", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "sql file", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/order_file": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update sql file order", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "修改文件上线顺序", + "operationId": "updateSqlFileOrderV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "description": "instance body v1.UpdateSqlFileOrderV1Req true", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateSqlFileOrderV1Req" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSqlFileOrderMethodResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/re_execute": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "re-execute task on workflow", + "tags": [ + "workflow" + ], + "summary": "单数据源SQL重新上线", + "operationId": "reExecuteTaskOnWorkflowV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "description": "re-execute task on workflow request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReExecuteTaskOnWorkflowReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/terminate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "execute one task on workflow", + "tags": [ + "workflow" + ], + "summary": "终止单个上线任务", + "operationId": "terminateSingleTaskByWorkflowV1", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_name}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow detail", + "tags": [ + "workflow" + ], + "summary": "获取工单详情", + "operationId": "getWorkflowV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update workflow when it is rejected to creator.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "更新工单(驳回后才可更新)", + "operationId": "updateWorkflowV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "update workflow request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateWorkflowReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_name}/cancel": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "cancel workflow", + "tags": [ + "workflow" + ], + "summary": "审批关闭(中止)", + "operationId": "cancelWorkflowV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_name}/steps/{workflow_step_id}/approve": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "approve workflow", + "tags": [ + "workflow" + ], + "summary": "审批通过", + "operationId": "approveWorkflowV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow step id", + "name": "workflow_step_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_name}/steps/{workflow_step_id}/reject": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "reject workflow", + "tags": [ + "workflow" + ], + "summary": "审批驳回", + "operationId": "rejectWorkflowV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow step id", + "name": "workflow_step_id", + "in": "path", + "required": true + }, + { + "description": "workflow approve request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RejectWorkflowReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_name}/tasks": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get summary of workflow instance tasks", + "tags": [ + "workflow" + ], + "summary": "获取工单数据源任务概览", + "operationId": "getSummaryOfInstanceTasksV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowTasksResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_name}/tasks/execute": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "execute tasks on workflow", + "tags": [ + "workflow" + ], + "summary": "多数据源批量上线", + "operationId": "executeTasksOnWorkflowV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_name}/tasks/{task_id}/execute": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "execute one task on workflow", + "tags": [ + "workflow" + ], + "summary": "工单提交单个数据源上线", + "operationId": "executeOneTaskOnWorkflowV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_name}/tasks/{task_id}/schedule": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update workflow schedule.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "设置工单数据源定时上线时间(设置为空则代表取消定时时间,需要SQL审核流程都通过后才可以设置)", + "operationId": "updateWorkflowScheduleV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "update workflow schedule request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateWorkflowScheduleReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/rule_knowledge/db_types/{db_type}/custom_rules/{rule_name}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get custom rule knowledge", + "tags": [ + "rule_template" + ], + "summary": "查看自定义规则知识库", + "operationId": "getCustomRuleKnowledgeV1", + "parameters": [ + { + "type": "string", + "description": "rule name", + "name": "rule_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "db type of rule", + "name": "db_type", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetRuleKnowledgeResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update custom rule knowledge", + "tags": [ + "rule_template" + ], + "summary": "更新自定义规则知识库", + "operationId": "updateCustomRuleKnowledge", + "parameters": [ + { + "type": "string", + "description": "rule name", + "name": "rule_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "db type of rule", + "name": "db_type", + "in": "path", + "required": true + }, + { + "description": "update rule knowledge", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateRuleKnowledgeReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/rule_knowledge/db_types/{db_type}/rules/{rule_name}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get rule knowledge", + "tags": [ + "rule_template" + ], + "summary": "查看规则知识库", + "operationId": "getRuleKnowledgeV1", + "parameters": [ + { + "type": "string", + "description": "rule name", + "name": "rule_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "db type of rule", + "name": "db_type", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetRuleKnowledgeResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update rule knowledge", + "tags": [ + "rule_template" + ], + "summary": "更新规则知识库", + "operationId": "updateRuleKnowledge", + "parameters": [ + { + "type": "string", + "description": "rule name", + "name": "rule_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "db type of rule", + "name": "db_type", + "in": "path", + "required": true + }, + { + "description": "update rule knowledge", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateRuleKnowledgeReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/rule_template_tips": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global rule template tips", + "tags": [ + "rule_template" + ], + "summary": "获取全局规则模板提示", + "operationId": "getRuleTemplateTipsV1", + "parameters": [ + { + "type": "string", + "description": "filter db type", + "name": "filter_db_type", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetRuleTemplateTipsResV1" + } + } + } + } + }, + "/v1/rule_templates": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get all global rule template", + "tags": [ + "rule_template" + ], + "summary": "全局规则模板列表", + "operationId": "getRuleTemplateListV1", + "parameters": [ + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetRuleTemplatesResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create a global rule template", + "consumes": [ + "application/json" + ], + "tags": [ + "rule_template" + ], + "summary": "添加全局规则模板", + "operationId": "createRuleTemplateV1", + "parameters": [ + { + "description": "add rule template request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateRuleTemplateReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/rule_templates/parse": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "parse rule template", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "rule_template" + ], + "summary": "解析规则模板文件", + "operationId": "importProjectRuleTemplateV1", + "parameters": [ + { + "enum": [ + "csv", + "json" + ], + "type": "string", + "description": "file type", + "name": "file_type", + "in": "formData", + "required": true + }, + { + "type": "file", + "description": "SQLE rule template file", + "name": "rule_template_file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ParseProjectRuleTemplateFileResV1" + } + }, + "400": { + "description": "return error file", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/rule_templates/{rule_template_name}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global rule template", + "tags": [ + "rule_template" + ], + "summary": "获取全局规则模板信息", + "operationId": "getRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy rule,keyword for desc and annotation", + "name": "fuzzy_keyword_rule", + "in": "query" + }, + { + "type": "string", + "description": "tags for rule", + "name": "tags", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetRuleTemplateResV1" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete global rule template", + "tags": [ + "rule_template" + ], + "summary": "删除全局规则模板", + "operationId": "deleteRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update global rule template", + "tags": [ + "rule_template" + ], + "summary": "更新全局规则模板", + "operationId": "updateRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + }, + { + "description": "update rule template request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateRuleTemplateReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/rule_templates/{rule_template_name}/clone": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "clone a rule template", + "consumes": [ + "application/json" + ], + "tags": [ + "rule_template" + ], + "summary": "克隆全局规则模板", + "operationId": "CloneRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + }, + { + "description": "clone rule template request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CloneRuleTemplateReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/rule_templates/{rule_template_name}/export": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "export rule template", + "tags": [ + "rule_template" + ], + "summary": "导出全局规则模板", + "operationId": "exportRuleTemplateV1", + "parameters": [ + { + "enum": [ + "csv", + "json" + ], + "type": "string", + "description": "export type", + "name": "export_type", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "sqle rule template file", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/rules": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get all rule template", + "tags": [ + "rule_template" + ], + "summary": "规则列表", + "operationId": "getRuleListV1", + "parameters": [ + { + "type": "string", + "description": "filter db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy rule,keyword for desc and annotation", + "name": "fuzzy_keyword_rule", + "in": "query" + }, + { + "type": "string", + "description": "filter global rule template name", + "name": "filter_global_rule_template_name", + "in": "query" + }, + { + "type": "string", + "description": "filter rule name list", + "name": "filter_rule_names", + "in": "query" + }, + { + "type": "integer", + "description": "filter rule version", + "name": "filter_rule_version", + "in": "query" + }, + { + "type": "string", + "description": "filter tags", + "name": "tags", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetRulesResV1" + } + } + } + } + }, + "/v1/rules/categoryStatistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get all rule category statistics", + "tags": [ + "rule_template" + ], + "summary": "获取规则分类统计信息", + "operationId": "getCategoryStatistics", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetRuleCategoryStatisticResV1" + } + } + } + } + }, + "/v1/rules_version_tips": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get the rule versions contained in plugins", + "tags": [ + "rule_template" + ], + "summary": "获取插件包含的规则版本", + "operationId": "GetDriverRuleVersionTips", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetDriverRuleVersionTipsResV1" + } + } + } + } + }, + "/v1/sql_analysis": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Direct get sql analysis result", + "tags": [ + "sql_analysis" + ], + "summary": "直接获取SQL分析结果", + "operationId": "directGetSQLAnalysisV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "schema name", + "name": "schema_name", + "in": "query" + }, + { + "type": "string", + "description": "sql", + "name": "sql", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DirectGetSQLAnalysisResV1" + } + } + } + } + }, + "/v1/sql_audit": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Direct audit sql", + "tags": [ + "sql_audit" + ], + "summary": "直接审核SQL", + "operationId": "directAuditV1", + "deprecated": true, + "parameters": [ + { + "description": "sqls that should be audited", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DirectAuditReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DirectAuditResV1" + } + } + } + } + }, + "/v1/sql_lineage_analysis": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Analyze SQL and return column-level lineage", + "tags": [ + "sql_analysis" + ], + "summary": "SQL列级血缘分析", + "operationId": "sqlLineageAnalyzeV1", + "parameters": [ + { + "description": "sql lineage analyze request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SQLLineageAnalyzeReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SQLLineageAnalyzeResV1" + } + } + } + } + }, + "/v1/statistic/instances/resource_overview_statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance overview statistics including average score, high priority SQL count and pending workflow count", + "tags": [ + "statistic" + ], + "summary": "获取实例概览统计信息", + "operationId": "getInstanceOverviewStatisticsV1", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "description": "filter by db service ids", + "name": "filter_by_db_service_ids", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetInstanceOverviewStatisticsRes" + } + } + } + } + }, + "/v1/statistic/instances/sql_average_execution_time": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get average execution time of sql", + "tags": [ + "statistic" + ], + "summary": "获取sql上线平均耗时,按平均耗时降序排列", + "operationId": "getSqlAverageExecutionTimeV1", + "parameters": [ + { + "type": "integer", + "description": "the limit of result item number", + "name": "limit", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSqlAverageExecutionTimeResV1" + } + } + } + } + }, + "/v1/statistic/instances/sql_execution_fail_percent": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql execution fail percent", + "tags": [ + "statistic" + ], + "summary": "获取SQL上线失败率,按失败率降序排列", + "operationId": "getSqlExecutionFailPercentV1", + "parameters": [ + { + "type": "integer", + "description": "the limit of result item number", + "name": "limit", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSqlExecutionFailPercentResV1" + } + } + } + } + }, + "/v1/statistic/instances/type_percent": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get database instances' types percent", + "tags": [ + "statistic" + ], + "summary": "获取数据源类型百分比", + "operationId": "getInstancesTypePercentV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetInstancesTypePercentResV1" + } + } + } + } + }, + "/v1/statistic/license/usage": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get usage of license", + "tags": [ + "statistic" + ], + "summary": "获取License使用情况", + "operationId": "getLicenseUsageV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetLicenseUsageResV1" + } + } + } + } + }, + "/v1/statistic/workflows/audit_pass_percent": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow audit pass percent", + "tags": [ + "statistic" + ], + "summary": "获取工单审核通过率", + "operationId": "getWorkflowAuditPassPercentV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowAuditPassPercentResV1" + } + } + } + } + }, + "/v1/statistic/workflows/counts": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow counts", + "tags": [ + "statistic" + ], + "summary": "获取工单数量统计数据", + "operationId": "getWorkflowCountV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowCountsResV1" + } + } + } + } + }, + "/v1/statistic/workflows/duration_of_waiting_for_audit": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get duration from workflow being created to audited", + "tags": [ + "statistic" + ], + "summary": "获取工单从创建到审核结束的平均时长", + "operationId": "getWorkflowDurationOfWaitingForAuditV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowDurationOfWaitingForAuditResV1" + } + } + } + } + }, + "/v1/statistic/workflows/duration_of_waiting_for_execution": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get duration from workflow being created to executed", + "tags": [ + "statistic" + ], + "summary": "获取工单各从审核完毕到执行上线的平均时长", + "operationId": "getWorkflowDurationOfWaitingForExecutionV1", + "deprecated": true, + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowDurationOfWaitingForExecutionResV1" + } + } + } + } + }, + "/v1/statistic/workflows/each_day_counts": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get counts of created workflow each day", + "tags": [ + "statistic" + ], + "summary": "获取每天工单创建数量", + "operationId": "getWorkflowCreatedCountEachDayV1", + "parameters": [ + { + "type": "string", + "description": "filter date from.(format:yyyy-mm-dd)", + "name": "filter_date_from", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "filter date to.(format:yyyy-mm-dd)", + "name": "filter_date_to", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowCreatedCountsEachDayResV1" + } + } + } + } + }, + "/v1/statistic/workflows/instance_type_percent": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflows percent counted by instance type", + "tags": [ + "statistic" + ], + "summary": "获取按数据源类型统计的工单百分比", + "operationId": "getWorkflowPercentCountedByInstanceTypeV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowPercentCountedByInstanceTypeResV1" + } + } + } + } + }, + "/v1/statistic/workflows/pass_percent": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow pass percent", + "tags": [ + "statistic" + ], + "summary": "获取工单通过率", + "operationId": "getWorkflowPassPercentV1", + "deprecated": true, + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowPassPercentResV1" + } + } + } + } + }, + "/v1/statistic/workflows/rejected_percent_group_by_creator": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflows rejected percent group by creator. The result will be sorted by rejected percent in descending order", + "tags": [ + "statistic" + ], + "summary": "获取各个用户提交的工单驳回率,按驳回率降序排列", + "operationId": "getWorkflowRejectedPercentGroupByCreatorV1", + "parameters": [ + { + "type": "integer", + "description": "the limit of result item number", + "name": "limit", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowRejectedPercentGroupByCreatorResV1" + } + } + } + } + }, + "/v1/statistic/workflows/rejected_percent_group_by_instance": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow rejected percent group by instance. The result will be sorted by rejected percent in descending order", + "tags": [ + "statistic" + ], + "summary": "获取各个数据源相关的工单驳回率,按驳回率降序排列", + "operationId": "getWorkflowRejectedPercentGroupByInstanceV1", + "deprecated": true, + "parameters": [ + { + "type": "integer", + "description": "the limit of result item number", + "name": "limit", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowRejectedPercentGroupByInstanceResV1" + } + } + } + } + }, + "/v1/statistic/workflows/status_count": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get count of workflow status", + "tags": [ + "statistic" + ], + "summary": "获取各种状态工单的数量", + "operationId": "getWorkflowStatusCountV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowStatusCountResV1" + } + } + } + } + }, + "/v1/system/module_red_dots": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get the red dot prompt information in the system", + "tags": [ + "system" + ], + "summary": "查询系统各模块的红点提示信息", + "operationId": "GetSystemModuleRedDots", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSystemModuleRedDotsRes" + } + } + } + } + }, + "/v1/system/module_status": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get module status for module in the system", + "tags": [ + "system" + ], + "summary": "查询系统功能支持情况信息", + "operationId": "getSystemModuleStatus", + "parameters": [ + { + "enum": [ + "MySQL", + "Oracle", + "TiDB", + "OceanBase For MySQL", + "PostgreSQL", + "DB2", + "SQL Server" + ], + "type": "string", + "description": "db type", + "name": "db_type", + "in": "query" + }, + { + "enum": [ + "execute_sql_file_mode", + "sql_optimization", + "backup", + "knowledge_base" + ], + "type": "string", + "description": "module name", + "name": "module_name", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetModuleStatusResV1" + } + } + } + } + }, + "/v1/task_groups/audit": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "audit task group.\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.\n4. file[input_zip_file]: it is zip file, sql will be parsed from it.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "审核任务组", + "operationId": "auditTaskGroupIdV1", + "parameters": [ + { + "type": "integer", + "description": "group id of tasks", + "name": "task_group_id", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "sqls for audit", + "name": "sql", + "in": "formData" + }, + { + "type": "boolean", + "description": "enable backup", + "name": "enable_backup", + "in": "formData" + }, + { + "type": "integer", + "description": "backup max rows", + "name": "backup_max_rows", + "in": "formData" + }, + { + "type": "string", + "description": "file order method", + "name": "file_order_method", + "in": "formData" + }, + { + "type": "file", + "description": "input SQL file", + "name": "input_sql_file", + "in": "formData" + }, + { + "type": "file", + "description": "input mybatis XML file", + "name": "input_mybatis_xml_file", + "in": "formData" + }, + { + "type": "file", + "description": "input ZIP file", + "name": "input_zip_file", + "in": "formData" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/AuditTaskGroupResV1" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get task", + "tags": [ + "task" + ], + "summary": "获取Sql扫描任务信息", + "operationId": "getAuditTaskV1", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditTaskResV1" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/backup_strategy": { + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update back up strategy for all sqls in task", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "更新工单中数据源对应所有SQL的备份策略", + "operationId": "UpdateTaskBackupStrategyV1", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "description": "update back up strategy for sqls in workflow", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateTaskBackupStrategyReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/origin_file": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get SQL origin file of the audit task", + "tags": [ + "task" + ], + "summary": "获取指定审核任务的原始文件", + "operationId": "DownloadAuditFile", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sql_content": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get SQL content for the audit task", + "tags": [ + "task" + ], + "summary": "获取指定扫描任务的SQL内容", + "operationId": "getAuditTaskSQLContentV1", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditTaskSQLContentResV1" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sql_file": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "download SQL file for the audit task", + "tags": [ + "task" + ], + "summary": "下载指定扫描任务的SQL文件", + "operationId": "downloadAuditTaskSQLFileV1", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "sql file", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sql_report": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "download report file of all SQLs information belong to the specified audit task", + "tags": [ + "task" + ], + "summary": "下载指定扫描任务的SQLs信息报告", + "operationId": "downloadAuditTaskSQLReportV1", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "select unique (fingerprint and audit result) for task sql", + "name": "no_duplicate", + "in": "query" + } + ], + "responses": { + "200": { + "description": "sql report csv file", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get information of all SQLs belong to the specified audit task", + "tags": [ + "task" + ], + "summary": "获取指定扫描任务的SQLs信息", + "operationId": "getAuditTaskSQLsV1", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "enum": [ + "initialized", + "doing", + "succeeded", + "failed", + "manually_executed", + "execute_rollback" + ], + "type": "string", + "description": "filter: exec status of task sql", + "name": "filter_exec_status", + "in": "query" + }, + { + "enum": [ + "initialized", + "doing", + "finished" + ], + "type": "string", + "description": "filter: audit status of task sql", + "name": "filter_audit_status", + "in": "query" + }, + { + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "type": "string", + "description": "filter: audit level of task sql", + "name": "filter_audit_level", + "in": "query" + }, + { + "type": "boolean", + "description": "select unique (fingerprint and audit result) for task sql", + "name": "no_duplicate", + "in": "query" + }, + { + "type": "string", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "page size", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditTaskSQLsResV1" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sqls/{number}": { + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "modify the relevant information of a certain SQL in the audit task", + "consumes": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "修改扫描任务中某条SQL的相关信息", + "operationId": "updateAuditTaskSQLsV1", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql number", + "name": "number", + "in": "path", + "required": true + }, + { + "description": "modify the relevant information of a certain SQL in the audit task", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAuditTaskSQLsReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sqls/{number}/analysis": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get SQL explain and related table metadata for analysis", + "tags": [ + "task" + ], + "summary": "获取task相关的SQL执行计划和表元数据", + "operationId": "getTaskAnalysisData", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "sql number", + "name": "number", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetTaskAnalysisDataResV1" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sqls/{number}/rewrite": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "启动特定任务中某条SQL语句的异步重写任务,返回任务状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "启动异步SQL重写任务", + "operationId": "RewriteSQL", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "sql number", + "name": "number", + "in": "path", + "required": true + }, + { + "description": "request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RewriteSQLReq" + } + } + ], + "responses": { + "200": { + "description": "成功启动异步重写任务", + "schema": { + "$ref": "#/definitions/AsyncRewriteTaskStatusRes" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sqls/{number}/rewrite/status": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取特定任务中某条SQL语句的异步重写任务状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "获取异步重写任务状态", + "operationId": "GetAsyncRewriteTaskStatus", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "sql number", + "name": "number", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "成功返回任务状态", + "schema": { + "$ref": "#/definitions/AsyncRewriteTaskStatusRes" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sqls/{sql_id}/backup_strategy": { + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update back up strategy for one sql in workflow", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "更新单条SQL的备份策略", + "operationId": "UpdateSqlBackupStrategyV1", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql id", + "name": "sql_id", + "in": "path", + "required": true + }, + { + "description": "update back up strategy for one sql in workflow", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateSqlBackupStrategyReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v1/tasks/file_order_methods": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get file order method", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "获取文件上线排序方式", + "operationId": "getSqlFileOrderMethodV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSqlFileOrderMethodResV1" + } + } + } + } + }, + "/v1/user_tips": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get user tip list", + "tags": [ + "user" + ], + "summary": "获取用户提示列表", + "operationId": "getUserTipListV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "filter_project", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetUserTipsResV1" + } + } + } + } + }, + "/v1/workflows/statistic_of_instances": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Get Workflows Statistic Of Instances", + "tags": [ + "workflow" + ], + "summary": "获取实例上工单的统计信息", + "operationId": "GetWorkflowStatisticOfInstances", + "parameters": [ + { + "type": "string", + "description": "instance id", + "name": "instance_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowStatisticOfInstancesResV1" + } + } + } + } + }, + "/v2/audit_files": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Direct audit sql from SQL files and MyBatis files", + "tags": [ + "sql_audit" + ], + "summary": "直接从文件内容提取SQL并审核,SQL文件暂时只支持一次解析一个文件", + "operationId": "directAuditFilesV2", + "parameters": [ + { + "description": "files that should be audited", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DirectAuditFileReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DirectAuditResV2" + } + } + } + } + }, + "/v2/configurations/drivers": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get drivers", + "tags": [ + "configuration" + ], + "summary": "获取当前 server 支持的审核类型", + "operationId": "getDriversV2", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetDriversRes" + } + } + } + } + }, + "/v2/dashboard/accounts": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global account list with filtering and pagination.\nPagination: page_index is 1-based; offset is (page_index-1)*page_size. Values of page_index less than 1 are normalized to 1; page_size less than 1 may fall back to a default on the server.", + "tags": [ + "GlobalDashboard" + ], + "summary": "获取全局账号管理列表", + "operationId": "GetGlobalAccountListV2", + "parameters": [ + { + "type": "integer", + "description": "1-based page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "Number of items per page", + "name": "page_size", + "in": "query", + "required": true + }, + { + "enum": [ + "expiring_soon", + "active" + ], + "type": "string", + "description": "filter by card; expiring_soon 即将过期, active 我的可用账号", + "name": "filter_card", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search keyword", + "name": "keyword", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_instance_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GlobalAccountListResV2" + } + } + } + } + }, + "/v2/dashboard/accounts/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global account statistics;", + "tags": [ + "GlobalDashboard" + ], + "summary": "获取全局账号管理统计数据", + "operationId": "GetGlobalAccountStatisticsV2", + "parameters": [ + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_instance_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GlobalAccountStatisticsResV2" + } + } + } + } + }, + "/v2/dashboard/sql_manage/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global sql manage statistics;", + "tags": [ + "GlobalDashboard" + ], + "summary": "获取全局 SQL 治理统计看板", + "operationId": "GetGlobalSqlManageStatisticsV2", + "parameters": [ + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_instance_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GlobalSqlManageStatisticsResV2" + } + } + } + } + }, + "/v2/dashboard/sql_manage/tasks": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global sql manage task list with filtering and pagination.\nPagination: 1-based page_index with offset (page_index-1)*page_size; page_index and page_size are required query parameters (non-zero).", + "tags": [ + "GlobalDashboard" + ], + "summary": "获取全局 SQL 治理任务列表", + "operationId": "GetGlobalSqlManageTaskListV2", + "parameters": [ + { + "type": "integer", + "description": "1-based page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "Number of items per page", + "name": "page_size", + "in": "query", + "required": true + }, + { + "enum": [ + "pending", + "optimized" + ], + "type": "string", + "description": "filter by card; pending 待我优化, optimized 优化完成", + "name": "filter_card", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search keyword", + "name": "keyword", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_instance_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GlobalSqlManageTaskListResV2" + } + } + } + } + }, + "/v2/dashboard/workflows": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global workflow list with filtering and pagination.\nPagination uses two mutually exclusive modes. Aggregate mode (omit workflow_type): merge sql_release and data_export ordered by time; use cursor (empty on first request, then data.next_cursor from the previous response) and page_size; page_index is not used for paging. Single-type mode (workflow_type set): list only that type with standard page_index (1-based) and page_size; cursor is ignored. Do not rely on mixing cursor tokens with workflow_type in one flow.", + "tags": [ + "GlobalDashboard" + ], + "summary": "获取全局工单管理列表", + "operationId": "GetGlobalWorkflowListV2", + "parameters": [ + { + "type": "string", + "description": "Aggregate mode only (omit workflow_type): opaque cursor string; leave empty on the first request, then pass the previous response's data.next_cursor. Ignored when workflow_type is set.", + "name": "cursor", + "in": "query" + }, + { + "type": "integer", + "description": "Page size; required in both aggregate and single-type modes.", + "name": "page_size", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "Single-type mode only (workflow_type set): 1-based page index. When workflow_type is omitted, this value is ignored for pagination (use cursor instead).", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "fuzzy search keyword", + "name": "keyword", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "archived", + "pending_for_me", + "initiated_by_me", + "view_all" + ], + "type": "string", + "description": "filter by card type; archived 已完成工单, pending_for_me 待我处理, initiated_by_me 我发起, view_all 查看全部", + "name": "filter_card", + "in": "query" + }, + { + "enum": [ + "sql_release", + "data_export" + ], + "type": "string", + "description": "filter by workflow type; sql_release SQL上线工单, data_export 数据导出工单", + "name": "workflow_type", + "in": "query" + }, + { + "enum": [ + "pending_approval", + "pending_action", + "in_progress", + "exporting", + "rejected", + "cancelled", + "failed", + "completed", + "unknown" + ], + "type": "string", + "description": "filter by unified workflow status; intersects with the card status set, applied to both sql_release and data_export workflows", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "filter by update time from", + "name": "filter_update_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter by update time to", + "name": "filter_update_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter by create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "type": "string", + "description": "filter create time from", + "name": "filter_create_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter create time to", + "name": "filter_create_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter by ops type dictionary item uid; empty means no filter; applies to sql_release and data_export", + "name": "filter_by_ops_type_uid", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GlobalWorkflowListResV2" + } + } + } + } + }, + "/v2/dashboard/workflows/exports": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "export global dashboard workflows as CSV or Excel; filter/permission semantics match GET /v2/dashboard/workflows (no pagination). workflow_type=sql_release|data_export|omit(common columns with workflow type). First column includes project name for global layouts. Max 10000 workflows (sum of both types when workflow_type omitted).", + "tags": [ + "GlobalDashboard" + ], + "summary": "导出全局工单管理列表", + "operationId": "ExportGlobalWorkflowsV2", + "parameters": [ + { + "type": "string", + "description": "fuzzy search keyword", + "name": "keyword", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "archived", + "pending_for_me", + "initiated_by_me", + "view_all" + ], + "type": "string", + "description": "filter by card type; archived 已完成工单, pending_for_me 待我处理, initiated_by_me 我发起, view_all 查看全部", + "name": "filter_card", + "in": "query" + }, + { + "enum": [ + "sql_release", + "data_export" + ], + "type": "string", + "description": "sql_release SQL上线完整列; data_export 数据导出列; omit/empty 全量公共列(含工单类型)", + "name": "workflow_type", + "in": "query" + }, + { + "enum": [ + "pending_approval", + "pending_action", + "in_progress", + "exporting", + "rejected", + "cancelled", + "failed", + "completed", + "unknown" + ], + "type": "string", + "description": "filter by unified workflow status", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "filter by update time from", + "name": "filter_update_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter by update time to", + "name": "filter_update_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter by create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "type": "string", + "description": "filter create time from", + "name": "filter_create_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter create time to", + "name": "filter_create_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter by ops type dictionary item uid; empty means no filter; applies to sql_release and data_export; same semantics as GET /v2/dashboard/workflows", + "name": "filter_by_ops_type_uid", + "in": "query" + }, + { + "enum": [ + "csv", + "excel" + ], + "type": "string", + "description": "export format: csv or excel, default csv", + "name": "export_format", + "in": "query" + } + ], + "responses": { + "200": { + "description": "export workflow", + "schema": { + "type": "file" + } + } + } + } + }, + "/v2/dashboard/workflows/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global workflow statistics, returns archived, pending_for_me, initiated_by_me, and view_all counts", + "tags": [ + "GlobalDashboard" + ], + "summary": "获取全局工单管理统计数据", + "operationId": "GetGlobalWorkflowStatisticsV2", + "parameters": [ + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_instance_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GlobalWorkflowStatisticsResV2" + } + } + } + } + }, + "/v2/projects/{project_name}/audit_plans": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan info list", + "tags": [ + "audit_plan" + ], + "summary": "获取扫描任务信息列表", + "operationId": "getAuditPlansV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter audit plan db type", + "name": "filter_audit_plan_db_type", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search audit plan name", + "name": "fuzzy_search_audit_plan_name", + "in": "query" + }, + { + "type": "string", + "description": "filter audit plan type", + "name": "filter_audit_plan_type", + "in": "query" + }, + { + "type": "string", + "description": "filter audit plan instance name", + "name": "filter_audit_plan_instance_name", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditPlansResV2" + } + } + } + } + }, + "/v2/projects/{project_name}/audit_plans/{audit_plan_id}/sqls/upload": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "upload intance audit plan SQLs", + "tags": [ + "instance_audit_plan" + ], + "summary": "同步SQL到扫描任务", + "operationId": "UploadInstanceAuditPlanSQLsV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan id", + "name": "audit_plan_id", + "in": "path", + "required": true + }, + { + "description": "upload instance audit plan SQLs request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UploadInstanceAuditPlanSQLsReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan report SQLs", + "tags": [ + "audit_plan" + ], + "summary": "获取指定扫描任务的SQL扫描详情", + "operationId": "getAuditPlanReportsSQLs", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan report id", + "name": "audit_plan_report_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditPlanReportSQLsResV2" + } + } + } + } + }, + "/v2/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls/{number}/analysis": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get SQL explain and related table metadata for analysis", + "tags": [ + "audit_plan" + ], + "summary": "获取task相关的SQL执行计划和表元数据", + "operationId": "getAuditPlantAnalysisDataV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan report id", + "name": "audit_plan_report_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql number", + "name": "number", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditPlanAnalysisDataResV2" + } + } + } + } + }, + "/v2/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/full": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "full sync audit plan SQLs", + "tags": [ + "audit_plan" + ], + "summary": "全量同步SQL到扫描任务", + "operationId": "fullSyncAuditPlanSQLsV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "description": "full sync audit plan SQLs request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/FullSyncAuditPlanSQLsReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/partial": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "partial sync audit plan SQLs", + "tags": [ + "audit_plan" + ], + "summary": "增量同步SQL到扫描任务", + "operationId": "partialSyncAuditPlanSQLsV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "description": "partial sync audit plan SQLs request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PartialSyncAuditPlanSQLsReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/instance_audit_plans": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance audit plan info list", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取实例扫描任务列表", + "operationId": "getInstanceAuditPlansV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter by environment tag", + "name": "filter_by_environment_tag", + "in": "query" + }, + { + "type": "string", + "description": "filter by db type", + "name": "filter_by_db_type", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_by_instance_id", + "in": "query" + }, + { + "type": "string", + "description": "filter instance audit plan type", + "name": "filter_by_audit_plan_type", + "in": "query" + }, + { + "type": "string", + "description": "filter instance audit plan active status", + "name": "filter_by_active_status", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search", + "name": "fuzzy_search", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetInstanceAuditPlansRes" + } + } + } + } + }, + "/v2/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance audit plan detail", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取实例扫描任务详情", + "operationId": "getInstanceAuditPlanDetailV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetInstanceAuditPlanDetailRes" + } + } + } + } + }, + "/v2/projects/{project_name}/instance_tips": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance tip list", + "tags": [ + "instance" + ], + "summary": "获取实例提示列表", + "operationId": "getInstanceTipListV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "filter by environment tag", + "name": "filter_by_environment_tag", + "in": "query" + }, + { + "type": "string", + "description": "filter workflow template id", + "name": "filter_workflow_template_id", + "in": "query" + }, + { + "enum": [ + "create_audit_plan", + "create_workflow", + "sql_manage", + "create_optimization", + "create_pipeline", + "create_version", + "view_sql_insight" + ], + "type": "string", + "description": "functional module", + "name": "functional_module", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetInstanceTipsResV2" + } + } + } + } + }, + "/v2/projects/{project_name}/instances/{instance_name}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance db", + "tags": [ + "instance" + ], + "summary": "获取实例信息", + "operationId": "getInstanceV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetInstanceResV2" + } + } + } + } + }, + "/v2/projects/{project_name}/sql_manages": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql manage list", + "tags": [ + "SqlManage" + ], + "summary": "获取管控sql列表", + "operationId": "GetSqlManageListV2", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy search sql fingerprint", + "name": "fuzzy_search_sql_fingerprint", + "in": "query" + }, + { + "type": "string", + "description": "assignee", + "name": "filter_assignee", + "in": "query" + }, + { + "type": "string", + "description": "instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "audit_plan", + "sql_audit_record" + ], + "type": "string", + "description": "source", + "name": "filter_source", + "in": "query" + }, + { + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "type": "string", + "description": "audit level", + "name": "filter_audit_level", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time from", + "name": "filter_last_audit_start_time_from", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time to", + "name": "filter_last_audit_start_time_to", + "in": "query" + }, + { + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited", + "sent" + ], + "type": "string", + "description": "status", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "rule name", + "name": "filter_rule_name", + "in": "query" + }, + { + "type": "string", + "description": "db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "filter by business", + "name": "filter_business", + "in": "query" + }, + { + "type": "string", + "description": "filter by environment tag", + "name": "filter_by_environment_tag", + "in": "query" + }, + { + "enum": [ + "high", + "low" + ], + "type": "string", + "description": "priority", + "name": "filter_priority", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search endpoint", + "name": "fuzzy_search_endpoint", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search schema name", + "name": "fuzzy_search_schema_name", + "in": "query" + }, + { + "enum": [ + "first_appear_timestamp", + "last_receive_timestamp", + "fp_count" + ], + "type": "string", + "description": "sort field", + "name": "sort_field", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "sort order", + "name": "sort_order", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSqlManageListResp" + } + } + } + } + }, + "/v2/projects/{project_name}/sql_manages/exports": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "export sql manage as CSV or Excel", + "tags": [ + "SqlManage" + ], + "summary": "导出SQL管控", + "operationId": "exportSqlManageV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy search sql fingerprint", + "name": "fuzzy_search_sql_fingerprint", + "in": "query" + }, + { + "type": "string", + "description": "assignee", + "name": "filter_assignee", + "in": "query" + }, + { + "type": "string", + "description": "filter by environment tag", + "name": "filter_by_environment_tag", + "in": "query" + }, + { + "enum": [ + "high", + "low" + ], + "type": "string", + "description": "priority", + "name": "filter_priority", + "in": "query" + }, + { + "type": "string", + "description": "instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "audit_plan", + "sql_audit_record" + ], + "type": "string", + "description": "source", + "name": "filter_source", + "in": "query" + }, + { + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "type": "string", + "description": "audit level", + "name": "filter_audit_level", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time from", + "name": "filter_last_audit_start_time_from", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time to", + "name": "filter_last_audit_start_time_to", + "in": "query" + }, + { + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited" + ], + "type": "string", + "description": "status", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "rule name", + "name": "filter_rule_name", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search endpoint", + "name": "fuzzy_search_endpoint", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search schema name", + "name": "fuzzy_search_schema_name", + "in": "query" + }, + { + "enum": [ + "first_appear_timestamp", + "last_receive_timestamp", + "fp_count" + ], + "type": "string", + "description": "sort field", + "name": "sort_field", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "sort order", + "name": "sort_order", + "in": "query" + }, + { + "enum": [ + "csv", + "excel" + ], + "type": "string", + "description": "export format", + "name": "export_format", + "in": "query" + } + ], + "responses": { + "200": { + "description": "export sql manage", + "schema": { + "type": "file" + } + } + } + } + }, + "/v2/projects/{project_name}/sql_optimization_records": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql optimization records", + "tags": [ + "sql_optimization" + ], + "summary": "获取SQL优化记录列表", + "operationId": "GetOptimizationRecordsV2", + "parameters": [ + { + "type": "string", + "description": "fuzzy search for optimization_id or create_username", + "name": "fuzzy_search", + "in": "query" + }, + { + "type": "string", + "description": "filter instance name", + "name": "filter_instance_name", + "in": "query" + }, + { + "type": "string", + "description": "filter create time from", + "name": "filter_create_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter create time to", + "name": "filter_create_time_to", + "in": "query" + }, + { + "enum": [ + "optimizing", + "failed", + "finish" + ], + "type": "string", + "description": "filter status", + "name": "filter_status", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetOptimizationRecordsRes" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "optimize sql\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.\n4. file[input_zip_file]: it is ZIP file that sql will be parsed from xml or sql file inside it.\n5. formData[git_http_url]:the url which scheme is http(s) and end with .git.\n6. formData[git_user_name]:The name of the user who owns the repository read access.\n7. formData[git_user_password]:The password corresponding to git_user_name.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sql_optimization" + ], + "summary": "优化SQL", + "operationId": "SQLOptimizeV2", + "parameters": [ + { + "description": "sqls that should be optimization", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/OptimizeSQLReq" + } + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "formData" + }, + { + "type": "string", + "description": "schema of instance", + "name": "schema_name", + "in": "formData" + }, + { + "type": "string", + "description": "db type of instance", + "name": "db_type", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "optimization name", + "name": "optimization_name", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "sqls for audit", + "name": "sql_content", + "in": "formData" + }, + { + "type": "string", + "description": "explain info", + "name": "explain_info", + "in": "formData" + }, + { + "type": "string", + "description": "metadata", + "name": "metadata", + "in": "formData" + }, + { + "type": "boolean", + "description": "enable high analysis", + "name": "enable_high_analysis", + "in": "formData" + }, + { + "type": "file", + "description": "input SQL file", + "name": "input_sql_file", + "in": "formData" + }, + { + "type": "file", + "description": "input ZIP file", + "name": "input_zip_file", + "in": "formData" + }, + { + "type": "file", + "description": "input mybatis XML file", + "name": "input_mybatis_xml_file", + "in": "formData" + }, + { + "type": "string", + "description": "git repository url", + "name": "git_http_url", + "in": "formData" + }, + { + "type": "string", + "description": "the name of user to clone the repository", + "name": "git_user_name", + "in": "formData" + }, + { + "type": "string", + "description": "the password corresponding to git_user_name", + "name": "git_user_password", + "in": "formData" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/OptimizeSQLRes" + } + } + } + } + }, + "/v2/projects/{project_name}/sql_optimization_records/{optimization_record_id}/detail": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql optimization record", + "tags": [ + "sql_optimization" + ], + "summary": "获取SQL优化语句详情", + "operationId": "GetOptimizationSQLDetailV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql optimization record id", + "name": "optimization_record_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetOptimizationDetailRes" + } + } + } + } + }, + "/v2/projects/{project_name}/sql_optimization_records/{optimization_record_id}/feedback": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "add optimized sql feedback", + "consumes": [ + "application/json" + ], + "tags": [ + "sql_optimization" + ], + "summary": "添加SQL优化语句反馈", + "operationId": "AddOptimizedSQLFeedback", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql optimization record id", + "name": "optimization_record_id", + "in": "path", + "required": true + }, + { + "description": "add optimized sql feedback req", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/OptimizedSQLFeedbackReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/sql_optimization_records/{optimization_record_id}/feedback/{feedback_id}/": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete optimized sql feedback", + "tags": [ + "sql_optimization" + ], + "summary": "删除SQL优化语句反馈", + "operationId": "DeleteOptimizedSQLFeedback", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql optimization record id", + "name": "optimization_record_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "feedback id", + "name": "feedback_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update optimized sql feedback", + "consumes": [ + "application/json" + ], + "tags": [ + "sql_optimization" + ], + "summary": "更新SQL优化语句反馈", + "operationId": "UpdateOptimizedSQLFeedback", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql optimization record id", + "name": "optimization_record_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "feedback id", + "name": "feedback_id", + "in": "path", + "required": true + }, + { + "description": "update optimized sql feedback req", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOptimizedSQLFeedbackReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create workflow", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "创建工单", + "operationId": "createWorkflowV2", + "parameters": [ + { + "description": "create workflow request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateWorkflowReqV2" + } + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/CreateWorkflowResV2" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/cancel": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "batch cancel workflows", + "tags": [ + "workflow" + ], + "summary": "批量取消工单", + "operationId": "batchCancelWorkflowsV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "batch cancel workflows request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BatchCancelWorkflowsReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/complete": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "this api will directly change the work order status to finished without real online operation", + "tags": [ + "workflow" + ], + "summary": "批量完成工单", + "operationId": "batchCompleteWorkflowsV2", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "batch complete workflows request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BatchCompleteWorkflowsReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/{workflow_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow detail", + "tags": [ + "workflow" + ], + "summary": "获取工单详情", + "operationId": "getWorkflowV2", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowResV2" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update workflow when it is rejected to creator.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "更新工单(工单被驳回、工单被关闭、执行成功、执行失败后才可更新)", + "operationId": "updateWorkflowV2", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "update workflow request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateWorkflowReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/{workflow_id}/cancel": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "cancel workflow", + "tags": [ + "workflow" + ], + "summary": "审批关闭(中止)", + "operationId": "cancelWorkflowV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/{workflow_id}/steps/{workflow_step_id}/approve": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "approve workflow", + "tags": [ + "workflow" + ], + "summary": "审批通过", + "operationId": "approveWorkflowV2", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow step id", + "name": "workflow_step_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "workflow approve request", + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/ApproveWorkflowReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/{workflow_id}/steps/{workflow_step_id}/reject": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "reject workflow", + "tags": [ + "workflow" + ], + "summary": "审批驳回", + "operationId": "rejectWorkflowV2", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow step id", + "name": "workflow_step_id", + "in": "path", + "required": true + }, + { + "description": "workflow approve request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RejectWorkflowReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/{workflow_id}/tasks": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get summary of workflow instance tasks", + "tags": [ + "workflow" + ], + "summary": "获取工单数据源任务概览", + "operationId": "getSummaryOfInstanceTasksV2", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkflowTasksResV2" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/{workflow_id}/tasks/execute": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "execute tasks on workflow", + "tags": [ + "workflow" + ], + "summary": "多数据源批量上线", + "operationId": "executeTasksOnWorkflowV2", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/execute": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "execute one task on workflow", + "tags": [ + "workflow" + ], + "summary": "工单提交单个数据源上线", + "operationId": "executeOneTaskOnWorkflowV2", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/schedule": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update workflow schedule.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "设置工单数据源定时上线时间(设置为空则代表取消定时时间,需要SQL审核流程都通过后才可以设置)", + "operationId": "updateWorkflowScheduleV2", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "update workflow schedule request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateWorkflowScheduleReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + }, + "/v2/sql_audit": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Direct audit sql", + "tags": [ + "sql_audit" + ], + "summary": "直接审核SQL", + "operationId": "directAuditV2", + "parameters": [ + { + "description": "sqls that should be audited", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DirectAuditReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DirectAuditResV2" + } + } + } + } + }, + "/v2/tasks/audits/{task_id}/files": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit task file list", + "tags": [ + "task" + ], + "summary": "获取审核任务文件概览列表", + "operationId": "getAuditFileList", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "page size", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditFileListRes" + } + } + } + } + }, + "/v2/tasks/audits/{task_id}/files/{file_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit task file execute statistic", + "tags": [ + "task" + ], + "summary": "获取审核任务文件执行概览", + "operationId": "getAuditFileExecStatistic", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "file id", + "name": "file_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditFileExecStatisticRes" + } + } + } + } + }, + "/v2/tasks/audits/{task_id}/sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get information of all SQLs belong to the specified audit task", + "tags": [ + "task" + ], + "summary": "获取指定扫描任务的SQLs信息", + "operationId": "getAuditTaskSQLsV2", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "enum": [ + "initialized", + "doing", + "succeeded", + "failed", + "manually_executed", + "terminating", + "terminate_succeeded", + "terminate_failed", + "execute_rollback", + "not_executed" + ], + "type": "string", + "description": "filter: exec status of task sql", + "name": "filter_exec_status", + "in": "query" + }, + { + "enum": [ + "initialized", + "doing", + "finished" + ], + "type": "string", + "description": "filter: audit status of task sql", + "name": "filter_audit_status", + "in": "query" + }, + { + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "type": "string", + "description": "filter: audit level of task sql", + "name": "filter_audit_level", + "in": "query" + }, + { + "type": "boolean", + "description": "select unique (fingerprint and audit result) for task sql", + "name": "no_duplicate", + "in": "query" + }, + { + "type": "integer", + "description": "filter: audit file id of task", + "name": "filter_audit_file_id", + "in": "query" + }, + { + "type": "string", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "page size", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetAuditTaskSQLsResV2" + } + } + } + } + }, + "/v2/tasks/audits/{task_id}/sqls/{number}/analysis": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get SQL explain and related table metadata for analysis", + "tags": [ + "task" + ], + "summary": "获取task相关的SQL执行计划和表元数据", + "operationId": "getTaskAnalysisDataV2", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "sql number", + "name": "number", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "whether to calculate and return affected rows, default is true", + "name": "affectRowsEnabled", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetTaskAnalysisDataResV2" + } + } + } + } + }, + "/v3/projects/{project_name}/sql_manages": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql manage list", + "tags": [ + "SqlManage" + ], + "summary": "获取SQL管控列表", + "operationId": "GetSqlManageListV3", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy search sql fingerprint", + "name": "fuzzy_search_sql_fingerprint", + "in": "query" + }, + { + "type": "string", + "description": "assignee", + "name": "filter_assignee", + "in": "query" + }, + { + "type": "string", + "description": "instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "audit_plan", + "sql_audit_record" + ], + "type": "string", + "description": "source", + "name": "filter_source", + "in": "query" + }, + { + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "type": "string", + "description": "audit level", + "name": "filter_audit_level", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time from", + "name": "filter_last_audit_start_time_from", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time to", + "name": "filter_last_audit_start_time_to", + "in": "query" + }, + { + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited", + "sent" + ], + "type": "string", + "description": "status", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "rule name", + "name": "filter_rule_name", + "in": "query" + }, + { + "type": "string", + "description": "db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "filter by name of environment tag", + "name": "filter_by_environment_tag", + "in": "query" + }, + { + "enum": [ + "high", + "low" + ], + "type": "string", + "description": "priority", + "name": "filter_priority", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search endpoint", + "name": "fuzzy_search_endpoint", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search schema name", + "name": "fuzzy_search_schema_name", + "in": "query" + }, + { + "enum": [ + "first_appear_timestamp", + "last_receive_timestamp", + "fp_count" + ], + "type": "string", + "description": "sort field", + "name": "sort_field", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "sort order", + "name": "sort_order", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetSqlManageListResp" + } + } + } + } + }, + "/v3/projects/{project_name}/workflows/complete": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "this api will directly change the work order status to finished without real online operation", + "tags": [ + "workflow" + ], + "summary": "批量完成工单", + "operationId": "batchCompleteWorkflowsV3", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "batch complete workflows request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BatchCompleteWorkflowsReqV3" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BaseRes" + } + } + } + } + } + }, + "definitions": { + "BaseRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GlobalAccountListDataV2": { + "type": "object", + "properties": { + "accounts": { + "type": "array", + "items": { + "$ref": "#/definitions/GlobalAccountListItemV2" + } + }, + "can_manage": { + "description": "是否有管理权限", + "type": "boolean" + } + } + }, + "GlobalAccountListItemV2": { + "type": "object", + "properties": { + "account_name": { + "description": "账号名称", + "type": "string" + }, + "account_uid": { + "description": "账号ID", + "type": "string" + }, + "expired_time": { + "description": "过期时间,前端应显示剩余时间,若小于7天则需要用警告图标配合加粗红色文字警示", + "type": "string" + }, + "instance_id": { + "description": "实例ID", + "type": "string" + }, + "instance_name": { + "description": "实例名称", + "type": "string" + }, + "project_name": { + "description": "项目名称", + "type": "string" + }, + "project_uid": { + "description": "项目ID", + "type": "string" + }, + "status": { + "description": "状态展示: 活跃,临期,已过期,已锁定", + "type": "string", + "enum": [ + "active", + "expiring", + "expired", + "locked" + ] + } + } + }, + "GlobalAccountListResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/GlobalAccountListDataV2" + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GlobalAccountStatisticsData": { + "type": "object", + "properties": { + "active_account_count": { + "description": "我的可用账号卡片,展示我的可用账号数量", + "type": "integer" + }, + "expiring_soon_count": { + "description": "即将过期卡片,展示即将过期的账号数量", + "type": "integer" + } + } + }, + "GlobalAccountStatisticsResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "description": "统计数据", + "type": "object", + "$ref": "#/definitions/GlobalAccountStatisticsData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GlobalSqlManageStatisticsResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/GlobalSqlManageStatisticsV2" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GlobalSqlManageStatisticsV2": { + "type": "object", + "properties": { + "optimized_this_week_count": { + "description": "优化完成卡片,展示历史优化完成的SQL数量", + "type": "integer" + }, + "pending_sql_count": { + "description": "待我优化卡片,展示需要我处理的SQL数量", + "type": "integer" + } + } + }, + "GlobalSqlManageTaskItemV2": { + "type": "object", + "properties": { + "avg_time": { + "description": "平均耗时(秒),来自采集 info;无慢日志等指标时 JSON 为 null(非 0)", + "type": "number" + }, + "count": { + "description": "执行频次;info 中无 counter 等时为 null(非 0)", + "type": "integer" + }, + "instance_id": { + "description": "实例ID", + "type": "string" + }, + "instance_name": { + "description": "实例名称", + "type": "string" + }, + "last_seen_at": { + "description": "最后一次捕捉时间", + "type": "string" + }, + "project_name": { + "description": "项目名称", + "type": "string" + }, + "project_uid": { + "description": "项目ID", + "type": "string" + }, + "source": { + "description": "来源,如:慢日志、库表元数据等,根据数据源id和项目id跳转到智能扫描详情", + "type": "string" + }, + "sql_fingerprint": { + "description": "SQL 指纹", + "type": "string" + }, + "status": { + "description": "SQL治理任务状态:待处理,已优化,已忽略,人工审核中,已分配", + "type": "string", + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited", + "sent" + ] + }, + "suggestion": { + "description": "管理员派单备注;无备注时为空字符串", + "type": "string" + } + } + }, + "GlobalSqlManageTaskListResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/GlobalSqlManageTaskItemV2" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GlobalWorkflowListData": { + "type": "object", + "properties": { + "has_more": { + "description": "是否还有更多数据", + "type": "boolean" + }, + "next_cursor": { + "description": "游标分页:下一页游标", + "type": "string" + }, + "total_nums": { + "description": "总条数", + "type": "integer" + }, + "workflows": { + "description": "工单列表", + "type": "array", + "items": { + "$ref": "#/definitions/GlobalWorkflowListItem" + } + } + } + }, + "GlobalWorkflowListItem": { + "type": "object", + "properties": { + "assignee": { + "description": "当前处理人姓名", + "type": "string" + }, + "create_user_name": { + "type": "string" + }, + "created_at": { + "description": "创建时间", + "type": "string" + }, + "current_step_assignee_user_name_list": { + "description": "当前处理人姓名列表", + "type": "array", + "items": { + "type": "string" + } + }, + "instance_id": { + "description": "实例ID", + "type": "string" + }, + "instance_name": { + "description": "实例名称", + "type": "string" + }, + "ops_type": { + "description": "OpsType 运维类型(跨项目按工单所属项目字典批量解析);未设置或字典项已删时省略", + "type": "object", + "$ref": "#/definitions/OpsType" + }, + "priority": { + "description": "High, Medium, Low", + "type": "string" + }, + "project_name": { + "description": "项目名称", + "type": "string" + }, + "project_uid": { + "description": "项目ID", + "type": "string" + }, + "status": { + "description": "工单状态", + "type": "string", + "enum": [ + "pending_approval", + "pending_action", + "in_progress", + "exporting", + "rejected", + "cancelled", + "failed", + "completed", + "unknown" + ] + }, + "updated_at": { + "description": "更新时间", + "type": "string" + }, + "workflow_desc": { + "description": "工单描述", + "type": "string" + }, + "workflow_id": { + "description": "工单ID", + "type": "string" + }, + "workflow_name": { + "description": "工单名称", + "type": "string" + }, + "workflow_type": { + "description": "工单类型", + "type": "string", + "enum": [ + "sql_release", + "data_export" + ] + } + } + }, + "GlobalWorkflowListResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/GlobalWorkflowListData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GlobalWorkflowStatisticsResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/GlobalWorkflowStatisticsV2" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GlobalWorkflowStatisticsV2": { + "type": "object", + "properties": { + "archived_count": { + "description": "已完成的工单数量", + "type": "integer" + }, + "initiated_by_me_count": { + "description": "我发起的工单数量", + "type": "integer" + }, + "pending_for_me_count": { + "description": "待我处理的工单数量", + "type": "integer" + }, + "view_all_count": { + "description": "查看全部的工单数量", + "type": "integer" + } + } + }, + "OpsType": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "AuditResultInfo": { + "type": "object", + "properties": { + "errorInfo": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "I18nAuditResultInfo": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/AuditResultInfo" + } + }, + "RuleCategoryStatistic": { + "type": "object", + "properties": { + "category": { + "type": "string", + "enum": [ + "audit_accuracy", + "audit_purpose", + "operand", + "sql" + ] + }, + "count": { + "type": "integer" + }, + "tag": { + "type": "string" + } + } + }, + "AdvisedIndex": { + "type": "object", + "properties": { + "has_advice": { + "type": "boolean" + }, + "indexes": { + "type": "array", + "items": { + "$ref": "#/definitions/IndexInfo" + } + }, + "other_advice": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "Analysis": { + "type": "object", + "properties": { + "detail": { + "type": "array", + "items": { + "$ref": "#/definitions/AnalysisDetail" + } + }, + "improvement_desc": { + "type": "string" + }, + "improvement_rate": { + "type": "number" + }, + "state": { + "type": "string" + }, + "total_score": { + "type": "number" + } + } + }, + "AnalysisDetail": { + "type": "object", + "properties": { + "category": { + "type": "string" + }, + "optimized_score": { + "type": "number" + }, + "original_score": { + "type": "number" + } + } + }, + "IndexInfo": { + "type": "object", + "properties": { + "create_index_statement": { + "type": "string" + }, + "reason": { + "type": "string" + } + } + }, + "OptimizeDetail": { + "type": "object", + "properties": { + "state": { + "type": "string" + }, + "steps": { + "type": "array", + "items": { + "$ref": "#/definitions/OptimizeStep" + } + } + } + }, + "OptimizeStep": { + "type": "object", + "properties": { + "analysis": { + "type": "object", + "$ref": "#/definitions/Analysis" + }, + "chat_id": { + "type": "string" + }, + "optimized_sql": { + "type": "string" + }, + "query_plan": { + "type": "object", + "$ref": "#/definitions/QueryPlan" + }, + "rule_desc": { + "type": "string" + }, + "rule_id": { + "type": "string" + }, + "rule_name": { + "type": "string" + } + } + }, + "QueryPlan": { + "type": "object", + "properties": { + "query_plan_desc": { + "type": "array", + "items": { + "$ref": "#/definitions/QueryPlanNode" + } + }, + "state": { + "type": "string" + } + } + }, + "QueryPlanNode": { + "type": "object", + "properties": { + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/QueryPlanNode" + } + }, + "operator": { + "type": "string" + }, + "summary": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "TotalAnalysis": { + "type": "object", + "properties": { + "detail": { + "type": "array", + "items": { + "$ref": "#/definitions/AnalysisDetail" + } + }, + "improvement_desc": { + "type": "string" + }, + "improvement_rate": { + "type": "number" + }, + "state": { + "type": "string" + }, + "total_score": { + "type": "number" + } + } + }, + "AIHubBannerData": { + "type": "object", + "properties": { + "modules": { + "description": "按模块分组的Banner卡片", + "type": "array", + "items": { + "$ref": "#/definitions/AIModuleBannerCards" + } + } + } + }, + "AIHubExecutionRecord": { + "type": "object", + "properties": { + "estimated_upgrade": { + "description": "预估提升", + "type": "number" + }, + "function_module": { + "description": "功能模块", + "type": "string", + "enum": [ + "smart_correction", + "performance_engine" + ] + }, + "id": { + "description": "记录ID", + "type": "integer" + }, + "operation_time": { + "description": "操作时间", + "type": "string" + }, + "process_status": { + "description": "处理状态", + "type": "string", + "enum": [ + "pending", + "running", + "completed", + "failed" + ] + }, + "source_project": { + "description": "来源项目", + "type": "string" + }, + "sql_snippet": { + "description": "SQL片段", + "type": "string" + }, + "value_dimension": { + "description": "价值维度", + "type": "string", + "enum": [ + "security", + "performance", + "correction", + "maintenance", + "code_standard" + ] + } + } + }, + "AIHubManagementViewData": { + "type": "object", + "properties": { + "modules": { + "description": "按模块分组的分析数据", + "type": "array", + "items": { + "$ref": "#/definitions/AIModuleAnalysis" + } + } + } + }, + "AIHubStrategicValueData": { + "type": "object", + "properties": { + "ai_strategic_insight": { + "description": "AI战略洞察", + "type": "object", + "$ref": "#/definitions/AIStrategicInsight" + }, + "efficiency_cards": { + "description": "效能卡片列表", + "type": "array", + "items": { + "$ref": "#/definitions/EfficiencyCard" + } + } + } + }, + "AIModuleAnalysis": { + "type": "object", + "properties": { + "ai_module_type": { + "description": "AI模块类型", + "type": "string", + "enum": [ + "smart_correction", + "performance_engine" + ] + }, + "project_io_analysis": { + "description": "项目组投入产出分析", + "type": "array", + "items": { + "$ref": "#/definitions/ProjectIOAnalysis" + } + }, + "top_problem_distribution": { + "description": "Top问题分布", + "type": "array", + "items": { + "$ref": "#/definitions/TopProblemDistribution" + } + } + } + }, + "AIModuleBannerCards": { + "type": "object", + "properties": { + "ai_module_type": { + "description": "AI模块类型", + "type": "string", + "enum": [ + "smart_correction", + "performance_engine" + ] + }, + "banner_cards": { + "description": "Banner卡片列表", + "type": "array", + "items": { + "$ref": "#/definitions/BannerCard" + } + }, + "is_enabled": { + "description": "功能是否启用", + "type": "boolean", + "example": true + } + } + }, + "AIStrategicInsight": { + "type": "object", + "properties": { + "description": { + "description": "描述", + "type": "string" + }, + "title": { + "description": "标题", + "type": "string" + } + } + }, + "AbnormalAuditPlanInstance": { + "type": "object", + "properties": { + "abnormal_status_code": { + "type": "integer" + }, + "instance_audit_plan_id": { + "type": "integer" + }, + "instance_name": { + "type": "string", + "example": "MySQL" + }, + "token_exp": { + "type": "integer", + "example": 1747129752 + } + } + }, + "AffectRows": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "err_message": { + "type": "string" + } + } + }, + "AssociateWorkflows": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "canceled", + "exec_failed", + "executing", + "finished" + ] + }, + "workflow_id": { + "type": "string" + }, + "workflow_name": { + "type": "string" + } + } + }, + "AsyncRewriteTask": { + "type": "object", + "properties": { + "end_time": { + "description": "结束时间", + "type": "string" + }, + "error_message": { + "description": "错误信息", + "type": "string" + }, + "result": { + "description": "重写结果", + "type": "object", + "$ref": "#/definitions/RewriteSQLData" + }, + "sql_number": { + "description": "SQL编号", + "type": "string" + }, + "start_time": { + "description": "开始时间", + "type": "string" + }, + "status": { + "description": "任务状态", + "type": "string", + "enum": [ + "pending", + "running", + "completed", + "failed" + ] + }, + "task_id": { + "description": "任务ID", + "type": "string" + } + } + }, + "AsyncRewriteTaskStatusRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AsyncRewriteTask" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "AuditFileResp": { + "type": "object", + "properties": { + "file_name": { + "type": "string" + } + } + }, + "AuditPlan": { + "type": "object", + "properties": { + "audit_plan_params": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanParamReqV1" + } + }, + "audit_plan_type": { + "type": "string", + "example": "slow log" + }, + "high_priority_conditions": { + "type": "array", + "items": { + "$ref": "#/definitions/HighPriorityConditionReq" + } + }, + "need_mark_high_priority_sql": { + "type": "boolean" + }, + "rule_template_name": { + "type": "string", + "example": "default_MySQL" + } + } + }, + "AuditPlanCount": { + "type": "object", + "properties": { + "audit_plan_count": { + "type": "integer" + }, + "audit_plan_desc": { + "type": "string" + }, + "audit_plan_type": { + "type": "string" + } + } + }, + "AuditPlanMetaV1": { + "type": "object", + "properties": { + "audit_plan_params": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanParamResV1" + } + }, + "audit_plan_type": { + "type": "string" + }, + "audit_plan_type_desc": { + "type": "string" + }, + "audit_plan_type_tips": { + "type": "string" + }, + "high_priority_conditions": { + "type": "array", + "items": { + "$ref": "#/definitions/HighPriorityConditionResV1" + } + }, + "instance_type": { + "type": "string" + } + } + }, + "AuditPlanParamReqV1": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "AuditPlanParamResV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "enums_value": { + "type": "array", + "items": { + "$ref": "#/definitions/EnumsValueResV1" + } + }, + "key": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "string", + "int", + "bool", + "password" + ] + }, + "value": { + "type": "string" + } + } + }, + "AuditPlanReportResV1": { + "type": "object", + "properties": { + "audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error", + "" + ] + }, + "audit_plan_report_id": { + "type": "string", + "example": "1" + }, + "audit_plan_report_timestamp": { + "type": "string", + "example": "RFC3339" + }, + "pass_rate": { + "type": "number" + }, + "score": { + "type": "integer" + } + } + }, + "AuditPlanReportSQLResV1": { + "type": "object", + "properties": { + "audit_plan_report_sql": { + "type": "string", + "example": "select * from t1 where id = 1" + }, + "audit_plan_report_sql_audit_result": { + "type": "string", + "example": "same format as task audit result" + }, + "number": { + "type": "integer", + "example": 1 + } + } + }, + "AuditPlanRes": { + "type": "object", + "properties": { + "audit_plan_params": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanParamResV1" + } + }, + "audit_plan_type": { + "type": "object", + "$ref": "#/definitions/AuditPlanTypeResBase" + }, + "high_priority_conditions": { + "type": "array", + "items": { + "$ref": "#/definitions/HighPriorityConditionResV1" + } + }, + "need_mark_high_priority_sql": { + "type": "boolean" + }, + "rule_template_name": { + "type": "string", + "example": "default_MySQL" + } + } + }, + "AuditPlanResV1": { + "type": "object", + "properties": { + "audit_plan_cron": { + "type": "string", + "example": "0 */2 * * *" + }, + "audit_plan_db_type": { + "type": "string", + "example": "mysql" + }, + "audit_plan_instance_database": { + "type": "string", + "example": "app1" + }, + "audit_plan_instance_name": { + "type": "string", + "example": "test_mysql" + }, + "audit_plan_meta": { + "type": "object", + "$ref": "#/definitions/AuditPlanMetaV1" + }, + "audit_plan_name": { + "type": "string", + "example": "audit_for_java_app1" + }, + "audit_plan_token": { + "type": "string", + "example": "it's a JWT Token for scanner" + }, + "rule_template_name": { + "type": "string", + "example": "default_MySQL" + } + } + }, + "AuditPlanRuleTemplate": { + "type": "object", + "properties": { + "is_global_rule_template": { + "type": "boolean" + }, + "name": { + "type": "string" + } + } + }, + "AuditPlanSQLDataResV1": { + "type": "object", + "properties": { + "rows": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "AuditPlanSQLHeadV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "field_name": { + "type": "string" + }, + "sortable": { + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "sql" + ] + } + } + }, + "AuditPlanSQLMetaResV1": { + "type": "object", + "properties": { + "filter_meta_list": { + "type": "array", + "items": { + "$ref": "#/definitions/FilterMeta" + } + }, + "head": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanSQLHeadV1" + } + } + } + }, + "AuditPlanSQLReqV1": { + "type": "object", + "properties": { + "audit_plan_sql_counter": { + "type": "string", + "example": "6" + }, + "audit_plan_sql_fingerprint": { + "type": "string", + "example": "select * from t1 where id = ?" + }, + "audit_plan_sql_last_receive_text": { + "type": "string", + "example": "select * from t1 where id = 1" + }, + "audit_plan_sql_last_receive_timestamp": { + "type": "string", + "example": "RFC3339" + }, + "audit_plan_sql_schema": { + "type": "string", + "example": "db1" + }, + "db_user": { + "type": "string", + "example": "database_user001" + }, + "endpoint": { + "type": "string", + "example": "10.186.1.2" + }, + "first_query_at": { + "type": "string", + "example": "2023-09-12T02:48:01.317880Z" + }, + "query_time_avg": { + "type": "number", + "example": 3.22 + }, + "query_time_max": { + "type": "number", + "example": 5.22 + } + } + }, + "AuditPlanSQLResV1": { + "type": "object", + "properties": { + "head": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanSQLHeadV1" + } + }, + "rows": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "AuditPlanTypeResBase": { + "type": "object", + "properties": { + "active_status": { + "type": "string", + "enum": [ + "normal", + "disabled" + ] + }, + "audit_plan_id": { + "type": "integer" + }, + "desc": { + "type": "string" + }, + "last_collection_status": { + "type": "string", + "enum": [ + "normal", + "abnormal" + ] + }, + "token": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "AuditPlanTypesV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "instance_type": { + "type": "string", + "enum": [ + "MySQL", + "Oracle", + "TiDB", + "OceanBase For MySQL", + "" + ] + }, + "type": { + "type": "string" + } + } + }, + "AuditResDataV1": { + "type": "object", + "properties": { + "audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error", + "" + ] + }, + "pass_rate": { + "type": "number" + }, + "score": { + "type": "integer" + }, + "sql_results": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditSQLResV1" + } + } + } + }, + "AuditResult": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "error_info": { + "type": "string" + }, + "execution_failed": { + "type": "boolean", + "example": false + }, + "i18n_audit_result_info": { + "type": "object", + "$ref": "#/definitions/I18nAuditResultInfo" + }, + "level": { + "type": "string", + "example": "warn" + }, + "message": { + "type": "string", + "example": "避免使用不必要的内置函数md5()" + }, + "rule_name": { + "type": "string" + } + } + }, + "AuditSQLResV1": { + "type": "object", + "properties": { + "audit_level": { + "type": "string" + }, + "audit_result": { + "type": "string" + }, + "exec_sql": { + "type": "string" + }, + "number": { + "type": "integer" + } + } + }, + "AuditTaskGroupRes": { + "type": "object", + "properties": { + "task_group_id": { + "type": "integer" + }, + "tasks": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditTaskResV1" + } + } + } + }, + "AuditTaskGroupResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AuditTaskGroupRes" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "AuditTaskResV1": { + "type": "object", + "properties": { + "audit_files": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditFileResp" + } + }, + "audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error", + "" + ] + }, + "backup_conflict_with_instance": { + "description": "当数据源备份开启,工单备份关闭,则需要提示审核人工单备份策略与数据源备份策略不一致", + "type": "boolean" + }, + "backup_max_rows": { + "type": "integer" + }, + "enable_backup": { + "type": "boolean" + }, + "exec_end_time": { + "type": "string" + }, + "exec_fail_reason": { + "type": "string" + }, + "exec_fail_sql_count": { + "type": "integer" + }, + "exec_fail_sql_id": { + "type": "integer" + }, + "exec_fail_sql_number": { + "type": "integer" + }, + "exec_fail_stage": { + "type": "string" + }, + "exec_mode": { + "type": "string" + }, + "exec_start_time": { + "type": "string" + }, + "file_order_method": { + "type": "string" + }, + "instance_db_type": { + "type": "string" + }, + "instance_name": { + "type": "string" + }, + "instance_schema": { + "type": "string", + "example": "db1" + }, + "pass_rate": { + "type": "number" + }, + "score": { + "type": "integer" + }, + "sql_source": { + "type": "string", + "enum": [ + "form_data", + "sql_file", + "mybatis_xml_file", + "audit_plan", + "zip_file", + "git_repository" + ] + }, + "status": { + "type": "string", + "enum": [ + "initialized", + "audited", + "executing", + "exec_success", + "exec_failed", + "manually_executed" + ] + }, + "task_id": { + "type": "integer" + } + } + }, + "AuditTaskSQLContentResV1": { + "type": "object", + "properties": { + "sql": { + "type": "string", + "example": "alter table tb1 drop columns c1" + } + } + }, + "AuditTaskSQLResV1": { + "type": "object", + "properties": { + "audit_level": { + "type": "string" + }, + "audit_result": { + "type": "string" + }, + "audit_status": { + "type": "string" + }, + "description": { + "type": "string" + }, + "exec_result": { + "type": "string" + }, + "exec_sql": { + "type": "string" + }, + "exec_status": { + "type": "string" + }, + "number": { + "type": "integer" + }, + "rollback_sqls": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "AuditTasksGroupResV1": { + "type": "object", + "properties": { + "task_group_id": { + "type": "integer" + } + } + }, + "AuditWhitelistResV1": { + "type": "object", + "properties": { + "audit_whitelist_id": { + "type": "integer" + }, + "desc": { + "type": "string" + }, + "last_match_time": { + "type": "string" + }, + "match_type": { + "type": "string" + }, + "matched_count": { + "type": "integer" + }, + "value": { + "type": "string" + } + } + }, + "AuditedSQLCount": { + "type": "object", + "properties": { + "risk_sql_count": { + "type": "integer" + }, + "total_sql_count": { + "type": "integer" + } + } + }, + "AutoCreateAndExecuteWorkflowResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AutoCreateAndExecuteWorkflowResV1Data" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "AutoCreateAndExecuteWorkflowResV1Data": { + "type": "object", + "properties": { + "workflow_id": { + "type": "string" + }, + "workflow_status": { + "type": "string" + } + } + }, + "BackupSqlData": { + "type": "object", + "properties": { + "backup_result": { + "type": "string" + }, + "backup_sqls": { + "type": "array", + "items": { + "type": "string" + } + }, + "backup_status": { + "type": "string", + "enum": [ + "waiting_for_execution", + "executing", + "failed", + "succeed" + ] + }, + "backup_strategy": { + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "original_row" + ] + }, + "description": { + "type": "string" + }, + "exec_order": { + "type": "integer" + }, + "exec_sql_id": { + "type": "integer" + }, + "exec_status": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "instance_name": { + "type": "string" + }, + "origin_sql": { + "type": "string" + }, + "origin_task_id": { + "type": "integer" + } + } + }, + "BackupSqlListRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/BackupSqlData" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "BannerCard": { + "type": "object", + "properties": { + "evidence_value": { + "description": "具体指标分值", + "type": "string", + "example": "22" + }, + "metric_evaluation": { + "description": "效能评价", + "type": "string", + "example": "高危风险消除率 79%" + }, + "need_display": { + "description": "是否需要展示", + "type": "boolean", + "example": true + } + } + }, + "BatchAssociateWorkflowsWithVersionReqV1": { + "type": "object", + "properties": { + "workflow_ids": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "BatchCancelWorkflowsReqV1": { + "type": "object", + "properties": { + "workflow_names": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "BatchCheckInstanceConnectionsReqV1": { + "type": "object", + "properties": { + "instances": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceForCheckConnection" + } + } + } + }, + "BatchCompleteWorkflowsReqV1": { + "type": "object", + "properties": { + "workflow_names": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "BatchExecuteWorkflowsReqV1": { + "type": "object", + "properties": { + "workflow_ids": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "BatchGetInstanceConnectionsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceConnectionResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "BatchReleaseWorkflowReqV1": { + "type": "object", + "properties": { + "release_workflows": { + "type": "array", + "items": { + "$ref": "#/definitions/ReleaseWorkflows" + } + } + } + }, + "BatchUpdateSqlManageReq": { + "type": "object", + "properties": { + "assignees": { + "type": "array", + "items": { + "type": "string" + } + }, + "priority": { + "type": "string", + "enum": [ + "", + "high" + ] + }, + "remark": { + "type": "string" + }, + "sql_manage_id_list": { + "type": "array", + "items": { + "type": "integer" + } + }, + "status": { + "type": "string", + "enum": [ + "solved", + "ignored", + "manual_audited" + ] + } + } + }, + "BlacklistResV1": { + "type": "object", + "properties": { + "blacklist_id": { + "type": "integer" + }, + "content": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "last_match_time": { + "type": "string" + }, + "matched_count": { + "type": "integer" + }, + "type": { + "type": "string", + "enum": [ + "sql", + "fp_sql", + "ip", + "cidr", + "host", + "instance" + ] + } + } + }, + "ChartPoint": { + "type": "object", + "properties": { + "info": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "status": { + "type": "integer" + }, + "x": { + "type": "string" + }, + "y": { + "type": "number" + } + } + }, + "CheckLicenseResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "content": { + "type": "string" + }, + "license": { + "type": "array", + "items": { + "$ref": "#/definitions/LicenseItem" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "CloneProjectRuleTemplateReqV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "new_rule_template_name": { + "type": "string" + } + } + }, + "CloneRuleTemplateReqV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "new_rule_template_name": { + "type": "string" + } + } + }, + "CodingConfigurationV1": { + "type": "object", + "properties": { + "coding_url": { + "type": "string" + }, + "is_coding_enabled": { + "type": "boolean" + } + } + }, + "CodingResp": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "CompanyNotice": { + "type": "object", + "properties": { + "notice_str": { + "type": "string" + } + } + }, + "CreatInstanceAuditPlanRes": { + "type": "object", + "properties": { + "instance_audit_plan_id": { + "type": "string" + } + } + }, + "CreatInstanceAuditPlanResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/CreatInstanceAuditPlanRes" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "CreateAuditPlanReqV1": { + "type": "object", + "properties": { + "audit_plan_cron": { + "type": "string", + "example": "0 */2 * * *" + }, + "audit_plan_instance_database": { + "type": "string", + "example": "app1" + }, + "audit_plan_instance_name": { + "type": "string", + "example": "test_mysql" + }, + "audit_plan_instance_type": { + "type": "string", + "example": "mysql" + }, + "audit_plan_name": { + "type": "string", + "example": "audit_plan_for_java_repo_1" + }, + "audit_plan_params": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanParamReqV1" + } + }, + "audit_plan_type": { + "type": "string", + "example": "slow log" + }, + "rule_template_name": { + "type": "string", + "example": "default_MySQL" + } + } + }, + "CreateAuditTaskReqV1": { + "type": "object", + "properties": { + "backup_max_rows": { + "type": "integer" + }, + "enable_backup": { + "type": "boolean" + }, + "exec_mode": { + "type": "string", + "enum": [ + "sql_file", + "sqls" + ] + }, + "file_order_method": { + "type": "string" + }, + "instance_name": { + "type": "string", + "example": "inst_1" + }, + "instance_schema": { + "type": "string", + "example": "db1" + }, + "rule_template_name": { + "type": "string" + }, + "sql": { + "type": "string", + "example": "alter table tb1 drop columns c1" + } + } + }, + "CreateAuditTasksGroupReqV1": { + "type": "object", + "properties": { + "exec_mode": { + "type": "string", + "enum": [ + "sql_file", + "sqls" + ] + }, + "file_order_method": { + "type": "string" + }, + "instances": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceForCreatingTask" + } + } + } + }, + "CreateAuditTasksGroupResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AuditTasksGroupResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "CreateAuditWhitelistReqV1": { + "type": "object", + "properties": { + "desc": { + "type": "string", + "example": "used for rapid release" + }, + "match_type": { + "type": "string", + "enum": [ + "exact_match", + "fp_match" + ], + "example": "exact_match" + }, + "value": { + "type": "string", + "example": "create table" + } + } + }, + "CreateBlacklistReqV1": { + "type": "object", + "properties": { + "content": { + "type": "string", + "example": "select * from t1" + }, + "desc": { + "type": "string", + "example": "used for rapid release" + }, + "type": { + "type": "string", + "enum": [ + "sql", + "fp_sql", + "ip", + "cidr", + "host", + "instance" + ], + "example": "sql" + } + } + }, + "CreateCustomRuleReqV1": { + "type": "object", + "properties": { + "annotation": { + "type": "string", + "example": "this is test rule" + }, + "db_type": { + "type": "string", + "example": "MySQL" + }, + "desc": { + "type": "string", + "example": "this is test rule" + }, + "level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "example": "notice" + }, + "rule_script": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "example": "DDL规则" + } + } + }, + "CreateInstanceAuditPlanReqV1": { + "type": "object", + "properties": { + "audit_plans": { + "description": "扫描类型", + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlan" + } + }, + "instance_id": { + "type": "string" + } + } + }, + "CreatePipelineReqV1": { + "type": "object", + "properties": { + "address": { + "description": "关联流水线地址", + "type": "string" + }, + "description": { + "description": "流水线描述", + "type": "string" + }, + "name": { + "description": "流水线名称", + "type": "string" + }, + "nodes": { + "description": "节点信息", + "type": "array", + "items": { + "$ref": "#/definitions/pipelineNodeBase" + } + } + } + }, + "CreatePipelineResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/createPipelineResData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "CreateProjectRuleTemplateReqV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "rule_list": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleReqV1" + } + }, + "rule_template_name": { + "type": "string" + }, + "rule_version": { + "type": "integer" + } + } + }, + "CreateRollbackWorkflowReq": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "rollback_sql_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "sql_version_id": { + "type": "integer" + }, + "task_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "workflow_subject": { + "type": "string" + }, + "workflow_template_id": { + "type": "integer" + } + } + }, + "CreateRollbackWorkflowRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/CreateRollbackWorkflowResData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "CreateRollbackWorkflowResData": { + "type": "object", + "properties": { + "workflow_id": { + "type": "string" + } + } + }, + "CreateRuleTemplateReqV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "rule_list": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleReqV1" + } + }, + "rule_template_name": { + "type": "string" + }, + "rule_version": { + "type": "integer" + } + } + }, + "CreateSQLAuditRecordResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/SQLAuditRecordResData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "CreateSqlVersionReqV1": { + "type": "object", + "properties": { + "create_sql_version_stage": { + "type": "array", + "items": { + "$ref": "#/definitions/CreateSqlVersionStage" + } + }, + "desc": { + "type": "string" + }, + "version": { + "type": "string", + "example": "2.23" + } + } + }, + "CreateSqlVersionRes": { + "type": "object", + "properties": { + "sql_version_id": { + "type": "integer" + } + } + }, + "CreateSqlVersionResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/CreateSqlVersionRes" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "CreateSqlVersionStage": { + "type": "object", + "properties": { + "create_stages_instance_dep": { + "type": "array", + "items": { + "$ref": "#/definitions/CreateStagesInstanceDep" + } + }, + "name": { + "type": "string", + "example": "生产" + }, + "stage_sequence": { + "type": "integer" + } + } + }, + "CreateStagesInstanceDep": { + "type": "object", + "properties": { + "next_stage_instance_id": { + "type": "string" + }, + "stage_instance_id": { + "type": "string" + } + } + }, + "CreateWorkflowReqV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "task_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "workflow_subject": { + "type": "string" + } + } + }, + "CreateWorkflowTemplateReqV1": { + "type": "object", + "properties": { + "allow_submit_when_less_audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ] + }, + "desc": { + "type": "string" + }, + "is_default": { + "type": "boolean" + }, + "workflow_step_template_list": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkFlowStepTemplateReqV1" + } + }, + "workflow_template_name": { + "type": "string" + }, + "workflow_type": { + "type": "string", + "enum": [ + "workflow", + "data_export" + ] + } + } + }, + "CustomRuleResV1": { + "type": "object", + "properties": { + "annotation": { + "type": "string", + "example": "this is test rule" + }, + "categories": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "db_type": { + "type": "string", + "example": "MySQL" + }, + "desc": { + "type": "string", + "example": "this is test rule" + }, + "level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "example": "notice" + }, + "rule_id": { + "type": "string" + }, + "rule_script": { + "type": "string" + }, + "type": { + "type": "string", + "example": "DDL规则" + } + } + }, + "DBPerformanceImproveOverview": { + "type": "object", + "properties": { + "avg_performance_improve": { + "type": "number" + }, + "instance_name": { + "type": "string" + } + } + }, + "DBTypeAuditPlan": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanCount" + } + }, + "db_type": { + "type": "string" + } + } + }, + "DBTypeHealth": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "health_instance_names": { + "type": "array", + "items": { + "type": "string" + } + }, + "unhealth_instance_names": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "DashboardResV1": { + "type": "object", + "properties": { + "workflow_statistics": { + "type": "object", + "$ref": "#/definitions/WorkflowStatisticsResV1" + } + } + }, + "DatabaseComparisonObject": { + "type": "object", + "properties": { + "instance_id": { + "type": "string" + }, + "schema_name": { + "type": "string" + } + } + }, + "DatabaseComparisonResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/SchemaObject" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "DatabaseComparisonStatements": { + "type": "object", + "properties": { + "base_sql": { + "type": "object", + "$ref": "#/definitions/SQLStatement" + }, + "comparison_sql": { + "type": "object", + "$ref": "#/definitions/SQLStatement" + } + } + }, + "DatabaseComparisonStatementsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/DatabaseComparisonStatements" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "DatabaseDiffModifySQL": { + "type": "object", + "properties": { + "audit_error": { + "type": "string" + }, + "modify_sqls": { + "type": "array", + "items": { + "$ref": "#/definitions/SQLStatementWithAuditResult" + } + }, + "schema_name": { + "type": "string" + } + } + }, + "DatabaseDiffObject": { + "type": "object", + "properties": { + "inconsistent_num": { + "type": "integer" + }, + "object_type": { + "type": "string", + "enum": [ + "TABLE", + "VIEW", + "PROCEDURE", + "TIGGER", + "EVENT", + "FUNCTION" + ] + }, + "objects_diff_result": { + "type": "array", + "items": { + "$ref": "#/definitions/ObjectDiffResult" + } + } + } + }, + "DatabaseDriverLogosV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "logo": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "DatabaseDriverOptionsV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "default_port": { + "type": "integer" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceAdditionalParamResV1" + } + } + } + }, + "DatabaseObject": { + "type": "object", + "properties": { + "object_name": { + "type": "string" + }, + "object_type": { + "type": "string", + "enum": [ + "TABLE", + "VIEW", + "PROCEDURE", + "TIGGER", + "EVENT", + "FUNCTION" + ] + } + } + }, + "DatabaseSchemaObject": { + "type": "object", + "properties": { + "base_schema_name": { + "type": "string" + }, + "comparison_schema_name": { + "type": "string" + }, + "database_objects": { + "type": "array", + "items": { + "$ref": "#/definitions/DatabaseObject" + } + } + } + }, + "DepBetweenStageInstance": { + "type": "object", + "properties": { + "next_stage_instance_id": { + "type": "string" + }, + "next_stage_instance_name": { + "type": "string" + }, + "stage_instance_id": { + "type": "string" + }, + "stage_instance_name": { + "type": "string" + } + } + }, + "DingTalkConfigurationV1": { + "type": "object", + "properties": { + "app_key": { + "type": "string" + }, + "is_enable_ding_talk_notify": { + "type": "boolean" + } + } + }, + "DirectAuditFileReqV1": { + "type": "object", + "properties": { + "file_contents": { + "description": "调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现\n每个数组元素是一个文件内容", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "select * from t1; select * from t2;" + ] + }, + "instance_name": { + "type": "string", + "example": "instance1" + }, + "instance_type": { + "type": "string", + "example": "MySQL" + }, + "project_name": { + "type": "string", + "example": "project1" + }, + "schema_name": { + "type": "string", + "example": "schema1" + }, + "sql_type": { + "type": "string", + "enum": [ + "sql", + "mybatis", + "" + ], + "example": "sql" + } + } + }, + "DirectAuditReqV1": { + "type": "object", + "properties": { + "instance_name": { + "type": "string", + "example": "instance1" + }, + "instance_type": { + "type": "string", + "example": "MySQL" + }, + "project_name": { + "type": "string", + "example": "project1" + }, + "schema_name": { + "type": "string", + "example": "schema1" + }, + "sql_content": { + "description": "调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现", + "type": "string", + "example": "select * from t1; select * from t2;" + }, + "sql_type": { + "type": "string", + "enum": [ + "sql", + "mybatis", + "" + ], + "example": "sql" + } + } + }, + "DirectAuditResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AuditResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "DirectGetSQLAnalysisResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/SqlAnalysisResDataV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "DriversResV1": { + "type": "object", + "properties": { + "driver_name_list": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "EdgeResponse": { + "type": "object", + "properties": { + "from_id": { + "description": "存储Node的ID", + "type": "string" + }, + "is_directed": { + "description": "是否有向", + "type": "boolean" + }, + "to_id": { + "description": "存储Node的ID", + "type": "string" + }, + "weight": { + "description": "权重", + "type": "integer" + } + } + }, + "EfficiencyCard": { + "type": "object", + "properties": { + "evidence_value": { + "description": "具体指标分值", + "type": "string", + "example": "高危拦截35次" + }, + "metric_evaluation": { + "description": "效能评价", + "type": "string", + "example": "S级,+450%,123h" + }, + "metric_title": { + "description": "效能指标标题", + "type": "string", + "enum": [ + "security_defense", + "resource_cost", + "code_standard", + "rd_efficiency", + "query_performance" + ] + } + } + }, + "EnumsValueResV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "ExplainClassicResult": { + "type": "object", + "properties": { + "head": { + "type": "array", + "items": { + "$ref": "#/definitions/TableMetaItemHeadResV1" + } + }, + "rows": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "ExplainValidationDetail": { + "type": "object", + "properties": { + "after_cost": { + "type": "number" + }, + "after_plan": { + "type": "string" + }, + "before_cost": { + "type": "number" + }, + "before_plan": { + "type": "string" + }, + "perform_improve_per": { + "type": "number" + } + } + }, + "FeishuConfigurationV1": { + "type": "object", + "properties": { + "app_id": { + "type": "string" + }, + "is_feishu_notification_enabled": { + "type": "boolean" + } + } + }, + "FileToSort": { + "type": "object", + "properties": { + "file_id": { + "type": "integer" + }, + "new_index": { + "type": "integer" + } + } + }, + "Filter": { + "type": "object", + "properties": { + "filter_between_value": { + "type": "object", + "$ref": "#/definitions/FilterBetweenValue" + }, + "filter_compare_value": { + "type": "string" + }, + "filter_name": { + "type": "string" + } + } + }, + "FilterBetweenValue": { + "type": "object", + "properties": { + "from": { + "type": "string" + }, + "to": { + "type": "string" + } + } + }, + "FilterMeta": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "filter_input_type": { + "type": "string", + "enum": [ + "int", + "string", + "date_time" + ] + }, + "filter_name": { + "type": "string" + }, + "filter_op_type": { + "type": "string", + "enum": [ + "equal", + "between" + ] + }, + "filter_tip_list": { + "type": "array", + "items": { + "$ref": "#/definitions/FilterTip" + } + } + } + }, + "FilterTip": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "group": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "FullSyncAuditPlanSQLsReqV1": { + "type": "object", + "properties": { + "audit_plan_sql_list": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanSQLReqV1" + } + } + } + }, + "GenModifySQLResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/DatabaseDiffModifySQL" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GenModifylSQLReqV1": { + "type": "object", + "properties": { + "base_instance_id": { + "type": "string" + }, + "comparison_instance_id": { + "type": "string" + }, + "database_schema_objects": { + "type": "array", + "items": { + "$ref": "#/definitions/DatabaseSchemaObject" + } + } + } + }, + "GetAIHubBannerResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AIHubBannerData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetAIHubExecutionDataResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AIHubExecutionRecord" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "description": "总数", + "type": "integer" + } + } + }, + "GetAIHubManagementViewResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AIHubManagementViewData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetAIHubStrategicValueResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AIHubStrategicValueData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetAbnormalAuditPlanInstancesResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AbnormalAuditPlanInstance" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetAuditPlanAnalysisDataResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/GetSQLAnalysisDataResItemV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetAuditPlanMetasResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanMetaV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetAuditPlanNotifyConfigResDataV1": { + "type": "object", + "properties": { + "enable_email_notify": { + "type": "boolean" + }, + "enable_web_hook_notify": { + "type": "boolean" + }, + "notify_interval": { + "type": "integer" + }, + "notify_level": { + "type": "string" + }, + "web_hook_template": { + "type": "string" + }, + "web_hook_url": { + "type": "string" + } + } + }, + "GetAuditPlanNotifyConfigResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/GetAuditPlanNotifyConfigResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetAuditPlanReportResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AuditPlanReportResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetAuditPlanReportSQLsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanReportSQLResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetAuditPlanReportsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanReportResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetAuditPlanResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AuditPlanResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetAuditPlanSQLDataReqV1": { + "type": "object", + "properties": { + "filter_list": { + "type": "array", + "items": { + "$ref": "#/definitions/Filter" + } + }, + "is_asc": { + "type": "boolean" + }, + "order_by": { + "type": "string" + }, + "page_index": { + "type": "integer" + }, + "page_size": { + "type": "integer" + } + } + }, + "GetAuditPlanSQLDataResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AuditPlanSQLDataResV1" + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetAuditPlanSQLExportReqV1": { + "type": "object", + "properties": { + "export_format": { + "description": "导出格式:csv 或 excel", + "type": "string", + "enum": [ + "csv", + "excel" + ], + "example": "excel" + }, + "filter_list": { + "type": "array", + "items": { + "$ref": "#/definitions/Filter" + } + }, + "is_asc": { + "type": "boolean" + }, + "order_by": { + "type": "string" + } + } + }, + "GetAuditPlanSQLMetaResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AuditPlanSQLMetaResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetAuditPlanSQLsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AuditPlanSQLResV1" + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetAuditPlanTypesResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanTypesV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetAuditPlansResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetAuditTaskResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AuditTaskResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetAuditTaskSQLContentResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AuditTaskSQLContentResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetAuditTaskSQLsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditTaskSQLResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetAuditWhitelistResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditWhitelistResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetBlacklistResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/BlacklistResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetCodingConfigurationResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/CodingConfigurationV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetCompanyNoticeResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/CompanyNotice" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetComparisonStatementsReqV1": { + "type": "object", + "properties": { + "database_comparison_object": { + "type": "object", + "$ref": "#/definitions/GetDatabaseComparisonReqV1" + }, + "database_object": { + "type": "object", + "$ref": "#/definitions/DatabaseObject" + } + } + }, + "GetCustomRuleResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/CustomRuleResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetCustomRulesResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomRuleResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetDBPerformanceImproveOverviewResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/DBPerformanceImproveOverview" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetDashboardResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/DashboardResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetDatabaseComparisonReqV1": { + "type": "object", + "properties": { + "base_db_object": { + "type": "object", + "$ref": "#/definitions/DatabaseComparisonObject" + }, + "comparison_db_object": { + "type": "object", + "$ref": "#/definitions/DatabaseComparisonObject" + } + } + }, + "GetDatabaseDriverLogosResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/DatabaseDriverLogosV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetDatabaseDriverOptionsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/DatabaseDriverOptionsV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetDepBetweenStageInstanceResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/DepBetweenStageInstance" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetDingTalkConfigurationResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/DingTalkConfigurationV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetDriverRuleVersionTipsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/GetDriverRuleVersionTipsV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetDriverRuleVersionTipsV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string", + "example": "mysql" + }, + "rule_versions": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "GetDriversResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/DriversResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetFeishuAuditConfigurationResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/FeishuConfigurationV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetGlobalSqlManageListResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/GlobalSqlManage" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetGlobalSqlManageStatisticsResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetInstanceAuditPlanDetailResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/InstanceAuditPlanDetailResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetInstanceAuditPlanOverviewResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceAuditPlanInfo" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetInstanceAuditPlansResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceAuditPlanResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetInstanceConnectableResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/InstanceConnectableResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetInstanceHealthResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/DBTypeHealth" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetInstanceOverviewStatisticsRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceOverviewStatistics" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetInstanceSchemaResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/InstanceSchemaResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetInstanceTipsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceTipResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetInstancesTypePercentResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/InstancesTypePercentV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetKnowledgeBaseListRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/KnowledgeBase" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetKnowledgeBaseTagListRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/Tag" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetKnowledgeGraphResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/GraphResponse" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetLicenseResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "content": { + "type": "string" + }, + "license": { + "type": "array", + "items": { + "$ref": "#/definitions/LicenseItem" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetLicenseUsageResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/LicenseUsageV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetModuleStatusResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/ModuleStatusRes" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetOperationsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/OperationResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetOptimizationOverviewResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/OptimizationRecordOverview" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetOptimizationRecordRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/OptimizationDetail" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetOptimizationRecordsRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/OptimizationRecord" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetOptimizationSQLRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/OptimizationSQLDetail" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetOptimizationSQLsRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/OptimizationSQL" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetPipelineDetailResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/pipelineDetailData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetPipelinesResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "description": "流水线列表数据", + "type": "array", + "items": { + "$ref": "#/definitions/pipelineDetail" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "description": "流水线总数", + "type": "integer" + } + } + }, + "GetProjectRuleTemplateResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/RuleProjectTemplateDetailResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetProjectRuleTemplatesResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/ProjectRuleTemplateResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetProjectScoreResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/ProjectScore" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetProjectStatisticsResDataV1": { + "type": "object", + "properties": { + "audit_plan_total": { + "type": "integer" + }, + "instance_total": { + "type": "integer" + }, + "member_total": { + "type": "integer" + }, + "rule_template_total": { + "type": "integer" + }, + "whitelist_total": { + "type": "integer" + }, + "workflow_total": { + "type": "integer" + } + } + }, + "GetProjectStatisticsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/GetProjectStatisticsResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetReportPushConfigsListResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/ReportPushConfigList" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetRiskAuditPlanResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/RiskAuditPlan" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetRoleUserCountResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/RoleUserCount" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetRuleCategoryStatisticResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleCategoryStatistic" + } + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetRuleKnowledgeResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/RuleKnowledgeResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetRuleTemplateResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/RuleTemplateDetailResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetRuleTemplateTipsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleTemplateTipResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetRuleTemplatesResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleTemplateResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetRuleTypeByDBTypeResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleTypeV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetRulesResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetSQLAnalysisDataResItemV1": { + "type": "object", + "properties": { + "sql_explain": { + "type": "object", + "$ref": "#/definitions/SQLExplain" + }, + "table_metas": { + "type": "array", + "items": { + "$ref": "#/definitions/TableMeta" + } + } + } + }, + "GetSQLAuditRecordResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/SQLAuditRecord" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetSQLAuditRecordTagTipsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetSQLAuditRecordsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/SQLAuditRecord" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetSqlAverageExecutionTimeResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/SqlAverageExecutionTime" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetSqlDEVRecordListResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/SqlDEVRecord" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetSqlExecutionFailPercentResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/SqlExecutionFailPercent" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetSqlFileOrderMethodResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/SqlFileOrderMethodRes" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetSqlManageListResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/SqlManage" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "sql_manage_bad_num": { + "type": "integer" + }, + "sql_manage_optimized_num": { + "type": "integer" + }, + "sql_manage_total_num": { + "type": "integer" + } + } + }, + "GetSqlManageRuleTipsResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleTips" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetSqlManageSqlAnalysisResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "description": "V1版本不能引用V2版本的结构体,所以只能复制一份", + "type": "object", + "$ref": "#/definitions/SqlAnalysis" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetSqlPerformanceInsightsRelatedSQLResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/RelatedSQLInfo" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetSqlPerformanceInsightsRelatedTransactionResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/RelatedTransactionInfo" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetSqlPerformanceInsightsResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/SqlPerformanceInsights" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetSqlVersionDetailResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/SqlVersionDetailResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetSqlVersionListResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/SqlVersionResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetSystemModuleRedDotsRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/ModuleRedDots" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetTableMetadataResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/InstanceTableMeta" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetTaskAnalysisDataResItemV1": { + "type": "object", + "properties": { + "sql_explain": { + "type": "object", + "$ref": "#/definitions/SQLExplain" + }, + "table_metas": { + "type": "array", + "items": { + "$ref": "#/definitions/TableMeta" + } + } + } + }, + "GetTaskAnalysisDataResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/GetTaskAnalysisDataResItemV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetUserTipsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/UserTipResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWechatAuditConfigurationResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/WechatConfigurationV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowAuditPassPercentResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/WorkflowAuditPassPercentV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowCountsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/WorkflowCountsV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowCreatedCountsEachDayResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/WorkflowCreatedCountsEachDayV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowDurationOfWaitingForAuditResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/WorkflowStageDuration" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowDurationOfWaitingForExecutionResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/WorkflowStageDuration" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowPassPercentResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/WorkflowPassPercentV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowPercentCountedByInstanceTypeResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/WorkflowPercentCountedByInstanceTypeV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowRejectedPercentGroupByCreatorResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowRejectedPercentGroupByCreator" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowRejectedPercentGroupByInstanceResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowRejectedPercentGroupByInstance" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/WorkflowResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowStatisticOfInstancesResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowStatisticOfInstance" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowStatusCountResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/WorkflowStatusCountV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowTasksItemV1": { + "type": "object", + "properties": { + "current_step_assignee_user_name_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "exec_end_time": { + "type": "string" + }, + "exec_start_time": { + "type": "string" + }, + "execution_user_name": { + "type": "string" + }, + "instance_maintenance_times": { + "type": "array", + "items": { + "$ref": "#/definitions/MaintenanceTimeResV1" + } + }, + "instance_name": { + "type": "string" + }, + "schedule_time": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "exec_scheduled", + "exec_failed", + "exec_succeeded", + "executing", + "manually_executed" + ] + }, + "task_id": { + "type": "integer" + }, + "task_pass_rate": { + "type": "number" + }, + "task_score": { + "type": "integer" + } + } + }, + "GetWorkflowTasksResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/GetWorkflowTasksItemV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowTemplateListResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowTemplateDetailResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowTemplateResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/WorkflowTemplateDetailResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowDetailResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetWorkflowsThatCanBeAssociatedToVersionResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AssociateWorkflows" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GlobalSqlManage": { + "type": "object", + "properties": { + "audit_result": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditResult" + } + }, + "first_appear_timestamp": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "instance_id": { + "type": "string" + }, + "instance_name": { + "type": "string" + }, + "problem_descriptions": { + "description": "根据来源信息拼接", + "type": "array", + "items": { + "type": "string" + } + }, + "project_name": { + "type": "string" + }, + "project_priority": { + "type": "string", + "enum": [ + "high", + "medium", + "low" + ] + }, + "project_uid": { + "type": "string" + }, + "source": { + "type": "object", + "$ref": "#/definitions/Source" + }, + "sql": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited", + "sent" + ] + } + } + }, + "GlobalWorkflowStatisticsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GraphResponse": { + "type": "object", + "properties": { + "edges": { + "description": "边集合", + "type": "array", + "items": { + "$ref": "#/definitions/EdgeResponse" + } + }, + "nodes": { + "description": "节点集合", + "type": "array", + "items": { + "$ref": "#/definitions/NodeResponse" + } + } + } + }, + "HighPriorityConditionReq": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "operator": { + "type": "string", + "default": ">", + "enum": [ + ">", + "=", + "<" + ] + }, + "value": { + "type": "string" + } + } + }, + "HighPriorityConditionResV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "enums_value": { + "type": "array", + "items": { + "$ref": "#/definitions/EnumsValueResV1" + } + }, + "key": { + "type": "string" + }, + "operator": { + "type": "object", + "$ref": "#/definitions/OperatorResV1" + }, + "type": { + "type": "string", + "enum": [ + "string", + "int", + "bool", + "password" + ] + }, + "value": { + "type": "string" + } + } + }, + "InstanceAdditionalParamResV1": { + "type": "object", + "properties": { + "description": { + "type": "string", + "example": "参数项中文名" + }, + "name": { + "type": "string", + "example": "param name" + }, + "type": { + "type": "string", + "example": "int" + }, + "value": { + "type": "string", + "example": "0" + } + } + }, + "InstanceAuditPlanDetailResV1": { + "type": "object", + "properties": { + "audit_plans": { + "description": "扫描类型", + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanRes" + } + }, + "business": { + "description": "This parameter is deprecated", + "type": "string", + "example": "test" + }, + "environment": { + "type": "string", + "example": "prod" + }, + "instance_id": { + "type": "string", + "example": "instance_id" + }, + "instance_name": { + "type": "string", + "example": "test_mysql" + }, + "instance_type": { + "type": "string", + "example": "mysql" + } + } + }, + "InstanceAuditPlanInfo": { + "type": "object", + "properties": { + "active_status": { + "type": "string", + "enum": [ + "normal", + "disabled" + ] + }, + "audit_plan_db_type": { + "type": "string", + "example": "mysql" + }, + "audit_plan_instance_name": { + "type": "string", + "example": "test_mysql" + }, + "audit_plan_rule_template": { + "type": "object", + "$ref": "#/definitions/AuditPlanRuleTemplate" + }, + "audit_plan_type": { + "type": "object", + "$ref": "#/definitions/AuditPlanTypeResBase" + }, + "exec_cmd": { + "type": "string", + "example": "./scanner xxx" + }, + "id": { + "type": "integer" + }, + "last_collection_status": { + "type": "string", + "enum": [ + "normal", + "abnormal" + ] + }, + "last_collection_time": { + "type": "string" + }, + "token_exp": { + "type": "integer", + "example": 1747129752 + }, + "total_sql_nums": { + "type": "integer" + }, + "unsolved_sql_nums": { + "type": "integer" + } + } + }, + "InstanceAuditPlanResV1": { + "type": "object", + "properties": { + "active_status": { + "type": "string", + "enum": [ + "normal", + "disabled" + ] + }, + "audit_plan_types": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanTypeResBase" + } + }, + "create_time": { + "description": "TODO 采集状态", + "type": "string" + }, + "creator": { + "type": "string" + }, + "environment": { + "type": "string" + }, + "instance_audit_plan_id": { + "type": "integer" + }, + "instance_id": { + "type": "string" + }, + "instance_name": { + "type": "string" + }, + "instance_type": { + "type": "string" + } + } + }, + "InstanceConnectableResV1": { + "type": "object", + "properties": { + "connect_error_message": { + "type": "string" + }, + "is_instance_connectable": { + "type": "boolean" + } + } + }, + "InstanceConnectionResV1": { + "type": "object", + "properties": { + "connect_error_message": { + "type": "string" }, - "model.AuditResultInfo": { - "type": "object", - "properties": { - "errorInfo": { - "type": "string" - }, - "message": { - "type": "string" - } - } + "instance_name": { + "type": "string" }, - "model.I18nAuditResultInfo": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/model.AuditResultInfo" - } + "is_instance_connectable": { + "type": "boolean" + } + } + }, + "InstanceForCheckConnection": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "InstanceForCreatingTask": { + "type": "object", + "properties": { + "instance_name": { + "type": "string" + }, + "instance_schema": { + "type": "string" + } + } + }, + "InstanceInfo": { + "type": "object", + "properties": { + "instance_id": { + "type": "string" + }, + "instance_name": { + "type": "string" + } + } + }, + "InstanceOverviewStatistics": { + "type": "object", + "properties": { + "avg_score": { + "type": "number" }, - "model.RuleCategoryStatistic": { - "type": "object", - "properties": { - "category": { - "type": "string", - "enum": [ - "audit_accuracy", - "audit_purpose", - "operand", - "sql" - ] - }, - "count": { - "type": "integer" - }, - "tag": { - "type": "string" - } - } - }, - "sql_flash.AdvisedIndex": { - "type": "object", - "properties": { - "has_advice": { - "type": "boolean" - }, - "indexes": { - "type": "array", - "items": { - "$ref": "#/definitions/sql_flash.IndexInfo" - } - }, - "other_advice": { - "type": "string" - }, - "state": { - "type": "string" - } - } - }, - "sql_flash.Analysis": { - "type": "object", - "properties": { - "detail": { - "type": "array", - "items": { - "$ref": "#/definitions/sql_flash.AnalysisDetail" - } - }, - "improvement_desc": { - "type": "string" - }, - "improvement_rate": { - "type": "number" - }, - "state": { - "type": "string" - }, - "total_score": { - "type": "number" - } - } - }, - "sql_flash.AnalysisDetail": { - "type": "object", - "properties": { - "category": { - "type": "string" - }, - "optimized_score": { - "type": "number" - }, - "original_score": { - "type": "number" - } - } - }, - "sql_flash.IndexInfo": { - "type": "object", - "properties": { - "create_index_statement": { - "type": "string" - }, - "reason": { - "type": "string" - } - } + "high_priority_sql_count": { + "type": "integer" }, - "sql_flash.OptimizeDetail": { - "type": "object", - "properties": { - "state": { - "type": "string" - }, - "steps": { - "type": "array", - "items": { - "$ref": "#/definitions/sql_flash.OptimizeStep" - } - } - } - }, - "sql_flash.OptimizeStep": { - "type": "object", - "properties": { - "analysis": { - "type": "object", - "$ref": "#/definitions/sql_flash.Analysis" - }, - "chat_id": { - "type": "string" - }, - "optimized_sql": { - "type": "string" - }, - "query_plan": { - "type": "object", - "$ref": "#/definitions/sql_flash.QueryPlan" - }, - "rule_desc": { - "type": "string" - }, - "rule_id": { - "type": "string" - }, - "rule_name": { - "type": "string" - } - } - }, - "sql_flash.QueryPlan": { - "type": "object", - "properties": { - "query_plan_desc": { - "type": "array", - "items": { - "$ref": "#/definitions/sql_flash.QueryPlanNode" - } - }, - "state": { - "type": "string" - } - } - }, - "sql_flash.QueryPlanNode": { - "type": "object", - "properties": { - "children": { - "type": "array", - "items": { - "$ref": "#/definitions/sql_flash.QueryPlanNode" - } - }, - "operator": { - "type": "string" - }, - "summary": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "sql_flash.TotalAnalysis": { - "type": "object", - "properties": { - "detail": { - "type": "array", - "items": { - "$ref": "#/definitions/sql_flash.AnalysisDetail" - } - }, - "improvement_desc": { - "type": "string" - }, - "improvement_rate": { - "type": "number" - }, - "state": { - "type": "string" - }, - "total_score": { - "type": "number" - } - } - }, - "v1.AIHubBannerData": { - "type": "object", - "properties": { - "modules": { - "description": "按模块分组的Banner卡片", - "type": "array", - "items": { - "$ref": "#/definitions/v1.AIModuleBannerCards" - } - } - } + "instance_id": { + "type": "string" }, - "v1.AIHubExecutionRecord": { - "type": "object", - "properties": { - "estimated_upgrade": { - "description": "预估提升", - "type": "number" - }, - "function_module": { - "description": "功能模块", - "type": "string", - "enum": [ - "smart_correction", - "performance_engine" - ] - }, - "id": { - "description": "记录ID", - "type": "integer" - }, - "operation_time": { - "description": "操作时间", - "type": "string" - }, - "process_status": { - "description": "处理状态", - "type": "string", - "enum": [ - "pending", - "running", - "completed", - "failed" - ] - }, - "source_project": { - "description": "来源项目", - "type": "string" - }, - "sql_snippet": { - "description": "SQL片段", - "type": "string" - }, - "value_dimension": { - "description": "价值维度", - "type": "string", - "enum": [ - "security", - "performance", - "correction", - "maintenance", - "code_standard" - ] - } - } - }, - "v1.AIHubManagementViewData": { - "type": "object", - "properties": { - "modules": { - "description": "按模块分组的分析数据", - "type": "array", - "items": { - "$ref": "#/definitions/v1.AIModuleAnalysis" - } - } - } + "pending_workflow_count": { + "type": "integer" + } + } + }, + "InstanceSchemaResV1": { + "type": "object", + "properties": { + "schema_name_list": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "InstanceTableMeta": { + "type": "object", + "properties": { + "columns": { + "type": "object", + "$ref": "#/definitions/TableColumns" }, - "v1.AIHubStrategicValueData": { - "type": "object", - "properties": { - "ai_strategic_insight": { - "description": "AI战略洞察", - "type": "object", - "$ref": "#/definitions/v1.AIStrategicInsight" - }, - "efficiency_cards": { - "description": "效能卡片列表", - "type": "array", - "items": { - "$ref": "#/definitions/v1.EfficiencyCard" - } - } - } - }, - "v1.AIModuleAnalysis": { - "type": "object", - "properties": { - "ai_module_type": { - "description": "AI模块类型", - "type": "string", - "enum": [ - "smart_correction", - "performance_engine" - ] - }, - "project_io_analysis": { - "description": "项目组投入产出分析", - "type": "array", - "items": { - "$ref": "#/definitions/v1.ProjectIOAnalysis" - } - }, - "top_problem_distribution": { - "description": "Top问题分布", - "type": "array", - "items": { - "$ref": "#/definitions/v1.TopProblemDistribution" - } - } - } - }, - "v1.AIModuleBannerCards": { - "type": "object", - "properties": { - "ai_module_type": { - "description": "AI模块类型", - "type": "string", - "enum": [ - "smart_correction", - "performance_engine" - ] - }, - "banner_cards": { - "description": "Banner卡片列表", - "type": "array", - "items": { - "$ref": "#/definitions/v1.BannerCard" - } - }, - "is_enabled": { - "description": "功能是否启用", - "type": "boolean", - "example": true - } - } - }, - "v1.AIStrategicInsight": { - "type": "object", - "properties": { - "description": { - "description": "描述", - "type": "string" - }, - "title": { - "description": "标题", - "type": "string" - } - } - }, - "v1.AbnormalAuditPlanInstance": { - "type": "object", - "properties": { - "abnormal_status_code": { - "type": "integer" - }, - "instance_audit_plan_id": { - "type": "integer" - }, - "instance_name": { - "type": "string", - "example": "MySQL" - }, - "token_exp": { - "type": "integer", - "example": 1747129752 - } - } - }, - "v1.AffectRows": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "err_message": { - "type": "string" - } - } + "create_table_sql": { + "type": "string" }, - "v1.AssociateWorkflows": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "canceled", - "exec_failed", - "executing", - "finished" - ] - }, - "workflow_id": { - "type": "string" - }, - "workflow_name": { - "type": "string" - } - } - }, - "v1.AsyncRewriteTask": { - "type": "object", - "properties": { - "end_time": { - "description": "结束时间", - "type": "string" - }, - "error_message": { - "description": "错误信息", - "type": "string" - }, - "result": { - "description": "重写结果", - "type": "object", - "$ref": "#/definitions/v1.RewriteSQLData" - }, - "sql_number": { - "description": "SQL编号", - "type": "string" - }, - "start_time": { - "description": "开始时间", - "type": "string" - }, - "status": { - "description": "任务状态", - "type": "string", - "enum": [ - "pending", - "running", - "completed", - "failed" - ] - }, - "task_id": { - "description": "任务ID", - "type": "string" - } - } - }, - "v1.AsyncRewriteTaskStatusRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AsyncRewriteTask" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.AuditFileResp": { - "type": "object", - "properties": { - "file_name": { - "type": "string" - } - } + "indexes": { + "type": "object", + "$ref": "#/definitions/TableIndexes" }, - "v1.AuditPlan": { - "type": "object", - "properties": { - "audit_plan_params": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanParamReqV1" - } - }, - "audit_plan_type": { - "type": "string", - "example": "slow log" - }, - "high_priority_conditions": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.HighPriorityConditionReq" - } - }, - "need_mark_high_priority_sql": { - "type": "boolean" - }, - "rule_template_name": { - "type": "string", - "example": "default_MySQL" - } - } - }, - "v1.AuditPlanCount": { - "type": "object", - "properties": { - "audit_plan_count": { - "type": "integer" - }, - "audit_plan_desc": { - "type": "string" - }, - "audit_plan_type": { - "type": "string" - } - } - }, - "v1.AuditPlanMetaV1": { - "type": "object", - "properties": { - "audit_plan_params": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanParamResV1" - } - }, - "audit_plan_type": { - "type": "string" - }, - "audit_plan_type_desc": { - "type": "string" - }, - "audit_plan_type_tips": { - "type": "string" - }, - "high_priority_conditions": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.HighPriorityConditionResV1" - } - }, - "instance_type": { - "type": "string" - } - } - }, - "v1.AuditPlanParamReqV1": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - } + "name": { + "type": "string" }, - "v1.AuditPlanParamResV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "enums_value": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.EnumsValueResV1" - } - }, - "key": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "string", - "int", - "bool", - "password" - ] - }, - "value": { - "type": "string" - } - } - }, - "v1.AuditPlanReportResV1": { - "type": "object", - "properties": { - "audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error", - "" - ] - }, - "audit_plan_report_id": { - "type": "string", - "example": "1" - }, - "audit_plan_report_timestamp": { - "type": "string", - "example": "RFC3339" - }, - "pass_rate": { - "type": "number" - }, - "score": { - "type": "integer" - } - } - }, - "v1.AuditPlanReportSQLResV1": { - "type": "object", - "properties": { - "audit_plan_report_sql": { - "type": "string", - "example": "select * from t1 where id = 1" - }, - "audit_plan_report_sql_audit_result": { - "type": "string", - "example": "same format as task audit result" - }, - "number": { - "type": "integer", - "example": 1 - } - } - }, - "v1.AuditPlanRes": { - "type": "object", - "properties": { - "audit_plan_params": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanParamResV1" - } - }, - "audit_plan_type": { - "type": "object", - "$ref": "#/definitions/v1.AuditPlanTypeResBase" - }, - "high_priority_conditions": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.HighPriorityConditionResV1" - } - }, - "need_mark_high_priority_sql": { - "type": "boolean" - }, - "rule_template_name": { - "type": "string", - "example": "default_MySQL" - } - } - }, - "v1.AuditPlanResV1": { - "type": "object", - "properties": { - "audit_plan_cron": { - "type": "string", - "example": "0 */2 * * *" - }, - "audit_plan_db_type": { - "type": "string", - "example": "mysql" - }, - "audit_plan_instance_database": { - "type": "string", - "example": "app1" - }, - "audit_plan_instance_name": { - "type": "string", - "example": "test_mysql" - }, - "audit_plan_meta": { - "type": "object", - "$ref": "#/definitions/v1.AuditPlanMetaV1" - }, - "audit_plan_name": { - "type": "string", - "example": "audit_for_java_app1" - }, - "audit_plan_token": { - "type": "string", - "example": "it's a JWT Token for scanner" - }, - "rule_template_name": { - "type": "string", - "example": "default_MySQL" - } - } - }, - "v1.AuditPlanRuleTemplate": { - "type": "object", - "properties": { - "is_global_rule_template": { - "type": "boolean" - }, - "name": { - "type": "string" - } - } + "schema": { + "type": "string" + } + } + }, + "InstanceTipResV1": { + "type": "object", + "properties": { + "backup_max_rows": { + "type": "integer" + }, + "enable_backup": { + "type": "boolean" + }, + "host": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "instance_name": { + "type": "string" + }, + "instance_type": { + "type": "string" + }, + "port": { + "type": "string" + }, + "supported_backup_strategy": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "original_row" + ] + } + }, + "workflow_template_id": { + "type": "integer" + } + } + }, + "InstanceTypePercent": { + "type": "object", + "properties": { + "count": { + "type": "integer" }, - "v1.AuditPlanSQLDataResV1": { - "type": "object", - "properties": { - "rows": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - }, - "v1.AuditPlanSQLHeadV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "field_name": { - "type": "string" - }, - "sortable": { - "type": "boolean" - }, - "type": { - "type": "string", - "enum": [ - "sql" - ] - } - } - }, - "v1.AuditPlanSQLMetaResV1": { - "type": "object", - "properties": { - "filter_meta_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.FilterMeta" - } - }, - "head": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanSQLHeadV1" - } - } - } - }, - "v1.AuditPlanSQLReqV1": { - "type": "object", - "properties": { - "audit_plan_sql_counter": { - "type": "string", - "example": "6" - }, - "audit_plan_sql_fingerprint": { - "type": "string", - "example": "select * from t1 where id = ?" - }, - "audit_plan_sql_last_receive_text": { - "type": "string", - "example": "select * from t1 where id = 1" - }, - "audit_plan_sql_last_receive_timestamp": { - "type": "string", - "example": "RFC3339" - }, - "audit_plan_sql_schema": { - "type": "string", - "example": "db1" - }, - "db_user": { - "type": "string", - "example": "database_user001" - }, - "endpoint": { - "type": "string", - "example": "10.186.1.2" - }, - "first_query_at": { - "type": "string", - "example": "2023-09-12T02:48:01.317880Z" - }, - "query_time_avg": { - "type": "number", - "example": 3.22 - }, - "query_time_max": { - "type": "number", - "example": 5.22 - } - } - }, - "v1.AuditPlanSQLResV1": { - "type": "object", - "properties": { - "head": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanSQLHeadV1" - } - }, - "rows": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - }, - "v1.AuditPlanTypeResBase": { - "type": "object", - "properties": { - "active_status": { - "type": "string", - "enum": [ - "normal", - "disabled" - ] - }, - "audit_plan_id": { - "type": "integer" - }, - "desc": { - "type": "string" - }, - "last_collection_status": { - "type": "string", - "enum": [ - "normal", - "abnormal" - ] - }, - "token": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "v1.AuditPlanTypesV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "instance_type": { - "type": "string", - "enum": [ - "MySQL", - "Oracle", - "TiDB", - "OceanBase For MySQL", - "" - ] - }, - "type": { - "type": "string" - } - } - }, - "v1.AuditResDataV1": { - "type": "object", - "properties": { - "audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error", - "" - ] - }, - "pass_rate": { - "type": "number" - }, - "score": { - "type": "integer" - }, - "sql_results": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditSQLResV1" - } - } - } - }, - "v1.AuditResult": { - "type": "object", - "properties": { - "error_info": { - "type": "string" - }, - "execution_failed": { - "type": "boolean" - }, - "level": { - "type": "string", - "example": "warn" - }, - "message": { - "type": "string", - "example": "避免使用不必要的内置函数md5()" - }, - "rule_name": { - "type": "string" - } - } - }, - "v1.AuditSQLResV1": { - "type": "object", - "properties": { - "audit_level": { - "type": "string" - }, - "audit_result": { - "type": "string" - }, - "exec_sql": { - "type": "string" - }, - "number": { - "type": "integer" - } - } - }, - "v1.AuditTaskGroupRes": { - "type": "object", - "properties": { - "task_group_id": { - "type": "integer" - }, - "tasks": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditTaskResV1" - } - } - } - }, - "v1.AuditTaskGroupResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AuditTaskGroupRes" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.AuditTaskResV1": { - "type": "object", - "properties": { - "audit_files": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditFileResp" - } - }, - "audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error", - "" - ] - }, - "backup_conflict_with_instance": { - "description": "当数据源备份开启,工单备份关闭,则需要提示审核人工单备份策略与数据源备份策略不一致", - "type": "boolean" - }, - "backup_max_rows": { - "type": "integer" - }, - "enable_backup": { - "type": "boolean" - }, - "exec_end_time": { - "type": "string" - }, - "exec_fail_reason": { - "type": "string" - }, - "exec_fail_sql_count": { - "type": "integer" - }, - "exec_fail_sql_id": { - "type": "integer" - }, - "exec_fail_sql_number": { - "type": "integer" - }, - "exec_fail_stage": { - "type": "string" - }, - "exec_mode": { - "type": "string" - }, - "exec_start_time": { - "type": "string" - }, - "file_order_method": { - "type": "string" - }, - "instance_db_type": { - "type": "string" - }, - "instance_name": { - "type": "string" - }, - "instance_schema": { - "type": "string", - "example": "db1" - }, - "pass_rate": { - "type": "number" - }, - "score": { - "type": "integer" - }, - "sql_source": { - "type": "string", - "enum": [ - "form_data", - "sql_file", - "mybatis_xml_file", - "audit_plan", - "zip_file", - "git_repository" - ] - }, - "status": { - "type": "string", - "enum": [ - "initialized", - "audited", - "executing", - "exec_success", - "exec_failed", - "manually_executed" - ] - }, - "task_id": { - "type": "integer" - } - } - }, - "v1.AuditTaskSQLContentResV1": { - "type": "object", - "properties": { - "sql": { - "type": "string", - "example": "alter table tb1 drop columns c1" - } - } + "percent": { + "type": "number" }, - "v1.AuditTaskSQLResV1": { - "type": "object", - "properties": { - "audit_level": { - "type": "string" - }, - "audit_result": { - "type": "string" - }, - "audit_status": { - "type": "string" - }, - "description": { - "type": "string" - }, - "exec_result": { - "type": "string" - }, - "exec_sql": { - "type": "string" - }, - "exec_status": { - "type": "string" - }, - "number": { - "type": "integer" - }, - "rollback_sqls": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "v1.AuditTasksGroupResV1": { - "type": "object", - "properties": { - "task_group_id": { - "type": "integer" - } - } + "type": { + "type": "string" + } + } + }, + "InstancesTypePercentV1": { + "type": "object", + "properties": { + "instance_total_num": { + "type": "integer" + }, + "instance_type_percents": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceTypePercent" + } + } + } + }, + "KnowledgeBase": { + "type": "object", + "properties": { + "content": { + "description": "内容", + "type": "string" + }, + "description": { + "description": "描述", + "type": "string" + }, + "id": { + "description": "知识库ID", + "type": "integer" + }, + "rule_name": { + "description": "规则名称", + "type": "string" + }, + "tags": { + "description": "标签", + "type": "array", + "items": { + "$ref": "#/definitions/Tag" + } + }, + "title": { + "description": "标题", + "type": "string" + } + } + }, + "LicenseItem": { + "type": "object", + "properties": { + "description": { + "type": "string" }, - "v1.AuditWhitelistResV1": { - "type": "object", - "properties": { - "audit_whitelist_id": { - "type": "integer" - }, - "desc": { - "type": "string" - }, - "last_match_time": { - "type": "string" - }, - "match_type": { - "type": "string" - }, - "matched_count": { - "type": "integer" - }, - "value": { - "type": "string" - } - } - }, - "v1.AuditedSQLCount": { - "type": "object", - "properties": { - "risk_sql_count": { - "type": "integer" - }, - "total_sql_count": { - "type": "integer" - } - } + "limit": { + "type": "string" }, - "v1.AutoCreateAndExecuteWorkflowResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AutoCreateAndExecuteWorkflowResV1Data" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.AutoCreateAndExecuteWorkflowResV1Data": { - "type": "object", - "properties": { - "workflow_id": { - "type": "string" - }, - "workflow_status": { - "type": "string" - } - } + "name": { + "type": "string" + } + } + }, + "LicenseUsageItem": { + "type": "object", + "properties": { + "is_limited": { + "type": "boolean" }, - "v1.BackupSqlData": { - "type": "object", - "properties": { - "backup_result": { - "type": "string" - }, - "backup_sqls": { - "type": "array", - "items": { - "type": "string" - } - }, - "backup_status": { - "type": "string", - "enum": [ - "waiting_for_execution", - "executing", - "failed", - "succeed" - ] - }, - "backup_strategy": { - "type": "string", - "enum": [ - "none", - "manual", - "reverse_sql", - "original_row" - ] - }, - "description": { - "type": "string" - }, - "exec_order": { - "type": "integer" - }, - "exec_sql_id": { - "type": "integer" - }, - "exec_status": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "instance_name": { - "type": "string" - }, - "origin_sql": { - "type": "string" - }, - "origin_task_id": { - "type": "integer" - } - } - }, - "v1.BackupSqlListRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.BackupSqlData" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.BannerCard": { - "type": "object", - "properties": { - "evidence_value": { - "description": "具体指标分值", - "type": "string", - "example": "22" - }, - "metric_evaluation": { - "description": "效能评价", - "type": "string", - "example": "高危风险消除率 79%" - }, - "need_display": { - "description": "是否需要展示", - "type": "boolean", - "example": true - } - } - }, - "v1.BatchAssociateWorkflowsWithVersionReqV1": { - "type": "object", - "properties": { - "workflow_ids": { - "type": "array", - "items": { - "type": "string" - } - } - } + "limit": { + "type": "integer" }, - "v1.BatchCancelWorkflowsReqV1": { - "type": "object", - "properties": { - "workflow_names": { - "type": "array", - "items": { - "type": "string" - } - } - } + "resource_type": { + "type": "string" }, - "v1.BatchCheckInstanceConnectionsReqV1": { - "type": "object", - "properties": { - "instances": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.InstanceForCheckConnection" - } - } + "resource_type_desc": { + "type": "string" + }, + "used": { + "type": "integer" + } + } + }, + "LicenseUsageV1": { + "type": "object", + "properties": { + "instances_usage": { + "type": "array", + "items": { + "$ref": "#/definitions/LicenseUsageItem" + } + }, + "users_usage": { + "type": "object", + "$ref": "#/definitions/LicenseUsageItem" + } + } + }, + "Line": { + "type": "object", + "properties": { + "line_name": { + "description": "线条名称", + "type": "string" + }, + "points": { + "description": "图表点数据", + "type": "array", + "items": { + "$ref": "#/definitions/ChartPoint" + } + } + } + }, + "ListTableBySchemaResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/Table" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "LockSqlVersionReqV1": { + "type": "object", + "properties": { + "is_locked": { + "type": "boolean" + } + } + }, + "MaintenanceTimeResV1": { + "type": "object", + "properties": { + "maintenance_start_time": { + "type": "object", + "$ref": "#/definitions/TimeResV1" + }, + "maintenance_stop_time": { + "type": "object", + "$ref": "#/definitions/TimeResV1" + } + } + }, + "ModuleRedDot": { + "type": "object", + "properties": { + "has_red_dot": { + "type": "boolean" + }, + "module_name": { + "type": "string", + "enum": [ + "global_dashboard" + ] + } + } + }, + "ModuleRedDots": { + "type": "array", + "items": { + "$ref": "#/definitions/ModuleRedDot" + } + }, + "ModuleStatusRes": { + "type": "object", + "properties": { + "is_supported": { + "type": "boolean" + } + } + }, + "NodeResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "weight": { + "type": "integer" + } + } + }, + "ObjectDiffResult": { + "type": "object", + "properties": { + "comparison_result": { + "type": "string", + "enum": [ + "same", + "inconsistent", + "base_not_exist", + "comparison_not_exist" + ] + }, + "object_name": { + "type": "string" + } + } + }, + "OperationResV1": { + "type": "object", + "properties": { + "op_code": { + "type": "integer" + }, + "op_desc": { + "type": "string" + } + } + }, + "OperatorResV1": { + "type": "object", + "properties": { + "operator_enums_value": { + "type": "array", + "items": { + "$ref": "#/definitions/EnumsValueResV1" + } + }, + "operator_value": { + "type": "string" + } + } + }, + "OptimizationDetail": { + "type": "object", + "properties": { + "basic_summary": { + "type": "object", + "$ref": "#/definitions/Optimizationsummary" + }, + "created_time": { + "type": "string" + }, + "created_user": { + "type": "string" + }, + "db_type": { + "type": "string" + }, + "index_recommendations": { + "type": "array", + "items": { + "type": "string" + } + }, + "instance_name": { + "type": "string" + }, + "optimization_id": { + "type": "string" + }, + "optimization_name": { + "type": "string" + }, + "status": { + "description": "优化状态", + "type": "string" + } + } + }, + "OptimizationRecord": { + "type": "object", + "properties": { + "adoption_rate": { + "description": "优化采纳率", + "type": "number" + }, + "created_time": { + "description": "创建时间", + "type": "string" + }, + "created_user": { + "description": "创建人", + "type": "string" + }, + "db_type": { + "description": "数据库类型", + "type": "string" + }, + "instance_name": { + "description": "数据源", + "type": "string" + }, + "number_of_index": { + "description": "优化索引数量", + "type": "integer" + }, + "number_of_rule": { + "description": "优化规则数量", + "type": "integer" + }, + "optimization_id": { + "description": "优化ID", + "type": "string" + }, + "optimization_name": { + "type": "string" + }, + "performance_improve": { + "description": "优化提升性能", + "type": "number" + }, + "status": { + "description": "优化状态", + "type": "string", + "enum": [ + "optimizing", + "failed", + "finish" + ] + }, + "status_detail": { + "description": "优化状态详情", + "type": "string" + } + } + }, + "OptimizationRecordOverview": { + "type": "object", + "properties": { + "record_number": { + "type": "integer" + }, + "time": { + "type": "string" + } + } + }, + "OptimizationSQL": { + "type": "object", + "properties": { + "contributing_indices": { + "type": "string" + }, + "number": { + "type": "integer" + }, + "number_of_hit_index": { + "type": "integer" + }, + "number_of_index": { + "type": "integer" + }, + "number_of_rewrite": { + "type": "integer" + }, + "number_of_syntax_error": { + "type": "integer" + }, + "original_sql": { + "type": "string" + }, + "performance": { + "type": "number" + } + } + }, + "OptimizationSQLDetail": { + "type": "object", + "properties": { + "advised_index": { + "description": "索引建议详情", + "type": "object", + "$ref": "#/definitions/AdvisedIndex" + }, + "id": { + "type": "integer" + }, + "metadata": { + "description": "数据库元数据信息", + "type": "string" + }, + "optimization_id": { + "type": "string" + }, + "optimize": { + "description": "优化详情", + "type": "object", + "$ref": "#/definitions/OptimizeDetail" + }, + "optimize_status": { + "description": "优化状态", + "type": "string", + "enum": [ + "optimizing", + "failed", + "finish" + ] + }, + "optimized_sql_feedbacks": { + "description": "优化后的SQL反馈", + "type": "array", + "items": { + "$ref": "#/definitions/OptimizedSQLFeedback" + } + }, + "origin_query_plan": { + "description": "原始SQL查询计划", + "type": "object", + "$ref": "#/definitions/QueryPlan" + }, + "origin_sql": { + "description": "SQL Flash相关字段", + "type": "string" + }, + "status": { + "description": "SQLe 维护的状态", + "type": "string", + "enum": [ + "rewriting", + "rewrite_done", + "advise_indexing", + "advise_index_done", + "finish", + "failed" + ] + }, + "status_detail": { + "description": "SQLe 维护的状态详情", + "type": "string" + }, + "total_analysis": { + "description": "总体分析", + "type": "object", + "$ref": "#/definitions/TotalAnalysis" + }, + "total_state": { + "description": "总状态", + "type": "string" + } + } + }, + "Optimizationsummary": { + "type": "object", + "properties": { + "number_of_index": { + "type": "integer" + }, + "number_of_query": { + "type": "integer" + }, + "number_of_query_index": { + "type": "integer" + }, + "number_of_rewrite": { + "type": "integer" + }, + "number_of_rewritten_query": { + "type": "integer" + }, + "number_of_syntax_error": { + "type": "integer" + }, + "performance_gain": { + "type": "number" + } + } + }, + "OptimizeSQLReq": { + "type": "object", + "properties": { + "db_type": { + "type": "string", + "example": "MySQL" + }, + "enable_high_analysis": { + "description": "是否启用高级分析", + "type": "boolean" + }, + "explain_info": { + "type": "string" + }, + "instance_name": { + "type": "string", + "example": "instance1" + }, + "metadata": { + "type": "string" + }, + "optimization_name": { + "type": "string", + "example": "optmz_2024031412091244" + }, + "schema_name": { + "type": "string", + "example": "schema1" + }, + "sql_content": { + "type": "string", + "example": "select * from t1; select * from t2;" + } + } + }, + "OptimizeSQLRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/OptimizeSQLResData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "OptimizeSQLResData": { + "type": "object", + "properties": { + "sql_optimization_record_id": { + "type": "string" + } + } + }, + "ParseProjectRuleTemplateFileResDataV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "name": { + "type": "string" + }, + "rule_list": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleResV1" + } + }, + "rule_version": { + "type": "integer" + } + } + }, + "ParseProjectRuleTemplateFileResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/ParseProjectRuleTemplateFileResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "PartialSyncAuditPlanSQLsReqV1": { + "type": "object", + "properties": { + "audit_plan_sql_list": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanSQLReqV1" + } + } + } + }, + "PerformanceStatistics": { + "type": "object", + "properties": { + "affect_rows": { + "type": "object", + "$ref": "#/definitions/AffectRows" + } + } + }, + "PostSqlManageCodingResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/CodingResp" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "ProjectIOAnalysis": { + "type": "object", + "properties": { + "active_members": { + "description": "活跃人数", + "type": "integer" + }, + "health_score": { + "description": "健康分", + "type": "number", + "example": 92.3 + }, + "invoke_count": { + "description": "调用频次", + "type": "integer" + }, + "performance_gain": { + "description": "性能提升", + "type": "string", + "example": "+35%" + }, + "project_name": { + "description": "项目名称", + "type": "string" + }, + "time_saved": { + "description": "节省工时", + "type": "number", + "example": 45.5 + } + } + }, + "ProjectRuleTemplateResV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "rule_template_name": { + "type": "string" + } + } + }, + "ProjectScore": { + "type": "object", + "properties": { + "score": { + "type": "integer" + } + } + }, + "ReExecuteTaskOnWorkflowReq": { + "type": "object", + "properties": { + "exec_sql_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "RecordSource": { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": [ + "ide_plugin" + ] + }, + "value": { + "type": "string" + } + } + }, + "RefreshAuditPlanTokenReqV1": { + "type": "object", + "properties": { + "expires_in_days": { + "type": "integer" + } + } + }, + "RejectWorkflowReqV1": { + "type": "object", + "properties": { + "reason": { + "type": "string" + } + } + }, + "RelatedSQLInfo": { + "type": "object", + "properties": { + "execute_time_avg": { + "description": "平均执行时间(s)", + "type": "number" + }, + "execute_time_max": { + "description": "最大执行时间(s)", + "type": "number" + }, + "execute_time_min": { + "description": "最小执行时间(s)", + "type": "number" + }, + "execute_time_sum": { + "description": "总执行时间(s)", + "type": "number" + }, + "execution_time_trend": { + "description": "SQL 趋势图表", + "type": "object", + "$ref": "#/definitions/SqlAnalysisScatterChart" + }, + "lock_wait_time": { + "description": "锁等待时间(s)", + "type": "number" + }, + "source": { + "type": "string", + "enum": [ + "workflow", + "sql_manage" + ] + }, + "sql_fingerprint": { + "type": "string" + } + } + }, + "RelatedTransactionInfo": { + "type": "object", + "properties": { + "related_sql_info": { + "description": "相关SQL列表", + "type": "array", + "items": { + "$ref": "#/definitions/TransactionSQL" + } + }, + "transaction_info": { + "description": "事务信息", + "type": "object", + "$ref": "#/definitions/TransactionInfo" + }, + "transaction_lock_info": { + "description": "事务锁信息", + "type": "array", + "items": { + "$ref": "#/definitions/TransactionLockInfo" + } + }, + "transaction_timeline": { + "description": "事务时间线", + "type": "object", + "$ref": "#/definitions/TransactionTimeline" + } + } + }, + "ReleaseWorkflows": { + "type": "object", + "properties": { + "target_release_instances": { + "type": "array", + "items": { + "$ref": "#/definitions/TargetReleaseInstance" + } + }, + "workflow_id": { + "type": "string" + } + } + }, + "ReportPushConfigList": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "last_push_time": { + "type": "string" + }, + "push_frequency_cron": { + "type": "string" + }, + "push_user_Type": { + "type": "string", + "enum": [ + "fixed", + "permission_match" + ] + }, + "push_user_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "report_push_config_id": { + "type": "string" + }, + "trigger_type": { + "type": "string", + "enum": [ + "immediately", + "timing" + ] + }, + "type": { + "type": "string" + } + } + }, + "RewriteRule": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "rewritten_queries_str": { + "type": "string" + }, + "rule_code": { + "type": "string" + }, + "rule_name": { + "type": "string" + }, + "violated_queries_str": { + "type": "string" + } + } + }, + "RewriteSQLData": { + "type": "object", + "properties": { + "business_desc": { + "description": "重写前的SQL业务描述", + "type": "string" + }, + "business_non_equivalent_desc": { + "description": "重写前后的业务不等价性描述,为空表示等价", + "type": "string" + }, + "logic_desc": { + "description": "重写前的SQL执行逻辑描述", + "type": "string" + }, + "rewritten_sql": { + "description": "重写后的SQL", + "type": "string" + }, + "rewritten_sql_business_desc": { + "description": "重写后的SQL业务描述", + "type": "string" + }, + "rewritten_sql_logic_desc": { + "description": "重写后的SQL执行逻辑描述", + "type": "string" + }, + "suggestions": { + "description": "重写建议列表", + "type": "array", + "items": { + "$ref": "#/definitions/RewriteSuggestion" + } + } + } + }, + "RewriteSQLReq": { + "type": "object", + "properties": { + "enable_structure_type": { + "description": "是否启用结构化类型的重写", + "type": "boolean", + "default": false, + "example": false + } + } + }, + "RewriteSuggestion": { + "type": "object", + "properties": { + "audit_level": { + "description": "审核规则等级", + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ] + }, + "ddl_dcl": { + "description": "具体的数据库结构变更语句,需要在数据库中执行该变更语句之后再应用重写SQL(包含CREATE/ALTER/DROP等DDL语句,或SET等DCL语句)(适用于结构级重写)", + "type": "string" + }, + "ddl_dcl_desc": { + "description": "数据库结构变更建议说明(例如:建议添加索引、修改表结构等优化建议)(适用于结构级重写)", + "type": "string" + }, + "desc": { + "description": "重写描述(适用于所有类型)", + "type": "string" + }, + "rewritten_sql": { + "description": "重写后的SQL(适用于语句级重写和结构级重写)", + "type": "string" + }, + "rule_name": { + "description": "审核规则名称", + "type": "string" + }, + "status": { + "description": "处理状态:初始化、已处理", + "type": "string", + "default": "initial", + "enum": [ + "initial", + "processed" + ] + }, + "type": { + "description": "重写建议类型:语句级重写、结构级重写、其他", + "type": "string", + "enum": [ + "statement", + "structure", + "other" + ] + } + } + }, + "RiskAuditPlan": { + "type": "object", + "properties": { + "audit_plan_name": { + "type": "string" + }, + "audit_plan_report_id": { + "type": "integer" + }, + "audit_plan_report_timestamp": { + "type": "string" + }, + "risk_sql_count": { + "type": "integer" + }, + "trigger_audit_plan_time": { + "type": "string" + } + } + }, + "RiskWorkflow": { + "type": "object", + "properties": { + "create_user_name": { + "type": "string" + }, + "update_time": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "workflow_name": { + "type": "string" + }, + "workflow_status": { + "type": "string" + } + } + }, + "RoleUserCount": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "role": { + "type": "string" + } + } + }, + "RuleInfo": { + "type": "object", + "properties": { + "annotation": { + "type": "string", + "example": "this is test rule" + }, + "desc": { + "type": "string", + "example": "this is test rule" + } + } + }, + "RuleKnowledgeResV1": { + "type": "object", + "properties": { + "knowledge_content": { + "type": "string" + }, + "rule": { + "type": "object", + "$ref": "#/definitions/RuleInfo" + } + } + }, + "RuleParamReqV1": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "RuleParamResV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "key": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "string", + "int", + "bool" + ] + }, + "value": { + "type": "string" + } + } + }, + "RuleProjectTemplateDetailResV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "rule_list": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleResV1" + } + }, + "rule_template_name": { + "type": "string" + }, + "rule_version": { + "type": "integer" + } + } + }, + "RuleReqV1": { + "type": "object", + "properties": { + "is_custom_rule": { + "type": "boolean" + }, + "level": { + "type": "string", + "example": "error" + }, + "name": { + "type": "string", + "example": "ddl_check_index_count" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleParamReqV1" + } + } + } + }, + "RuleResV1": { + "type": "object", + "properties": { + "annotation": { + "type": "string", + "example": "避免多次 table rebuild 带来的消耗、以及对线上业务的影响" + }, + "categories": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" } + } }, - "v1.BatchCompleteWorkflowsReqV1": { - "type": "object", - "properties": { - "workflow_names": { - "type": "array", - "items": { - "type": "string" - } - } - } + "db_type": { + "type": "string", + "example": "mysql" }, - "v1.BatchExecuteWorkflowsReqV1": { - "type": "object", - "properties": { - "workflow_ids": { - "type": "array", - "items": { - "type": "string" - } - } - } + "desc": { + "type": "string" }, - "v1.BatchGetInstanceConnectionsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.InstanceConnectionResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.BatchReleaseWorkflowReqV1": { - "type": "object", - "properties": { - "release_workflows": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.ReleaseWorkflows" - } - } - } + "has_audit_power": { + "type": "boolean" }, - "v1.BatchUpdateSqlManageReq": { - "type": "object", - "properties": { - "assignees": { - "type": "array", - "items": { - "type": "string" - } - }, - "priority": { - "type": "string", - "enum": [ - "", - "high" - ] - }, - "remark": { - "type": "string" - }, - "sql_manage_id_list": { - "type": "array", - "items": { - "type": "integer" - } - }, - "status": { - "type": "string", - "enum": [ - "solved", - "ignored", - "manual_audited" - ] - } - } - }, - "v1.BlacklistResV1": { - "type": "object", - "properties": { - "blacklist_id": { - "type": "integer" - }, - "content": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "last_match_time": { - "type": "string" - }, - "matched_count": { - "type": "integer" - }, - "type": { - "type": "string", - "enum": [ - "sql", - "fp_sql", - "ip", - "cidr", - "host", - "instance" - ] - } - } - }, - "v1.ChartPoint": { - "type": "object", - "properties": { - "info": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "status": { - "type": "integer" - }, - "x": { - "type": "string" - }, - "y": { - "type": "number" - } - } - }, - "v1.CheckLicenseResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "content": { - "type": "string" - }, - "license": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.LicenseItem" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.CloneProjectRuleTemplateReqV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "new_rule_template_name": { - "type": "string" - } - } + "has_rewrite_power": { + "type": "boolean" }, - "v1.CloneRuleTemplateReqV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "new_rule_template_name": { - "type": "string" - } - } + "is_custom_rule": { + "type": "boolean" }, - "v1.CodingConfigurationV1": { - "type": "object", - "properties": { - "coding_url": { - "type": "string" - }, - "is_coding_enabled": { - "type": "boolean" - } - } + "level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "example": "error" }, - "v1.CodingResp": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - } + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleParamResV1" + } }, - "v1.CompanyNotice": { - "type": "object", - "properties": { - "notice_str": { - "type": "string" - } - } + "rule_name": { + "type": "string" }, - "v1.CreatInstanceAuditPlanRes": { - "type": "object", - "properties": { - "instance_audit_plan_id": { - "type": "string" - } - } + "type": { + "type": "string", + "example": "全局配置" }, - "v1.CreatInstanceAuditPlanResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.CreatInstanceAuditPlanRes" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.CreateAuditPlanReqV1": { - "type": "object", - "properties": { - "audit_plan_cron": { - "type": "string", - "example": "0 */2 * * *" - }, - "audit_plan_instance_database": { - "type": "string", - "example": "app1" - }, - "audit_plan_instance_name": { - "type": "string", - "example": "test_mysql" - }, - "audit_plan_instance_type": { - "type": "string", - "example": "mysql" - }, - "audit_plan_name": { - "type": "string", - "example": "audit_plan_for_java_repo_1" - }, - "audit_plan_params": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanParamReqV1" - } - }, - "audit_plan_type": { - "type": "string", - "example": "slow log" - }, - "rule_template_name": { - "type": "string", - "example": "default_MySQL" - } - } - }, - "v1.CreateAuditTaskReqV1": { - "type": "object", - "properties": { - "backup_max_rows": { - "type": "integer" - }, - "enable_backup": { - "type": "boolean" - }, - "exec_mode": { - "type": "string", - "enum": [ - "sql_file", - "sqls" - ] - }, - "file_order_method": { - "type": "string" - }, - "instance_name": { - "type": "string", - "example": "inst_1" - }, - "instance_schema": { - "type": "string", - "example": "db1" - }, - "rule_template_name": { - "type": "string" - }, - "sql": { - "type": "string", - "example": "alter table tb1 drop columns c1" - } - } - }, - "v1.CreateAuditTasksGroupReqV1": { - "type": "object", - "properties": { - "exec_mode": { - "type": "string", - "enum": [ - "sql_file", - "sqls" - ] - }, - "file_order_method": { - "type": "string" - }, - "instances": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.InstanceForCreatingTask" - } - } - } - }, - "v1.CreateAuditTasksGroupResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AuditTasksGroupResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.CreateAuditWhitelistReqV1": { - "type": "object", - "properties": { - "desc": { - "type": "string", - "example": "used for rapid release" - }, - "match_type": { - "type": "string", - "enum": [ - "exact_match", - "fp_match" - ], - "example": "exact_match" - }, - "value": { - "type": "string", - "example": "create table" - } - } - }, - "v1.CreateBlacklistReqV1": { - "type": "object", - "properties": { - "content": { - "type": "string", - "example": "select * from t1" - }, - "desc": { - "type": "string", - "example": "used for rapid release" - }, - "type": { - "type": "string", - "enum": [ - "sql", - "fp_sql", - "ip", - "cidr", - "host", - "instance" - ], - "example": "sql" - } - } - }, - "v1.CreateCustomRuleReqV1": { - "type": "object", - "properties": { - "annotation": { - "type": "string", - "example": "this is test rule" - }, - "db_type": { - "type": "string", - "example": "MySQL" - }, - "desc": { - "type": "string", - "example": "this is test rule" - }, - "level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "example": "notice" - }, - "rule_script": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "type": "string", - "example": "DDL规则" - } - } - }, - "v1.CreateInstanceAuditPlanReqV1": { - "type": "object", - "properties": { - "audit_plans": { - "description": "扫描类型", - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlan" - } - }, - "instance_id": { - "type": "string" - } - } - }, - "v1.CreatePipelineReqV1": { - "type": "object", - "properties": { - "address": { - "description": "关联流水线地址", - "type": "string" - }, - "description": { - "description": "流水线描述", - "type": "string" - }, - "name": { - "description": "流水线名称", - "type": "string" - }, - "nodes": { - "description": "节点信息", - "type": "array", - "items": { - "$ref": "#/definitions/v1.pipelineNodeBase" - } - } - } - }, - "v1.CreatePipelineResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.createPipelineResData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.CreateProjectRuleTemplateReqV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "rule_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RuleReqV1" - } - }, - "rule_template_name": { - "type": "string" - }, - "rule_version": { - "type": "integer" - } - } - }, - "v1.CreateRollbackWorkflowReq": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "rollback_sql_ids": { - "type": "array", - "items": { - "type": "integer" - } - }, - "sql_version_id": { - "type": "integer" - }, - "task_ids": { - "type": "array", - "items": { - "type": "integer" - } - }, - "workflow_subject": { - "type": "string" - }, - "workflow_template_id": { - "type": "integer" - } - } - }, - "v1.CreateRollbackWorkflowRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.CreateRollbackWorkflowResData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.CreateRollbackWorkflowResData": { - "type": "object", - "properties": { - "workflow_id": { - "type": "string" - } - } + "version": { + "type": "integer" + } + } + }, + "RuleRespV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "rule_name": { + "type": "string" + } + } + }, + "RuleTemplateDetailResV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "rule_list": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleResV1" + } + }, + "rule_template_name": { + "type": "string" + }, + "rule_version": { + "type": "integer" + } + } + }, + "RuleTemplateResV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" }, - "v1.CreateRuleTemplateReqV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "rule_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RuleReqV1" - } - }, - "rule_template_name": { - "type": "string" - }, - "rule_version": { - "type": "integer" - } - } - }, - "v1.CreateSQLAuditRecordResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.SQLAuditRecordResData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.CreateSqlVersionReqV1": { - "type": "object", - "properties": { - "create_sql_version_stage": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.CreateSqlVersionStage" - } - }, - "desc": { - "type": "string" - }, - "version": { - "type": "string", - "example": "2.23" - } - } - }, - "v1.CreateSqlVersionRes": { - "type": "object", - "properties": { - "sql_version_id": { - "type": "integer" - } - } + "desc": { + "type": "string" }, - "v1.CreateSqlVersionResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.CreateSqlVersionRes" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.CreateSqlVersionStage": { - "type": "object", - "properties": { - "create_stages_instance_dep": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.CreateStagesInstanceDep" - } - }, - "name": { - "type": "string", - "example": "生产" - }, - "stage_sequence": { - "type": "integer" - } - } - }, - "v1.CreateStagesInstanceDep": { - "type": "object", - "properties": { - "next_stage_instance_id": { - "type": "string" - }, - "stage_instance_id": { - "type": "string" - } - } + "rule_template_name": { + "type": "string" }, - "v1.CreateWorkflowReqV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "task_ids": { - "type": "array", - "items": { - "type": "integer" - } - }, - "workflow_subject": { - "type": "string" - } - } - }, - "v1.CreateWorkflowTemplateReqV1": { - "type": "object", - "properties": { - "allow_submit_when_less_audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ] - }, - "desc": { - "type": "string" - }, - "is_default": { - "type": "boolean" - }, - "workflow_step_template_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.WorkFlowStepTemplateReqV1" - } - }, - "workflow_template_name": { - "type": "string" - }, - "workflow_type": { - "type": "string", - "enum": [ - "workflow", - "data_export" - ] - } - } - }, - "v1.CustomRuleResV1": { - "type": "object", - "properties": { - "annotation": { - "type": "string", - "example": "this is test rule" - }, - "categories": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "db_type": { - "type": "string", - "example": "MySQL" - }, - "desc": { - "type": "string", - "example": "this is test rule" - }, - "level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "example": "notice" - }, - "rule_id": { - "type": "string" - }, - "rule_script": { - "type": "string" - }, - "type": { - "type": "string", - "example": "DDL规则" - } - } - }, - "v1.DBPerformanceImproveOverview": { - "type": "object", - "properties": { - "avg_performance_improve": { - "type": "number" - }, - "instance_name": { - "type": "string" - } - } + "rule_version": { + "type": "integer" + } + } + }, + "RuleTemplateTipResV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" }, - "v1.DBTypeAuditPlan": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanCount" - } - }, - "db_type": { - "type": "string" - } - } - }, - "v1.DBTypeHealth": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "health_instance_names": { - "type": "array", - "items": { - "type": "string" - } - }, - "unhealth_instance_names": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "v1.DashboardResV1": { - "type": "object", - "properties": { - "workflow_statistics": { - "type": "object", - "$ref": "#/definitions/v1.WorkflowStatisticsResV1" - } - } + "is_default_rule_template": { + "type": "boolean" }, - "v1.DatabaseComparisonObject": { - "type": "object", - "properties": { - "instance_id": { - "type": "string" - }, - "schema_name": { - "type": "string" - } - } + "rule_template_id": { + "type": "string" }, - "v1.DatabaseComparisonResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SchemaObject" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.DatabaseComparisonStatements": { - "type": "object", - "properties": { - "base_sql": { - "type": "object", - "$ref": "#/definitions/v1.SQLStatement" - }, - "comparison_sql": { - "type": "object", - "$ref": "#/definitions/v1.SQLStatement" - } - } - }, - "v1.DatabaseComparisonStatementsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.DatabaseComparisonStatements" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.DatabaseDiffModifySQL": { - "type": "object", - "properties": { - "audit_error": { - "type": "string" - }, - "modify_sqls": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SQLStatementWithAuditResult" - } - }, - "schema_name": { - "type": "string" - } - } - }, - "v1.DatabaseDiffObject": { - "type": "object", - "properties": { - "inconsistent_num": { - "type": "integer" - }, - "object_type": { - "type": "string", - "enum": [ - "TABLE", - "VIEW", - "PROCEDURE", - "TIGGER", - "EVENT", - "FUNCTION" - ] - }, - "objects_diff_result": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.ObjectDiffResult" - } - } - } - }, - "v1.DatabaseDriverLogosV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "logo": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "v1.DatabaseDriverOptionsV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "default_port": { - "type": "integer" - }, - "params": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.InstanceAdditionalParamResV1" - } - } - } - }, - "v1.DatabaseObject": { - "type": "object", - "properties": { - "object_name": { - "type": "string" - }, - "object_type": { - "type": "string", - "enum": [ - "TABLE", - "VIEW", - "PROCEDURE", - "TIGGER", - "EVENT", - "FUNCTION" - ] - } - } - }, - "v1.DatabaseSchemaObject": { - "type": "object", - "properties": { - "base_schema_name": { - "type": "string" - }, - "comparison_schema_name": { - "type": "string" - }, - "database_objects": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.DatabaseObject" - } - } - } - }, - "v1.DepBetweenStageInstance": { - "type": "object", - "properties": { - "next_stage_instance_id": { - "type": "string" - }, - "next_stage_instance_name": { - "type": "string" - }, - "stage_instance_id": { - "type": "string" - }, - "stage_instance_name": { - "type": "string" - } - } - }, - "v1.DingTalkConfigurationV1": { - "type": "object", - "properties": { - "app_key": { - "type": "string" - }, - "is_enable_ding_talk_notify": { - "type": "boolean" - } - } + "rule_template_name": { + "type": "string" }, - "v1.DirectAuditFileReqV1": { - "type": "object", - "properties": { - "file_contents": { - "description": "调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现\n每个数组元素是一个文件内容", - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "select * from t1; select * from t2;" - ] - }, - "instance_name": { - "type": "string", - "example": "instance1" - }, - "instance_type": { - "type": "string", - "example": "MySQL" - }, - "project_name": { - "type": "string", - "example": "project1" - }, - "schema_name": { - "type": "string", - "example": "schema1" - }, - "sql_type": { - "type": "string", - "enum": [ - "sql", - "mybatis", - "" - ], - "example": "sql" - } - } - }, - "v1.DirectAuditReqV1": { - "type": "object", - "properties": { - "instance_name": { - "type": "string", - "example": "instance1" - }, - "instance_type": { - "type": "string", - "example": "MySQL" - }, - "project_name": { - "type": "string", - "example": "project1" - }, - "schema_name": { - "type": "string", - "example": "schema1" - }, - "sql_content": { - "description": "调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现", - "type": "string", - "example": "select * from t1; select * from t2;" - }, - "sql_type": { - "type": "string", - "enum": [ - "sql", - "mybatis", - "" - ], - "example": "sql" - } - } - }, - "v1.DirectAuditResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AuditResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.DirectGetSQLAnalysisResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SqlAnalysisResDataV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.DriversResV1": { - "type": "object", - "properties": { - "driver_name_list": { - "type": "array", - "items": { - "type": "string" - } - } - } + "rule_version": { + "type": "integer" + } + } + }, + "RuleTips": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "rule": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleRespV1" + } + } + } + }, + "RuleTypeV1": { + "type": "object", + "properties": { + "is_custom_rule_type": { + "type": "boolean" }, - "v1.EdgeResponse": { - "type": "object", - "properties": { - "from_id": { - "description": "存储Node的ID", - "type": "string" - }, - "is_directed": { - "description": "是否有向", - "type": "boolean" - }, - "to_id": { - "description": "存储Node的ID", - "type": "string" - }, - "weight": { - "description": "权重", - "type": "integer" - } - } - }, - "v1.EfficiencyCard": { - "type": "object", - "properties": { - "evidence_value": { - "description": "具体指标分值", - "type": "string", - "example": "高危拦截35次" - }, - "metric_evaluation": { - "description": "效能评价", - "type": "string", - "example": "S级,+450%,123h" - }, - "metric_title": { - "description": "效能指标标题", - "type": "string", - "enum": [ - "security_defense", - "resource_cost", - "code_standard", - "rd_efficiency", - "query_performance" - ] - } - } - }, - "v1.EnumsValueResV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "value": { - "type": "string" - } - } + "rule_count": { + "type": "integer" }, - "v1.ExplainClassicResult": { - "type": "object", - "properties": { - "head": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.TableMetaItemHeadResV1" - } - }, - "rows": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - }, - "v1.ExplainValidationDetail": { - "type": "object", - "properties": { - "after_cost": { - "type": "number" - }, - "after_plan": { - "type": "string" - }, - "before_cost": { - "type": "number" - }, - "before_plan": { - "type": "string" - }, - "perform_improve_per": { - "type": "number" - } - } - }, - "v1.FeishuConfigurationV1": { - "type": "object", - "properties": { - "app_id": { - "type": "string" - }, - "is_feishu_notification_enabled": { - "type": "boolean" - } - } + "rule_type": { + "type": "string" + } + } + }, + "SQLAuditRecord": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "creator": { + "type": "string" + }, + "instance": { + "type": "object", + "$ref": "#/definitions/SQLAuditRecordInstance" + }, + "sql_audit_record_id": { + "type": "string" + }, + "sql_audit_status": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "task": { + "type": "object", + "$ref": "#/definitions/AuditTaskResV1" + } + } + }, + "SQLAuditRecordInstance": { + "type": "object", + "properties": { + "db_host": { + "type": "string", + "example": "10.10.10.10" + }, + "db_port": { + "type": "string", + "example": "3306" + } + } + }, + "SQLAuditRecordResData": { + "type": "object", + "properties": { + "sql_audit_record_id": { + "type": "string" + }, + "task": { + "type": "object", + "$ref": "#/definitions/AuditTaskResV1" + } + } + }, + "SQLAuditResult": { + "type": "object", + "properties": { + "db_type": { + "type": "string" }, - "v1.FileToSort": { - "type": "object", - "properties": { - "file_id": { - "type": "integer" - }, - "new_index": { - "type": "integer" - } - } + "error_info": { + "type": "string" }, - "v1.Filter": { - "type": "object", - "properties": { - "filter_between_value": { - "type": "object", - "$ref": "#/definitions/v1.FilterBetweenValue" - }, - "filter_compare_value": { - "type": "string" - }, - "filter_name": { - "type": "string" - } - } - }, - "v1.FilterBetweenValue": { - "type": "object", - "properties": { - "from": { - "type": "string" - }, - "to": { - "type": "string" - } - } + "execution_failed": { + "type": "boolean", + "example": false }, - "v1.FilterMeta": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "filter_input_type": { - "type": "string", - "enum": [ - "int", - "string", - "date_time" - ] - }, - "filter_name": { - "type": "string" - }, - "filter_op_type": { - "type": "string", - "enum": [ - "equal", - "between" - ] - }, - "filter_tip_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.FilterTip" - } - } - } - }, - "v1.FilterTip": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "group": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "v1.FullSyncAuditPlanSQLsReqV1": { - "type": "object", - "properties": { - "audit_plan_sql_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanSQLReqV1" - } - } - } + "i18n_audit_result_info": { + "type": "object", + "$ref": "#/definitions/I18nAuditResultInfo" }, - "v1.GenModifySQLResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.DatabaseDiffModifySQL" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GenModifylSQLReqV1": { - "type": "object", - "properties": { - "base_instance_id": { - "type": "string" - }, - "comparison_instance_id": { - "type": "string" - }, - "database_schema_objects": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.DatabaseSchemaObject" - } - } - } - }, - "v1.GetAIHubBannerResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AIHubBannerData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetAIHubExecutionDataResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AIHubExecutionRecord" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "description": "总数", - "type": "integer" - } - } - }, - "v1.GetAIHubManagementViewResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AIHubManagementViewData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetAIHubStrategicValueResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AIHubStrategicValueData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetAbnormalAuditPlanInstancesResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AbnormalAuditPlanInstance" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetAuditPlanAnalysisDataResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.GetSQLAnalysisDataResItemV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetAuditPlanMetasResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanMetaV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetAuditPlanNotifyConfigResDataV1": { - "type": "object", - "properties": { - "enable_email_notify": { - "type": "boolean" - }, - "enable_web_hook_notify": { - "type": "boolean" - }, - "notify_interval": { - "type": "integer" - }, - "notify_level": { - "type": "string" - }, - "web_hook_template": { - "type": "string" - }, - "web_hook_url": { - "type": "string" - } - } - }, - "v1.GetAuditPlanNotifyConfigResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.GetAuditPlanNotifyConfigResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetAuditPlanReportResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AuditPlanReportResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetAuditPlanReportSQLsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanReportSQLResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetAuditPlanReportsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanReportResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetAuditPlanResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AuditPlanResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetAuditPlanSQLDataReqV1": { - "type": "object", - "properties": { - "filter_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.Filter" - } - }, - "is_asc": { - "type": "boolean" - }, - "order_by": { - "type": "string" - }, - "page_index": { - "type": "integer" - }, - "page_size": { - "type": "integer" - } - } - }, - "v1.GetAuditPlanSQLDataResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AuditPlanSQLDataResV1" - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetAuditPlanSQLExportReqV1": { - "type": "object", - "properties": { - "export_format": { - "description": "导出格式:csv 或 excel", - "type": "string", - "enum": [ - "csv", - "excel" - ], - "example": "excel" - }, - "filter_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.Filter" - } - }, - "is_asc": { - "type": "boolean" - }, - "order_by": { - "type": "string" - } - } - }, - "v1.GetAuditPlanSQLMetaResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AuditPlanSQLMetaResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetAuditPlanSQLsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AuditPlanSQLResV1" - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetAuditPlanTypesResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanTypesV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetAuditPlansResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetAuditTaskResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AuditTaskResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetAuditTaskSQLContentResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AuditTaskSQLContentResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetAuditTaskSQLsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditTaskSQLResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetAuditWhitelistResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditWhitelistResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetBlacklistResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.BlacklistResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetCodingConfigurationResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.CodingConfigurationV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetCompanyNoticeResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.CompanyNotice" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetComparisonStatementsReqV1": { - "type": "object", - "properties": { - "database_comparison_object": { - "type": "object", - "$ref": "#/definitions/v1.GetDatabaseComparisonReqV1" - }, - "database_object": { - "type": "object", - "$ref": "#/definitions/v1.DatabaseObject" - } - } - }, - "v1.GetCustomRuleResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.CustomRuleResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetCustomRulesResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.CustomRuleResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetDBPerformanceImproveOverviewResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.DBPerformanceImproveOverview" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetDashboardResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.DashboardResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetDatabaseComparisonReqV1": { - "type": "object", - "properties": { - "base_db_object": { - "type": "object", - "$ref": "#/definitions/v1.DatabaseComparisonObject" - }, - "comparison_db_object": { - "type": "object", - "$ref": "#/definitions/v1.DatabaseComparisonObject" - } - } - }, - "v1.GetDatabaseDriverLogosResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.DatabaseDriverLogosV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetDatabaseDriverOptionsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.DatabaseDriverOptionsV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetDepBetweenStageInstanceResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.DepBetweenStageInstance" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetDingTalkConfigurationResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.DingTalkConfigurationV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetDriverRuleVersionTipsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.GetDriverRuleVersionTipsV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetDriverRuleVersionTipsV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string", - "example": "mysql" - }, - "rule_versions": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "v1.GetDriversResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.DriversResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetFeishuAuditConfigurationResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.FeishuConfigurationV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetGlobalSqlManageListResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.GlobalSqlManage" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetGlobalSqlManageStatisticsResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetInstanceAuditPlanDetailResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.InstanceAuditPlanDetailResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetInstanceAuditPlanOverviewResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.InstanceAuditPlanInfo" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetInstanceAuditPlansResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.InstanceAuditPlanResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetInstanceConnectableResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.InstanceConnectableResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetInstanceHealthResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.DBTypeHealth" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetInstanceOverviewStatisticsRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.InstanceOverviewStatistics" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetInstanceSchemaResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.InstanceSchemaResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetInstanceTipsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.InstanceTipResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetInstancesTypePercentResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.InstancesTypePercentV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetKnowledgeBaseListRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.KnowledgeBase" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetKnowledgeBaseTagListRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.Tag" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetKnowledgeGraphResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.GraphResponse" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetLicenseResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "content": { - "type": "string" - }, - "license": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.LicenseItem" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetLicenseUsageResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.LicenseUsageV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetModuleStatusResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.ModuleStatusRes" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetOperationsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.OperationResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetOptimizationOverviewResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.OptimizationRecordOverview" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetOptimizationRecordRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.OptimizationDetail" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetOptimizationRecordsRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.OptimizationRecord" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetOptimizationSQLRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.OptimizationSQLDetail" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetOptimizationSQLsRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.OptimizationSQL" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetPipelineDetailResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.pipelineDetailData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetPipelinesResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "description": "流水线列表数据", - "type": "array", - "items": { - "$ref": "#/definitions/v1.pipelineDetail" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "description": "流水线总数", - "type": "integer" - } - } - }, - "v1.GetProjectRuleTemplateResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.RuleProjectTemplateDetailResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetProjectRuleTemplatesResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.ProjectRuleTemplateResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetProjectScoreResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.ProjectScore" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetProjectStatisticsResDataV1": { - "type": "object", - "properties": { - "audit_plan_total": { - "type": "integer" - }, - "instance_total": { - "type": "integer" - }, - "member_total": { - "type": "integer" - }, - "rule_template_total": { - "type": "integer" - }, - "whitelist_total": { - "type": "integer" - }, - "workflow_total": { - "type": "integer" - } - } - }, - "v1.GetProjectStatisticsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.GetProjectStatisticsResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetReportPushConfigsListResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.ReportPushConfigList" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetRiskAuditPlanResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RiskAuditPlan" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetRoleUserCountResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RoleUserCount" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetRuleCategoryStatisticResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "$ref": "#/definitions/model.RuleCategoryStatistic" - } - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetRuleKnowledgeResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.RuleKnowledgeResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetRuleTemplateResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.RuleTemplateDetailResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetRuleTemplateTipsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RuleTemplateTipResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetRuleTemplatesResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RuleTemplateResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetRuleTypeByDBTypeResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RuleTypeV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetRulesResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RuleResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetSQLAnalysisDataResItemV1": { - "type": "object", - "properties": { - "sql_explain": { - "type": "object", - "$ref": "#/definitions/v1.SQLExplain" - }, - "table_metas": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.TableMeta" - } - } - } - }, - "v1.GetSQLAuditRecordResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.SQLAuditRecord" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetSQLAuditRecordTagTipsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "type": "string" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetSQLAuditRecordsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SQLAuditRecord" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetSqlAverageExecutionTimeResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SqlAverageExecutionTime" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetSqlDEVRecordListResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SqlDEVRecord" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetSqlExecutionFailPercentResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SqlExecutionFailPercent" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetSqlFileOrderMethodResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.SqlFileOrderMethodRes" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetSqlManageListResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SqlManage" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "sql_manage_bad_num": { - "type": "integer" - }, - "sql_manage_optimized_num": { - "type": "integer" - }, - "sql_manage_total_num": { - "type": "integer" - } - } - }, - "v1.GetSqlManageRuleTipsResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RuleTips" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetSqlManageSqlAnalysisResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "description": "V1版本不能引用V2版本的结构体,所以只能复制一份", - "type": "object", - "$ref": "#/definitions/v1.SqlAnalysis" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetSqlPerformanceInsightsRelatedSQLResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RelatedSQLInfo" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetSqlPerformanceInsightsRelatedTransactionResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.RelatedTransactionInfo" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetSqlPerformanceInsightsResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.SqlPerformanceInsights" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetSqlVersionDetailResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.SqlVersionDetailResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetSqlVersionListResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SqlVersionResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetSystemModuleRedDotsRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.ModuleRedDots" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetTableMetadataResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.InstanceTableMeta" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetTaskAnalysisDataResItemV1": { - "type": "object", - "properties": { - "sql_explain": { - "type": "object", - "$ref": "#/definitions/v1.SQLExplain" - }, - "table_metas": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.TableMeta" - } - } - } - }, - "v1.GetTaskAnalysisDataResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.GetTaskAnalysisDataResItemV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetUserTipsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.UserTipResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWechatAuditConfigurationResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.WechatConfigurationV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWorkflowAuditPassPercentResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.WorkflowAuditPassPercentV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWorkflowCountsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.WorkflowCountsV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWorkflowCreatedCountsEachDayResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.WorkflowCreatedCountsEachDayV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWorkflowDurationOfWaitingForAuditResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.WorkflowStageDuration" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWorkflowDurationOfWaitingForExecutionResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.WorkflowStageDuration" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWorkflowPassPercentResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.WorkflowPassPercentV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWorkflowPercentCountedByInstanceTypeResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.WorkflowPercentCountedByInstanceTypeV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWorkflowRejectedPercentGroupByCreatorResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.WorkflowRejectedPercentGroupByCreator" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWorkflowRejectedPercentGroupByInstanceResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.WorkflowRejectedPercentGroupByInstance" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWorkflowResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.WorkflowResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWorkflowStatisticOfInstancesResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.WorkflowStatisticOfInstance" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWorkflowStatusCountResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.WorkflowStatusCountV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWorkflowTasksItemV1": { - "type": "object", - "properties": { - "current_step_assignee_user_name_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "exec_end_time": { - "type": "string" - }, - "exec_start_time": { - "type": "string" - }, - "execution_user_name": { - "type": "string" - }, - "instance_maintenance_times": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.MaintenanceTimeResV1" - } - }, - "instance_name": { - "type": "string" - }, - "schedule_time": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_execution", - "exec_scheduled", - "exec_failed", - "exec_succeeded", - "executing", - "manually_executed" - ] - }, - "task_id": { - "type": "integer" - }, - "task_pass_rate": { - "type": "number" - }, - "task_score": { - "type": "integer" - } - } - }, - "v1.GetWorkflowTasksResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.GetWorkflowTasksItemV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWorkflowTemplateListResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.WorkflowTemplateDetailResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWorkflowTemplateResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.WorkflowTemplateDetailResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GetWorkflowsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.WorkflowDetailResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GetWorkflowsThatCanBeAssociatedToVersionResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AssociateWorkflows" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.GlobalSqlManage": { - "type": "object", - "properties": { - "audit_result": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditResult" - } - }, - "first_appear_timestamp": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "instance_id": { - "type": "string" - }, - "instance_name": { - "type": "string" - }, - "problem_descriptions": { - "description": "根据来源信息拼接", - "type": "array", - "items": { - "type": "string" - } - }, - "project_name": { - "type": "string" - }, - "project_priority": { - "type": "string", - "enum": [ - "high", - "medium", - "low" - ] - }, - "project_uid": { - "type": "string" - }, - "source": { - "type": "object", - "$ref": "#/definitions/v1.Source" - }, - "sql": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited", - "sent" - ] - } - } - }, - "v1.GlobalWorkflowStatisticsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v1.GraphResponse": { - "type": "object", - "properties": { - "edges": { - "description": "边集合", - "type": "array", - "items": { - "$ref": "#/definitions/v1.EdgeResponse" - } - }, - "nodes": { - "description": "节点集合", - "type": "array", - "items": { - "$ref": "#/definitions/v1.NodeResponse" - } - } - } - }, - "v1.HighPriorityConditionReq": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "operator": { - "type": "string", - "default": "\u003e", - "enum": [ - "\u003e", - "=", - "\u003c" - ] - }, - "value": { - "type": "string" - } - } - }, - "v1.HighPriorityConditionResV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "enums_value": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.EnumsValueResV1" - } - }, - "key": { - "type": "string" - }, - "operator": { - "type": "object", - "$ref": "#/definitions/v1.OperatorResV1" - }, - "type": { - "type": "string", - "enum": [ - "string", - "int", - "bool", - "password" - ] - }, - "value": { - "type": "string" - } - } - }, - "v1.InstanceAdditionalParamResV1": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "参数项中文名" - }, - "name": { - "type": "string", - "example": "param name" - }, - "type": { - "type": "string", - "example": "int" - }, - "value": { - "type": "string", - "example": "0" - } - } - }, - "v1.InstanceAuditPlanDetailResV1": { - "type": "object", - "properties": { - "audit_plans": { - "description": "扫描类型", - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanRes" - } - }, - "business": { - "description": "This parameter is deprecated", - "type": "string", - "example": "test" - }, - "environment": { - "type": "string", - "example": "prod" - }, - "instance_id": { - "type": "string", - "example": "instance_id" - }, - "instance_name": { - "type": "string", - "example": "test_mysql" - }, - "instance_type": { - "type": "string", - "example": "mysql" - } - } - }, - "v1.InstanceAuditPlanInfo": { - "type": "object", - "properties": { - "active_status": { - "type": "string", - "enum": [ - "normal", - "disabled" - ] - }, - "audit_plan_db_type": { - "type": "string", - "example": "mysql" - }, - "audit_plan_instance_name": { - "type": "string", - "example": "test_mysql" - }, - "audit_plan_rule_template": { - "type": "object", - "$ref": "#/definitions/v1.AuditPlanRuleTemplate" - }, - "audit_plan_type": { - "type": "object", - "$ref": "#/definitions/v1.AuditPlanTypeResBase" - }, - "exec_cmd": { - "type": "string", - "example": "./scanner xxx" - }, - "id": { - "type": "integer" - }, - "last_collection_status": { - "type": "string", - "enum": [ - "normal", - "abnormal" - ] - }, - "last_collection_time": { - "type": "string" - }, - "token_exp": { - "type": "integer", - "example": 1747129752 - }, - "total_sql_nums": { - "type": "integer" - }, - "unsolved_sql_nums": { - "type": "integer" - } - } - }, - "v1.InstanceAuditPlanResV1": { - "type": "object", - "properties": { - "active_status": { - "type": "string", - "enum": [ - "normal", - "disabled" - ] - }, - "audit_plan_types": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanTypeResBase" - } - }, - "business": { - "description": "This parameter is deprecated", - "type": "string" - }, - "create_time": { - "description": "TODO 采集状态", - "type": "string" - }, - "creator": { - "type": "string" - }, - "environment": { - "type": "string" - }, - "instance_audit_plan_id": { - "type": "integer" - }, - "instance_id": { - "type": "string" - }, - "instance_name": { - "type": "string" - }, - "instance_type": { - "type": "string" - } - } - }, - "v1.InstanceConnectableResV1": { - "type": "object", - "properties": { - "connect_error_message": { - "type": "string" - }, - "is_instance_connectable": { - "type": "boolean" - } - } + "level": { + "type": "string", + "example": "warn" }, - "v1.InstanceConnectionResV1": { - "type": "object", - "properties": { - "connect_error_message": { - "type": "string" - }, - "instance_name": { - "type": "string" - }, - "is_instance_connectable": { - "type": "boolean" - } - } - }, - "v1.InstanceForCheckConnection": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } + "message": { + "type": "string", + "example": "避免使用不必要的内置函数md5()" }, - "v1.InstanceForCreatingTask": { - "type": "object", - "properties": { - "instance_name": { - "type": "string" - }, - "instance_schema": { - "type": "string" - } - } + "rule_name": { + "type": "string" + } + } + }, + "SQLExplain": { + "type": "object", + "properties": { + "classic_result": { + "type": "object", + "$ref": "#/definitions/ExplainClassicResult" }, - "v1.InstanceInfo": { - "type": "object", - "properties": { - "instance_id": { - "type": "string" - }, - "instance_name": { - "type": "string" - } - } + "cost": { + "type": "number" }, - "v1.InstanceOverviewStatistics": { - "type": "object", - "properties": { - "avg_score": { - "type": "number" - }, - "high_priority_sql_count": { - "type": "integer" - }, - "instance_id": { - "type": "string" - }, - "pending_workflow_count": { - "type": "integer" - } - } - }, - "v1.InstanceSchemaResV1": { - "type": "object", - "properties": { - "schema_name_list": { - "type": "array", - "items": { - "type": "string" - } - } - } + "err_message": { + "type": "string" }, - "v1.InstanceTableMeta": { - "type": "object", - "properties": { - "columns": { - "type": "object", - "$ref": "#/definitions/v1.TableColumns" - }, - "create_table_sql": { - "type": "string" - }, - "indexes": { - "type": "object", - "$ref": "#/definitions/v1.TableIndexes" - }, - "name": { - "type": "string" - }, - "schema": { - "type": "string" - } - } - }, - "v1.InstanceTipResV1": { - "type": "object", - "properties": { - "backup_max_rows": { - "type": "integer" - }, - "enable_backup": { - "type": "boolean" - }, - "host": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "instance_name": { - "type": "string" - }, - "instance_type": { - "type": "string" - }, - "port": { - "type": "string" - }, - "supported_backup_strategy": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "none", - "manual", - "reverse_sql", - "original_row" - ] - } - }, - "workflow_template_id": { - "type": "integer" - } - } - }, - "v1.InstanceTypePercent": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "percent": { - "type": "number" - }, - "type": { - "type": "string" - } - } - }, - "v1.InstancesTypePercentV1": { - "type": "object", - "properties": { - "instance_total_num": { - "type": "integer" - }, - "instance_type_percents": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.InstanceTypePercent" - } - } - } - }, - "v1.KnowledgeBase": { - "type": "object", - "properties": { - "content": { - "description": "内容", - "type": "string" - }, - "description": { - "description": "描述", - "type": "string" - }, - "id": { - "description": "知识库ID", - "type": "integer" - }, - "rule_name": { - "description": "规则名称", - "type": "string" - }, - "tags": { - "description": "标签", - "type": "array", - "items": { - "$ref": "#/definitions/v1.Tag" - } - }, - "title": { - "description": "标题", - "type": "string" - } - } - }, - "v1.LicenseItem": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "limit": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "v1.LicenseUsageItem": { - "type": "object", - "properties": { - "is_limited": { - "type": "boolean" - }, - "limit": { - "type": "integer" - }, - "resource_type": { - "type": "string" - }, - "resource_type_desc": { - "type": "string" - }, - "used": { - "type": "integer" - } - } - }, - "v1.LicenseUsageV1": { - "type": "object", - "properties": { - "instances_usage": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.LicenseUsageItem" - } - }, - "users_usage": { - "type": "object", - "$ref": "#/definitions/v1.LicenseUsageItem" - } - } - }, - "v1.Line": { - "type": "object", - "properties": { - "line_name": { - "description": "线条名称", - "type": "string" - }, - "points": { - "description": "图表点数据", - "type": "array", - "items": { - "$ref": "#/definitions/v1.ChartPoint" - } - } - } - }, - "v1.ListTableBySchemaResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.Table" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.LockSqlVersionReqV1": { - "type": "object", - "properties": { - "is_locked": { - "type": "boolean" - } - } + "sql": { + "type": "string" + } + } + }, + "SQLLineageAnalyzeReqV1": { + "type": "object", + "properties": { + "default_schema": { + "type": "string" + }, + "instance_type": { + "type": "string" + }, + "result_columns": { + "type": "array", + "items": { + "type": "string" + } + }, + "sql": { + "type": "string" + } + } + }, + "SQLLineageAnalyzeResDataV1": { + "type": "object", + "properties": { + "result": { + "type": "object", + "$ref": "#/definitions/SQLLineageAnalyzeResultV1" + } + } + }, + "SQLLineageAnalyzeResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/SQLLineageAnalyzeResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "SQLLineageAnalyzeResultV1": { + "type": "object", + "properties": { + "edges": { + "type": "array", + "items": { + "$ref": "#/definitions/SQLLineageEdgeV1" + } + }, + "nodes": { + "type": "array", + "items": { + "$ref": "#/definitions/SQLLineageNodeV1" + } + }, + "original_sql": { + "type": "string" + }, + "result_columns": { + "type": "array", + "items": { + "$ref": "#/definitions/SQLLineageResultColumnV1" + } + }, + "source_columns": { + "type": "array", + "items": { + "$ref": "#/definitions/SQLLineageColumnRefV1" + } + }, + "tables": { + "type": "array", + "items": { + "$ref": "#/definitions/SQLLineageTableRefV1" + } + }, + "title": { + "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "SQLLineageColumnRefV1": { + "type": "object", + "properties": { + "column": { + "type": "string" }, - "v1.MaintenanceTimeResV1": { - "type": "object", - "properties": { - "maintenance_start_time": { - "type": "object", - "$ref": "#/definitions/v1.TimeResV1" - }, - "maintenance_stop_time": { - "type": "object", - "$ref": "#/definitions/v1.TimeResV1" - } - } - }, - "v1.ModuleRedDot": { - "type": "object", - "properties": { - "has_red_dot": { - "type": "boolean" - }, - "module_name": { - "type": "string", - "enum": [ - "global_dashboard" - ] - } - } - }, - "v1.ModuleRedDots": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.ModuleRedDot" - } + "schema": { + "type": "string" }, - "v1.ModuleStatusRes": { - "type": "object", - "properties": { - "is_supported": { - "type": "boolean" - } - } + "table": { + "type": "string" + } + } + }, + "SQLLineageEdgeV1": { + "type": "object", + "properties": { + "from_id": { + "type": "string" }, - "v1.NodeResponse": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "weight": { - "type": "integer" - } - } - }, - "v1.ObjectDiffResult": { - "type": "object", - "properties": { - "comparison_result": { - "type": "string", - "enum": [ - "same", - "inconsistent", - "base_not_exist", - "comparison_not_exist" - ] - }, - "object_name": { - "type": "string" - } - } - }, - "v1.OperationResV1": { - "type": "object", - "properties": { - "op_code": { - "type": "integer" - }, - "op_desc": { - "type": "string" - } - } + "to_id": { + "type": "string" }, - "v1.OperatorResV1": { - "type": "object", - "properties": { - "operator_enums_value": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.EnumsValueResV1" - } - }, - "operator_value": { - "type": "string" - } - } - }, - "v1.OptimizationDetail": { - "type": "object", - "properties": { - "basic_summary": { - "type": "object", - "$ref": "#/definitions/v1.Optimizationsummary" - }, - "created_time": { - "type": "string" - }, - "created_user": { - "type": "string" - }, - "db_type": { - "type": "string" - }, - "index_recommendations": { - "type": "array", - "items": { - "type": "string" - } - }, - "instance_name": { - "type": "string" - }, - "optimization_id": { - "type": "string" - }, - "optimization_name": { - "type": "string" - }, - "status": { - "description": "优化状态", - "type": "string" - } - } - }, - "v1.OptimizationRecord": { - "type": "object", - "properties": { - "created_time": { - "description": "创建时间", - "type": "string" - }, - "created_user": { - "description": "创建人", - "type": "string" - }, - "db_type": { - "description": "数据库类型", - "type": "string" - }, - "instance_name": { - "description": "数据源", - "type": "string" - }, - "optimization_id": { - "description": "优化ID", - "type": "string" - }, - "optimization_name": { - "type": "string" - }, - "performance_gain": { - "description": "优化提升性能", - "type": "number" - }, - "status": { - "description": "优化状态", - "type": "string" - } - } - }, - "v1.OptimizationRecordOverview": { - "type": "object", - "properties": { - "record_number": { - "type": "integer" - }, - "time": { - "type": "string" - } - } + "type": { + "type": "string" + } + } + }, + "SQLLineageNodeV1": { + "type": "object", + "properties": { + "column": { + "type": "string" }, - "v1.OptimizationSQL": { - "type": "object", - "properties": { - "contributing_indices": { - "type": "string" - }, - "number": { - "type": "integer" - }, - "number_of_hit_index": { - "type": "integer" - }, - "number_of_index": { - "type": "integer" - }, - "number_of_rewrite": { - "type": "integer" - }, - "number_of_syntax_error": { - "type": "integer" - }, - "original_sql": { - "type": "string" - }, - "performance": { - "type": "number" - } - } - }, - "v1.OptimizationSQLDetail": { - "type": "object", - "properties": { - "explain_validation_details": { - "type": "object", - "$ref": "#/definitions/v1.ExplainValidationDetail" - }, - "index_recommendations": { - "description": "索引建议", - "type": "array", - "items": { - "type": "string" - } - }, - "optimized_sql": { - "description": "优化后的SQL", - "type": "string" - }, - "original_sql": { - "description": "原始SQL", - "type": "string" - }, - "triggered_rule": { - "description": "触发的规则", - "type": "array", - "items": { - "$ref": "#/definitions/v1.RewriteRule" - } - } - } - }, - "v1.Optimizationsummary": { - "type": "object", - "properties": { - "number_of_index": { - "type": "integer" - }, - "number_of_query": { - "type": "integer" - }, - "number_of_query_index": { - "type": "integer" - }, - "number_of_rewrite": { - "type": "integer" - }, - "number_of_rewritten_query": { - "type": "integer" - }, - "number_of_syntax_error": { - "type": "integer" - }, - "performance_gain": { - "type": "number" - } - } - }, - "v1.OptimizeSQLReq": { - "type": "object", - "properties": { - "db_type": { - "type": "string", - "example": "MySQL" - }, - "instance_name": { - "type": "string", - "example": "instance1" - }, - "optimization_name": { - "type": "string", - "example": "optmz_2024031412091244" - }, - "schema_name": { - "type": "string", - "example": "schema1" - }, - "sql_content": { - "type": "string", - "example": "select * from t1; select * from t2;" - } - } - }, - "v1.OptimizeSQLRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.OptimizeSQLResData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.OptimizeSQLResData": { - "type": "object", - "properties": { - "sql_optimization_record_id": { - "type": "string" - } - } + "expr": { + "type": "string" }, - "v1.ParseProjectRuleTemplateFileResDataV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "name": { - "type": "string" - }, - "rule_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RuleResV1" - } - }, - "rule_version": { - "type": "integer" - } - } - }, - "v1.ParseProjectRuleTemplateFileResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.ParseProjectRuleTemplateFileResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.PartialSyncAuditPlanSQLsReqV1": { - "type": "object", - "properties": { - "audit_plan_sql_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanSQLReqV1" - } - } - } + "id": { + "type": "string" }, - "v1.PerformanceStatistics": { - "type": "object", - "properties": { - "affect_rows": { - "type": "object", - "$ref": "#/definitions/v1.AffectRows" - } - } + "name": { + "type": "string" }, - "v1.PostSqlManageCodingResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.CodingResp" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.ProjectIOAnalysis": { - "type": "object", - "properties": { - "active_members": { - "description": "活跃人数", - "type": "integer" - }, - "health_score": { - "description": "健康分", - "type": "number", - "example": 92.3 - }, - "invoke_count": { - "description": "调用频次", - "type": "integer" - }, - "performance_gain": { - "description": "性能提升", - "type": "string", - "example": "+35%" - }, - "project_name": { - "description": "项目名称", - "type": "string" - }, - "time_saved": { - "description": "节省工时", - "type": "number", - "example": 45.5 - } - } - }, - "v1.ProjectRuleTemplateResV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "rule_template_name": { - "type": "string" - } - } - }, - "v1.ProjectScore": { - "type": "object", - "properties": { - "score": { - "type": "integer" - } - } + "schema": { + "type": "string" }, - "v1.ReExecuteTaskOnWorkflowReq": { - "type": "object", - "properties": { - "exec_sql_ids": { - "type": "array", - "items": { - "type": "integer" - } - } - } + "table": { + "type": "string" }, - "v1.RecordSource": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": [ - "ide_plugin" - ] - }, - "value": { - "type": "string" - } - } - }, - "v1.RefreshAuditPlanTokenReqV1": { - "type": "object", - "properties": { - "expires_in_days": { - "type": "integer" - } - } + "type": { + "type": "string" + } + } + }, + "SQLLineageResultColumnV1": { + "type": "object", + "properties": { + "expression": { + "type": "string" + }, + "name": { + "type": "string" + }, + "sources": { + "type": "array", + "items": { + "$ref": "#/definitions/SQLLineageColumnRefV1" + } + } + } + }, + "SQLLineageTableRefV1": { + "type": "object", + "properties": { + "alias": { + "type": "string" }, - "v1.RejectWorkflowReqV1": { - "type": "object", - "properties": { - "reason": { - "type": "string" - } - } + "schema": { + "type": "string" }, - "v1.RelatedSQLInfo": { - "type": "object", - "properties": { - "execute_time_avg": { - "description": "平均执行时间(s)", - "type": "number" - }, - "execute_time_max": { - "description": "最大执行时间(s)", - "type": "number" - }, - "execute_time_min": { - "description": "最小执行时间(s)", - "type": "number" - }, - "execute_time_sum": { - "description": "总执行时间(s)", - "type": "number" - }, - "execution_time_trend": { - "description": "SQL 趋势图表", - "type": "object", - "$ref": "#/definitions/v1.SqlAnalysisScatterChart" - }, - "lock_wait_time": { - "description": "锁等待时间(s)", - "type": "number" - }, - "source": { - "type": "string", - "enum": [ - "workflow", - "sql_manage" - ] - }, - "sql_fingerprint": { - "type": "string" - } - } - }, - "v1.RelatedTransactionInfo": { - "type": "object", - "properties": { - "related_sql_info": { - "description": "相关SQL列表", - "type": "array", - "items": { - "$ref": "#/definitions/v1.TransactionSQL" - } - }, - "transaction_info": { - "description": "事务信息", - "type": "object", - "$ref": "#/definitions/v1.TransactionInfo" - }, - "transaction_lock_info": { - "description": "事务锁信息", - "type": "array", - "items": { - "$ref": "#/definitions/v1.TransactionLockInfo" - } - }, - "transaction_timeline": { - "description": "事务时间线", - "type": "object", - "$ref": "#/definitions/v1.TransactionTimeline" - } - } - }, - "v1.ReleaseWorkflows": { - "type": "object", - "properties": { - "target_release_instances": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.TargetReleaseInstance" - } - }, - "workflow_id": { - "type": "string" - } - } - }, - "v1.ReportPushConfigList": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "last_push_time": { - "type": "string" - }, - "push_frequency_cron": { - "type": "string" - }, - "push_user_Type": { - "type": "string", - "enum": [ - "fixed", - "permission_match" - ] - }, - "push_user_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "report_push_config_id": { - "type": "string" - }, - "trigger_type": { - "type": "string", - "enum": [ - "immediately", - "timing" - ] - }, - "type": { - "type": "string" - } - } - }, - "v1.RewriteRule": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "rewritten_queries_str": { - "type": "string" - }, - "rule_code": { - "type": "string" - }, - "rule_name": { - "type": "string" - }, - "violated_queries_str": { - "type": "string" - } - } - }, - "v1.RewriteSQLData": { - "type": "object", - "properties": { - "business_desc": { - "description": "重写前的SQL业务描述", - "type": "string" - }, - "business_non_equivalent_desc": { - "description": "重写前后的业务不等价性描述,为空表示等价", - "type": "string" - }, - "logic_desc": { - "description": "重写前的SQL执行逻辑描述", - "type": "string" - }, - "rewritten_sql": { - "description": "重写后的SQL", - "type": "string" - }, - "rewritten_sql_business_desc": { - "description": "重写后的SQL业务描述", - "type": "string" - }, - "rewritten_sql_logic_desc": { - "description": "重写后的SQL执行逻辑描述", - "type": "string" - }, - "suggestions": { - "description": "重写建议列表", - "type": "array", - "items": { - "$ref": "#/definitions/v1.RewriteSuggestion" - } - } - } - }, - "v1.RewriteSQLReq": { + "table": { + "type": "string" + } + } + }, + "SQLQueryConfigResV1": { + "type": "object", + "properties": { + "allow_query_when_less_than_audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ] + }, + "audit_enabled": { + "type": "boolean" + }, + "max_pre_query_rows": { + "type": "integer" + }, + "query_timeout_second": { + "type": "integer" + } + } + }, + "SQLStatement": { + "type": "object", + "properties": { + "audit_error": { + "type": "string" + }, + "sql_statement_with_audit": { + "type": "object", + "$ref": "#/definitions/SQLStatementWithAuditResult" + } + } + }, + "SQLStatementWithAuditResult": { + "type": "object", + "properties": { + "audit_results": { + "type": "array", + "items": { + "$ref": "#/definitions/SQLAuditResult" + } + }, + "sql_statement": { + "type": "string" + } + } + }, + "SSHPublicKeyInfo": { + "type": "object", + "properties": { + "public_key": { + "type": "string" + } + } + }, + "SSHPublicKeyInfoV1Rsp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/SSHPublicKeyInfo" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "ScatterPoint": { + "type": "object", + "properties": { + "execute_time": { + "description": "执行时间", + "type": "number" + }, + "id": { + "description": "SQL ID", + "type": "integer" + }, + "info": { + "description": "额外信息", + "type": "array", + "items": { "type": "object", - "properties": { - "enable_structure_type": { - "description": "是否启用结构化类型的重写", - "type": "boolean", - "default": false, - "example": false - } + "additionalProperties": { + "type": "string" } + } }, - "v1.RewriteSuggestion": { - "type": "object", - "properties": { - "audit_level": { - "description": "审核规则等级", - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ] - }, - "ddl_dcl": { - "description": "具体的数据库结构变更语句,需要在数据库中执行该变更语句之后再应用重写SQL(包含CREATE/ALTER/DROP等DDL语句,或SET等DCL语句)(适用于结构级重写)", - "type": "string" - }, - "ddl_dcl_desc": { - "description": "数据库结构变更建议说明(例如:建议添加索引、修改表结构等优化建议)(适用于结构级重写)", - "type": "string" - }, - "desc": { - "description": "重写描述(适用于所有类型)", - "type": "string" - }, - "rewritten_sql": { - "description": "重写后的SQL(适用于语句级重写和结构级重写)", - "type": "string" - }, - "rule_name": { - "description": "审核规则名称", - "type": "string" - }, - "status": { - "description": "处理状态:初始化、已处理", - "type": "string", - "default": "initial", - "enum": [ - "initial", - "processed" - ] - }, - "type": { - "description": "重写建议类型:语句级重写、结构级重写、其他", - "type": "string", - "enum": [ - "statement", - "structure", - "other" - ] - } - } - }, - "v1.RiskAuditPlan": { - "type": "object", - "properties": { - "audit_plan_name": { - "type": "string" - }, - "audit_plan_report_id": { - "type": "integer" - }, - "audit_plan_report_timestamp": { - "type": "string" - }, - "risk_sql_count": { - "type": "integer" - }, - "trigger_audit_plan_time": { - "type": "string" - } - } - }, - "v1.RiskWorkflow": { - "type": "object", - "properties": { - "create_user_name": { - "type": "string" - }, - "update_time": { - "type": "string" - }, - "workflow_id": { - "type": "string" - }, - "workflow_name": { - "type": "string" - }, - "workflow_status": { - "type": "string" - } - } - }, - "v1.RoleUserCount": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "role": { - "type": "string" - } - } + "is_in_transaction": { + "description": "是否在事务中", + "type": "boolean" }, - "v1.RuleInfo": { - "type": "object", - "properties": { - "annotation": { - "type": "string", - "example": "this is test rule" - }, - "desc": { - "type": "string", - "example": "this is test rule" - } - } - }, - "v1.RuleKnowledgeResV1": { - "type": "object", - "properties": { - "knowledge_content": { - "type": "string" - }, - "rule": { - "type": "object", - "$ref": "#/definitions/v1.RuleInfo" - } - } + "sql": { + "description": "SQL语句", + "type": "string" }, - "v1.RuleParamReqV1": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - } + "time": { + "description": "时间点", + "type": "string" + } + } + }, + "ScheduleTaskDefaultOption": { + "type": "object", + "properties": { + "default_selector": { + "type": "string", + "enum": [ + "wechat", + "feishu" + ] + } + } + }, + "ScheduledTaskDefaultOptionV1Rsp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/ScheduleTaskDefaultOption" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "SchemaObject": { + "type": "object", + "properties": { + "base_schema_name": { + "type": "string" + }, + "comparison_result": { + "type": "string", + "enum": [ + "same", + "inconsistent", + "base_not_exist", + "comparison_not_exist" + ] + }, + "comparison_schema_name": { + "type": "string" + }, + "database_diff_objects": { + "type": "array", + "items": { + "$ref": "#/definitions/DatabaseDiffObject" + } + }, + "inconsistent_num": { + "type": "integer" + } + } + }, + "Source": { + "type": "object", + "properties": { + "sql_source_desc": { + "type": "string" + }, + "sql_source_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "sql_source_type": { + "type": "string" + } + } + }, + "SqlAnalysis": { + "type": "object", + "properties": { + "performance_statistics": { + "type": "object", + "$ref": "#/definitions/PerformanceStatistics" + }, + "sql_explain": { + "type": "object", + "$ref": "#/definitions/SQLExplain" + }, + "table_metas": { + "type": "object", + "$ref": "#/definitions/TableMetas" + } + } + }, + "SqlAnalysisChart": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "points": { + "type": "array", + "items": { + "$ref": "#/definitions/ChartPoint" + } + }, + "x_info": { + "type": "string" + }, + "y_info": { + "type": "string" + } + } + }, + "SqlAnalysisResDataV1": { + "type": "object", + "properties": { + "sql_explain": { + "type": "object", + "$ref": "#/definitions/SQLExplain" + }, + "table_metas": { + "type": "array", + "items": { + "$ref": "#/definitions/TableMeta" + } + } + } + }, + "SqlAnalysisScatterChart": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "points": { + "type": "array", + "items": { + "$ref": "#/definitions/ScatterPoint" + } + }, + "x_info": { + "type": "string" + }, + "y_info": { + "type": "string" + } + } + }, + "SqlAverageExecutionTime": { + "type": "object", + "properties": { + "average_execution_seconds": { + "type": "integer" }, - "v1.RuleParamResV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "key": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "string", - "int", - "bool" - ] - }, - "value": { - "type": "string" - } - } - }, - "v1.RuleProjectTemplateDetailResV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "rule_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RuleResV1" - } - }, - "rule_template_name": { - "type": "string" - }, - "rule_version": { - "type": "integer" - } - } - }, - "v1.RuleReqV1": { - "type": "object", - "properties": { - "is_custom_rule": { - "type": "boolean" - }, - "level": { - "type": "string", - "example": "error" - }, - "name": { - "type": "string", - "example": "ddl_check_index_count" - }, - "params": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RuleParamReqV1" - } - } - } - }, - "v1.RuleResV1": { - "type": "object", - "properties": { - "annotation": { - "type": "string", - "example": "避免多次 table rebuild 带来的消耗、以及对线上业务的影响" - }, - "categories": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "db_type": { - "type": "string", - "example": "mysql" - }, - "desc": { - "type": "string" - }, - "has_audit_power": { - "type": "boolean" - }, - "has_rewrite_power": { - "type": "boolean" - }, - "is_custom_rule": { - "type": "boolean" - }, - "level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "example": "error" - }, - "params": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RuleParamResV1" - } - }, - "rule_name": { - "type": "string" - }, - "type": { - "type": "string", - "example": "全局配置" - }, - "version": { - "type": "integer" - } - } - }, - "v1.RuleRespV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "rule_name": { - "type": "string" - } - } + "instance_name": { + "type": "string" }, - "v1.RuleTemplateDetailResV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "rule_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RuleResV1" - } - }, - "rule_template_name": { - "type": "string" - }, - "rule_version": { - "type": "integer" - } - } - }, - "v1.RuleTemplateResV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "rule_template_name": { - "type": "string" - }, - "rule_version": { - "type": "integer" - } - } - }, - "v1.RuleTemplateTipResV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "is_default_rule_template": { - "type": "boolean" - }, - "rule_template_id": { - "type": "string" - }, - "rule_template_name": { - "type": "string" - }, - "rule_version": { - "type": "integer" - } - } - }, - "v1.RuleTips": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "rule": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RuleRespV1" - } - } - } - }, - "v1.RuleTypeV1": { - "type": "object", - "properties": { - "is_custom_rule_type": { - "type": "boolean" - }, - "rule_count": { - "type": "integer" - }, - "rule_type": { - "type": "string" - } - } - }, - "v1.SQLAuditRecord": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "creator": { - "type": "string" - }, - "instance": { - "type": "object", - "$ref": "#/definitions/v1.SQLAuditRecordInstance" - }, - "sql_audit_record_id": { - "type": "string" - }, - "sql_audit_status": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "task": { - "type": "object", - "$ref": "#/definitions/v1.AuditTaskResV1" - } - } - }, - "v1.SQLAuditRecordInstance": { + "max_execution_seconds": { + "type": "integer" + }, + "min_execution_seconds": { + "type": "integer" + } + } + }, + "SqlDEVRecord": { + "type": "object", + "properties": { + "audit_result": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditResult" + } + }, + "creator": { + "description": "create user name", + "type": "string" + }, + "first_appear_timestamp": { + "type": "string" + }, + "fp_count": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "instance_name": { + "type": "string" + }, + "last_receive_timestamp": { + "type": "string" + }, + "schema_name": { + "type": "string" + }, + "source": { + "type": "object", + "$ref": "#/definitions/RecordSource" + }, + "sql": { + "type": "string" + }, + "sql_fingerprint": { + "type": "string" + } + } + }, + "SqlExecutionFailPercent": { + "type": "object", + "properties": { + "instance_name": { + "type": "string" + }, + "percent": { + "type": "number" + } + } + }, + "SqlFileOrderMethod": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "order_method": { + "type": "string" + } + } + }, + "SqlFileOrderMethodRes": { + "type": "object", + "properties": { + "methods": { + "type": "array", + "items": { + "$ref": "#/definitions/SqlFileOrderMethod" + } + } + } + }, + "SqlManage": { + "type": "object", + "properties": { + "assignees": { + "type": "array", + "items": { + "type": "string" + } + }, + "audit_result": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditResult" + } + }, + "audit_status": { + "type": "string", + "enum": [ + "being_audited" + ] + }, + "endpoints": { + "type": "array", + "items": { + "type": "string" + } + }, + "first_appear_timestamp": { + "type": "string" + }, + "fp_count": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "instance_name": { + "type": "string" + }, + "last_receive_timestamp": { + "type": "string" + }, + "priority": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "schema_name": { + "type": "string" + }, + "source": { + "type": "object", + "$ref": "#/definitions/Source" + }, + "sql": { + "type": "string" + }, + "sql_fingerprint": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited", + "sent" + ] + } + } + }, + "SqlManageAnalysisChartResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/SqlAnalysisChart" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "SqlManageCodingReq": { + "type": "object", + "properties": { + "coding_project_name": { + "type": "string" + }, + "priority": { + "type": "string", + "enum": [ + "LOW", + "MEDIUM", + "HIGH", + "EMERGENCY" + ] + }, + "sql_manage_id_list": { + "type": "array", + "items": { + "type": "integer" + } + }, + "type": { + "type": "string", + "enum": [ + "DEFECT", + "MISSION", + "REQUIREMENT", + "EPIC", + "SUB_TASK" + ] + } + } + }, + "SqlPerformanceInsights": { + "type": "object", + "properties": { + "lines": { + "description": "图表线条数据", + "type": "array", + "items": { + "$ref": "#/definitions/Line" + } + }, + "message": { + "description": "提示信息", + "type": "string" + }, + "task_enable": { + "description": "是否启用任务", + "type": "boolean" + }, + "task_support": { + "description": "是否支持任务", + "type": "boolean" + }, + "x_info": { + "description": "X轴信息", + "type": "string" + }, + "y_info": { + "description": "Y轴信息", + "type": "string" + } + } + }, + "SqlVersionDetailResV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "sql_version_id": { + "type": "integer" + }, + "sql_version_stage_detail": { + "type": "array", + "items": { + "$ref": "#/definitions/SqlVersionStageDetail" + } + }, + "status": { + "type": "string", + "enum": [ + "is_being_released", + "locked" + ] + }, + "version": { + "type": "string" + } + } + }, + "SqlVersionResV1": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "deletable": { + "type": "boolean" + }, + "desc": { + "type": "string" + }, + "lock_time": { + "type": "string" + }, + "lockable": { + "type": "boolean" + }, + "status": { + "type": "string", + "enum": [ + "is_being_released", + "locked" + ] + }, + "version": { + "type": "string" + }, + "version_id": { + "type": "integer" + } + } + }, + "SqlVersionStageDetail": { + "type": "object", + "properties": { + "stage_id": { + "type": "integer" + }, + "stage_instances": { + "type": "array", + "items": { + "$ref": "#/definitions/VersionStageInstance" + } + }, + "stage_name": { + "type": "string" + }, + "stage_sequence": { + "type": "integer" + }, + "workflow_details": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowDetailWithInstance" + } + } + } + }, + "StatisticAuditPlanResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/DBTypeAuditPlan" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "StatisticRiskWorkflowResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/RiskWorkflow" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "StatisticsAuditedSQLResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AuditedSQLCount" + }, + "message": { + "type": "string", + "example": "ok" + }, + "risk_rate": { + "type": "integer" + } + } + }, + "Table": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "TableColumns": { + "type": "object", + "properties": { + "head": { + "type": "array", + "items": { + "$ref": "#/definitions/TableMetaItemHeadResV1" + } + }, + "rows": { + "type": "array", + "items": { "type": "object", - "properties": { - "db_host": { - "type": "string", - "example": "10.10.10.10" - }, - "db_port": { - "type": "string", - "example": "3306" - } - } - }, - "v1.SQLAuditRecordResData": { + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "TableIndexes": { + "type": "object", + "properties": { + "head": { + "type": "array", + "items": { + "$ref": "#/definitions/TableMetaItemHeadResV1" + } + }, + "rows": { + "type": "array", + "items": { "type": "object", - "properties": { - "sql_audit_record_id": { - "type": "string" - }, - "task": { - "type": "object", - "$ref": "#/definitions/v1.AuditTaskResV1" - } + "additionalProperties": { + "type": "string" } + } + } + } + }, + "TableMeta": { + "type": "object", + "properties": { + "columns": { + "type": "object", + "$ref": "#/definitions/TableColumns" + }, + "create_table_sql": { + "type": "string" + }, + "indexes": { + "type": "object", + "$ref": "#/definitions/TableIndexes" + }, + "message": { + "type": "string" + }, + "name": { + "type": "string" + }, + "schema": { + "type": "string" + } + } + }, + "TableMetaItemHeadResV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "field_name": { + "type": "string" + } + } + }, + "TableMetas": { + "type": "object", + "properties": { + "err_message": { + "type": "string" + }, + "table_meta_items": { + "type": "array", + "items": { + "$ref": "#/definitions/TableMeta" + } + } + } + }, + "Tag": { + "type": "object", + "properties": { + "id": { + "description": "标签ID", + "type": "integer" + }, + "name": { + "description": "标签名称", + "type": "string" + }, + "sub_tags": { + "description": "子标签", + "type": "array", + "items": { + "$ref": "#/definitions/Tag" + } + } + } + }, + "TargetReleaseInstance": { + "type": "object", + "properties": { + "instance_id": { + "type": "string" + }, + "instance_schema": { + "type": "string" + }, + "target_instance_id": { + "type": "string" + }, + "target_instance_schema": { + "type": "string" + } + } + }, + "TestAuditPlanNotifyConfigResDataV1": { + "type": "object", + "properties": { + "is_notify_send_normal": { + "type": "boolean" + }, + "send_error_message": { + "type": "string" + } + } + }, + "TestAuditPlanNotifyConfigResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/TestAuditPlanNotifyConfigResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "TestCodingConfigResDataV1": { + "type": "object", + "properties": { + "error_message": { + "type": "string" + }, + "is_message_sent_normally": { + "type": "boolean" + } + } + }, + "TestCodingConfigResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/TestCodingConfigResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "TestCodingConfigurationReqV1": { + "type": "object", + "properties": { + "coding_project_name": { + "type": "string" + } + } + }, + "TestDingTalkConfigResDataV1": { + "type": "object", + "properties": { + "is_ding_talk_send_normal": { + "type": "boolean" + }, + "send_error_message": { + "type": "string" + } + } + }, + "TestDingTalkConfigResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/TestDingTalkConfigResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "TestFeishuConfigResDataV1": { + "type": "object", + "properties": { + "error_message": { + "type": "string" + }, + "is_message_sent_normally": { + "type": "boolean" + } + } + }, + "TestFeishuConfigResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/TestFeishuConfigResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "TestFeishuConfigurationReqV1": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "account_type": { + "type": "string", + "enum": [ + "email", + "phone" + ] + } + } + }, + "TestGitConnectionReqV1": { + "type": "object", + "properties": { + "git_http_url": { + "type": "string" + }, + "git_user_name": { + "type": "string" + }, + "git_user_password": { + "type": "string" + } + } + }, + "TestGitConnectionResDataV1": { + "type": "object", + "properties": { + "branches": { + "type": "array", + "items": { + "type": "string" + } + }, + "error_message": { + "type": "string" + }, + "is_connected_success": { + "type": "boolean" + } + } + }, + "TestGitConnectionResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/TestGitConnectionResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "TestWechatConfigResDataV1": { + "type": "object", + "properties": { + "error_message": { + "type": "string" + }, + "is_message_sent_normally": { + "type": "boolean" + } + } + }, + "TestWechatConfigResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/TestWechatConfigResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "TestWechatConfigurationReqV1": { + "type": "object", + "properties": { + "wechat_id": { + "type": "string" + } + } + }, + "TimeResV1": { + "type": "object", + "properties": { + "hour": { + "type": "integer" + }, + "minute": { + "type": "integer" + } + } + }, + "TopProblemDistribution": { + "type": "object", + "properties": { + "percentage": { + "description": "占比", + "type": "number" + }, + "problem_type": { + "description": "问题类型", + "type": "string" + } + } + }, + "TransactionInfo": { + "type": "object", + "properties": { + "lock_type": { + "description": "锁类型", + "type": "string", + "enum": [ + "SHARED", + "EXCLUSIVE", + "INTENTION_SHARED", + "INTENTION_EXCLUSIVE", + "SHARED_INTENTION_EXCLUSIVE", + "ROW_LOCK", + "TABLE_LOCK", + "METADATA_LOCK" + ] + }, + "transaction_duration": { + "description": "事务持续时间", + "type": "number" + }, + "transaction_end_time": { + "description": "事务结束时间", + "type": "string" + }, + "transaction_id": { + "description": "事务ID", + "type": "string" + }, + "transaction_start_time": { + "description": "事务开始时间", + "type": "string" + }, + "transaction_state": { + "description": "事务状态", + "type": "string", + "enum": [ + "RUNNING", + "COMPLETED" + ] + } + } + }, + "TransactionLockInfo": { + "type": "object", + "properties": { + "create_lock_sql": { + "description": "创建锁的SQL语句", + "type": "string" + }, + "lock_type": { + "description": "锁类型", + "type": "string", + "enum": [ + "SHARED", + "EXCLUSIVE", + "INTENTION_SHARED", + "INTENTION_EXCLUSIVE", + "SHARED_INTENTION_EXCLUSIVE", + "ROW_LOCK", + "TABLE_LOCK", + "METADATA_LOCK" + ] + }, + "table_name": { + "description": "表名", + "type": "string" + } + } + }, + "TransactionSQL": { + "type": "object", + "properties": { + "execute_duration": { + "description": "执行时长", + "type": "number" + }, + "lock_type": { + "description": "锁类型", + "type": "string", + "enum": [ + "SHARED", + "EXCLUSIVE", + "INTENTION_SHARED", + "INTENTION_EXCLUSIVE", + "SHARED_INTENTION_EXCLUSIVE", + "ROW_LOCK", + "TABLE_LOCK", + "METADATA_LOCK" + ] + }, + "sql": { + "description": "SQL语句", + "type": "string" + } + } + }, + "TransactionTimeline": { + "type": "object", + "properties": { + "current_step_index": { + "description": "当前步骤索引", + "type": "integer" + }, + "timeline": { + "description": "时间线项目列表", + "type": "array", + "items": { + "$ref": "#/definitions/TransactionTimelineItem" + } + } + } + }, + "TransactionTimelineItem": { + "type": "object", + "properties": { + "description": { + "description": "描述信息", + "type": "string" + }, + "start_time": { + "description": "开始时间", + "type": "string" + } + } + }, + "TriggerAuditPlanResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AuditPlanReportResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "UpdateAuditPlanNotifyConfigReqV1": { + "type": "object", + "properties": { + "enable_email_notify": { + "type": "boolean" + }, + "enable_web_hook_notify": { + "type": "boolean" + }, + "notify_interval": { + "type": "integer", + "default": 10 + }, + "notify_level": { + "type": "string", + "default": "warn", + "enum": [ + "normal", + "notice", + "warn", + "error" + ] + }, + "web_hook_template": { + "type": "string" + }, + "web_hook_url": { + "type": "string" + } + } + }, + "UpdateAuditPlanReqV1": { + "type": "object", + "properties": { + "audit_plan_cron": { + "type": "string", + "example": "0 */2 * * *" + }, + "audit_plan_instance_database": { + "type": "string", + "example": "app1" + }, + "audit_plan_instance_name": { + "type": "string", + "example": "test_mysql" + }, + "audit_plan_params": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanParamReqV1" + } + }, + "rule_template_name": { + "type": "string", + "example": "default_MySQL" + } + } + }, + "UpdateAuditPlanStatusReqV1": { + "type": "object", + "properties": { + "active": { + "description": "任务状态", + "type": "string", + "enum": [ + "normal", + "disabled" + ] + } + } + }, + "UpdateAuditTaskSQLsReqV1": { + "type": "object", + "properties": { + "description": { + "type": "string" + } + } + }, + "UpdateAuditWhitelistReqV1": { + "type": "object", + "properties": { + "desc": { + "type": "string", + "example": "used for rapid release" + }, + "match_type": { + "type": "string", + "enum": [ + "exact_match", + "fp_match" + ], + "example": "exact_match" + }, + "value": { + "type": "string", + "example": "create table" + } + } + }, + "UpdateBlacklistReqV1": { + "type": "object", + "properties": { + "content": { + "type": "string", + "example": "select * from t1" + }, + "desc": { + "type": "string", + "example": "used for rapid release" + }, + "type": { + "type": "string", + "enum": [ + "sql", + "fp_sql", + "ip", + "cidr", + "host", + "instance" + ], + "example": "sql" + } + } + }, + "UpdateCodingConfigurationReqV1": { + "type": "object", + "properties": { + "coding_url": { + "type": "string" }, - "v1.SQLAuditResult": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "error_info": { - "type": "string" - }, - "execution_failed": { - "type": "boolean", - "example": false - }, - "i18n_audit_result_info": { - "type": "object", - "$ref": "#/definitions/model.I18nAuditResultInfo" - }, - "level": { - "type": "string", - "example": "warn" - }, - "message": { - "type": "string", - "example": "避免使用不必要的内置函数md5()" - }, - "rule_name": { - "type": "string" - } - } - }, - "v1.SQLExplain": { - "type": "object", - "properties": { - "classic_result": { - "description": "explain result in table format", - "type": "object", - "$ref": "#/definitions/v1.ExplainClassicResult" - }, - "cost": { - "type": "number" - }, - "message": { - "type": "string" - }, - "sql": { - "type": "string" - } - } - }, - "v1.SQLLineageAnalyzeReqV1": { - "type": "object", - "properties": { - "default_schema": { - "type": "string" - }, - "instance_type": { - "type": "string" - }, - "result_columns": { - "type": "array", - "items": { - "type": "string" - } - }, - "sql": { - "type": "string" - } - } - }, - "v1.SQLLineageAnalyzeResDataV1": { - "type": "object", - "properties": { - "result": { - "type": "object", - "$ref": "#/definitions/v1.SQLLineageAnalyzeResultV1" - } - } + "is_coding_enabled": { + "type": "boolean" }, - "v1.SQLLineageAnalyzeResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.SQLLineageAnalyzeResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.SQLLineageAnalyzeResultV1": { - "type": "object", - "properties": { - "edges": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SQLLineageEdgeV1" - } - }, - "nodes": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SQLLineageNodeV1" - } - }, - "original_sql": { - "type": "string" - }, - "result_columns": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SQLLineageResultColumnV1" - } - }, - "source_columns": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SQLLineageColumnRefV1" - } - }, - "tables": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SQLLineageTableRefV1" - } - }, - "title": { - "type": "string" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "v1.SQLLineageColumnRefV1": { - "type": "object", - "properties": { - "column": { - "type": "string" - }, - "schema": { - "type": "string" - }, - "table": { - "type": "string" - } - } - }, - "v1.SQLLineageEdgeV1": { - "type": "object", - "properties": { - "from_id": { - "type": "string" - }, - "to_id": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "v1.SQLLineageNodeV1": { - "type": "object", - "properties": { - "column": { - "type": "string" - }, - "expr": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "schema": { - "type": "string" - }, - "table": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "v1.SQLLineageResultColumnV1": { - "type": "object", - "properties": { - "expression": { - "type": "string" - }, - "name": { - "type": "string" - }, - "sources": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SQLLineageColumnRefV1" - } - } - } - }, - "v1.SQLLineageTableRefV1": { - "type": "object", - "properties": { - "alias": { - "type": "string" - }, - "schema": { - "type": "string" - }, - "table": { - "type": "string" - } - } - }, - "v1.SQLQueryConfigResV1": { - "type": "object", - "properties": { - "allow_query_when_less_than_audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ] - }, - "audit_enabled": { - "type": "boolean" - }, - "max_pre_query_rows": { - "type": "integer" - }, - "query_timeout_second": { - "type": "integer" - } - } - }, - "v1.SQLStatement": { - "type": "object", - "properties": { - "audit_error": { - "type": "string" - }, - "sql_statement_with_audit": { - "type": "object", - "$ref": "#/definitions/v1.SQLStatementWithAuditResult" - } - } + "token": { + "type": "string" + } + } + }, + "UpdateCompanyNoticeReq": { + "type": "object", + "properties": { + "notice_str": { + "type": "string" + } + } + }, + "UpdateCustomRuleReqV1": { + "type": "object", + "properties": { + "annotation": { + "type": "string", + "example": "this is test rule" + }, + "desc": { + "type": "string", + "example": "this is test rule" + }, + "level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "example": "notice" + }, + "rule_script": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "example": "DDL规则" + } + } + }, + "UpdateDingTalkConfigurationReqV1": { + "type": "object", + "required": [ + "app_key", + "app_secret", + "is_enable_ding_talk_notify" + ], + "properties": { + "app_key": { + "type": "string" + }, + "app_secret": { + "type": "string" + }, + "is_enable_ding_talk_notify": { + "type": "boolean" + } + } + }, + "UpdateFeishuConfigurationReqV1": { + "type": "object", + "required": [ + "app_id", + "app_secret", + "is_feishu_notification_enabled" + ], + "properties": { + "app_id": { + "type": "string" + }, + "app_secret": { + "type": "string" + }, + "is_feishu_notification_enabled": { + "type": "boolean" + } + } + }, + "UpdateInstanceAuditPlanReqV1": { + "type": "object", + "properties": { + "audit_plans": { + "description": "扫描类型", + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlan" + } + } + } + }, + "UpdateInstanceAuditPlanStatusReqV1": { + "type": "object", + "properties": { + "active": { + "description": "任务状态", + "type": "string", + "enum": [ + "normal", + "disabled" + ] + } + } + }, + "UpdatePipelineReqV1": { + "type": "object", + "properties": { + "address": { + "description": "关联流水线地址", + "type": "string" + }, + "description": { + "description": "流水线描述", + "type": "string" + }, + "name": { + "description": "流水线名称", + "type": "string" + }, + "nodes": { + "description": "节点信息", + "type": "array", + "items": { + "$ref": "#/definitions/updatePipelineNode" + } + } + } + }, + "UpdateProjectRuleTemplateReqV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "rule_list": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleReqV1" + } + } + } + }, + "UpdateReportPushConfigReqV1": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "push_frequency_cron": { + "type": "string" + }, + "push_user_Type": { + "type": "string", + "enum": [ + "fixed", + "permission_match" + ] + }, + "push_user_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "trigger_type": { + "type": "string", + "enum": [ + "immediately", + "timing" + ] + } + } + }, + "UpdateRuleKnowledgeReq": { + "type": "object", + "properties": { + "knowledge_content": { + "type": "string" + } + } + }, + "UpdateRuleTemplateReqV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "rule_list": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleReqV1" + } + } + } + }, + "UpdateSQLAuditRecordReqV1": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "UpdateSqlBackupStrategyReq": { + "type": "object", + "properties": { + "strategy": { + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "original_row" + ] + } + } + }, + "UpdateSqlFileOrderV1Req": { + "type": "object", + "properties": { + "files_to_sort": { + "type": "array", + "items": { + "$ref": "#/definitions/FileToSort" + } + } + } + }, + "UpdateSqlVersionReqV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "update_sql_version_stage": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateSqlVersionStage" + } + }, + "version": { + "type": "string", + "example": "2.23" + } + } + }, + "UpdateSqlVersionStage": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "生产" + }, + "stage_sequence": { + "type": "integer" + }, + "update_stages_instance_dep": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateStagesInstanceDep" + } + } + } + }, + "UpdateStagesInstanceDep": { + "type": "object", + "properties": { + "next_stage_instance_id": { + "type": "string" + }, + "stage_instance_id": { + "type": "string" + } + } + }, + "UpdateTaskBackupStrategyReq": { + "type": "object", + "properties": { + "strategy": { + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "original_row" + ] + } + } + }, + "UpdateWechatConfigurationReqV1": { + "type": "object", + "required": [ + "is_wechat_notification_enabled" + ], + "properties": { + "corp_id": { + "type": "string" + }, + "corp_secret": { + "type": "string" + }, + "is_wechat_notification_enabled": { + "type": "boolean" + } + } + }, + "UpdateWorkflowReqV1": { + "type": "object", + "properties": { + "task_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "UpdateWorkflowScheduleReqV1": { + "type": "object", + "properties": { + "schedule_time": { + "type": "string" + } + } + }, + "UpdateWorkflowTemplateByIdReqV1": { + "type": "object", + "properties": { + "allow_submit_when_less_audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ] + }, + "desc": { + "type": "string" + }, + "is_default": { + "type": "boolean" + }, + "workflow_step_template_list": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkFlowStepTemplateReqV1" + } + }, + "workflow_template_name": { + "type": "string" + } + } + }, + "UpdateWorkflowTemplateReqV1": { + "type": "object", + "properties": { + "allow_submit_when_less_audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ] + }, + "desc": { + "type": "string" + }, + "workflow_step_template_list": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkFlowStepTemplateReqV1" + } + } + } + }, + "UserTipResV1": { + "type": "object", + "properties": { + "user_id": { + "type": "string" + }, + "user_name": { + "type": "string" + } + } + }, + "VersionStageInstance": { + "type": "object", + "properties": { + "instance_schema": { + "type": "string" }, - "v1.SQLStatementWithAuditResult": { - "type": "object", - "properties": { - "audit_results": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SQLAuditResult" - } - }, - "sql_statement": { - "type": "string" - } - } - }, - "v1.SSHPublicKeyInfo": { - "type": "object", - "properties": { - "public_key": { - "type": "string" - } - } + "instances_id": { + "type": "string" }, - "v1.SSHPublicKeyInfoV1Rsp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.SSHPublicKeyInfo" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.ScatterPoint": { - "type": "object", - "properties": { - "execute_time": { - "description": "执行时间", - "type": "number" - }, - "id": { - "description": "SQL ID", - "type": "integer" - }, - "info": { - "description": "额外信息", - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "is_in_transaction": { - "description": "是否在事务中", - "type": "boolean" - }, - "sql": { - "description": "SQL语句", - "type": "string" - }, - "time": { - "description": "时间点", - "type": "string" - } - } - }, - "v1.ScheduleTaskDefaultOption": { - "type": "object", - "properties": { - "default_selector": { - "type": "string", - "enum": [ - "wechat", - "feishu" - ] - } - } + "instances_name": { + "type": "string" + } + } + }, + "WechatConfigurationV1": { + "type": "object", + "properties": { + "corp_id": { + "type": "string" + }, + "is_wechat_notification_enabled": { + "type": "boolean" + } + } + }, + "WorkFlowStepTemplateReqV1": { + "type": "object", + "properties": { + "approved_by_authorized": { + "type": "boolean" + }, + "assignee_user_id_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "desc": { + "type": "string" + }, + "execute_by_authorized": { + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "sql_review", + "sql_execute", + "export_review", + "export_execute" + ] + } + } + }, + "WorkFlowStepTemplateResV1": { + "type": "object", + "properties": { + "approved_by_authorized": { + "type": "boolean" }, - "v1.ScheduledTaskDefaultOptionV1Rsp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.ScheduleTaskDefaultOption" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.SchemaObject": { - "type": "object", - "properties": { - "base_schema_name": { - "type": "string" - }, - "comparison_result": { - "type": "string", - "enum": [ - "same", - "inconsistent", - "base_not_exist", - "comparison_not_exist" - ] - }, - "comparison_schema_name": { - "type": "string" - }, - "database_diff_objects": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.DatabaseDiffObject" - } - }, - "inconsistent_num": { - "type": "integer" - } - } - }, - "v1.Source": { - "type": "object", - "properties": { - "sql_source_desc": { - "type": "string" - }, - "sql_source_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "sql_source_type": { - "type": "string" - } - } - }, - "v1.SqlAnalysis": { - "type": "object", - "properties": { - "performance_statistics": { - "type": "object", - "$ref": "#/definitions/v1.PerformanceStatistics" - }, - "sql_explain": { - "type": "object", - "$ref": "#/definitions/v1.SQLExplain" - }, - "table_metas": { - "type": "object", - "$ref": "#/definitions/v1.TableMetas" - } - } - }, - "v1.SqlAnalysisChart": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "points": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.ChartPoint" - } - }, - "x_info": { - "type": "string" - }, - "y_info": { - "type": "string" - } - } - }, - "v1.SqlAnalysisResDataV1": { - "type": "object", - "properties": { - "sql_explain": { - "type": "object", - "$ref": "#/definitions/v1.SQLExplain" - }, - "table_metas": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.TableMeta" - } - } - } - }, - "v1.SqlAnalysisScatterChart": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "points": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.ScatterPoint" - } - }, - "x_info": { - "type": "string" - }, - "y_info": { - "type": "string" - } - } - }, - "v1.SqlAverageExecutionTime": { - "type": "object", - "properties": { - "average_execution_seconds": { - "type": "integer" - }, - "instance_name": { - "type": "string" - }, - "max_execution_seconds": { - "type": "integer" - }, - "min_execution_seconds": { - "type": "integer" - } - } - }, - "v1.SqlDEVRecord": { - "type": "object", - "properties": { - "audit_result": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditResult" - } - }, - "creator": { - "description": "create user name", - "type": "string" - }, - "first_appear_timestamp": { - "type": "string" - }, - "fp_count": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "instance_name": { - "type": "string" - }, - "last_receive_timestamp": { - "type": "string" - }, - "schema_name": { - "type": "string" - }, - "source": { - "type": "object", - "$ref": "#/definitions/v1.RecordSource" - }, - "sql": { - "type": "string" - }, - "sql_fingerprint": { - "type": "string" - } - } - }, - "v1.SqlExecutionFailPercent": { - "type": "object", - "properties": { - "instance_name": { - "type": "string" - }, - "percent": { - "type": "number" - } - } + "assignee_user_id_list": { + "type": "array", + "items": { + "type": "string" + } }, - "v1.SqlFileOrderMethod": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "order_method": { - "type": "string" - } - } + "desc": { + "type": "string" }, - "v1.SqlFileOrderMethodRes": { - "type": "object", - "properties": { - "methods": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SqlFileOrderMethod" - } - } - } + "execute_by_authorized": { + "type": "boolean" }, - "v1.SqlManage": { - "type": "object", - "properties": { - "appear_num": { - "type": "integer" - }, - "assignees": { - "type": "array", - "items": { - "type": "string" - } - }, - "audit_result": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditResult" - } - }, - "endpoint": { - "type": "string" - }, - "first_appear_time": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "instance_name": { - "type": "string" - }, - "last_appear_time": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "schema_name": { - "type": "string" - }, - "source": { - "type": "object", - "$ref": "#/definitions/v1.Source" - }, - "sql": { - "type": "string" - }, - "sql_fingerprint": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited", - "sent" - ] - } - } - }, - "v1.SqlManageAnalysisChartResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.SqlAnalysisChart" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.SqlManageCodingReq": { - "type": "object", - "properties": { - "coding_project_name": { - "type": "string" - }, - "priority": { - "type": "string", - "enum": [ - "LOW", - "MEDIUM", - "HIGH", - "EMERGENCY" - ] - }, - "sql_manage_id_list": { - "type": "array", - "items": { - "type": "integer" - } - }, - "type": { - "type": "string", - "enum": [ - "DEFECT", - "MISSION", - "REQUIREMENT", - "EPIC", - "SUB_TASK" - ] - } - } - }, - "v1.SqlPerformanceInsights": { - "type": "object", - "properties": { - "lines": { - "description": "图表线条数据", - "type": "array", - "items": { - "$ref": "#/definitions/v1.Line" - } - }, - "message": { - "description": "提示信息", - "type": "string" - }, - "task_enable": { - "description": "是否启用任务", - "type": "boolean" - }, - "task_support": { - "description": "是否支持任务", - "type": "boolean" - }, - "x_info": { - "description": "X轴信息", - "type": "string" - }, - "y_info": { - "description": "Y轴信息", - "type": "string" - } - } - }, - "v1.SqlVersionDetailResV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "sql_version_id": { - "type": "integer" - }, - "sql_version_stage_detail": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.SqlVersionStageDetail" - } - }, - "status": { - "type": "string", - "enum": [ - "is_being_released", - "locked" - ] - }, - "version": { - "type": "string" - } - } - }, - "v1.SqlVersionResV1": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "deletable": { - "type": "boolean" - }, - "desc": { - "type": "string" - }, - "lock_time": { - "type": "string" - }, - "lockable": { - "type": "boolean" - }, - "status": { - "type": "string", - "enum": [ - "is_being_released", - "locked" - ] - }, - "version": { - "type": "string" - }, - "version_id": { - "type": "integer" - } - } - }, - "v1.SqlVersionStageDetail": { - "type": "object", - "properties": { - "stage_id": { - "type": "integer" - }, - "stage_instances": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.VersionStageInstance" - } - }, - "stage_name": { - "type": "string" - }, - "stage_sequence": { - "type": "integer" - }, - "workflow_details": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.WorkflowDetailWithInstance" - } - } - } - }, - "v1.StatisticAuditPlanResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.DBTypeAuditPlan" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.StatisticRiskWorkflowResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RiskWorkflow" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.StatisticsAuditedSQLResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AuditedSQLCount" - }, - "message": { - "type": "string", - "example": "ok" - }, - "risk_rate": { - "type": "integer" - } - } - }, - "v1.Table": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } + "number": { + "type": "integer" }, - "v1.TableColumns": { - "type": "object", - "properties": { - "head": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.TableMetaItemHeadResV1" - } - }, - "rows": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - }, - "v1.TableIndexes": { - "type": "object", - "properties": { - "head": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.TableMetaItemHeadResV1" - } - }, - "rows": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - }, - "v1.TableMeta": { - "type": "object", - "properties": { - "columns": { - "type": "object", - "$ref": "#/definitions/v1.TableColumns" - }, - "create_table_sql": { - "type": "string" - }, - "indexes": { - "type": "object", - "$ref": "#/definitions/v1.TableIndexes" - }, - "message": { - "type": "string" - }, - "name": { - "type": "string" - }, - "schema": { - "type": "string" - } - } - }, - "v1.TableMetaItemHeadResV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "field_name": { - "type": "string" - } - } + "type": { + "type": "string" + } + } + }, + "WorkflowAuditPassPercentV1": { + "type": "object", + "properties": { + "audit_pass_percent": { + "type": "number" + } + } + }, + "WorkflowCountsV1": { + "type": "object", + "properties": { + "today_count": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "WorkflowCreatedCountsEachDayItem": { + "type": "object", + "properties": { + "date": { + "type": "string", + "example": "2022-08-24" + }, + "value": { + "type": "integer" + } + } + }, + "WorkflowCreatedCountsEachDayV1": { + "type": "object", + "properties": { + "samples": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowCreatedCountsEachDayItem" + } + } + } + }, + "WorkflowDetailResV1": { + "type": "object", + "properties": { + "create_time": { + "type": "string" + }, + "create_user_name": { + "type": "string" + }, + "current_step_assignee_user_name_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "current_step_type": { + "type": "string", + "enum": [ + "sql_review", + "sql_execute" + ] + }, + "desc": { + "type": "string" + }, + "instance_info": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceInfo" + } + }, + "ops_type": { + "description": "OpsType 运维类型(项目字典批量解析);未设置或字典项已删时省略", + "type": "object", + "$ref": "#/definitions/OpsType" + }, + "project_name": { + "type": "string" + }, + "project_priority": { + "type": "string" + }, + "project_uid": { + "type": "string" + }, + "sql_version_name": { + "type": "array", + "items": { + "type": "string" + } + }, + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_approve", + "wait_for_execution", + "wait_for_export", + "rejected", + "canceled", + "cancel", + "exec_failed", + "failed", + "executing", + "exporting", + "finished", + "finish" + ] + }, + "workflow_id": { + "type": "string" + }, + "workflow_name": { + "type": "string" + }, + "workflow_template_id": { + "type": "integer" + }, + "workflow_template_name": { + "type": "string" + } + } + }, + "WorkflowDetailWithInstance": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "canceled", + "exec_failed", + "executing", + "finished" + ] + }, + "workflow_exec_time": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "workflow_instances": { + "type": "array", + "items": { + "$ref": "#/definitions/VersionStageInstance" + } + }, + "workflow_name": { + "type": "string" + }, + "workflow_release_status": { + "type": "string", + "enum": [ + "wait_for_release", + "released", + "not_need_release" + ] + }, + "workflow_sequence": { + "type": "integer" + } + } + }, + "WorkflowPassPercentV1": { + "type": "object", + "properties": { + "audit_pass_percent": { + "type": "number" + }, + "execution_success_percent": { + "type": "number" + } + } + }, + "WorkflowPercentCountedByInstanceType": { + "type": "object", + "properties": { + "count": { + "type": "integer" }, - "v1.TableMetas": { - "type": "object", - "properties": { - "err_message": { - "type": "string" - }, - "table_meta_items": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.TableMeta" - } - } - } - }, - "v1.Tag": { - "type": "object", - "properties": { - "id": { - "description": "标签ID", - "type": "integer" - }, - "name": { - "description": "标签名称", - "type": "string" - }, - "sub_tags": { - "description": "子标签", - "type": "array", - "items": { - "$ref": "#/definitions/v1.Tag" - } - } - } - }, - "v1.TargetReleaseInstance": { - "type": "object", - "properties": { - "instance_id": { - "type": "string" - }, - "instance_schema": { - "type": "string" - }, - "target_instance_id": { - "type": "string" - }, - "target_instance_schema": { - "type": "string" - } - } - }, - "v1.TestAuditPlanNotifyConfigResDataV1": { - "type": "object", - "properties": { - "is_notify_send_normal": { - "type": "boolean" - }, - "send_error_message": { - "type": "string" - } - } + "instance_type": { + "type": "string" }, - "v1.TestAuditPlanNotifyConfigResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.TestAuditPlanNotifyConfigResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.TestCodingConfigResDataV1": { - "type": "object", - "properties": { - "error_message": { - "type": "string" - }, - "is_message_sent_normally": { - "type": "boolean" - } - } + "percent": { + "type": "number" + } + } + }, + "WorkflowPercentCountedByInstanceTypeV1": { + "type": "object", + "properties": { + "workflow_percents": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowPercentCountedByInstanceType" + } + }, + "workflow_total_num": { + "type": "integer" + } + } + }, + "WorkflowRecordResV1": { + "type": "object", + "properties": { + "current_step_number": { + "type": "integer" + }, + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "canceled", + "exec_failed", + "executing", + "finished" + ] + }, + "tasks": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowTaskItem" + } + }, + "workflow_step_list": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowStepResV1" + } + } + } + }, + "WorkflowRejectedPercentGroupByCreator": { + "type": "object", + "properties": { + "creator": { + "type": "string" }, - "v1.TestCodingConfigResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.TestCodingConfigResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.TestCodingConfigurationReqV1": { - "type": "object", - "properties": { - "coding_project_name": { - "type": "string" - } - } + "rejected_percent": { + "type": "number" }, - "v1.TestDingTalkConfigResDataV1": { - "type": "object", - "properties": { - "is_ding_talk_send_normal": { - "type": "boolean" - }, - "send_error_message": { - "type": "string" - } - } + "workflow_total_num": { + "type": "integer" + } + } + }, + "WorkflowRejectedPercentGroupByInstance": { + "type": "object", + "properties": { + "instance_name": { + "type": "string" }, - "v1.TestDingTalkConfigResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.TestDingTalkConfigResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.TestFeishuConfigResDataV1": { - "type": "object", - "properties": { - "error_message": { - "type": "string" - }, - "is_message_sent_normally": { - "type": "boolean" - } - } + "rejected_percent": { + "type": "number" }, - "v1.TestFeishuConfigResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.TestFeishuConfigResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.TestFeishuConfigurationReqV1": { - "type": "object", - "properties": { - "account": { - "type": "string" - }, - "account_type": { - "type": "string", - "enum": [ - "email", - "phone" - ] - } - } - }, - "v1.TestGitConnectionReqV1": { - "type": "object", - "properties": { - "git_http_url": { - "type": "string" - }, - "git_user_name": { - "type": "string" - }, - "git_user_password": { - "type": "string" - } - } - }, - "v1.TestGitConnectionResDataV1": { - "type": "object", - "properties": { - "branches": { - "type": "array", - "items": { - "type": "string" - } - }, - "error_message": { - "type": "string" - }, - "is_connected_success": { - "type": "boolean" - } - } - }, - "v1.TestGitConnectionResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.TestGitConnectionResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.TestWechatConfigResDataV1": { - "type": "object", - "properties": { - "error_message": { - "type": "string" - }, - "is_message_sent_normally": { - "type": "boolean" - } - } + "workflow_total_num": { + "type": "integer" + } + } + }, + "WorkflowResV1": { + "type": "object", + "properties": { + "create_time": { + "type": "string" + }, + "create_user_name": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "mode": { + "type": "string", + "enum": [ + "same_sqls", + "different_sqls" + ] + }, + "record": { + "type": "object", + "$ref": "#/definitions/WorkflowRecordResV1" + }, + "record_history_list": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowRecordResV1" + } + }, + "workflow_name": { + "type": "string" + } + } + }, + "WorkflowStageDuration": { + "type": "object", + "properties": { + "minutes": { + "type": "integer" + } + } + }, + "WorkflowStatisticOfInstance": { + "type": "object", + "properties": { + "instance_id": { + "type": "integer" + }, + "unfinished_count": { + "type": "integer" + } + } + }, + "WorkflowStatisticsResV1": { + "type": "object", + "properties": { + "my_need_execute_workflow_number": { + "type": "integer" }, - "v1.TestWechatConfigResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.TestWechatConfigResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.TestWechatConfigurationReqV1": { - "type": "object", - "properties": { - "wechat_id": { - "type": "string" - } - } + "my_need_review_workflow_number": { + "type": "integer" }, - "v1.TimeResV1": { - "type": "object", - "properties": { - "hour": { - "type": "integer" - }, - "minute": { - "type": "integer" - } - } + "my_on_process_workflow_number": { + "type": "integer" }, - "v1.TopProblemDistribution": { - "type": "object", - "properties": { - "percentage": { - "description": "占比", - "type": "number" - }, - "problem_type": { - "description": "问题类型", - "type": "string" - } - } - }, - "v1.TransactionInfo": { - "type": "object", - "properties": { - "lock_type": { - "description": "锁类型", - "type": "string", - "enum": [ - "SHARED", - "EXCLUSIVE", - "INTENTION_SHARED", - "INTENTION_EXCLUSIVE", - "SHARED_INTENTION_EXCLUSIVE", - "ROW_LOCK", - "TABLE_LOCK", - "METADATA_LOCK" - ] - }, - "transaction_duration": { - "description": "事务持续时间", - "type": "number" - }, - "transaction_end_time": { - "description": "事务结束时间", - "type": "string" - }, - "transaction_id": { - "description": "事务ID", - "type": "string" - }, - "transaction_start_time": { - "description": "事务开始时间", - "type": "string" - }, - "transaction_state": { - "description": "事务状态", - "type": "string", - "enum": [ - "RUNNING", - "COMPLETED" - ] - } - } - }, - "v1.TransactionLockInfo": { - "type": "object", - "properties": { - "create_lock_sql": { - "description": "创建锁的SQL语句", - "type": "string" - }, - "lock_type": { - "description": "锁类型", - "type": "string", - "enum": [ - "SHARED", - "EXCLUSIVE", - "INTENTION_SHARED", - "INTENTION_EXCLUSIVE", - "SHARED_INTENTION_EXCLUSIVE", - "ROW_LOCK", - "TABLE_LOCK", - "METADATA_LOCK" - ] - }, - "table_name": { - "description": "表名", - "type": "string" - } - } - }, - "v1.TransactionSQL": { - "type": "object", - "properties": { - "execute_duration": { - "description": "执行时长", - "type": "number" - }, - "lock_type": { - "description": "锁类型", - "type": "string", - "enum": [ - "SHARED", - "EXCLUSIVE", - "INTENTION_SHARED", - "INTENTION_EXCLUSIVE", - "SHARED_INTENTION_EXCLUSIVE", - "ROW_LOCK", - "TABLE_LOCK", - "METADATA_LOCK" - ] - }, - "sql": { - "description": "SQL语句", - "type": "string" - } - } - }, - "v1.TransactionTimeline": { - "type": "object", - "properties": { - "current_step_index": { - "description": "当前步骤索引", - "type": "integer" - }, - "timeline": { - "description": "时间线项目列表", - "type": "array", - "items": { - "$ref": "#/definitions/v1.TransactionTimelineItem" - } - } - } - }, - "v1.TransactionTimelineItem": { - "type": "object", - "properties": { - "description": { - "description": "描述信息", - "type": "string" - }, - "start_time": { - "description": "开始时间", - "type": "string" - } - } - }, - "v1.TriggerAuditPlanResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v1.AuditPlanReportResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v1.UpdateAuditPlanNotifyConfigReqV1": { - "type": "object", - "properties": { - "enable_email_notify": { - "type": "boolean" - }, - "enable_web_hook_notify": { - "type": "boolean" - }, - "notify_interval": { - "type": "integer", - "default": 10 - }, - "notify_level": { - "type": "string", - "default": "warn", - "enum": [ - "normal", - "notice", - "warn", - "error" - ] - }, - "web_hook_template": { - "type": "string" - }, - "web_hook_url": { - "type": "string" - } - } - }, - "v1.UpdateAuditPlanReqV1": { - "type": "object", - "properties": { - "audit_plan_cron": { - "type": "string", - "example": "0 */2 * * *" - }, - "audit_plan_instance_database": { - "type": "string", - "example": "app1" - }, - "audit_plan_instance_name": { - "type": "string", - "example": "test_mysql" - }, - "audit_plan_params": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanParamReqV1" - } - }, - "rule_template_name": { - "type": "string", - "example": "default_MySQL" - } - } - }, - "v1.UpdateAuditPlanStatusReqV1": { - "type": "object", - "properties": { - "active": { - "description": "任务状态", - "type": "string", - "enum": [ - "normal", - "disabled" - ] - } - } - }, - "v1.UpdateAuditTaskSQLsReqV1": { - "type": "object", - "properties": { - "description": { - "type": "string" - } - } + "my_rejected_workflow_number": { + "type": "integer" }, - "v1.UpdateAuditWhitelistReqV1": { - "type": "object", - "properties": { - "desc": { - "type": "string", - "example": "used for rapid release" - }, - "match_type": { - "type": "string", - "enum": [ - "exact_match", - "fp_match" - ], - "example": "exact_match" - }, - "value": { - "type": "string", - "example": "create table" - } - } - }, - "v1.UpdateBlacklistReqV1": { - "type": "object", - "properties": { - "content": { - "type": "string", - "example": "select * from t1" - }, - "desc": { - "type": "string", - "example": "used for rapid release" - }, - "type": { - "type": "string", - "enum": [ - "sql", - "fp_sql", - "ip", - "cidr", - "host", - "instance" - ], - "example": "sql" - } - } - }, - "v1.UpdateCodingConfigurationReqV1": { - "type": "object", - "properties": { - "coding_url": { - "type": "string" - }, - "is_coding_enabled": { - "type": "boolean" - }, - "token": { - "type": "string" - } - } - }, - "v1.UpdateCompanyNoticeReq": { - "type": "object", - "properties": { - "notice_str": { - "type": "string" - } - } + "need_me_to_execute_workflow_number": { + "type": "integer" }, - "v1.UpdateCustomRuleReqV1": { - "type": "object", - "properties": { - "annotation": { - "type": "string", - "example": "this is test rule" - }, - "desc": { - "type": "string", - "example": "this is test rule" - }, - "level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "example": "notice" - }, - "rule_script": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "type": "string", - "example": "DDL规则" - } - } - }, - "v1.UpdateDingTalkConfigurationReqV1": { - "type": "object", - "required": [ - "app_key", - "app_secret", - "is_enable_ding_talk_notify" - ], - "properties": { - "app_key": { - "type": "string" - }, - "app_secret": { - "type": "string" - }, - "is_enable_ding_talk_notify": { - "type": "boolean" - } - } - }, - "v1.UpdateFeishuConfigurationReqV1": { - "type": "object", - "required": [ - "app_id", - "app_secret", - "is_feishu_notification_enabled" - ], - "properties": { - "app_id": { - "type": "string" - }, - "app_secret": { - "type": "string" - }, - "is_feishu_notification_enabled": { - "type": "boolean" - } - } - }, - "v1.UpdateInstanceAuditPlanReqV1": { - "type": "object", - "properties": { - "audit_plans": { - "description": "扫描类型", - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlan" - } - } - } + "need_me_to_review_workflow_number": { + "type": "integer" + } + } + }, + "WorkflowStatusCountV1": { + "type": "object", + "properties": { + "closed_count": { + "type": "integer" }, - "v1.UpdateInstanceAuditPlanStatusReqV1": { - "type": "object", - "properties": { - "active": { - "description": "任务状态", - "type": "string", - "enum": [ - "normal", - "disabled" - ] - } - } - }, - "v1.UpdatePipelineReqV1": { - "type": "object", - "properties": { - "address": { - "description": "关联流水线地址", - "type": "string" - }, - "description": { - "description": "流水线描述", - "type": "string" - }, - "name": { - "description": "流水线名称", - "type": "string" - }, - "nodes": { - "description": "节点信息", - "type": "array", - "items": { - "$ref": "#/definitions/v1.updatePipelineNode" - } - } - } - }, - "v1.UpdateProjectRuleTemplateReqV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "rule_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RuleReqV1" - } - } - } - }, - "v1.UpdateReportPushConfigReqV1": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "push_frequency_cron": { - "type": "string" - }, - "push_user_Type": { - "type": "string", - "enum": [ - "fixed", - "permission_match" - ] - }, - "push_user_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "trigger_type": { - "type": "string", - "enum": [ - "immediately", - "timing" - ] - } - } - }, - "v1.UpdateRuleKnowledgeReq": { - "type": "object", - "properties": { - "knowledge_content": { - "type": "string" - } - } + "executing_count": { + "type": "integer" }, - "v1.UpdateRuleTemplateReqV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "rule_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.RuleReqV1" - } - } - } - }, - "v1.UpdateSQLAuditRecordReqV1": { - "type": "object", - "properties": { - "tags": { - "type": "array", - "items": { - "type": "string" - } - } - } + "executing_failed_count": { + "type": "integer" }, - "v1.UpdateSqlBackupStrategyReq": { - "type": "object", - "properties": { - "strategy": { - "type": "string", - "enum": [ - "none", - "manual", - "reverse_sql", - "original_row" - ] - } - } - }, - "v1.UpdateSqlFileOrderV1Req": { - "type": "object", - "properties": { - "files_to_sort": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.FileToSort" - } - } - } + "execution_success_count": { + "type": "integer" }, - "v1.UpdateSqlVersionReqV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "update_sql_version_stage": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.UpdateSqlVersionStage" - } - }, - "version": { - "type": "string", - "example": "2.23" - } - } - }, - "v1.UpdateSqlVersionStage": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "生产" - }, - "stage_sequence": { - "type": "integer" - }, - "update_stages_instance_dep": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.UpdateStagesInstanceDep" - } - } - } - }, - "v1.UpdateStagesInstanceDep": { - "type": "object", - "properties": { - "next_stage_instance_id": { - "type": "string" - }, - "stage_instance_id": { - "type": "string" - } - } + "rejected_count": { + "type": "integer" }, - "v1.UpdateTaskBackupStrategyReq": { - "type": "object", - "properties": { - "strategy": { - "type": "string", - "enum": [ - "none", - "manual", - "reverse_sql", - "original_row" - ] - } - } - }, - "v1.UpdateWechatConfigurationReqV1": { - "type": "object", - "required": [ - "is_wechat_notification_enabled" - ], - "properties": { - "corp_id": { - "type": "string" - }, - "corp_secret": { - "type": "string" - }, - "is_wechat_notification_enabled": { - "type": "boolean" - } - } - }, - "v1.UpdateWorkflowReqV1": { - "type": "object", - "properties": { - "task_ids": { - "type": "array", - "items": { - "type": "integer" - } - } - } + "waiting_for_audit_count": { + "type": "integer" }, - "v1.UpdateWorkflowScheduleReqV1": { - "type": "object", - "properties": { - "schedule_time": { - "type": "string" - } - } + "waiting_for_execution_count": { + "type": "integer" + } + } + }, + "WorkflowStepResV1": { + "type": "object", + "properties": { + "assignee_user_name_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "desc": { + "type": "string" + }, + "number": { + "type": "integer" + }, + "operation_time": { + "type": "string" + }, + "operation_user_name": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "state": { + "type": "string", + "enum": [ + "initialized", + "approved", + "rejected" + ] + }, + "type": { + "type": "string", + "enum": [ + "create_workflow", + "update_workflow", + "sql_review", + "sql_execute" + ] + }, + "workflow_step_id": { + "type": "integer" + } + } + }, + "WorkflowTaskItem": { + "type": "object", + "properties": { + "task_id": { + "type": "integer" + } + } + }, + "WorkflowTemplateDetailResV1": { + "type": "object", + "properties": { + "allow_submit_when_less_audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ] + }, + "desc": { + "type": "string" + }, + "is_default": { + "type": "boolean" + }, + "update_time": { + "type": "string" + }, + "workflow_step_template_list": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkFlowStepTemplateResV1" + } + }, + "workflow_template_id": { + "type": "integer" + }, + "workflow_template_name": { + "type": "string" + }, + "workflow_type": { + "type": "string", + "enum": [ + "workflow", + "data_export" + ] + } + } + }, + "createPipelineResData": { + "type": "object", + "properties": { + "pipeline_id": { + "description": "流水线的唯一标识符", + "type": "integer" + } + } + }, + "pipelineDetail": { + "type": "object", + "properties": { + "address": { + "description": "关联流水线地址", + "type": "string" + }, + "data_sources": { + "description": "数据源", + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "description": "流水线描述", + "type": "string" + }, + "id": { + "description": "流水线的唯一标识符", + "type": "integer" + }, + "name": { + "description": "流水线名称", + "type": "string" + }, + "node_count": { + "description": "节点个数", + "type": "integer" + } + } + }, + "pipelineDetailData": { + "type": "object", + "properties": { + "address": { + "description": "关联流水线地址", + "type": "string" + }, + "data_sources": { + "description": "数据源", + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "description": "流水线描述", + "type": "string" + }, + "id": { + "description": "流水线的唯一标识符", + "type": "integer" + }, + "name": { + "description": "流水线名称", + "type": "string" + }, + "node_count": { + "description": "节点个数", + "type": "integer" + }, + "nodes": { + "description": "流水线节点信息", + "type": "array", + "items": { + "$ref": "#/definitions/pipelineNodeDetail" + } + } + } + }, + "pipelineNodeBase": { + "type": "object", + "properties": { + "audit_method": { + "description": "审核方式,必选,可选项为离线审核、在线审核", + "type": "string", + "enum": [ + "offline", + "online" + ] + }, + "instance_name": { + "description": "数据源名称,在线审核时必填", + "type": "string" + }, + "instance_type": { + "description": "数据源类型,离线审核时必填", + "type": "string" + }, + "name": { + "description": "节点名称,必填,支持中文、英文+数字+特殊字符", + "type": "string" + }, + "object_path": { + "description": "审核脚本路径,必填,用户填写文件路径", + "type": "string" + }, + "object_type": { + "description": "审核对象类型,必填,可选项为SQL文件、MyBatis文件", + "type": "string", + "enum": [ + "sql", + "mybatis" + ] + }, + "rule_template_name": { + "description": "审核规则模板,必填", + "type": "string" + }, + "type": { + "description": "节点类型,必填,选项为“审核”或“上线”", + "type": "string", + "enum": [ + "audit", + "release" + ] + } + } + }, + "pipelineNodeDetail": { + "type": "object", + "properties": { + "audit_method": { + "description": "审核方式,必选,可选项为离线审核、在线审核", + "type": "string", + "enum": [ + "offline", + "online" + ] + }, + "id": { + "description": "节点的唯一标识符", + "type": "integer" + }, + "instance_name": { + "description": "数据源名称,在线审核时必填", + "type": "string" + }, + "instance_type": { + "description": "数据源类型,离线审核时必填", + "type": "string" + }, + "integration_info": { + "description": "对接说明", + "type": "string" + }, + "name": { + "description": "节点名称,必填,支持中文、英文+数字+特殊字符", + "type": "string" + }, + "object_path": { + "description": "审核脚本路径,必填,用户填写文件路径", + "type": "string" + }, + "object_type": { + "description": "审核对象类型,必填,可选项为SQL文件、MyBatis文件", + "type": "string", + "enum": [ + "sql", + "mybatis" + ] + }, + "rule_template_name": { + "description": "审核规则模板,必填", + "type": "string" + }, + "type": { + "description": "节点类型,必填,选项为“审核”或“上线”", + "type": "string", + "enum": [ + "audit", + "release" + ] + } + } + }, + "updatePipelineNode": { + "type": "object", + "properties": { + "audit_method": { + "description": "审核方式,必选,可选项为离线审核、在线审核", + "type": "string", + "enum": [ + "offline", + "online" + ] + }, + "id": { + "type": "integer" + }, + "instance_name": { + "description": "数据源名称,在线审核时必填", + "type": "string" + }, + "instance_type": { + "description": "数据源类型,离线审核时必填", + "type": "string" + }, + "name": { + "description": "节点名称,必填,支持中文、英文+数字+特殊字符", + "type": "string" + }, + "object_path": { + "description": "审核脚本路径,必填,用户填写文件路径", + "type": "string" + }, + "object_type": { + "description": "审核对象类型,必填,可选项为SQL文件、MyBatis文件", + "type": "string", + "enum": [ + "sql", + "mybatis" + ] + }, + "rule_template_name": { + "description": "审核规则模板,必填", + "type": "string" + }, + "type": { + "description": "节点类型,必填,选项为“审核”或“上线”", + "type": "string", + "enum": [ + "audit", + "release" + ] + } + } + }, + "ApproveWorkflowReqV2": { + "type": "object", + "properties": { + "reason": { + "type": "string" + } + } + }, + "AssociatedRollbackWorkflow": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "canceled", + "exec_failed", + "executing", + "finished" + ] + }, + "workflow_id": { + "type": "string" + }, + "workflow_name": { + "type": "string" + } + } + }, + "AssociatedStageWorkflows": { + "type": "object", + "properties": { + "sql_version_stage_id": { + "type": "integer" + }, + "stage_sequence": { + "type": "integer" + }, + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "canceled", + "exec_failed", + "executing", + "finished" + ] + }, + "workflow_id": { + "type": "string" + }, + "workflow_name": { + "type": "string" + } + } + }, + "AuditFileExecStatistic": { + "type": "object", + "properties": { + "exec_result_count": { + "type": "object", + "$ref": "#/definitions/ExecResultCount" + }, + "file_id": { + "type": "string" + }, + "file_name": { + "type": "string" + } + } + }, + "AuditFileStatistic": { + "type": "object", + "properties": { + "audit_result_count": { + "type": "object", + "$ref": "#/definitions/AuditResultCount" }, - "v1.UpdateWorkflowTemplateByIdReqV1": { - "type": "object", - "properties": { - "allow_submit_when_less_audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ] - }, - "desc": { - "type": "string" - }, - "is_default": { - "type": "boolean" - }, - "workflow_step_template_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.WorkFlowStepTemplateReqV1" - } - }, - "workflow_template_name": { - "type": "string" - } - } - }, - "v1.UpdateWorkflowTemplateReqV1": { - "type": "object", - "properties": { - "allow_submit_when_less_audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ] - }, - "desc": { - "type": "string" - }, - "workflow_step_template_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.WorkFlowStepTemplateReqV1" - } - } - } - }, - "v1.UserTipResV1": { - "type": "object", - "properties": { - "user_id": { - "type": "string" - }, - "user_name": { - "type": "string" - } - } + "exec_order": { + "type": "integer" }, - "v1.VersionStageInstance": { - "type": "object", - "properties": { - "instance_schema": { - "type": "string" - }, - "instances_id": { - "type": "string" - }, - "instances_name": { - "type": "string" - } - } - }, - "v1.WechatConfigurationV1": { - "type": "object", - "properties": { - "corp_id": { - "type": "string" - }, - "is_wechat_notification_enabled": { - "type": "boolean" - } - } + "exec_status": { + "type": "string" }, - "v1.WorkFlowStepTemplateReqV1": { - "type": "object", - "properties": { - "approved_by_authorized": { - "type": "boolean" - }, - "assignee_user_id_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "desc": { - "type": "string" - }, - "execute_by_authorized": { - "type": "boolean" - }, - "type": { - "type": "string", - "enum": [ - "sql_review", - "sql_execute", - "export_review", - "export_execute" - ] - } - } - }, - "v1.WorkFlowStepTemplateResV1": { - "type": "object", - "properties": { - "approved_by_authorized": { - "type": "boolean" - }, - "assignee_user_id_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "desc": { - "type": "string" - }, - "execute_by_authorized": { - "type": "boolean" - }, - "number": { - "type": "integer" - }, - "type": { - "type": "string" - } - } - }, - "v1.WorkflowAuditPassPercentV1": { - "type": "object", - "properties": { - "audit_pass_percent": { - "type": "number" - } - } + "file_id": { + "type": "string" }, - "v1.WorkflowCountsV1": { - "type": "object", - "properties": { - "today_count": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } + "file_name": { + "type": "string" + } + } + }, + "AuditPlanReportSQLResV2": { + "type": "object", + "properties": { + "audit_plan_report_sql": { + "type": "string", + "example": "select * from t1 where id = 1" + }, + "audit_plan_report_sql_audit_result": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditResult" + } + }, + "number": { + "type": "integer", + "example": 1 + } + } + }, + "AuditPlanResV2": { + "type": "object", + "properties": { + "audit_plan_cron": { + "type": "string", + "example": "0 */2 * * *" + }, + "audit_plan_db_type": { + "type": "string", + "example": "mysql" + }, + "audit_plan_instance_database": { + "type": "string", + "example": "app1" + }, + "audit_plan_instance_name": { + "type": "string", + "example": "test_mysql" + }, + "audit_plan_meta": { + "type": "object", + "$ref": "#/definitions/AuditPlanMetaV1" + }, + "audit_plan_name": { + "type": "string", + "example": "audit_for_java_app1" + }, + "audit_plan_token": { + "type": "string", + "example": "it's a JWT Token for scanner" + }, + "create_user_id": { + "type": "string" + }, + "rule_template": { + "type": "object", + "$ref": "#/definitions/RuleTemplateV2" + } + } + }, + "AuditPlanSQLReqV2": { + "type": "object", + "properties": { + "audit_plan_sql_counter": { + "type": "string", + "example": "6" + }, + "audit_plan_sql_fingerprint": { + "type": "string", + "example": "select * from t1 where id = ?" + }, + "audit_plan_sql_last_receive_text": { + "type": "string", + "example": "select * from t1 where id = 1" + }, + "audit_plan_sql_last_receive_timestamp": { + "type": "string", + "example": "RFC3339" + }, + "audit_plan_sql_schema": { + "type": "string", + "example": "db1" + }, + "db_user": { + "type": "string", + "example": "database_user001" + }, + "endpoints": { + "type": "array", + "items": { + "type": "string" + } + }, + "first_query_at": { + "type": "string", + "example": "2023-09-12T02:48:01.317880Z" + }, + "query_time_avg": { + "type": "number", + "example": 3.22 + }, + "query_time_max": { + "type": "number", + "example": 5.22 + }, + "row_examined_avg": { + "type": "number", + "example": 100.22 + } + } + }, + "AuditResDataV2": { + "type": "object", + "properties": { + "audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error", + "" + ] + }, + "pass_rate": { + "type": "number" + }, + "score": { + "type": "integer" + }, + "sql_results": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditSQLResV2" + } + } + } + }, + "AuditResultCount": { + "type": "object", + "properties": { + "error_sql_count": { + "type": "integer" }, - "v1.WorkflowCreatedCountsEachDayItem": { - "type": "object", - "properties": { - "date": { - "type": "string", - "example": "2022-08-24" - }, - "value": { - "type": "integer" - } - } + "normal_sql_count": { + "type": "integer" }, - "v1.WorkflowCreatedCountsEachDayV1": { - "type": "object", - "properties": { - "samples": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.WorkflowCreatedCountsEachDayItem" - } - } - } + "notice_sql_count": { + "type": "integer" }, - "v1.WorkflowDetailResV1": { - "type": "object", - "properties": { - "create_time": { - "type": "string" - }, - "create_user_name": { - "type": "string" - }, - "current_step_assignee_user_name_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "current_step_type": { - "type": "string", - "enum": [ - "sql_review", - "sql_execute" - ] - }, - "desc": { - "type": "string" - }, - "instance_info": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.InstanceInfo" - } - }, - "ops_type": { - "description": "OpsType 运维类型(项目字典批量解析);未设置或字典项已删时省略", - "type": "object", - "$ref": "#/definitions/dms.OpsType" - }, - "project_name": { - "type": "string" - }, - "project_priority": { - "type": "string" - }, - "project_uid": { - "type": "string" - }, - "sql_version_name": { - "type": "array", - "items": { - "type": "string" - } - }, - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_approve", - "wait_for_execution", - "wait_for_export", - "rejected", - "canceled", - "cancel", - "exec_failed", - "failed", - "executing", - "exporting", - "finished", - "finish" - ] - }, - "workflow_id": { - "type": "string" - }, - "workflow_name": { - "type": "string" - }, - "workflow_template_id": { - "type": "integer" - }, - "workflow_template_name": { - "type": "string" - } - } - }, - "v1.WorkflowDetailWithInstance": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "canceled", - "exec_failed", - "executing", - "finished" - ] - }, - "workflow_exec_time": { - "type": "string" - }, - "workflow_id": { - "type": "string" - }, - "workflow_instances": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.VersionStageInstance" - } - }, - "workflow_name": { - "type": "string" - }, - "workflow_release_status": { - "type": "string", - "enum": [ - "wait_for_release", - "released", - "not_need_release" - ] - }, - "workflow_sequence": { - "type": "integer" - } - } - }, - "v1.WorkflowPassPercentV1": { - "type": "object", - "properties": { - "audit_pass_percent": { - "type": "number" - }, - "execution_success_percent": { - "type": "number" - } - } + "warning_sql_count": { + "type": "integer" + } + } + }, + "AuditSQLResV2": { + "type": "object", + "properties": { + "audit_level": { + "type": "string" + }, + "audit_result": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditResult" + } + }, + "exec_sql": { + "type": "string" + }, + "number": { + "type": "integer" + }, + "sql_type": { + "type": "string" + } + } + }, + "AuditTaskSQLResV2": { + "type": "object", + "properties": { + "associated_rollback_workflows": { + "type": "array", + "items": { + "$ref": "#/definitions/AssociatedRollbackWorkflow" + } + }, + "audit_level": { + "type": "string" + }, + "audit_result": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditResult" + } + }, + "audit_status": { + "type": "string" + }, + "backup_result": { + "type": "string" + }, + "backup_status": { + "type": "string", + "enum": [ + "waiting_for_execution", + "executing", + "failed", + "succeed" + ] + }, + "backup_strategy": { + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "original_row" + ] + }, + "backup_strategy_tip": { + "type": "string" + }, + "description": { + "type": "string" + }, + "exec_result": { + "type": "string" + }, + "exec_sql": { + "type": "string" + }, + "exec_sql_id": { + "type": "integer" + }, + "exec_status": { + "type": "string" + }, + "fail_reason": { + "type": "string" + }, + "fail_stage": { + "type": "string" + }, + "number": { + "type": "integer" + }, + "rollback_sqls": { + "type": "array", + "items": { + "type": "string" + } + }, + "sql_source_file": { + "type": "string" + }, + "sql_start_line": { + "type": "integer" + }, + "sql_type": { + "type": "string" + } + } + }, + "BatchCancelWorkflowsReqV2": { + "type": "object", + "properties": { + "workflow_id_list": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "BatchCompleteWorkflowsReqV2": { + "type": "object", + "properties": { + "workflow_id_list": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "CreateWorkflowReqV2": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "ops_type_uid": { + "description": "OpsTypeUID 运维类型字典项标识;可选;空表示未设置;创建后不可改", + "type": "string" + }, + "sql_version_id": { + "type": "integer" + }, + "task_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "workflow_subject": { + "type": "string" + }, + "workflow_template_id": { + "type": "integer" + } + } + }, + "CreateWorkflowResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/CreateWorkflowResV2Data" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "CreateWorkflowResV2Data": { + "type": "object", + "properties": { + "workflow_id": { + "type": "string" + } + } + }, + "DirectAuditFileReqV2": { + "type": "object", + "properties": { + "file_contents": { + "description": "调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现\n每个数组元素是一个文件内容", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "select * from t1; select * from t2;" + ] + }, + "instance_name": { + "type": "string", + "example": "instance1" + }, + "instance_type": { + "type": "string", + "example": "MySQL" + }, + "project_name": { + "type": "string", + "example": "project1" + }, + "schema_name": { + "type": "string", + "example": "schema1" + }, + "sql_type": { + "type": "string", + "enum": [ + "sql", + "mybatis", + "" + ], + "example": "sql" + } + } + }, + "DirectAuditReqV2": { + "type": "object", + "properties": { + "instance_name": { + "type": "string", + "example": "instance1" + }, + "instance_type": { + "type": "string", + "example": "MySQL" + }, + "project_id": { + "type": "string", + "example": "700300" + }, + "rule_template_name": { + "type": "string", + "example": "default" + }, + "schema_name": { + "type": "string", + "example": "schema1" + }, + "sql_content": { + "description": "调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现", + "type": "string", + "example": "select * from t1; select * from t2;" + }, + "sql_type": { + "type": "string", + "enum": [ + "sql", + "mybatis", + "" + ], + "example": "sql" + } + } + }, + "DirectAuditResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AuditResDataV2" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "DriverMeta": { + "type": "object", + "properties": { + "default_port": { + "type": "integer" }, - "v1.WorkflowPercentCountedByInstanceType": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "instance_type": { - "type": "string" - }, - "percent": { - "type": "number" - } - } - }, - "v1.WorkflowPercentCountedByInstanceTypeV1": { - "type": "object", - "properties": { - "workflow_percents": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.WorkflowPercentCountedByInstanceType" - } - }, - "workflow_total_num": { - "type": "integer" - } - } - }, - "v1.WorkflowRecordResV1": { - "type": "object", - "properties": { - "current_step_number": { - "type": "integer" - }, - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "canceled", - "exec_failed", - "executing", - "finished" - ] - }, - "tasks": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.WorkflowTaskItem" - } - }, - "workflow_step_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.WorkflowStepResV1" - } - } - } - }, - "v1.WorkflowRejectedPercentGroupByCreator": { - "type": "object", - "properties": { - "creator": { - "type": "string" - }, - "rejected_percent": { - "type": "number" - }, - "workflow_total_num": { - "type": "integer" - } - } - }, - "v1.WorkflowRejectedPercentGroupByInstance": { - "type": "object", - "properties": { - "instance_name": { - "type": "string" - }, - "rejected_percent": { - "type": "number" - }, - "workflow_total_num": { - "type": "integer" - } - } - }, - "v1.WorkflowResV1": { - "type": "object", - "properties": { - "create_time": { - "type": "string" - }, - "create_user_name": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "mode": { - "type": "string", - "enum": [ - "same_sqls", - "different_sqls" - ] - }, - "record": { - "type": "object", - "$ref": "#/definitions/v1.WorkflowRecordResV1" - }, - "record_history_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.WorkflowRecordResV1" - } - }, - "workflow_name": { - "type": "string" - } - } - }, - "v1.WorkflowStageDuration": { - "type": "object", - "properties": { - "minutes": { - "type": "integer" - } - } + "driver_name": { + "type": "string" }, - "v1.WorkflowStatisticOfInstance": { - "type": "object", - "properties": { - "instance_id": { - "type": "integer" - }, - "unfinished_count": { - "type": "integer" - } - } + "logo_url": { + "type": "string" + } + } + }, + "ExecResultCount": { + "type": "object", + "properties": { + "doing_count": { + "type": "integer" }, - "v1.WorkflowStatisticsResV1": { - "type": "object", - "properties": { - "my_need_execute_workflow_number": { - "type": "integer" - }, - "my_need_review_workflow_number": { - "type": "integer" - }, - "my_on_process_workflow_number": { - "type": "integer" - }, - "my_rejected_workflow_number": { - "type": "integer" - }, - "need_me_to_execute_workflow_number": { - "type": "integer" - }, - "need_me_to_review_workflow_number": { - "type": "integer" - } - } - }, - "v1.WorkflowStatusCountV1": { - "type": "object", - "properties": { - "closed_count": { - "type": "integer" - }, - "executing_count": { - "type": "integer" - }, - "executing_failed_count": { - "type": "integer" - }, - "execution_success_count": { - "type": "integer" - }, - "rejected_count": { - "type": "integer" - }, - "waiting_for_audit_count": { - "type": "integer" - }, - "waiting_for_execution_count": { - "type": "integer" - } - } - }, - "v1.WorkflowStepResV1": { - "type": "object", - "properties": { - "assignee_user_name_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "desc": { - "type": "string" - }, - "number": { - "type": "integer" - }, - "operation_time": { - "type": "string" - }, - "operation_user_name": { - "type": "string" - }, - "reason": { - "type": "string" - }, - "state": { - "type": "string", - "enum": [ - "initialized", - "approved", - "rejected" - ] - }, - "type": { - "type": "string", - "enum": [ - "create_workflow", - "update_workflow", - "sql_review", - "sql_execute" - ] - }, - "workflow_step_id": { - "type": "integer" - } - } - }, - "v1.WorkflowTaskItem": { - "type": "object", - "properties": { - "task_id": { - "type": "integer" - } - } + "failed_count": { + "type": "integer" }, - "v1.WorkflowTemplateDetailResV1": { - "type": "object", - "properties": { - "allow_submit_when_less_audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ] - }, - "desc": { - "type": "string" - }, - "is_default": { - "type": "boolean" - }, - "update_time": { - "type": "string" - }, - "workflow_step_template_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.WorkFlowStepTemplateResV1" - } - }, - "workflow_template_id": { - "type": "integer" - }, - "workflow_template_name": { - "type": "string" - }, - "workflow_type": { - "type": "string", - "enum": [ - "workflow", - "data_export" - ] - } - } - }, - "v1.createPipelineResData": { - "type": "object", - "properties": { - "pipeline_id": { - "description": "流水线的唯一标识符", - "type": "integer" - } - } + "initialized_count": { + "type": "integer" }, - "v1.pipelineDetail": { - "type": "object", - "properties": { - "address": { - "description": "关联流水线地址", - "type": "string" - }, - "data_sources": { - "description": "数据源", - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "description": "流水线描述", - "type": "string" - }, - "id": { - "description": "流水线的唯一标识符", - "type": "integer" - }, - "name": { - "description": "流水线名称", - "type": "string" - }, - "node_count": { - "description": "节点个数", - "type": "integer" - } - } - }, - "v1.pipelineDetailData": { - "type": "object", - "properties": { - "address": { - "description": "关联流水线地址", - "type": "string" - }, - "data_sources": { - "description": "数据源", - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "description": "流水线描述", - "type": "string" - }, - "id": { - "description": "流水线的唯一标识符", - "type": "integer" - }, - "name": { - "description": "流水线名称", - "type": "string" - }, - "node_count": { - "description": "节点个数", - "type": "integer" - }, - "nodes": { - "description": "流水线节点信息", - "type": "array", - "items": { - "$ref": "#/definitions/v1.pipelineNodeDetail" - } - } - } - }, - "v1.pipelineNodeBase": { - "type": "object", - "properties": { - "audit_method": { - "description": "审核方式,必选,可选项为离线审核、在线审核", - "type": "string", - "enum": [ - "offline", - "online" - ] - }, - "instance_name": { - "description": "数据源名称,在线审核时必填", - "type": "string" - }, - "instance_type": { - "description": "数据源类型,离线审核时必填", - "type": "string" - }, - "name": { - "description": "节点名称,必填,支持中文、英文+数字+特殊字符", - "type": "string" - }, - "object_path": { - "description": "审核脚本路径,必填,用户填写文件路径", - "type": "string" - }, - "object_type": { - "description": "审核对象类型,必填,可选项为SQL文件、MyBatis文件", - "type": "string", - "enum": [ - "sql", - "mybatis" - ] - }, - "rule_template_name": { - "description": "审核规则模板,必填", - "type": "string" - }, - "type": { - "description": "节点类型,必填,选项为“审核”或“上线”", - "type": "string", - "enum": [ - "audit", - "release" - ] - } - } - }, - "v1.pipelineNodeDetail": { - "type": "object", - "properties": { - "audit_method": { - "description": "审核方式,必选,可选项为离线审核、在线审核", - "type": "string", - "enum": [ - "offline", - "online" - ] - }, - "id": { - "description": "节点的唯一标识符", - "type": "integer" - }, - "instance_name": { - "description": "数据源名称,在线审核时必填", - "type": "string" - }, - "instance_type": { - "description": "数据源类型,离线审核时必填", - "type": "string" - }, - "integration_info": { - "description": "对接说明", - "type": "string" - }, - "name": { - "description": "节点名称,必填,支持中文、英文+数字+特殊字符", - "type": "string" - }, - "object_path": { - "description": "审核脚本路径,必填,用户填写文件路径", - "type": "string" - }, - "object_type": { - "description": "审核对象类型,必填,可选项为SQL文件、MyBatis文件", - "type": "string", - "enum": [ - "sql", - "mybatis" - ] - }, - "rule_template_name": { - "description": "审核规则模板,必填", - "type": "string" - }, - "type": { - "description": "节点类型,必填,选项为“审核”或“上线”", - "type": "string", - "enum": [ - "audit", - "release" - ] - } - } - }, - "v1.updatePipelineNode": { - "type": "object", - "properties": { - "audit_method": { - "description": "审核方式,必选,可选项为离线审核、在线审核", - "type": "string", - "enum": [ - "offline", - "online" - ] - }, - "id": { - "type": "integer" - }, - "instance_name": { - "description": "数据源名称,在线审核时必填", - "type": "string" - }, - "instance_type": { - "description": "数据源类型,离线审核时必填", - "type": "string" - }, - "name": { - "description": "节点名称,必填,支持中文、英文+数字+特殊字符", - "type": "string" - }, - "object_path": { - "description": "审核脚本路径,必填,用户填写文件路径", - "type": "string" - }, - "object_type": { - "description": "审核对象类型,必填,可选项为SQL文件、MyBatis文件", - "type": "string", - "enum": [ - "sql", - "mybatis" - ] - }, - "rule_template_name": { - "description": "审核规则模板,必填", - "type": "string" - }, - "type": { - "description": "节点类型,必填,选项为“审核”或“上线”", - "type": "string", - "enum": [ - "audit", - "release" - ] - } - } - }, - "v2.AffectRows": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "err_message": { - "type": "string" - } - } + "manually_executed_count": { + "type": "integer" }, - "v2.ApproveWorkflowReqV2": { - "type": "object", - "properties": { - "reason": { - "type": "string" - } - } + "succeeded_count": { + "type": "integer" }, - "v2.AssociatedRollbackWorkflow": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "canceled", - "exec_failed", - "executing", - "finished" - ] - }, - "workflow_id": { - "type": "string" - }, - "workflow_name": { - "type": "string" - } - } - }, - "v2.AssociatedStageWorkflows": { - "type": "object", - "properties": { - "sql_version_stage_id": { - "type": "integer" - }, - "stage_sequence": { - "type": "integer" - }, - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "canceled", - "exec_failed", - "executing", - "finished" - ] - }, - "workflow_id": { - "type": "string" - }, - "workflow_name": { - "type": "string" - } - } - }, - "v2.AuditFileExecStatistic": { - "type": "object", - "properties": { - "exec_result_count": { - "type": "object", - "$ref": "#/definitions/v2.ExecResultCount" - }, - "file_id": { - "type": "string" - }, - "file_name": { - "type": "string" - } - } - }, - "v2.AuditFileStatistic": { - "type": "object", - "properties": { - "audit_result_count": { - "type": "object", - "$ref": "#/definitions/v2.AuditResultCount" - }, - "exec_order": { - "type": "integer" - }, - "exec_status": { - "type": "string" - }, - "file_id": { - "type": "string" - }, - "file_name": { - "type": "string" - } - } - }, - "v2.AuditPlanReportSQLResV2": { - "type": "object", - "properties": { - "audit_plan_report_sql": { - "type": "string", - "example": "select * from t1 where id = 1" - }, - "audit_plan_report_sql_audit_result": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.AuditResult" - } - }, - "number": { - "type": "integer", - "example": 1 - } - } - }, - "v2.AuditPlanRes": { - "type": "object", - "properties": { - "audit_plan_params": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditPlanParamResV1" - } - }, - "audit_plan_type": { - "type": "object", - "$ref": "#/definitions/v2.AuditPlanTypeResBase" - }, - "high_priority_conditions": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.HighPriorityConditionResV1" - } - }, - "need_mark_high_priority_sql": { - "type": "boolean" - }, - "rule_template_name": { - "type": "string", - "example": "default_MySQL" - } - } - }, - "v2.AuditPlanResV2": { - "type": "object", - "properties": { - "audit_plan_cron": { - "type": "string", - "example": "0 */2 * * *" - }, - "audit_plan_db_type": { - "type": "string", - "example": "mysql" - }, - "audit_plan_instance_database": { - "type": "string", - "example": "app1" - }, - "audit_plan_instance_name": { - "type": "string", - "example": "test_mysql" - }, - "audit_plan_meta": { - "type": "object", - "$ref": "#/definitions/v1.AuditPlanMetaV1" - }, - "audit_plan_name": { - "type": "string", - "example": "audit_for_java_app1" - }, - "audit_plan_token": { - "type": "string", - "example": "it's a JWT Token for scanner" - }, - "create_user_id": { - "type": "string" - }, - "rule_template": { - "type": "object", - "$ref": "#/definitions/v2.RuleTemplateV2" - } - } - }, - "v2.AuditPlanSQLReqV2": { - "type": "object", - "properties": { - "audit_plan_sql_counter": { - "type": "string", - "example": "6" - }, - "audit_plan_sql_fingerprint": { - "type": "string", - "example": "select * from t1 where id = ?" - }, - "audit_plan_sql_last_receive_text": { - "type": "string", - "example": "select * from t1 where id = 1" - }, - "audit_plan_sql_last_receive_timestamp": { - "type": "string", - "example": "RFC3339" - }, - "audit_plan_sql_schema": { - "type": "string", - "example": "db1" - }, - "db_user": { - "type": "string", - "example": "database_user001" - }, - "endpoints": { - "type": "array", - "items": { - "type": "string" - } - }, - "first_query_at": { - "type": "string", - "example": "2023-09-12T02:48:01.317880Z" - }, - "query_time_avg": { - "type": "number", - "example": 3.22 - }, - "query_time_max": { - "type": "number", - "example": 5.22 - }, - "row_examined_avg": { - "type": "number", - "example": 100.22 - } - } - }, - "v2.AuditPlanTypeResBase": { - "type": "object", - "properties": { - "active_status": { - "type": "string", - "enum": [ - "normal", - "disabled" - ] - }, - "audit_plan_id": { - "type": "integer" - }, - "desc": { - "type": "string" - }, - "last_collection_status": { - "type": "string", - "enum": [ - "normal", - "abnormal" - ] - }, - "token": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "v2.AuditResDataV2": { - "type": "object", - "properties": { - "audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error", - "" - ] - }, - "pass_rate": { - "type": "number" - }, - "score": { - "type": "integer" - }, - "sql_results": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.AuditSQLResV2" - } - } - } - }, - "v2.AuditResult": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "error_info": { - "type": "string" - }, - "execution_failed": { - "type": "boolean", - "example": false - }, - "i18n_audit_result_info": { - "type": "object", - "$ref": "#/definitions/model.I18nAuditResultInfo" - }, - "level": { - "type": "string", - "example": "warn" - }, - "message": { - "type": "string", - "example": "避免使用不必要的内置函数md5()" - }, - "rule_name": { - "type": "string" - } - } - }, - "v2.AuditResultCount": { - "type": "object", - "properties": { - "error_sql_count": { - "type": "integer" - }, - "normal_sql_count": { - "type": "integer" - }, - "notice_sql_count": { - "type": "integer" - }, - "warning_sql_count": { - "type": "integer" - } - } - }, - "v2.AuditSQLResV2": { - "type": "object", - "properties": { - "audit_level": { - "type": "string" - }, - "audit_result": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.AuditResult" - } - }, - "exec_sql": { - "type": "string" - }, - "number": { - "type": "integer" - }, - "sql_type": { - "type": "string" - } - } - }, - "v2.AuditTaskSQLResV2": { - "type": "object", - "properties": { - "associated_rollback_workflows": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.AssociatedRollbackWorkflow" - } - }, - "audit_level": { - "type": "string" - }, - "audit_result": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.AuditResult" - } - }, - "audit_status": { - "type": "string" - }, - "backup_result": { - "type": "string" - }, - "backup_status": { - "type": "string", - "enum": [ - "waiting_for_execution", - "executing", - "failed", - "succeed" - ] - }, - "backup_strategy": { - "type": "string", - "enum": [ - "none", - "manual", - "reverse_sql", - "original_row" - ] - }, - "backup_strategy_tip": { - "type": "string" - }, - "description": { - "type": "string" - }, - "exec_result": { - "type": "string" - }, - "exec_sql": { - "type": "string" - }, - "exec_sql_id": { - "type": "integer" - }, - "exec_status": { - "type": "string" - }, - "fail_reason": { - "type": "string" - }, - "fail_stage": { - "type": "string" - }, - "number": { - "type": "integer" - }, - "rollback_sqls": { - "type": "array", - "items": { - "type": "string" - } - }, - "sql_source_file": { - "type": "string" - }, - "sql_start_line": { - "type": "integer" - }, - "sql_type": { - "type": "string" - } - } - }, - "v2.BatchCancelWorkflowsReqV2": { - "type": "object", - "properties": { - "workflow_id_list": { - "type": "array", - "items": { - "type": "string" - } - } - } + "terminate_failed_count": { + "type": "integer" }, - "v2.BatchCompleteWorkflowsReqV2": { - "type": "object", - "properties": { - "workflow_id_list": { - "type": "array", - "items": { - "type": "string" - } - } - } + "terminate_succeeded_count": { + "type": "integer" + } + } + }, + "FullSyncAuditPlanSQLsReqV2": { + "type": "object", + "properties": { + "audit_plan_sql_list": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanSQLReqV2" + } + }, + "error_message": { + "type": "string" + } + } + }, + "GetAuditFileExecStatisticRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/AuditFileExecStatistic" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetAuditFileListRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditFileStatistic" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetAuditPlanAnalysisDataResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/TaskAnalysisDataV2" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetAuditPlanReportSQLsResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanReportSQLResV2" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetAuditPlansResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanResV2" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetAuditTaskSQLsResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditTaskSQLResV2" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetDriversRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/DriverMeta" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetInstanceAuditPlanDetailRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/InstanceAuditPlanDetailRes" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetInstanceAuditPlansRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceAuditPlanResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "GetInstanceResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/InstanceResV2" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetInstanceTipsResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceTipResV2" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetOptimizationDetailRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/OptimizationSQLDetail" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetTaskAnalysisDataResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/TaskAnalysisDataV2" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/WorkflowResV2" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "GetWorkflowTasksItemV2": { + "type": "object", + "properties": { + "current_step_assignee_user_name_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "exec_end_time": { + "type": "string" + }, + "exec_start_time": { + "type": "string" + }, + "execution_user_name": { + "type": "string" + }, + "instance_maintenance_times": { + "type": "array", + "items": { + "$ref": "#/definitions/MaintenanceTimeResV1" + } + }, + "instance_name": { + "type": "string" + }, + "schedule_time": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "exec_scheduled", + "exec_failed", + "exec_succeeded", + "executing", + "manually_executed", + "terminating", + "terminate_succeeded", + "terminate_failed" + ] + }, + "task_id": { + "type": "integer" + }, + "task_pass_rate": { + "type": "number" + }, + "task_score": { + "type": "integer" + } + } + }, + "GetWorkflowTasksResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/GetWorkflowTasksItemV2" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "InstanceAuditPlanDetailRes": { + "type": "object", + "properties": { + "audit_plans": { + "description": "扫描类型", + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanRes" + } + }, + "environment": { + "type": "string", + "example": "prod" + }, + "instance_id": { + "type": "string", + "example": "instance_id" + }, + "instance_name": { + "type": "string", + "example": "test_mysql" + }, + "instance_type": { + "type": "string", + "example": "mysql" + } + } + }, + "InstanceResV2": { + "type": "object", + "properties": { + "additional_params": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceAdditionalParamResV1" + } + }, + "db_host": { + "type": "string", + "example": "10.10.10.10" + }, + "db_port": { + "type": "string", + "example": "3306" + }, + "db_type": { + "type": "string", + "example": "mysql" + }, + "db_user": { + "type": "string", + "example": "root" + }, + "desc": { + "type": "string", + "example": "this is a instance" + }, + "environment_tag_color": { + "type": "string" + }, + "environment_tag_name": { + "type": "string" + }, + "environment_tag_uid": { + "type": "string" + }, + "instance_name": { + "type": "string" + }, + "maintenance_times": { + "type": "array", + "items": { + "$ref": "#/definitions/MaintenanceTimeResV1" + } + }, + "rule_template": { + "type": "object", + "$ref": "#/definitions/RuleTemplateV2" + }, + "source": { + "type": "string", + "example": "SQLE" + }, + "sql_query_config": { + "type": "object", + "$ref": "#/definitions/SQLQueryConfigResV1" + } + } + }, + "InstanceTipResV2": { + "type": "object", + "properties": { + "backup_max_rows": { + "type": "integer" }, - "v2.CreateWorkflowReqV2": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "ops_type_uid": { - "description": "OpsTypeUID 运维类型字典项标识;可选;空表示未设置;创建后不可改", - "type": "string" - }, - "sql_version_id": { - "type": "integer" - }, - "task_ids": { - "type": "array", - "items": { - "type": "integer" - } - }, - "workflow_subject": { - "type": "string" - }, - "workflow_template_id": { - "type": "integer" - } - } - }, - "v2.CreateWorkflowResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v2.CreateWorkflowResV2Data" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v2.CreateWorkflowResV2Data": { - "type": "object", - "properties": { - "workflow_id": { - "type": "string" - } - } + "enable_backup": { + "type": "boolean" }, - "v2.DirectAuditFileReqV2": { - "type": "object", - "properties": { - "file_contents": { - "description": "调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现\n每个数组元素是一个文件内容", - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "select * from t1; select * from t2;" - ] - }, - "instance_name": { - "type": "string", - "example": "instance1" - }, - "instance_type": { - "type": "string", - "example": "MySQL" - }, - "project_name": { - "type": "string", - "example": "project1" - }, - "schema_name": { - "type": "string", - "example": "schema1" - }, - "sql_type": { - "type": "string", - "enum": [ - "sql", - "mybatis", - "" - ], - "example": "sql" - } - } - }, - "v2.DirectAuditReqV2": { - "type": "object", - "properties": { - "instance_name": { - "type": "string", - "example": "instance1" - }, - "instance_type": { - "type": "string", - "example": "MySQL" - }, - "project_id": { - "type": "string", - "example": "700300" - }, - "rule_template_name": { - "type": "string", - "example": "default" - }, - "schema_name": { - "type": "string", - "example": "schema1" - }, - "sql_content": { - "description": "调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现", - "type": "string", - "example": "select * from t1; select * from t2;" - }, - "sql_type": { - "type": "string", - "enum": [ - "sql", - "mybatis", - "" - ], - "example": "sql" - } - } - }, - "v2.DirectAuditResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v2.AuditResDataV2" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v2.DriverMeta": { - "type": "object", - "properties": { - "default_port": { - "type": "integer" - }, - "driver_name": { - "type": "string" - }, - "logo_url": { - "type": "string" - } - } - }, - "v2.ExecResultCount": { - "type": "object", - "properties": { - "doing_count": { - "type": "integer" - }, - "failed_count": { - "type": "integer" - }, - "initialized_count": { - "type": "integer" - }, - "manually_executed_count": { - "type": "integer" - }, - "succeeded_count": { - "type": "integer" - }, - "terminate_failed_count": { - "type": "integer" - }, - "terminate_succeeded_count": { - "type": "integer" - } - } - }, - "v2.FullSyncAuditPlanSQLsReqV2": { - "type": "object", - "properties": { - "audit_plan_sql_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.AuditPlanSQLReqV2" - } - }, - "error_message": { - "type": "string" - } - } - }, - "v2.GetAuditFileExecStatisticRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v2.AuditFileExecStatistic" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v2.GetAuditFileListRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.AuditFileStatistic" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v2.GetAuditPlanAnalysisDataResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v2.TaskAnalysisDataV2" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v2.GetAuditPlanReportSQLsResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.AuditPlanReportSQLResV2" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v2.GetAuditPlansResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.AuditPlanResV2" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v2.GetAuditTaskSQLsResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.AuditTaskSQLResV2" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v2.GetDriversRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.DriverMeta" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v2.GetInstanceAuditPlanDetailRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v2.InstanceAuditPlanDetailRes" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v2.GetInstanceAuditPlansRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.InstanceAuditPlanResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v2.GetInstanceResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v2.InstanceResV2" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v2.GetInstanceTipsResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.InstanceTipResV2" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v2.GetOptimizationDetailRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v2.OptimizationSQLDetail" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v2.GetOptimizationRecordsRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.OptimizationRecord" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "v2.GetSqlManageListResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.SqlManage" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "sql_manage_bad_num": { - "type": "integer" - }, - "sql_manage_optimized_num": { - "type": "integer" - }, - "sql_manage_total_num": { - "type": "integer" - } - } - }, - "v2.GetTaskAnalysisDataResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v2.TaskAnalysisDataV2" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v2.GetWorkflowResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v2.WorkflowResV2" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v2.GetWorkflowTasksItemV2": { - "type": "object", - "properties": { - "current_step_assignee_user_name_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "exec_end_time": { - "type": "string" - }, - "exec_start_time": { - "type": "string" - }, - "execution_user_name": { - "type": "string" - }, - "instance_maintenance_times": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.MaintenanceTimeResV1" - } - }, - "instance_name": { - "type": "string" - }, - "schedule_time": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_execution", - "exec_scheduled", - "exec_failed", - "exec_succeeded", - "executing", - "manually_executed", - "terminating", - "terminate_succeeded", - "terminate_failed" - ] - }, - "task_id": { - "type": "integer" - }, - "task_pass_rate": { - "type": "number" - }, - "task_score": { - "type": "integer" - } - } - }, - "v2.GetWorkflowTasksResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.GetWorkflowTasksItemV2" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v2.InstanceAuditPlanDetailRes": { - "type": "object", - "properties": { - "audit_plans": { - "description": "扫描类型", - "type": "array", - "items": { - "$ref": "#/definitions/v2.AuditPlanRes" - } - }, - "environment": { - "type": "string", - "example": "prod" - }, - "instance_id": { - "type": "string", - "example": "instance_id" - }, - "instance_name": { - "type": "string", - "example": "test_mysql" - }, - "instance_type": { - "type": "string", - "example": "mysql" - } - } - }, - "v2.InstanceAuditPlanResV1": { - "type": "object", - "properties": { - "active_status": { - "type": "string", - "enum": [ - "normal", - "disabled" - ] - }, - "audit_plan_types": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.AuditPlanTypeResBase" - } - }, - "create_time": { - "description": "TODO 采集状态", - "type": "string" - }, - "creator": { - "type": "string" - }, - "environment": { - "type": "string" - }, - "instance_audit_plan_id": { - "type": "integer" - }, - "instance_id": { - "type": "string" - }, - "instance_name": { - "type": "string" - }, - "instance_type": { - "type": "string" - } - } - }, - "v2.InstanceResV2": { - "type": "object", - "properties": { - "additional_params": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.InstanceAdditionalParamResV1" - } - }, - "db_host": { - "type": "string", - "example": "10.10.10.10" - }, - "db_port": { - "type": "string", - "example": "3306" - }, - "db_type": { - "type": "string", - "example": "mysql" - }, - "db_user": { - "type": "string", - "example": "root" - }, - "desc": { - "type": "string", - "example": "this is a instance" - }, - "environment_tag_color": { - "type": "string" - }, - "environment_tag_name": { - "type": "string" - }, - "environment_tag_uid": { - "type": "string" - }, - "instance_name": { - "type": "string" - }, - "maintenance_times": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.MaintenanceTimeResV1" - } - }, - "rule_template": { - "type": "object", - "$ref": "#/definitions/v2.RuleTemplateV2" - }, - "source": { - "type": "string", - "example": "SQLE" - }, - "sql_query_config": { - "type": "object", - "$ref": "#/definitions/v1.SQLQueryConfigResV1" - } - } - }, - "v2.InstanceTipResV2": { - "type": "object", - "properties": { - "backup_max_rows": { - "type": "integer" - }, - "enable_backup": { - "type": "boolean" - }, - "environment_tag_color": { - "type": "string" - }, - "environment_tag_name": { - "type": "string" - }, - "environment_tag_uid": { - "type": "string" - }, - "host": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "instance_name": { - "type": "string" - }, - "instance_type": { - "type": "string" - }, - "port": { - "type": "string" - }, - "supported_backup_strategy": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "none", - "manual", - "reverse_sql", - "original_row" - ] - } - }, - "workflow_template_id": { - "type": "integer" - } - } - }, - "v2.OptimizationRecord": { - "type": "object", - "properties": { - "adoption_rate": { - "description": "优化采纳率", - "type": "number" - }, - "created_time": { - "description": "创建时间", - "type": "string" - }, - "created_user": { - "description": "创建人", - "type": "string" - }, - "db_type": { - "description": "数据库类型", - "type": "string" - }, - "instance_name": { - "description": "数据源", - "type": "string" - }, - "number_of_index": { - "description": "优化索引数量", - "type": "integer" - }, - "number_of_rule": { - "description": "优化规则数量", - "type": "integer" - }, - "optimization_id": { - "description": "优化ID", - "type": "string" - }, - "optimization_name": { - "type": "string" - }, - "performance_improve": { - "description": "优化提升性能", - "type": "number" - }, - "status": { - "description": "优化状态", - "type": "string", - "enum": [ - "optimizing", - "failed", - "finish" - ] - }, - "status_detail": { - "description": "优化状态详情", - "type": "string" - } - } - }, - "v2.OptimizationSQLDetail": { - "type": "object", - "properties": { - "advised_index": { - "description": "索引建议详情", - "type": "object", - "$ref": "#/definitions/sql_flash.AdvisedIndex" - }, - "id": { - "type": "integer" - }, - "metadata": { - "description": "数据库元数据信息", - "type": "string" - }, - "optimization_id": { - "type": "string" - }, - "optimize": { - "description": "优化详情", - "type": "object", - "$ref": "#/definitions/sql_flash.OptimizeDetail" - }, - "optimize_status": { - "description": "优化状态", - "type": "string", - "enum": [ - "optimizing", - "failed", - "finish" - ] - }, - "optimized_sql_feedbacks": { - "description": "优化后的SQL反馈", - "type": "array", - "items": { - "$ref": "#/definitions/v2.OptimizedSQLFeedback" - } - }, - "origin_query_plan": { - "description": "原始SQL查询计划", - "type": "object", - "$ref": "#/definitions/sql_flash.QueryPlan" - }, - "origin_sql": { - "description": "SQL Flash相关字段", - "type": "string" - }, - "status": { - "description": "SQLe 维护的状态", - "type": "string", - "enum": [ - "rewriting", - "rewrite_done", - "advise_indexing", - "advise_index_done", - "finish", - "failed" - ] - }, - "status_detail": { - "description": "SQLe 维护的状态详情", - "type": "string" - }, - "total_analysis": { - "description": "总体分析", - "type": "object", - "$ref": "#/definitions/sql_flash.TotalAnalysis" - }, - "total_state": { - "description": "总状态", - "type": "string" - } - } - }, - "v2.OptimizeSQLReq": { - "type": "object", - "properties": { - "db_type": { - "type": "string", - "example": "MySQL" - }, - "enable_high_analysis": { - "description": "是否启用高级分析", - "type": "boolean" - }, - "explain_info": { - "type": "string" - }, - "instance_name": { - "type": "string", - "example": "instance1" - }, - "metadata": { - "type": "string" - }, - "optimization_name": { - "type": "string", - "example": "optmz_2024031412091244" - }, - "schema_name": { - "type": "string", - "example": "schema1" - }, - "sql_content": { - "type": "string", - "example": "select * from t1; select * from t2;" - } - } - }, - "v2.OptimizeSQLRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/v2.OptimizeSQLResData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "v2.OptimizeSQLResData": { - "type": "object", - "properties": { - "sql_optimization_record_id": { - "type": "string" - } - } + "environment_tag_color": { + "type": "string" }, - "v2.OptimizedSQLFeedback": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "creator": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "reason": { - "type": "string" - }, - "vote": { - "type": "string", - "enum": [ - "agree", - "disagree" - ] - } - } - }, - "v2.OptimizedSQLFeedbackReq": { - "type": "object", - "properties": { - "reason": { - "type": "string", - "example": "the sql is not optimized" - }, - "vote": { - "type": "string", - "enum": [ - "agree", - "disagree" - ], - "example": "agree" - } - } - }, - "v2.PartialSyncAuditPlanSQLsReqV2": { - "type": "object", - "properties": { - "audit_plan_sql_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.AuditPlanSQLReqV2" - } - } - } + "environment_tag_name": { + "type": "string" }, - "v2.PerformanceStatistics": { - "type": "object", - "properties": { - "affect_rows": { - "type": "object", - "$ref": "#/definitions/v2.AffectRows" - } - } + "environment_tag_uid": { + "type": "string" }, - "v2.RejectWorkflowReqV2": { - "type": "object", - "properties": { - "reason": { - "type": "string" - } - } + "host": { + "type": "string" }, - "v2.RuleTemplateV2": { - "type": "object", - "properties": { - "is_global_rule_template": { - "type": "boolean" - }, - "name": { - "type": "string" - } - } + "instance_id": { + "type": "string" }, - "v2.SQLExplain": { - "type": "object", - "properties": { - "classic_result": { - "type": "object", - "$ref": "#/definitions/v1.ExplainClassicResult" - }, - "cost": { - "type": "number" - }, - "err_message": { - "type": "string" - }, - "sql": { - "type": "string" - } - } - }, - "v2.SqlManage": { - "type": "object", - "properties": { - "assignees": { - "type": "array", - "items": { - "type": "string" - } - }, - "audit_result": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditResult" - } - }, - "audit_status": { - "type": "string", - "enum": [ - "being_audited" - ] - }, - "endpoints": { - "type": "array", - "items": { - "type": "string" - } - }, - "first_appear_timestamp": { - "type": "string" - }, - "fp_count": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "instance_name": { - "type": "string" - }, - "last_receive_timestamp": { - "type": "string" - }, - "priority": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "schema_name": { - "type": "string" - }, - "source": { - "type": "object", - "$ref": "#/definitions/v1.Source" - }, - "sql": { - "type": "string" - }, - "sql_fingerprint": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited", - "sent" - ] - } - } - }, - "v2.SqlVersion": { - "type": "object", - "properties": { - "sql_version_id": { - "type": "integer" - }, - "sql_version_name": { - "type": "string" - } - } + "instance_name": { + "type": "string" }, - "v2.TableMetas": { - "type": "object", - "properties": { - "err_message": { - "type": "string" - }, - "table_meta_items": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.TableMeta" - } - } - } - }, - "v2.TaskAnalysisDataV2": { - "type": "object", - "properties": { - "performance_statistics": { - "type": "object", - "$ref": "#/definitions/v2.PerformanceStatistics" - }, - "sql_explain": { - "type": "object", - "$ref": "#/definitions/v2.SQLExplain" - }, - "table_metas": { - "type": "object", - "$ref": "#/definitions/v2.TableMetas" - } - } - }, - "v2.UpdateOptimizedSQLFeedbackReq": { - "type": "object", - "properties": { - "reason": { - "type": "string", - "example": "the sql is not optimized" - }, - "vote": { - "type": "string", - "enum": [ - "agree", - "disagree" - ], - "example": "agree" - } - } - }, - "v2.UpdateWorkflowReqV2": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "task_ids": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "v2.UpdateWorkflowScheduleReqV2": { - "type": "object", - "properties": { - "is_notify": { - "type": "boolean" - }, - "notify_type": { - "type": "string", - "enum": [ - "wechat", - "feishu" - ] - }, - "schedule_time": { - "type": "string" - } - } - }, - "v2.UploadInstanceAuditPlanSQLsReqV2": { - "type": "object", - "properties": { - "audit_plan_sql_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.AuditPlanSQLReqV2" - } - }, - "error_message": { - "type": "string" - } - } - }, - "v2.WorkflowRecordResV2": { - "type": "object", - "properties": { - "assignee_user_name_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "current_step_number": { - "type": "integer" - }, - "executable": { - "type": "boolean" - }, - "executable_reason": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "canceled", - "exec_failed", - "executing", - "finished" - ] - }, - "tasks": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.WorkflowTaskItem" - } - }, - "workflow_step_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.WorkflowStepResV2" - } - } - } - }, - "v2.WorkflowResV2": { - "type": "object", - "properties": { - "associated_rollback_workflows": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.AssociatedRollbackWorkflow" - } - }, - "associated_stage_workflows": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.AssociatedStageWorkflows" - } - }, - "create_time": { - "type": "string" - }, - "create_user_name": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "exec_mode": { - "type": "string", - "enum": [ - "sql_file", - "sqls" - ] - }, - "mode": { - "type": "string", - "enum": [ - "same_sqls", - "different_sqls" - ] - }, - "ops_type": { - "description": "OpsType 运维类型(项目字典解析);未设置或字典项已删时省略,供前端「-」约定", - "type": "object", - "$ref": "#/definitions/dms.OpsType" - }, - "record": { - "type": "object", - "$ref": "#/definitions/v2.WorkflowRecordResV2" - }, - "record_history_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v2.WorkflowRecordResV2" - } - }, - "sql_version": { - "type": "object", - "$ref": "#/definitions/v2.SqlVersion" - }, - "workflow_id": { - "type": "string" - }, - "workflow_name": { - "type": "string" - }, - "workflow_template_id": { - "type": "integer" - }, - "workflow_template_name": { - "type": "string" - } - } - }, - "v2.WorkflowStepResV2": { - "type": "object", - "properties": { - "assignee_user_name_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "desc": { - "type": "string" - }, - "number": { - "type": "integer" - }, - "operation_time": { - "type": "string" - }, - "operation_user_name": { - "type": "string" - }, - "reason": { - "type": "string" - }, - "state": { - "type": "string", - "enum": [ - "initialized", - "approved", - "rejected" - ] - }, - "type": { - "type": "string", - "enum": [ - "create_workflow", - "update_workflow", - "sql_review", - "sql_execute" - ] - }, - "workflow_step_id": { - "type": "integer" - } - } - }, - "v2.WorkflowTaskItem": { - "type": "object", - "properties": { - "task_id": { - "type": "integer" - } - } + "instance_type": { + "type": "string" }, - "v3.BatchCompleteWorkflowsReqV3": { - "type": "object", - "properties": { - "workflow_list": { - "type": "array", - "items": { - "$ref": "#/definitions/v3.CompleteWorkflowReq" - } - } - } + "port": { + "type": "string" }, - "v3.CompleteWorkflowReq": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "workflow_id": { - "type": "string" - } - } + "supported_backup_strategy": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "original_row" + ] + } }, - "v3.GetSqlManageListResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/v3.SqlManage" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "sql_manage_bad_num": { - "type": "integer" - }, - "sql_manage_optimized_num": { - "type": "integer" - }, - "sql_manage_total_num": { - "type": "integer" - } - } - }, - "v3.SqlManage": { - "type": "object", - "properties": { - "assignees": { - "type": "array", - "items": { - "type": "string" - } - }, - "audit_result": { - "type": "array", - "items": { - "$ref": "#/definitions/v1.AuditResult" - } - }, - "audit_status": { - "type": "string", - "enum": [ - "being_audited" - ] - }, - "endpoints": { - "type": "array", - "items": { - "type": "string" - } - }, - "first_appear_timestamp": { - "type": "string" - }, - "fp_count": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "instance_name": { - "type": "string" - }, - "last_receive_timestamp": { - "type": "string" - }, - "priority": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "schema_name": { - "type": "string" - }, - "source": { - "type": "object", - "$ref": "#/definitions/v1.Source" - }, - "sql": { - "type": "string" - }, - "sql_fingerprint": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited", - "sent" - ] - } - } - } - }, - "securityDefinitions": { - "ApiKeyAuth": { - "type": "apiKey", - "name": "Authorization", - "in": "header" + "workflow_template_id": { + "type": "integer" + } + } + }, + "OptimizedSQLFeedback": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "creator": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "reason": { + "type": "string" + }, + "vote": { + "type": "string", + "enum": [ + "agree", + "disagree" + ] + } + } + }, + "OptimizedSQLFeedbackReq": { + "type": "object", + "properties": { + "reason": { + "type": "string", + "example": "the sql is not optimized" + }, + "vote": { + "type": "string", + "enum": [ + "agree", + "disagree" + ], + "example": "agree" + } + } + }, + "PartialSyncAuditPlanSQLsReqV2": { + "type": "object", + "properties": { + "audit_plan_sql_list": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanSQLReqV2" + } + } + } + }, + "RejectWorkflowReqV2": { + "type": "object", + "properties": { + "reason": { + "type": "string" + } + } + }, + "RuleTemplateV2": { + "type": "object", + "properties": { + "is_global_rule_template": { + "type": "boolean" + }, + "name": { + "type": "string" + } + } + }, + "SqlVersion": { + "type": "object", + "properties": { + "sql_version_id": { + "type": "integer" + }, + "sql_version_name": { + "type": "string" + } + } + }, + "TaskAnalysisDataV2": { + "type": "object", + "properties": { + "performance_statistics": { + "type": "object", + "$ref": "#/definitions/PerformanceStatistics" + }, + "sql_explain": { + "type": "object", + "$ref": "#/definitions/SQLExplain" + }, + "table_metas": { + "type": "object", + "$ref": "#/definitions/TableMetas" + } + } + }, + "UpdateOptimizedSQLFeedbackReq": { + "type": "object", + "properties": { + "reason": { + "type": "string", + "example": "the sql is not optimized" + }, + "vote": { + "type": "string", + "enum": [ + "agree", + "disagree" + ], + "example": "agree" + } + } + }, + "UpdateWorkflowReqV2": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "task_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "UpdateWorkflowScheduleReqV2": { + "type": "object", + "properties": { + "is_notify": { + "type": "boolean" + }, + "notify_type": { + "type": "string", + "enum": [ + "wechat", + "feishu" + ] + }, + "schedule_time": { + "type": "string" + } + } + }, + "UploadInstanceAuditPlanSQLsReqV2": { + "type": "object", + "properties": { + "audit_plan_sql_list": { + "type": "array", + "items": { + "$ref": "#/definitions/AuditPlanSQLReqV2" + } + }, + "error_message": { + "type": "string" + } + } + }, + "WorkflowRecordResV2": { + "type": "object", + "properties": { + "assignee_user_name_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "current_step_number": { + "type": "integer" + }, + "executable": { + "type": "boolean" + }, + "executable_reason": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "canceled", + "exec_failed", + "executing", + "finished" + ] + }, + "tasks": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowTaskItem" + } + }, + "workflow_step_list": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowStepResV2" + } + } + } + }, + "WorkflowResV2": { + "type": "object", + "properties": { + "associated_rollback_workflows": { + "type": "array", + "items": { + "$ref": "#/definitions/AssociatedRollbackWorkflow" + } + }, + "associated_stage_workflows": { + "type": "array", + "items": { + "$ref": "#/definitions/AssociatedStageWorkflows" + } + }, + "create_time": { + "type": "string" + }, + "create_user_name": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "exec_mode": { + "type": "string", + "enum": [ + "sql_file", + "sqls" + ] + }, + "mode": { + "type": "string", + "enum": [ + "same_sqls", + "different_sqls" + ] + }, + "ops_type": { + "description": "OpsType 运维类型(项目字典解析);未设置或字典项已删时省略,供前端「-」约定", + "type": "object", + "$ref": "#/definitions/OpsType" + }, + "record": { + "type": "object", + "$ref": "#/definitions/WorkflowRecordResV2" + }, + "record_history_list": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowRecordResV2" + } + }, + "sql_version": { + "type": "object", + "$ref": "#/definitions/SqlVersion" + }, + "workflow_id": { + "type": "string" + }, + "workflow_name": { + "type": "string" + }, + "workflow_template_id": { + "type": "integer" + }, + "workflow_template_name": { + "type": "string" + } + } + }, + "WorkflowStepResV2": { + "type": "object", + "properties": { + "assignee_user_name_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "desc": { + "type": "string" + }, + "number": { + "type": "integer" + }, + "operation_time": { + "type": "string" + }, + "operation_user_name": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "state": { + "type": "string", + "enum": [ + "initialized", + "approved", + "rejected" + ] + }, + "type": { + "type": "string", + "enum": [ + "create_workflow", + "update_workflow", + "sql_review", + "sql_execute" + ] + }, + "workflow_step_id": { + "type": "integer" + } + } + }, + "BatchCompleteWorkflowsReqV3": { + "type": "object", + "properties": { + "workflow_list": { + "type": "array", + "items": { + "$ref": "#/definitions/CompleteWorkflowReq" + } + } + } + }, + "CompleteWorkflowReq": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "workflow_id": { + "type": "string" } + } + } + }, + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "name": "Authorization", + "in": "header" } + } } \ No newline at end of file diff --git a/sqle/docs/swagger.yaml b/sqle/docs/swagger.yaml index 4419f8709..61a9291ae 100644 --- a/sqle/docs/swagger.yaml +++ b/sqle/docs/swagger.yaml @@ -15779,6 +15779,11 @@ paths: in: query name: filter_create_time_to type: string + - description: filter by ops type dictionary item uid; empty means no filter; + applies to sql_release and data_export; same semantics as GET /v2/dashboard/workflows + in: query + name: filter_by_ops_type_uid + type: string - description: 'export format: csv or excel, default csv' enum: - csv From dc3e3ae13f5c6cae20873a89aebd7e16640809c5 Mon Sep 17 00:00:00 2001 From: actiontech-zihan Date: Fri, 21 Aug 2026 11:17:03 +0800 Subject: [PATCH 4/5] fix: gate DataExport OpsType mapping behind CE build stub CE vendor ListDataExportWorkflow has no OpsType field; move name resolution to a !enterprise stub so shared export.go typechecks. --- sqle/server/workflowexport/export.go | 4 +--- sqle/server/workflowexport/export_list_ops_type_ce.go | 11 +++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 sqle/server/workflowexport/export_list_ops_type_ce.go diff --git a/sqle/server/workflowexport/export.go b/sqle/server/workflowexport/export.go index 21c134bed..21632415f 100644 --- a/sqle/server/workflowexport/export.go +++ b/sqle/server/workflowexport/export.go @@ -181,14 +181,12 @@ func FromListDataExportWorkflow(r *dmsV1.ListDataExportWorkflow) DataExportExpor CreatedAt: r.CreatedAt.Format(timeLayout), CreatorName: r.Creater.Name, //nolint:misspell // DMS API field is Creater UnifiedStatus: mapDataExportStatus(r.Status), + OpsTypeName: opsTypeNameFromListDataExport(r), } if r.ProjectInfo != nil { out.ProjectName = r.ProjectInfo.ProjectName out.ProjectUID = r.ProjectInfo.ProjectUid } - if r.OpsType != nil { - out.OpsTypeName = r.OpsType.Name - } for _, db := range r.DBServiceInfos { if db == nil { continue diff --git a/sqle/server/workflowexport/export_list_ops_type_ce.go b/sqle/server/workflowexport/export_list_ops_type_ce.go new file mode 100644 index 000000000..1be86620a --- /dev/null +++ b/sqle/server/workflowexport/export_list_ops_type_ce.go @@ -0,0 +1,11 @@ +//go:build !enterprise +// +build !enterprise + +package workflowexport + +import dmsV1 "github.com/actiontech/dms/pkg/dms-common/api/dms/v1" + +// opsTypeNameFromListDataExport is a CE stub: CE vendor ListDataExportWorkflow has no OpsType field. +func opsTypeNameFromListDataExport(_ *dmsV1.ListDataExportWorkflow) string { + return "" +} From 154e36f452c4b5719a6d4fb4a80c306d3238620d Mon Sep 17 00:00:00 2001 From: actiontech-zihan Date: Fri, 21 Aug 2026 13:28:49 +0800 Subject: [PATCH 5/5] docs: regenerate swagger with make swagger Replace the mismatched swagger.json dump with the repo swag output so docs.go, swagger.json, and swagger.yaml stay consistent. --- sqle/docs/docs.go | 7 - sqle/docs/swagger.json | 51082 ++++++++++++++++++++------------------- sqle/docs/swagger.yaml | 5 - 3 files changed, 25795 insertions(+), 25299 deletions(-) diff --git a/sqle/docs/docs.go b/sqle/docs/docs.go index 18f3ee856..5a5fa145a 100644 --- a/sqle/docs/docs.go +++ b/sqle/docs/docs.go @@ -14332,10 +14332,6 @@ var doc = `{ "dashboard.GlobalWorkflowListItem": { "type": "object", "properties": { - "assignee": { - "description": "当前处理人姓名", - "type": "string" - }, "create_user_name": { "type": "string" }, @@ -16768,9 +16764,6 @@ var doc = `{ "db_type": { "type": "string" }, - "default_port": { - "type": "integer" - }, "params": { "type": "array", "items": { diff --git a/sqle/docs/swagger.json b/sqle/docs/swagger.json index 53959244f..9a2e8781a 100644 --- a/sqle/docs/swagger.json +++ b/sqle/docs/swagger.json @@ -1,25407 +1,25915 @@ { - "swagger": "2.0", - "info": { - "description": "This is a sample server for dev.", - "title": "Sqle API Docs", - "contact": {}, - "license": {}, - "version": "1.0" - }, - "basePath": "/sqle", - "paths": { - "/v1/ai_hub/banner": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "返回按模块分组的Banner卡片列表(模块类型、Banner卡片列表)", - "produces": [ - "application/json" - ], - "tags": [ - "ai_hub" - ], - "summary": "获取AI智能中心Banner", - "operationId": "GetAIHubBanner", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAIHubBannerResp" - } - } - } - } - }, - "/v1/ai_hub/execution_data": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "返回最新10条执行数据记录(来源项目、SQL片段、功能模块、价值维度、处理状态、预估提升、时间)", - "produces": [ - "application/json" - ], - "tags": [ - "ai_hub" - ], - "summary": "获取AI智能中心执行数据", - "operationId": "GetAIHubExecutionData", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAIHubExecutionDataResp" - } - } - } - } - }, - "/v1/ai_hub/management_view": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "返回按模块分组的分析数据(模块类型、项目组投入产出分析、Top问题分布)", - "produces": [ - "application/json" - ], - "tags": [ - "ai_hub" - ], - "summary": "获取AI智能中心管理视图", - "operationId": "GetAIHubManagementView", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAIHubManagementViewResp" - } - } - } - } - }, - "/v1/ai_hub/strategic_value": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "返回AI战略洞察(标题、描述)和效能卡片列表(效能指标、效能评价、具体指标、价值描述)", - "produces": [ - "application/json" - ], - "tags": [ - "ai_hub" - ], - "summary": "获取AI智能中心战略价值", - "operationId": "GetAIHubStrategicValue", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAIHubStrategicValueResp" - } - } - } - } - }, - "/v1/audit_files": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Direct audit sql from SQL files and MyBatis files", - "tags": [ - "sql_audit" - ], - "summary": "直接从文件内容提取SQL并审核,SQL文件暂时只支持一次解析一个文件", - "operationId": "directAuditFilesV1", - "parameters": [ - { - "description": "files that should be audited", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/DirectAuditFileReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DirectAuditResV1" - } - } - } - } - }, - "/v1/audit_plan_metas": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan metas", - "tags": [ - "audit_plan" - ], - "summary": "获取扫描任务元信息", - "operationId": "getAuditPlanMetasV1", - "parameters": [ - { - "type": "string", - "description": "filter instance type", - "name": "filter_instance_type", - "in": "query" - }, - { - "type": "string", - "description": "filter instance id", - "name": "filter_instance_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditPlanMetasResV1" - } - } - } - } - }, - "/v1/audit_plan_types": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan types", - "tags": [ - "audit_plan" - ], - "summary": "获取扫描任务类型", - "operationId": "getAuditPlanTypesV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditPlanTypesResV1" - } - } - } - } - }, - "/v1/company_notice": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get company notice info", - "tags": [ - "companyNotice" - ], - "summary": "获取企业公告", - "operationId": "getCompanyNotice", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetCompanyNoticeResp" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update company notice info", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "companyNotice" - ], - "summary": "更新企业公告", - "operationId": "updateCompanyNotice", - "parameters": [ - { - "description": "company notice", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateCompanyNoticeReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/configurations/coding": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get coding configuration", - "tags": [ - "configuration" - ], - "summary": "获取Coding审核配置", - "operationId": "getCodingConfigurationV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetCodingConfigurationResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update coding configuration", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "添加或更新Coding配置", - "operationId": "UpdateCodingConfigurationV1", - "parameters": [ - { - "description": "update coding configuration req", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateCodingConfigurationReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/configurations/coding/test": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "test coding configuration", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "测试Coding配置", - "operationId": "testCodingConfigV1", - "parameters": [ - { - "description": "test coding configuration req", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/TestCodingConfigurationReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/TestCodingConfigResV1" - } - } - } - } - }, - "/v1/configurations/ding_talk": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get dingTalk configuration", - "tags": [ - "configuration" - ], - "summary": "获取 dingTalk 配置", - "operationId": "getDingTalkConfigurationV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetDingTalkConfigurationResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update DingTalk configuration", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "添加或更新 DingTalk 配置", - "operationId": "updateDingTalkConfigurationV1", - "parameters": [ - { - "description": "update DingTalk configuration req", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateDingTalkConfigurationReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/configurations/ding_talk/test": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "test DingTalk configuration", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "测试 DingTalk 配置", - "operationId": "testDingTalkConfigV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/TestDingTalkConfigResV1" - } - } - } - } - }, - "/v1/configurations/drivers": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get drivers", - "tags": [ - "configuration" - ], - "summary": "获取当前 server 支持的审核类型", - "operationId": "getDriversV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetDriversResV1" - } - } - } - } - }, - "/v1/configurations/feishu_audit": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get feishu audit configuration", - "tags": [ - "configuration" - ], - "summary": "获取飞书审核配置", - "operationId": "getFeishuAuditConfigurationV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetFeishuAuditConfigurationResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update feishu audit configuration", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "添加或更新飞书配置", - "operationId": "updateFeishuAuditConfigurationV1", - "parameters": [ - { - "description": "update feishu audit configuration req", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateFeishuConfigurationReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/configurations/feishu_audit/test": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "test feishu audit configuration", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "测试飞书审批配置", - "operationId": "testFeishuAuditConfigV1", - "parameters": [ - { - "description": "test feishu configuration req", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/TestFeishuConfigurationReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/TestFeishuConfigResV1" - } - } - } - } - }, - "/v1/configurations/git/test": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "test git connection", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "测试Git联通性", - "operationId": "TestGitConnectionV1", - "parameters": [ - { - "description": "test git configuration req", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/TestGitConnectionReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/TestGitConnectionResV1" - } - } - } - } - }, - "/v1/configurations/license": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sqle license", - "tags": [ - "configuration" - ], - "summary": "获取 sqle license", - "operationId": "getSQLELicenseV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetLicenseResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "set sqle license", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "configuration" - ], - "summary": "导入 sqle license", - "operationId": "setSQLELicenseV1", - "parameters": [ - { - "type": "file", - "description": "SQLE license file", - "name": "license_file", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/configurations/license/check": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "parse and check sqle license", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "configuration" - ], - "summary": "解析和校验 sqle license", - "operationId": "checkSQLELicenseV1", - "parameters": [ - { - "type": "file", - "description": "SQLE license file", - "name": "license_file", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/CheckLicenseResV1" - } - } - } - } - }, - "/v1/configurations/license/info": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get the information needed to generate the sqle license", - "tags": [ - "configuration" - ], - "summary": "获取生成 sqle license需要的的信息", - "operationId": "GetSQLELicenseInfoV1", - "responses": { - "200": { - "description": "server info", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/configurations/ssh_key": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get ssh public key", - "tags": [ - "configuration" - ], - "summary": "获取SSH公钥", - "operationId": "getSSHPublicKey", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/SSHPublicKeyInfoV1Rsp" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "gen ssh key", - "tags": [ - "configuration" - ], - "summary": "生成SSH密钥对", - "operationId": "genSSHPublicKey", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/configurations/wechat_audit": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get wechat audit configuration", - "tags": [ - "configuration" - ], - "summary": "获取微信审核配置", - "operationId": "getWechatAuditConfigurationV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWechatAuditConfigurationResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update wechat audit configuration", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "添加或更新微信配置", - "operationId": "updateWechatAuditConfigurationV1", - "parameters": [ - { - "description": "update wechat audit configuration req", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateWechatConfigurationReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/configurations/wechat_audit/test": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "test wechat audit configuration", - "consumes": [ - "application/json" - ], - "tags": [ - "configuration" - ], - "summary": "测试微信审批配置", - "operationId": "testWechatAuditConfigV1", - "parameters": [ - { - "description": "test wechat configuration req", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/TestWechatConfigurationReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/TestWechatConfigResV1" - } - } - } - } - }, - "/v1/configurations/workflows/schedule/default_option": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get scheduled task default option", - "tags": [ - "workflow" - ], - "summary": "获取工单定时上线二次确认默认选项", - "operationId": "getScheduledTaskDefaultOptionV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/ScheduledTaskDefaultOptionV1Rsp" - } - } - } - } - }, - "/v1/custom_rules": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get all custom rule template", - "tags": [ - "rule_template" - ], - "summary": "自定义规则列表", - "operationId": "getCustomRulesV1", - "parameters": [ - { - "type": "string", - "description": "filter db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "filter desc", - "name": "filter_desc", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetCustomRulesResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create custom rule", - "tags": [ - "rule_template" - ], - "summary": "添加自定义规则", - "operationId": "createCustomRuleV1", - "parameters": [ - { - "description": "add custom rule", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateCustomRuleReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/custom_rules/{db_type}/rule_types": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get rule type by db type", - "tags": [ - "rule_template" - ], - "summary": "获取规则分类", - "operationId": "getRuleTypeByDBTypeV1", - "parameters": [ - { - "type": "string", - "description": "db type", - "name": "db_type", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRuleTypeByDBTypeResV1" - } - } - } - } - }, - "/v1/custom_rules/{rule_id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get custom rule by rule_id", - "tags": [ - "rule_template" - ], - "summary": "获取自定义规则", - "operationId": "getCustomRuleV1", - "parameters": [ - { - "type": "string", - "description": "rule id", - "name": "rule_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetCustomRuleResV1" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete custom rule", - "tags": [ - "rule_template" - ], - "summary": "删除自定义规则", - "operationId": "deleteCustomRuleV1", - "parameters": [ - { - "type": "string", - "description": "rule id", - "name": "rule_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update custom rule", - "tags": [ - "rule_template" - ], - "summary": "更新自定义规则", - "operationId": "updateCustomRuleV1", - "parameters": [ - { - "type": "string", - "description": "rule id", - "name": "rule_id", - "in": "path", - "required": true - }, - { - "description": "update custom rule", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateCustomRuleReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/dashboard": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get dashboard info", - "produces": [ - "application/json" - ], - "tags": [ - "dashboard" - ], - "summary": "获取 dashboard 信息", - "operationId": "getDashboardV1", - "parameters": [ - { - "type": "string", - "description": "filter project name", - "name": "filter_project_name", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetDashboardResV1" - } - } - } - } - }, - "/v1/dashboard/data_export_workflows": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global data export workflows list", - "tags": [ - "workflow" - ], - "summary": "获取全局导出工单列表", - "operationId": "getGlobalDataExportWorkflowsV1", - "parameters": [ - { - "type": "string", - "description": "filter create user id", - "name": "filter_create_user_id", - "in": "query" - }, - { - "enum": [ - "wait_for_approve", - "wait_for_export", - "exporting", - "failed", - "rejected", - "cancel", - "finish" - ], - "type": "array", - "items": { - "type": "string" - }, - "description": "filter by workflow status,support using many status", - "name": "filter_status_list", - "in": "query" - }, - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id in project", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "high", - "medium", - "low" - ], - "type": "string", - "description": "filter by project priority", - "name": "filter_project_priority", - "in": "query" - }, - { - "type": "string", - "description": "filter current step assignee user id", - "name": "filter_current_step_assignee_user_id", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowsResV1" - } - } - } - } - }, - "/v1/dashboard/data_export_workflows/statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global data export workflows statistics", - "tags": [ - "workflow" - ], - "summary": "获取全局导出工单统计数据", - "operationId": "getGlobalDataExportWorkflowStatisticsV1", - "parameters": [ - { - "type": "string", - "description": "filter create user id", - "name": "filter_create_user_id", - "in": "query" - }, - { - "enum": [ - "wait_for_approve", - "wait_for_export", - "exporting", - "failed", - "rejected", - "cancel", - "finish" - ], - "type": "array", - "items": { - "type": "string" - }, - "description": "filter by workflow status,support using many status", - "name": "filter_status_list", - "in": "query" - }, - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id in project", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "high", - "medium", - "low" - ], - "type": "string", - "description": "filter by project priority", - "name": "filter_project_priority", - "in": "query" - }, - { - "type": "string", - "description": "filter current step assignee user id", - "name": "filter_current_step_assignee_user_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GlobalWorkflowStatisticsResV1" - } - } - } - } - }, - "/v1/dashboard/sql_manages": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global sql manage list", - "tags": [ - "SqlManage" - ], - "summary": "获取全局管控sql列表", - "operationId": "GetGlobalSqlManageList", - "parameters": [ - { - "type": "string", - "description": "project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "high", - "medium", - "low" - ], - "type": "string", - "description": "project priority", - "name": "filter_project_priority", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetGlobalSqlManageListResp" - } - } - } - } - }, - "/v1/dashboard/sql_manages/statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global sql manage statistics", - "tags": [ - "SqlManage" - ], - "summary": "获取全局管控sql统计信息", - "operationId": "GetGlobalSqlManageStatistics", - "parameters": [ - { - "type": "string", - "description": "project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "high", - "medium", - "low" - ], - "type": "string", - "description": "project priority", - "name": "filter_project_priority", - "in": "query" - }, - { - "type": "string", - "description": "filter current step assignee user id", - "name": "filter_current_step_assignee_user_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetGlobalSqlManageStatisticsResp" - } - } - } - } - }, - "/v1/dashboard/workflows": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global workflow list", - "tags": [ - "workflow" - ], - "summary": "获取全局工单列表", - "operationId": "getGlobalWorkflowsV1", - "parameters": [ - { - "type": "string", - "description": "filter create user id", - "name": "filter_create_user_id", - "in": "query" - }, - { - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "executing", - "canceled", - "exec_failed", - "finished" - ], - "type": "array", - "items": { - "type": "string" - }, - "description": "filter by workflow status,, support using many status", - "name": "filter_status_list", - "in": "query" - }, - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id in project", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "high", - "medium", - "low" - ], - "type": "string", - "description": "filter by project priority", - "name": "filter_project_priority", - "in": "query" - }, - { - "type": "string", - "description": "filter current step assignee user id", - "name": "filter_current_step_assignee_user_id", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowsResV1" - } - } - } - } - }, - "/v1/dashboard/workflows/statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global workflow statistics", - "tags": [ - "workflow" - ], - "summary": "获取全局工单统计数据", - "operationId": "GetGlobalWorkflowStatistics", - "parameters": [ - { - "type": "string", - "description": "filter create user id", - "name": "filter_create_user_id", - "in": "query" - }, - { - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "executing", - "canceled", - "exec_failed", - "finished" - ], - "type": "array", - "items": { - "type": "string" - }, - "description": "filter by workflow status,, support using many status", - "name": "filter_status_list", - "in": "query" - }, - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id in project", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "high", - "medium", - "low" - ], - "type": "string", - "description": "filter by project priority", - "name": "filter_project_priority", - "in": "query" - }, - { - "type": "string", - "description": "filter current step assignee user id", - "name": "filter_current_step_assignee_user_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GlobalWorkflowStatisticsResV1" - } - } - } - } - }, - "/v1/database_driver_logos": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get database driver logos", - "tags": [ - "instance" - ], - "summary": "获取数据库插件的Logo图片", - "operationId": "GetDatabaseDriverLogos", - "parameters": [ - { - "type": "array", - "items": { - "type": "string" - }, - "description": "MySQL,Oracle", - "name": "db_types", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetDatabaseDriverLogosResV1" - } - } - } - } - }, - "/v1/database_driver_options": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get database driver options", - "tags": [ - "instance" - ], - "summary": "获取实例的额外属性列表", - "operationId": "getDatabaseDriverOptions", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetDatabaseDriverOptionsResV1" - } - } - } - } - }, - "/v1/import_rule_template": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get rule template file", - "tags": [ - "rule_template" - ], - "summary": "获取规则模板文件", - "operationId": "getRuleTemplateFileV1", - "parameters": [ - { - "type": "string", - "description": "instance type", - "name": "instance_type", - "in": "query", - "required": true - }, - { - "enum": [ - "csv", - "json" - ], - "type": "string", - "description": "file type", - "name": "file_type", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "sqle rule template file", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/knowledge_bases": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get knowledge base list", - "tags": [ - "knowledge_base" - ], - "summary": "获取知识库列表", - "operationId": "getKnowledgeBaseList", - "parameters": [ - { - "type": "string", - "description": "keywords", - "name": "keywords", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "description": "tags", - "name": "tags", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetKnowledgeBaseListRes" - } - } - } - } - }, - "/v1/knowledge_bases/graph": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get knowledge graph", - "tags": [ - "knowledge_base" - ], - "summary": "获取知识库知识图谱", - "operationId": "getKnowledgeGraph", - "parameters": [ - { - "type": "string", - "description": "filter by rule name", - "name": "filter_by_rule_name", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetKnowledgeGraphResp" - } - } - } - } - }, - "/v1/knowledge_bases/tags": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get tag list of knowledge base", - "tags": [ - "knowledge_base" - ], - "summary": "获取知识库标签列表", - "operationId": "getKnowledgeBaseTagList", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetKnowledgeBaseTagListRes" - } - } - } - } - }, - "/v1/operations": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get permission operations", - "tags": [ - "operation" - ], - "summary": "获取权限动作列表", - "operationId": "GetOperationsV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetOperationsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan info list", - "tags": [ - "audit_plan" - ], - "summary": "获取扫描任务信息列表", - "operationId": "getAuditPlansV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "filter audit plan db type", - "name": "filter_audit_plan_db_type", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search audit plan name", - "name": "fuzzy_search_audit_plan_name", - "in": "query" - }, - { - "type": "string", - "description": "filter audit plan type", - "name": "filter_audit_plan_type", - "in": "query" - }, - { - "type": "string", - "description": "filter audit plan instance name", - "name": "filter_audit_plan_instance_name", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditPlansResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create audit plan", - "consumes": [ - "application/json" - ], - "tags": [ - "audit_plan" - ], - "summary": "添加扫描任务", - "operationId": "createAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "create audit plan", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateAuditPlanReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan", - "tags": [ - "audit_plan" - ], - "summary": "获取指定扫描任务", - "operationId": "getAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditPlanResV1" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete audit plan", - "tags": [ - "audit_plan" - ], - "summary": "删除扫描任务", - "operationId": "deleteAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update audit plan", - "tags": [ - "audit_plan" - ], - "summary": "更新扫描任务", - "operationId": "updateAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "description": "update audit plan", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateAuditPlanReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/notify_config": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan notify config", - "tags": [ - "audit_plan" - ], - "summary": "获取扫描任务消息推送设置", - "operationId": "getAuditPlanNotifyConfigV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditPlanNotifyConfigResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update audit plan notify config", - "tags": [ - "audit_plan" - ], - "summary": "更新扫描任务通知设置", - "operationId": "updateAuditPlanNotifyConfigV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "description": "update audit plan notify config", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateAuditPlanNotifyConfigReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/notify_config/test": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Test audit task message push", - "tags": [ - "audit_plan" - ], - "summary": "测试扫描任务消息推送", - "operationId": "testAuditPlanNotifyConfigV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/TestAuditPlanNotifyConfigResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan report list", - "tags": [ - "audit_plan" - ], - "summary": "获取指定扫描任务的报告列表", - "operationId": "getAuditPlanReportsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditPlanReportsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan report", - "tags": [ - "audit_plan" - ], - "summary": "获取指定扫描任务的SQL扫描记录统计信息", - "operationId": "getAuditPlanReportV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan report id", - "name": "audit_plan_report_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditPlanReportResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/export": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "export audit plan report as csv", - "tags": [ - "audit_plan" - ], - "summary": "以csv的形式导出扫描报告", - "operationId": "exportAuditPlanReportV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan report id", - "name": "audit_plan_report_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "get export audit plan report", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan report SQLs", - "tags": [ - "audit_plan" - ], - "summary": "获取指定扫描任务的SQL扫描详情", - "operationId": "getAuditPlanReportsSQLsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan report id", - "name": "audit_plan_report_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditPlanReportSQLsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls/{number}/analysis": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get SQL explain and related table metadata for analysis", - "tags": [ - "audit_plan" - ], - "summary": "获取task相关的SQL执行计划和表元数据", - "operationId": "getTaskAnalysisData", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan report id", - "name": "audit_plan_report_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql number", - "name": "number", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditPlanAnalysisDataResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan SQLs", - "tags": [ - "audit_plan" - ], - "summary": "获取指定扫描任务的SQLs信息(不包括扫描结果)", - "operationId": "getAuditPlanSQLsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditPlanSQLsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/full": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "full sync audit plan SQLs", - "tags": [ - "audit_plan" - ], - "summary": "全量同步SQL到扫描任务", - "operationId": "fullSyncAuditPlanSQLsV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "description": "full sync audit plan SQLs request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/FullSyncAuditPlanSQLsReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/partial": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "partial sync audit plan SQLs", - "tags": [ - "audit_plan" - ], - "summary": "增量同步SQL到扫描任务", - "operationId": "partialSyncAuditPlanSQLsV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "description": "partial sync audit plan SQLs request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PartialSyncAuditPlanSQLsReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/trigger": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "trigger audit plan", - "tags": [ - "audit_plan" - ], - "summary": "触发扫描任务", - "operationId": "triggerAuditPlanV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/TriggerAuditPlanResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_whitelist": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get all whitelist", - "tags": [ - "audit_whitelist" - ], - "summary": "获取Sql审核白名单", - "operationId": "getAuditWhitelistV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy value", - "name": "fuzzy_search_value", - "in": "query" - }, - { - "type": "string", - "description": "match type", - "name": "filter_match_type", - "in": "query" - }, - { - "type": "string", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "page size", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditWhitelistResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create a sql whitelist", - "consumes": [ - "application/json" - ], - "tags": [ - "audit_whitelist" - ], - "summary": "添加SQL白名单", - "operationId": "createAuditWhitelistV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "add sql whitelist req", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateAuditWhitelistReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/audit_whitelist/{audit_whitelist_id}/": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "remove sql white", - "tags": [ - "audit_whitelist" - ], - "summary": "删除SQL白名单信息", - "operationId": "deleteAuditWhitelistByIdV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit whitelist id", - "name": "audit_whitelist_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update sql whitelist by id", - "consumes": [ - "application/json" - ], - "tags": [ - "audit_whitelist" - ], - "summary": "更新SQL白名单", - "operationId": "UpdateAuditWhitelistByIdV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql audit whitelist id", - "name": "audit_whitelist_id", - "in": "path", - "required": true - }, - { - "description": "update sql whitelist req", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateAuditWhitelistReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/blacklist": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get blacklist", - "tags": [ - "blacklist" - ], - "summary": "获取黑名单列表", - "operationId": "getBlacklistV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "enum": [ - "sql", - "fp_sql", - "ip", - "cidr", - "host", - "instance" - ], - "type": "string", - "description": "filter type", - "name": "filter_type", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search content", - "name": "fuzzy_search_content", - "in": "query" - }, - { - "type": "string", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "page size", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetBlacklistResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create a blacklist", - "consumes": [ - "application/json" - ], - "tags": [ - "blacklist" - ], - "summary": "添加黑名单", - "operationId": "createBlacklistV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "add blacklist req", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateBlacklistReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/blacklist/{blacklist_id}/": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete a blacklist", - "tags": [ - "blacklist" - ], - "operationId": "deleteBlackList", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "blacklist id", - "name": "blacklist_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update a blacklist", - "consumes": [ - "application/json" - ], - "tags": [ - "blacklist" - ], - "summary": "更新黑名单", - "operationId": "updateBlacklistV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "blacklist id", - "name": "blacklist_id", - "in": "path", - "required": true - }, - { - "description": "update blacklist req", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateBlacklistReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/database_comparison/comparison_statements": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get database comparison detail", - "consumes": [ - "application/json" - ], - "tags": [ - "database_comparison" - ], - "summary": "获取对比语句", - "operationId": "getComparisonStatementV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "get database comparison statement request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/GetComparisonStatementsReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DatabaseComparisonStatementsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/database_comparison/execute_comparison": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get database comparison", - "consumes": [ - "application/json" - ], - "tags": [ - "database_comparison" - ], - "summary": "执行数据库结构对比并获取结果", - "operationId": "executeDatabaseComparisonV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "get database comparison request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/GetDatabaseComparisonReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DatabaseComparisonResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/database_comparison/modify_sql_statements": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "generate database diff modify sqls", - "consumes": [ - "application/json" - ], - "tags": [ - "database_comparison" - ], - "summary": "生成变更SQL", - "operationId": "genDatabaseDiffModifySQLsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "generate database diff modify sqls request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/GenModifylSQLReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GenModifySQLResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance audit plan info list", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取实例扫描任务列表", - "operationId": "getInstanceAuditPlansV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "filter by business", - "name": "filter_by_business", - "in": "query" - }, - { - "type": "string", - "description": "filter by environment tag", - "name": "filter_by_environment_tag", - "in": "query" - }, - { - "type": "string", - "description": "filter by db type", - "name": "filter_by_db_type", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_by_instance_id", - "in": "query" - }, - { - "type": "string", - "description": "filter instance audit plan type", - "name": "filter_by_audit_plan_type", - "in": "query" - }, - { - "type": "string", - "description": "filter instance audit plan active status", - "name": "filter_by_active_status", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search", - "name": "fuzzy_search", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetInstanceAuditPlansResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create instance audit plan", - "consumes": [ - "application/json" - ], - "tags": [ - "instance_audit_plan" - ], - "summary": "添加实例扫描任务", - "operationId": "createInstanceAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "create instance audit plan", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateInstanceAuditPlanReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/CreatInstanceAuditPlanResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance audit plan detail", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取实例扫描任务详情", - "operationId": "getInstanceAuditPlanDetailV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetInstanceAuditPlanDetailResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update instance audit plan", - "tags": [ - "instance_audit_plan" - ], - "summary": "更新实例扫描任务配置", - "operationId": "updateInstanceAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "description": "update instance audit plan", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateInstanceAuditPlanReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete instance audit plan", - "tags": [ - "instance_audit_plan" - ], - "summary": "删除实例扫描任务", - "operationId": "deleteInstanceAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "stop/start instance audit plan", - "tags": [ - "instance_audit_plan" - ], - "summary": "更新实例扫描任务状态", - "operationId": "updateInstanceAuditPlanStatusV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "description": "update instance audit plan", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateInstanceAuditPlanStatusReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan overview", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取实例扫描任务概览", - "operationId": "getInstanceAuditPlanOverviewV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetInstanceAuditPlanOverviewResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete audit plan by type", - "tags": [ - "instance_audit_plan" - ], - "summary": "删除扫描任务", - "operationId": "deleteAuditPlanByTypeV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan id", - "name": "audit_plan_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "stop/start audit plan", - "tags": [ - "instance_audit_plan" - ], - "summary": "更新扫描任务状态", - "operationId": "updateAuditPlanStatusV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan id", - "name": "audit_plan_id", - "in": "path", - "required": true - }, - { - "description": "update audit plan status", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateAuditPlanStatusReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/audit": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "audit plan trigger sql audit", - "tags": [ - "instance_audit_plan" - ], - "summary": "扫描任务触发sql审核", - "operationId": "auditPlanTriggerSqlAuditV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan id", - "name": "audit_plan_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/sql_data": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan SQLs", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取指定扫描任务的SQL列表", - "operationId": "getInstanceAuditPlanSQLDataV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan id", - "name": "audit_plan_id", - "in": "path", - "required": true - }, - { - "description": "audit plan sql data request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/GetAuditPlanSQLDataReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditPlanSQLDataResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/sql_export": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "export audit plan SQL report as CSV or Excel", - "tags": [ - "instance_audit_plan" - ], - "summary": "导出指定扫描任务的 SQL 列表", - "operationId": "getInstanceAuditPlanSQLExportV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan id", - "name": "audit_plan_id", - "in": "path", - "required": true - }, - { - "description": "audit plan sql export request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/GetAuditPlanSQLExportReqV1" - } - } - ], - "responses": { - "200": { - "description": "export audit plan sql report", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/sql_meta": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan SQL meta", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取指定扫描任务的SQL列表元信息", - "operationId": "getInstanceAuditPlanSQLMetaV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan id", - "name": "audit_plan_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditPlanSQLMetaResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan SQLs", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取指定扫描任务的SQLs信息", - "operationId": "getInstanceAuditPlanSQLsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan id", - "name": "audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditPlanSQLsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/sqls/{id}/analysis": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get SQL explain and related table metadata for analysis", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取扫描任务相关的SQL执行计划和表元数据", - "operationId": "getAuditPlanSqlAnalysisDataV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan sql id", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "whether to calculate and return affected rows, default is true", - "name": "affectRowsEnabled", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSqlManageSqlAnalysisResp" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/token": { - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "refresh audit plan token", - "tags": [ - "instance_audit_plan" - ], - "summary": "重置扫描任务token", - "operationId": "refreshAuditPlanTokenV1", - "parameters": [ - { - "description": "update instance audit plan token", - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/RefreshAuditPlanTokenReqV1" - } - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/instance_tips": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance tip list", - "tags": [ - "instance" - ], - "summary": "获取实例提示列表", - "operationId": "getInstanceTipListV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "filter db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "filter by business", - "name": "filter_by_business", - "in": "query" - }, - { - "type": "string", - "description": "filter workflow template id", - "name": "filter_workflow_template_id", - "in": "query" - }, - { - "enum": [ - "create_audit_plan", - "create_workflow", - "sql_manage", - "create_optimization", - "create_pipeline" - ], - "type": "string", - "description": "functional module", - "name": "functional_module", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetInstanceTipsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instances/connections": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "batch test instance db connections", - "tags": [ - "instance" - ], - "summary": "批量测试实例连通性(实例提交后)", - "operationId": "batchCheckInstanceIsConnectableByName", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "instances", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/BatchCheckInstanceConnectionsReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BatchGetInstanceConnectionsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instances/{instance_name}/connection": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "test instance db connection", - "tags": [ - "instance" - ], - "summary": "实例连通性测试(实例提交后)", - "operationId": "checkInstanceIsConnectableByNameV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetInstanceConnectableResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instances/{instance_name}/rules": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance all rule", - "tags": [ - "instance" - ], - "summary": "获取实例应用的规则列表", - "operationId": "getInstanceRuleListV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRulesResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instances/{instance_name}/schemas": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "instance schema list", - "tags": [ - "instance" - ], - "summary": "实例 Schema 列表", - "operationId": "getInstanceSchemasV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetInstanceSchemaResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instances/{instance_name}/schemas/{schema_name}/tables": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "list table by schema", - "tags": [ - "instance" - ], - "summary": "获取数据库下的所有表", - "operationId": "listTableBySchema", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "schema name", - "name": "schema_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/ListTableBySchemaResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/instances/{instance_name}/schemas/{schema_name}/tables/{table_name}/metadata": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get table metadata", - "tags": [ - "instance" - ], - "summary": "获取表元数据", - "operationId": "getTableMetadata", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "schema name", - "name": "schema_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "table name", - "name": "table_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetTableMetadataResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/pipelines": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get pipeline list", - "tags": [ - "pipeline" - ], - "summary": "获取流水线列表", - "operationId": "getPipelinesV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy search pipeline name and description", - "name": "fuzzy_search_name_desc", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetPipelinesResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create pipeline", - "consumes": [ - "application/json" - ], - "tags": [ - "pipeline" - ], - "summary": "创建流水线", - "operationId": "createPipelineV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "create pipeline", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreatePipelineReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/CreatePipelineResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/pipelines/{pipeline_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get pipeline detail", - "tags": [ - "pipeline" - ], - "summary": "获取流水线详情", - "operationId": "getPipelineDetailV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "pipeline id", - "name": "pipeline_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetPipelineDetailResV1" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete pipeline", - "tags": [ - "pipeline" - ], - "summary": "删除流水线", - "operationId": "deletePipelineV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "pipeline id", - "name": "pipeline_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update pipeline", - "tags": [ - "pipeline" - ], - "summary": "更新流水线", - "operationId": "updatePipelineV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "pipeline id", - "name": "pipeline_id", - "in": "path", - "required": true - }, - { - "description": "update pipeline", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdatePipelineReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/pipelines/{pipeline_id}/token/{node_id}/": { - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "refresh pipeline token", - "tags": [ - "pipeline" - ], - "summary": "刷新流水线节点token", - "operationId": "refreshPipelineNodeTokenV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "pipeline id", - "name": "pipeline_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "node id", - "name": "node_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/report_push_configs": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Get report push config list", - "tags": [ - "ReportPushConfig" - ], - "summary": "获取消息推送配置列表", - "operationId": "GetReportPushConfigList", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetReportPushConfigsListResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/report_push_configs/{report_push_config_id}/": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update report push config", - "tags": [ - "ReportPushConfig" - ], - "summary": "更新消息推送配置", - "operationId": "UpdateReportPushConfig", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "report push config id", - "name": "report_push_config_id", - "in": "path", - "required": true - }, - { - "description": "update report push config request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateReportPushConfigReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/rule_template_tips": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get rule template tips in project", - "tags": [ - "rule_template" - ], - "summary": "获取项目规则模板提示", - "operationId": "getProjectRuleTemplateTipsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "filter db type", - "name": "filter_db_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRuleTemplateTipsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/rule_templates": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get all rule template in a project", - "tags": [ - "rule_template" - ], - "summary": "项目规则模板列表", - "operationId": "getProjectRuleTemplateListV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetProjectRuleTemplatesResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create a rule template in project", - "consumes": [ - "application/json" - ], - "tags": [ - "rule_template" - ], - "summary": "添加项目规则模板", - "operationId": "createProjectRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "add rule template request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateProjectRuleTemplateReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/rule_templates/{rule_template_name}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get rule template detail in project", - "tags": [ - "rule_template" - ], - "summary": "获取项目规则模板信息", - "operationId": "getProjectRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy rule,keyword for desc and annotation", - "name": "fuzzy_keyword_rule", - "in": "query" - }, - { - "type": "string", - "description": "tags for rule", - "name": "tags", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetProjectRuleTemplateResV1" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete rule template in project", - "tags": [ - "rule_template" - ], - "summary": "删除项目规则模板", - "operationId": "deleteProjectRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update rule template in project", - "tags": [ - "rule_template" - ], - "summary": "更新项目规则模板", - "operationId": "updateProjectRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - }, - { - "description": "update rule template request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateProjectRuleTemplateReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/rule_templates/{rule_template_name}/clone": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "clone a rule template in project", - "consumes": [ - "application/json" - ], - "tags": [ - "rule_template" - ], - "summary": "克隆项目规则模板", - "operationId": "cloneProjectRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - }, - { - "description": "clone rule template request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CloneProjectRuleTemplateReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/rule_templates/{rule_template_name}/export": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "export rule template in a project", - "tags": [ - "rule_template" - ], - "summary": "导出项目规则模板", - "operationId": "exportProjectRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - }, - { - "enum": [ - "csv", - "json" - ], - "type": "string", - "description": "export type", - "name": "export_type", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "sqle rule template file", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_audit_records": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql audit records", - "tags": [ - "sql_audit_record" - ], - "summary": "获取SQL审核记录列表", - "operationId": "getSQLAuditRecordsV1", - "parameters": [ - { - "type": "string", - "description": "fuzzy search tags", - "name": "fuzzy_search_tags", - "in": "query" - }, - { - "enum": [ - "auditing", - "successfully" - ], - "type": "string", - "description": "filter sql audit status", - "name": "filter_sql_audit_status", - "in": "query" - }, - { - "type": "integer", - "description": "filter instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "type": "string", - "description": "filter create time from", - "name": "filter_create_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter create time to", - "name": "filter_create_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter sql audit record ids", - "name": "filter_sql_audit_record_ids", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSQLAuditRecordsResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "SQL audit\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.\n4. file[input_zip_file]: it is ZIP file that sql will be parsed from xml or sql file inside it.\n5. formData[git_http_url]:the url which scheme is http(s) and end with .git.\n6. formData[git_user_name]:The name of the user who owns the repository read access.\n7. formData[git_branch_name]:The name of the repository branch.\n8. formData[git_user_password]:The password corresponding to git_user_name.", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sql_audit_record" - ], - "summary": "SQL审核", - "operationId": "CreateSQLAuditRecordV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "formData" - }, - { - "type": "string", - "description": "schema of instance", - "name": "instance_schema", - "in": "formData" - }, - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "formData" - }, - { - "type": "string", - "description": "db type of instance", - "name": "db_type", - "in": "formData" - }, - { - "type": "string", - "description": "sqls for audit", - "name": "sqls", - "in": "formData" - }, - { - "type": "file", - "description": "input SQL file", - "name": "input_sql_file", - "in": "formData" - }, - { - "type": "file", - "description": "input mybatis XML file", - "name": "input_mybatis_xml_file", - "in": "formData" - }, - { - "type": "file", - "description": "input ZIP file", - "name": "input_zip_file", - "in": "formData" - }, - { - "type": "string", - "description": "git repository url", - "name": "git_http_url", - "in": "formData" - }, - { - "type": "string", - "description": "the name of user to clone the repository", - "name": "git_user_name", - "in": "formData" - }, - { - "type": "string", - "description": "the name of repository branch", - "name": "git_branch_name", - "in": "formData" - }, - { - "type": "string", - "description": "the password corresponding to git_user_name", - "name": "git_user_password", - "in": "formData" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/CreateSQLAuditRecordResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_audit_records/tag_tips": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql audit record tag tips", - "tags": [ - "sql_audit_record" - ], - "summary": "获取SQL审核记录标签列表", - "operationId": "GetSQLAuditRecordTagTipsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSQLAuditRecordTagTipsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_audit_records/{sql_audit_record_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql audit record info", - "tags": [ - "sql_audit_record" - ], - "summary": "获取SQL审核记录信息", - "operationId": "getSQLAuditRecordV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql audit record id", - "name": "sql_audit_record_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSQLAuditRecordResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update SQL audit record", - "consumes": [ - "application/json" - ], - "tags": [ - "sql_audit_record" - ], - "summary": "更新SQL审核记录", - "operationId": "updateSQLAuditRecordV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql audit record id", - "name": "sql_audit_record_id", - "in": "path", - "required": true - }, - { - "description": "update SQL audit record", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateSQLAuditRecordReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_dev_records": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql dev record list", - "tags": [ - "SqlDEVRecord" - ], - "summary": "获取开发sql记录", - "operationId": "GetSqlDEVRecordList", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy search sql fingerprint", - "name": "fuzzy_search_sql_fingerprint", - "in": "query" - }, - { - "type": "string", - "description": "instance name", - "name": "filter_instance_name", - "in": "query" - }, - { - "enum": [ - "ide_plugin" - ], - "type": "string", - "description": "source", - "name": "filter_source", - "in": "query" - }, - { - "type": "string", - "description": "creator name", - "name": "filter_creator", - "in": "query" - }, - { - "type": "string", - "description": "last receive time from", - "name": "filter_last_receive_time_from", - "in": "query" - }, - { - "type": "string", - "description": "last receive time to", - "name": "filter_last_receive_time_to", - "in": "query" - }, - { - "enum": [ - "first_appear_timestamp", - "last_receive_timestamp", - "fp_count" - ], - "type": "string", - "description": "sort field", - "name": "sort_field", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "sort order", - "name": "sort_order", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSqlDEVRecordListResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_manages": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql manage list", - "tags": [ - "SqlManage" - ], - "summary": "获取管控sql列表", - "operationId": "GetSqlManageList", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy search sql fingerprint", - "name": "fuzzy_search_sql_fingerprint", - "in": "query" - }, - { - "type": "string", - "description": "assignee", - "name": "filter_assignee", - "in": "query" - }, - { - "type": "string", - "description": "instance name", - "name": "filter_instance_name", - "in": "query" - }, - { - "enum": [ - "audit_plan", - "sql_audit_record" - ], - "type": "string", - "description": "source", - "name": "filter_source", - "in": "query" - }, - { - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "type": "string", - "description": "audit level", - "name": "filter_audit_level", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time from", - "name": "filter_last_audit_start_time_from", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time to", - "name": "filter_last_audit_start_time_to", - "in": "query" - }, - { - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited" - ], - "type": "string", - "description": "status", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "rule name", - "name": "filter_rule_name", - "in": "query" - }, - { - "type": "string", - "description": "db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search endpoint", - "name": "fuzzy_search_endpoint", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search schema name", - "name": "fuzzy_search_schema_name", - "in": "query" - }, - { - "enum": [ - "first_appear_timestamp", - "last_receive_timestamp", - "fp_count" - ], - "type": "string", - "description": "sort field", - "name": "sort_field", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "sort order", - "name": "sort_order", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSqlManageListResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_manages/abnormal_audit_plan_instance": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get the instance of audit plan execution abnormal", - "tags": [ - "SqlManage" - ], - "summary": "获取执行异常的扫描任务实例", - "operationId": "getAbnormalInstanceAuditPlansV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAbnormalAuditPlanInstancesResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_manages/batch": { - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "batch update sql manage", - "tags": [ - "SqlManage" - ], - "summary": "批量更新SQL管控", - "operationId": "BatchUpdateSqlManage", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "batch update sql manage request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/BatchUpdateSqlManageReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_manages/exports": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "export sql manage", - "tags": [ - "SqlManage" - ], - "summary": "导出SQL管控", - "operationId": "exportSqlManageV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy search sql fingerprint", - "name": "fuzzy_search_sql_fingerprint", - "in": "query" - }, - { - "type": "string", - "description": "assignee", - "name": "filter_assignee", - "in": "query" - }, - { - "type": "string", - "description": "filter by business", - "name": "filter_business", - "in": "query" - }, - { - "enum": [ - "high", - "low" - ], - "type": "string", - "description": "priority", - "name": "filter_priority", - "in": "query" - }, - { - "type": "string", - "description": "instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "audit_plan", - "sql_audit_record" - ], - "type": "string", - "description": "source", - "name": "filter_source", - "in": "query" - }, - { - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "type": "string", - "description": "audit level", - "name": "filter_audit_level", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time from", - "name": "filter_last_audit_start_time_from", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time to", - "name": "filter_last_audit_start_time_to", - "in": "query" - }, - { - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited" - ], - "type": "string", - "description": "status", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "rule name", - "name": "filter_rule_name", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search endpoint", - "name": "fuzzy_search_endpoint", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search schema name", - "name": "fuzzy_search_schema_name", - "in": "query" - }, - { - "enum": [ - "first_appear_timestamp", - "last_receive_timestamp", - "fp_count" - ], - "type": "string", - "description": "sort field", - "name": "sort_field", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "sort order", - "name": "sort_order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "export sql manage", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_manages/rule_tips": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql manage rule tips", - "tags": [ - "SqlManage" - ], - "summary": "获取管控规则tips", - "operationId": "GetSqlManageRuleTips", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSqlManageRuleTipsResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_manages/send": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql manage analysis", - "tags": [ - "SqlManage" - ], - "summary": "推送SQL管控结果到外部系统", - "operationId": "SendSqlManage", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "batch update sql manage request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SqlManageCodingReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostSqlManageCodingResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_manages/{sql_manage_id}/sql_analysis": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql manage analysis", - "tags": [ - "SqlManage" - ], - "summary": "获取SQL管控SQL分析", - "operationId": "GetSqlManageSqlAnalysisV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql manage id", - "name": "sql_manage_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "whether to calculate and return affected rows, default is true", - "name": "affectRowsEnabled", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSqlManageSqlAnalysisResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_manages/{sql_manage_id}/sql_analysis_chart": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql manage analysis", - "tags": [ - "SqlManage" - ], - "summary": "获取SQL管控SQL执行计划Cost趋势图表", - "operationId": "GetSqlManageSqlAnalysisChartV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql manage id", - "name": "sql_manage_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "latest_point_enabled", - "name": "latest_point_enabled", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "start time", - "name": "start_time", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "end time", - "name": "end_time", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "metric_name", - "name": "metric_name", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/SqlManageAnalysisChartResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_optimization_records": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql optimization records", - "tags": [ - "sql_optimization" - ], - "summary": "获取SQL优化记录列表", - "operationId": "getOptimizationRecords", - "parameters": [ - { - "type": "string", - "description": "fuzzy search for optimization_id or create_username", - "name": "fuzzy_search", - "in": "query" - }, - { - "type": "string", - "description": "filter instance name", - "name": "filter_instance_name", - "in": "query" - }, - { - "type": "string", - "description": "filter create time from", - "name": "filter_create_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter create time to", - "name": "filter_create_time_to", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetOptimizationRecordsRes" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "optimize sql\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.\n4. file[input_zip_file]: it is ZIP file that sql will be parsed from xml or sql file inside it.\n5. formData[git_http_url]:the url which scheme is http(s) and end with .git.\n6. formData[git_user_name]:The name of the user who owns the repository read access.\n7. formData[git_user_password]:The password corresponding to git_user_name.", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sql_optimization" - ], - "summary": "优化SQL", - "operationId": "OptimizeSQLReq", - "parameters": [ - { - "description": "sqls that should be optimization", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/OptimizeSQLReq" - } - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "formData" - }, - { - "type": "string", - "description": "schema of instance", - "name": "schema_name", - "in": "formData" - }, - { - "type": "string", - "description": "db type of instance", - "name": "db_type", - "in": "formData" - }, - { - "type": "string", - "description": "sqls for audit", - "name": "sql_content", - "in": "formData" - }, - { - "type": "string", - "description": "optimization name", - "name": "optimization_name", - "in": "formData", - "required": true - }, - { - "type": "file", - "description": "input SQL file", - "name": "input_sql_file", - "in": "formData" - }, - { - "type": "file", - "description": "input mybatis XML file", - "name": "input_mybatis_xml_file", - "in": "formData" - }, - { - "type": "file", - "description": "input ZIP file", - "name": "input_zip_file", - "in": "formData" - }, - { - "type": "string", - "description": "git repository url", - "name": "git_http_url", - "in": "formData" - }, - { - "type": "string", - "description": "the name of user to clone the repository", - "name": "git_user_name", - "in": "formData" - }, - { - "type": "string", - "description": "the password corresponding to git_user_name", - "name": "git_user_password", - "in": "formData" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/OptimizeSQLRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_optimization_records/{optimization_record_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql optimization record", - "tags": [ - "sql_optimization" - ], - "summary": "获取SQL优化记录", - "operationId": "GetOptimizationRecordReq", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql optimization record id", - "name": "optimization_record_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql", - "name": "sql", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetOptimizationRecordRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_optimization_records/{optimization_record_id}/sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql optimization sqls", - "tags": [ - "sql_optimization" - ], - "summary": "获取SQL优化语句列表", - "operationId": "getOptimizationSQLs", - "parameters": [ - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "optimization record id", - "name": "optimization_record_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetOptimizationSQLsRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_optimization_records/{optimization_record_id}/sqls/{number}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql optimization record", - "tags": [ - "sql_optimization" - ], - "summary": "获取SQL优化语句详情", - "operationId": "GetOptimizationReq", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql optimization record id", - "name": "optimization_record_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "optimization record sql number", - "name": "number", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetOptimizationSQLRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_performance_insights": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql manage sql performance insights", - "tags": [ - "SqlInsight" - ], - "summary": "获取SQL管控SQL性能洞察图表数据", - "operationId": "GetSqlPerformanceInsights", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "enum": [ - "comprehensive_trend", - "slow_sql_trend", - "top_sql_trend", - "active_session_trend" - ], - "type": "string", - "description": "metric name", - "name": "metric_name", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "start time", - "name": "start_time", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "end time", - "name": "end_time", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "instance id", - "name": "instance_id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSqlPerformanceInsightsResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_performance_insights/related_sql": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Get related SQL for the selected time range in SQL performance insights", - "tags": [ - "SqlInsight" - ], - "summary": "获取sql洞察 时间选区 的关联SQL", - "operationId": "GetSqlPerformanceInsightsRelatedSQL", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance id", - "name": "instance_id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "start time", - "name": "start_time", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "end time", - "name": "end_time", - "in": "query", - "required": true - }, - { - "enum": [ - "workflow", - "sql_manage", - "workbench" - ], - "type": "string", - "description": "filter by SQL source", - "name": "filter_source", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "order by field", - "name": "order_by", - "in": "query" - }, - { - "type": "boolean", - "description": "is ascending order", - "name": "is_asc", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSqlPerformanceInsightsRelatedSQLResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_performance_insights/related_sql/related_transaction": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Get related transaction for the selected SQL in SQL performance insights", - "tags": [ - "SqlInsight" - ], - "summary": "获取sql洞察 相关SQL中具体一条SQL 的关联事务", - "operationId": "GetSqlPerformanceInsightsRelatedTransaction", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance id", - "name": "instance_id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "sql id", - "name": "sql_id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSqlPerformanceInsightsRelatedTransactionResp" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_versions": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "sql version list", - "consumes": [ - "application/json" - ], - "tags": [ - "sql_version" - ], - "summary": "获取SQL版本列表", - "operationId": "getSqlVersionListV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "filter by created at from", - "name": "filter_by_created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "filter by created at to", - "name": "filter_by_created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "filter by lock time from", - "name": "filter_by_lock_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter by lock time to", - "name": "filter_by_lock_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter by version status", - "name": "filter_by_version_status", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search", - "name": "fuzzy_search", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSqlVersionListResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create sql version", - "consumes": [ - "application/json" - ], - "tags": [ - "sql_version" - ], - "summary": "创建SQL版本记录", - "operationId": "createSqlVersionV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "create sql version request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateSqlVersionReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/CreateSqlVersionResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_versions/{sql_version_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql version detail", - "tags": [ - "sql_version" - ], - "summary": "获取SQL版本详情", - "operationId": "getSqlVersionDetailV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSqlVersionDetailResV1" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete sql version", - "tags": [ - "sql_version" - ], - "summary": "删除SQL版本", - "operationId": "deleteSqlVersionV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update sql version", - "tags": [ - "sql_version" - ], - "summary": "更新SQL版本信息", - "operationId": "updateSqlVersionV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - }, - { - "description": "update sql version request", - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/UpdateSqlVersionReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_versions/{sql_version_id}/batch_execute_workflows": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "batch execute workflows", - "tags": [ - "sql_version" - ], - "summary": "工单批量上线", - "operationId": "batchExecuteWorkflowsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - }, - { - "description": "batch execute workflows request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/BatchExecuteWorkflowsReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_versions/{sql_version_id}/batch_release_workflows": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "batch release workflow", - "tags": [ - "sql_version" - ], - "summary": "批量发布工单(在版本的下一阶段创建工单)", - "operationId": "batchReleaseWorkflowsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - }, - { - "description": "batch release workflow request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/BatchReleaseWorkflowReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_versions/{sql_version_id}/lock": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "lock sql version", - "tags": [ - "sql_version" - ], - "summary": "锁定SQL版本", - "operationId": "lockSqlVersionV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - }, - { - "description": "lock sql version request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/LockSqlVersionReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_versions/{sql_version_id}/sql_version_stages/{sql_version_stage_id}/associate_workflows": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflows that can be associated to version", - "tags": [ - "sql_version" - ], - "summary": "获取可与版本关联的工单", - "operationId": "GetWorkflowsThatCanBeAssociatedToVersionV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version stage id", - "name": "sql_version_stage_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowsThatCanBeAssociatedToVersionResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "batch associate workflows with version", - "tags": [ - "sql_version" - ], - "summary": "批量关联工单到版本", - "operationId": "batchAssociateWorkflowsWithVersionV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version stage id", - "name": "sql_version_stage_id", - "in": "path", - "required": true - }, - { - "description": "batch associate workflows with version request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/BatchAssociateWorkflowsWithVersionReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/sql_versions/{sql_version_id}/sql_version_stages/{sql_version_stage_id}/dependencies": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get dependencies between stage instance", - "tags": [ - "sql_version" - ], - "summary": "获取当前阶段与下一阶段实例的依赖信息", - "operationId": "getDependenciesBetweenStageInstanceV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version id", - "name": "sql_version_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql version stage id", - "name": "sql_version_stage_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetDepBetweenStageInstanceResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/audit_plans": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "statistic audit plan", - "tags": [ - "statistic" - ], - "summary": "获取各类型数据源上的扫描任务数量", - "operationId": "statisticAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/StatisticAuditPlanResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/audited_sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "statistics audited sql", - "tags": [ - "statistic" - ], - "summary": "获取审核SQL总数,以及触发审核规则的SQL数量", - "operationId": "statisticsAuditedSQLV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/StatisticsAuditedSQLResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/instance_health": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance health", - "tags": [ - "statistic" - ], - "summary": "获取各类型数据源的健康情况", - "operationId": "GetInstanceHealthV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetInstanceHealthResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/optimization_performance_improve_overview": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get db optimization performance improvements", - "tags": [ - "sql_optimization" - ], - "summary": "获取实例性能提升概览", - "operationId": "getDBPerformanceImproveOverview", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetDBPerformanceImproveOverviewResp" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/optimization_record_overview": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql optimization record overview", - "tags": [ - "sql_optimization" - ], - "summary": "获取SQL优化记录概览", - "operationId": "getOptimizationOverview", - "parameters": [ - { - "type": "string", - "description": "create time from", - "name": "filter_create_time_from", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "create time to", - "name": "filter_create_time_to", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetOptimizationOverviewResp" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/project_score": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get project score", - "tags": [ - "statistic" - ], - "summary": "获取项目分数", - "operationId": "GetProjectScoreV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetProjectScoreResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/risk_audit_plans": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get risk audit plan", - "tags": [ - "statistic" - ], - "summary": "获取扫描任务报告评分低于60的扫描任务", - "operationId": "getRiskAuditPlanV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRiskAuditPlanResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/risk_workflow": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "statistic risk workflow", - "tags": [ - "statistic" - ], - "summary": "获取存在风险的工单", - "operationId": "statisticRiskWorkflowV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/StatisticRiskWorkflowResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/role_user": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get role user count", - "tags": [ - "statistic" - ], - "summary": "获取各角色类型对应的成员数量", - "operationId": "getRoleUserCountV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRoleUserCountResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistic/workflow_status": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "statistic workflow status", - "tags": [ - "statistic" - ], - "summary": "获取项目下工单各个状态的数量", - "operationId": "statisticWorkflowStatusV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowStatusCountResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get project statistics", - "tags": [ - "statistic" - ], - "summary": "获取项目统计信息", - "operationId": "getProjectStatisticsV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetProjectStatisticsResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/task_groups": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create tasks group.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "task" - ], - "summary": "创建审核任务组", - "operationId": "createAuditTasksV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "parameters for creating audit tasks group", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateAuditTasksGroupReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/CreateAuditTasksGroupResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/tasks/audits": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create and audit a task, you can upload sql content in three ways, any one can be used, but only one is effective.\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "task" - ], - "summary": "创建Sql扫描任务并提交审核", - "operationId": "createAndAuditTaskV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "schema of instance", - "name": "instance_schema", - "in": "formData" - }, - { - "type": "boolean", - "description": "enable backup", - "name": "enable_backup", - "in": "formData" - }, - { - "type": "integer", - "description": "backup max rows", - "name": "backup_max_rows", - "in": "formData" - }, - { - "type": "string", - "description": "sqls for audit", - "name": "sql", - "in": "formData" - }, - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "formData" - }, - { - "type": "file", - "description": "input SQL file", - "name": "input_sql_file", - "in": "formData" - }, - { - "type": "file", - "description": "input mybatis XML file", - "name": "input_mybatis_xml_file", - "in": "formData" - }, - { - "type": "file", - "description": "input ZIP file", - "name": "input_zip_file", - "in": "formData" - }, - { - "type": "string", - "description": "exec mode", - "name": "exec_mode", - "in": "formData" - }, - { - "type": "string", - "description": "file order method", - "name": "file_order_method", - "in": "formData" - }, - { - "description": "create and audit task", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateAuditTaskReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditTaskResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/workflow_template": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow template detail; query by workflow_template_id or by workflow_type default template", - "tags": [ - "workflow" - ], - "summary": "获取审批流程模板详情", - "operationId": "getWorkflowTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "enum": [ - "workflow", - "data_export" - ], - "type": "string", - "description": "filter workflow type", - "name": "workflow_type", - "in": "query" - }, - { - "type": "integer", - "description": "workflow template id", - "name": "workflow_template_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowTemplateResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/workflow_template/{workflow_type}/": { - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update the workflow template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "更新Sql审批流程模板", - "operationId": "updateWorkflowTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "enum": [ - "workflow", - "data_export" - ], - "type": "string", - "description": "workflow type", - "name": "workflow_type", - "in": "path", - "required": true - }, - { - "description": "create workflow template", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateWorkflowTemplateReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflow_templates": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow template list", - "tags": [ - "workflow" - ], - "summary": "获取审批流程模板列表", - "operationId": "getWorkflowTemplateListV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "enum": [ - "workflow", - "data_export" - ], - "type": "string", - "description": "filter workflow type", - "name": "workflow_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowTemplateListResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create workflow template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "创建审批流程模板", - "operationId": "createWorkflowTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "create workflow template", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateWorkflowTemplateReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowTemplateResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/workflow_templates/{workflow_template_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow template by id", - "tags": [ - "workflow" - ], - "summary": "根据ID获取审批流程模板详情", - "operationId": "getWorkflowTemplateByIdV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "workflow template id", - "name": "workflow_template_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowTemplateResV1" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete workflow template by id", - "tags": [ - "workflow" - ], - "summary": "删除审批流程模板", - "operationId": "deleteWorkflowTemplateV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "workflow template id", - "name": "workflow_template_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update workflow template by id", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "根据ID更新审批流程模板", - "operationId": "updateWorkflowTemplateByIdV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "workflow template id", - "name": "workflow_template_id", - "in": "path", - "required": true - }, - { - "description": "update workflow template", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateWorkflowTemplateByIdReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow list", - "tags": [ - "workflow" - ], - "summary": "获取工单列表", - "operationId": "getWorkflowsV1", - "parameters": [ - { - "type": "string", - "description": "filter subject", - "name": "filter_subject", - "in": "query" - }, - { - "type": "string", - "description": "filter by workflow_id", - "name": "filter_workflow_id", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search by workflow description", - "name": "fuzzy_search_workflow_desc", - "in": "query" - }, - { - "type": "string", - "description": "filter create time from", - "name": "filter_create_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter create time to", - "name": "filter_create_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter_task_execute_start_time_from", - "name": "filter_task_execute_start_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter_task_execute_start_time_to", - "name": "filter_task_execute_start_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter create user id", - "name": "filter_create_user_id", - "in": "query" - }, - { - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "executing", - "canceled", - "exec_failed", - "finished" - ], - "type": "string", - "description": "filter workflow status", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "filter current step assignee user id", - "name": "filter_current_step_assignee_user_id", - "in": "query" - }, - { - "type": "string", - "description": "filter instance id", - "name": "filter_task_instance_id", - "in": "query" - }, - { - "type": "string", - "description": "filter sql version id", - "name": "filter_sql_version_id", - "in": "query" - }, - { - "type": "integer", - "description": "filter workflow template id", - "name": "filter_workflow_template_id", - "in": "query" - }, - { - "type": "string", - "description": "filter by ops type dictionary item uid; empty means no filter", - "name": "filter_by_ops_type_uid", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy matching subject/workflow_id", - "name": "fuzzy_keyword", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowsResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create workflow", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "创建工单", - "operationId": "createWorkflowV1", - "deprecated": true, - "parameters": [ - { - "description": "create workflow request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateWorkflowReqV1" - } - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/auto_create_and_execute": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "auto create task group, audit SQL, create workflow, approve and execute workflow (sys user only)", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "自动创建工单、审核SQL、审批和上线工单(仅sys用户)", - "operationId": "autoCreateAndExecuteWorkflowV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instances JSON array", - "name": "instances", - "in": "formData", - "required": true - }, - { - "enum": [ - "sql_file", - "sqls" - ], - "type": "string", - "description": "exec mode", - "name": "exec_mode", - "in": "formData" - }, - { - "type": "string", - "description": "file order method", - "name": "file_order_method", - "in": "formData" - }, - { - "type": "string", - "description": "sqls for audit", - "name": "sql", - "in": "formData" - }, - { - "type": "string", - "description": "workflow subject", - "name": "workflow_subject", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "workflow description", - "name": "desc", - "in": "formData" - }, - { - "type": "file", - "description": "input SQL file", - "name": "input_sql_file", - "in": "formData" - }, - { - "type": "file", - "description": "input mybatis XML file", - "name": "input_mybatis_xml_file", - "in": "formData" - }, - { - "type": "file", - "description": "input ZIP file", - "name": "input_zip_file", - "in": "formData" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/AutoCreateAndExecuteWorkflowResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/cancel": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "batch cancel workflows", - "tags": [ - "workflow" - ], - "summary": "批量取消工单", - "operationId": "batchCancelWorkflowsV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "batch cancel workflows request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/BatchCancelWorkflowsReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/complete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "this api will directly change the work order status to finished without real online operation", - "tags": [ - "workflow" - ], - "summary": "批量完成工单", - "operationId": "batchCompleteWorkflowsV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "batch complete workflows request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/BatchCompleteWorkflowsReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/exports": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "export workflow as CSV or Excel", - "tags": [ - "workflow" - ], - "summary": "导出工单", - "operationId": "exportWorkflowV1", - "parameters": [ - { - "type": "string", - "description": "filter subject", - "name": "filter_subject", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search by workflow description", - "name": "fuzzy_search_workflow_desc", - "in": "query" - }, - { - "type": "string", - "description": "filter create time from", - "name": "filter_create_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter create time to", - "name": "filter_create_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter_task_execute_start_time_from", - "name": "filter_task_execute_start_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter_task_execute_start_time_to", - "name": "filter_task_execute_start_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter create user id", - "name": "filter_create_user_id", - "in": "query" - }, - { - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "executing", - "canceled", - "exec_failed", - "finished" - ], - "type": "string", - "description": "filter workflow status", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "filter current step assignee user id", - "name": "filter_current_step_assignee_user_id", - "in": "query" - }, - { - "type": "string", - "description": "filter instance id", - "name": "filter_task_instance_id", - "in": "query" - }, - { - "type": "string", - "description": "filter by ops type dictionary item uid; empty means no filter", - "name": "filter_by_ops_type_uid", - "in": "query" - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy matching subject/workflow_id/desc", - "name": "fuzzy_keyword", - "in": "query" - }, - { - "enum": [ - "csv", - "excel" - ], - "type": "string", - "description": "export format", - "name": "export_format", - "in": "query" - } - ], - "responses": { - "200": { - "description": "export workflow", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_id}/backup_sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get backup sql list", - "tags": [ - "workflow" - ], - "summary": "获取工单下所有回滚SQL的列表", - "operationId": "GetBackupSqlListV1", - "parameters": [ - { - "enum": [ - "initialized", - "doing", - "succeeded", - "failed", - "manually_executed", - "terminating", - "terminate_succeeded", - "terminate_failed", - "execute_rollback" - ], - "type": "string", - "description": "filter: exec status of task sql", - "name": "filter_exec_status", - "in": "query" - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "filter: instance id in workflow", - "name": "filter_instance_id", - "in": "query" - }, - { - "type": "string", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "page size", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BackupSqlListRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_id}/create_rollback_workflow": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create rollback workflow", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "创建回滚工单", - "operationId": "CreateRollbackWorkflow", - "parameters": [ - { - "description": "create rollback workflow request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateRollbackWorkflowReq" - } - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "origin workflow id to rollback", - "name": "workflow_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/CreateRollbackWorkflowRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/terminate": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "terminate multiple task by project and workflow", - "tags": [ - "workflow" - ], - "summary": "终止工单下多个上线任务", - "operationId": "terminateMultipleTaskByWorkflowV1", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/attachment": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow attachment", - "tags": [ - "workflow" - ], - "summary": "获取工单的task附件", - "operationId": "getWorkflowAttachment", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "get workflow attachment", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/backup_files/download": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "download SQL back up file for the audit task", - "tags": [ - "task" - ], - "summary": "下载工单中的SQL备份", - "operationId": "downloadBackupFileV1", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "sql file", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/order_file": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update sql file order", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "task" - ], - "summary": "修改文件上线顺序", - "operationId": "updateSqlFileOrderV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "description": "instance body v1.UpdateSqlFileOrderV1Req true", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateSqlFileOrderV1Req" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSqlFileOrderMethodResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/re_execute": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "re-execute task on workflow", - "tags": [ - "workflow" - ], - "summary": "单数据源SQL重新上线", - "operationId": "reExecuteTaskOnWorkflowV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "description": "re-execute task on workflow request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ReExecuteTaskOnWorkflowReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/terminate": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "execute one task on workflow", - "tags": [ - "workflow" - ], - "summary": "终止单个上线任务", - "operationId": "terminateSingleTaskByWorkflowV1", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_name}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow detail", - "tags": [ - "workflow" - ], - "summary": "获取工单详情", - "operationId": "getWorkflowV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update workflow when it is rejected to creator.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "更新工单(驳回后才可更新)", - "operationId": "updateWorkflowV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "update workflow request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateWorkflowReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_name}/cancel": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "cancel workflow", - "tags": [ - "workflow" - ], - "summary": "审批关闭(中止)", - "operationId": "cancelWorkflowV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_name}/steps/{workflow_step_id}/approve": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "approve workflow", - "tags": [ - "workflow" - ], - "summary": "审批通过", - "operationId": "approveWorkflowV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow step id", - "name": "workflow_step_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_name}/steps/{workflow_step_id}/reject": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "reject workflow", - "tags": [ - "workflow" - ], - "summary": "审批驳回", - "operationId": "rejectWorkflowV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow step id", - "name": "workflow_step_id", - "in": "path", - "required": true - }, - { - "description": "workflow approve request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RejectWorkflowReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_name}/tasks": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get summary of workflow instance tasks", - "tags": [ - "workflow" - ], - "summary": "获取工单数据源任务概览", - "operationId": "getSummaryOfInstanceTasksV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowTasksResV1" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_name}/tasks/execute": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "execute tasks on workflow", - "tags": [ - "workflow" - ], - "summary": "多数据源批量上线", - "operationId": "executeTasksOnWorkflowV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_name}/tasks/{task_id}/execute": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "execute one task on workflow", - "tags": [ - "workflow" - ], - "summary": "工单提交单个数据源上线", - "operationId": "executeOneTaskOnWorkflowV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/projects/{project_name}/workflows/{workflow_name}/tasks/{task_id}/schedule": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update workflow schedule.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "设置工单数据源定时上线时间(设置为空则代表取消定时时间,需要SQL审核流程都通过后才可以设置)", - "operationId": "updateWorkflowScheduleV1", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "workflow name", - "name": "workflow_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "update workflow schedule request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateWorkflowScheduleReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/rule_knowledge/db_types/{db_type}/custom_rules/{rule_name}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get custom rule knowledge", - "tags": [ - "rule_template" - ], - "summary": "查看自定义规则知识库", - "operationId": "getCustomRuleKnowledgeV1", - "parameters": [ - { - "type": "string", - "description": "rule name", - "name": "rule_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "db type of rule", - "name": "db_type", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRuleKnowledgeResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update custom rule knowledge", - "tags": [ - "rule_template" - ], - "summary": "更新自定义规则知识库", - "operationId": "updateCustomRuleKnowledge", - "parameters": [ - { - "type": "string", - "description": "rule name", - "name": "rule_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "db type of rule", - "name": "db_type", - "in": "path", - "required": true - }, - { - "description": "update rule knowledge", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateRuleKnowledgeReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/rule_knowledge/db_types/{db_type}/rules/{rule_name}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get rule knowledge", - "tags": [ - "rule_template" - ], - "summary": "查看规则知识库", - "operationId": "getRuleKnowledgeV1", - "parameters": [ - { - "type": "string", - "description": "rule name", - "name": "rule_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "db type of rule", - "name": "db_type", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRuleKnowledgeResV1" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update rule knowledge", - "tags": [ - "rule_template" - ], - "summary": "更新规则知识库", - "operationId": "updateRuleKnowledge", - "parameters": [ - { - "type": "string", - "description": "rule name", - "name": "rule_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "db type of rule", - "name": "db_type", - "in": "path", - "required": true - }, - { - "description": "update rule knowledge", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateRuleKnowledgeReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/rule_template_tips": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global rule template tips", - "tags": [ - "rule_template" - ], - "summary": "获取全局规则模板提示", - "operationId": "getRuleTemplateTipsV1", - "parameters": [ - { - "type": "string", - "description": "filter db type", - "name": "filter_db_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRuleTemplateTipsResV1" - } - } - } - } - }, - "/v1/rule_templates": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get all global rule template", - "tags": [ - "rule_template" - ], - "summary": "全局规则模板列表", - "operationId": "getRuleTemplateListV1", - "parameters": [ - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRuleTemplatesResV1" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create a global rule template", - "consumes": [ - "application/json" - ], - "tags": [ - "rule_template" - ], - "summary": "添加全局规则模板", - "operationId": "createRuleTemplateV1", - "parameters": [ - { - "description": "add rule template request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateRuleTemplateReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/rule_templates/parse": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "parse rule template", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "rule_template" - ], - "summary": "解析规则模板文件", - "operationId": "importProjectRuleTemplateV1", - "parameters": [ - { - "enum": [ - "csv", - "json" - ], - "type": "string", - "description": "file type", - "name": "file_type", - "in": "formData", - "required": true - }, - { - "type": "file", - "description": "SQLE rule template file", - "name": "rule_template_file", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/ParseProjectRuleTemplateFileResV1" - } - }, - "400": { - "description": "return error file", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/rule_templates/{rule_template_name}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global rule template", - "tags": [ - "rule_template" - ], - "summary": "获取全局规则模板信息", - "operationId": "getRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy rule,keyword for desc and annotation", - "name": "fuzzy_keyword_rule", - "in": "query" - }, - { - "type": "string", - "description": "tags for rule", - "name": "tags", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRuleTemplateResV1" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete global rule template", - "tags": [ - "rule_template" - ], - "summary": "删除全局规则模板", - "operationId": "deleteRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update global rule template", - "tags": [ - "rule_template" - ], - "summary": "更新全局规则模板", - "operationId": "updateRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - }, - { - "description": "update rule template request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateRuleTemplateReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/rule_templates/{rule_template_name}/clone": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "clone a rule template", - "consumes": [ - "application/json" - ], - "tags": [ - "rule_template" - ], - "summary": "克隆全局规则模板", - "operationId": "CloneRuleTemplateV1", - "parameters": [ - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - }, - { - "description": "clone rule template request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CloneRuleTemplateReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/rule_templates/{rule_template_name}/export": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "export rule template", - "tags": [ - "rule_template" - ], - "summary": "导出全局规则模板", - "operationId": "exportRuleTemplateV1", - "parameters": [ - { - "enum": [ - "csv", - "json" - ], - "type": "string", - "description": "export type", - "name": "export_type", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "rule template name", - "name": "rule_template_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "sqle rule template file", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/rules": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get all rule template", - "tags": [ - "rule_template" - ], - "summary": "规则列表", - "operationId": "getRuleListV1", - "parameters": [ - { - "type": "string", - "description": "filter db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy rule,keyword for desc and annotation", - "name": "fuzzy_keyword_rule", - "in": "query" - }, - { - "type": "string", - "description": "filter global rule template name", - "name": "filter_global_rule_template_name", - "in": "query" - }, - { - "type": "string", - "description": "filter rule name list", - "name": "filter_rule_names", - "in": "query" - }, - { - "type": "integer", - "description": "filter rule version", - "name": "filter_rule_version", - "in": "query" - }, - { - "type": "string", - "description": "filter tags", - "name": "tags", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRulesResV1" - } - } - } - } - }, - "/v1/rules/categoryStatistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get all rule category statistics", - "tags": [ - "rule_template" - ], - "summary": "获取规则分类统计信息", - "operationId": "getCategoryStatistics", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRuleCategoryStatisticResV1" - } - } - } - } - }, - "/v1/rules_version_tips": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get the rule versions contained in plugins", - "tags": [ - "rule_template" - ], - "summary": "获取插件包含的规则版本", - "operationId": "GetDriverRuleVersionTips", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetDriverRuleVersionTipsResV1" - } - } - } - } - }, - "/v1/sql_analysis": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Direct get sql analysis result", - "tags": [ - "sql_analysis" - ], - "summary": "直接获取SQL分析结果", - "operationId": "directGetSQLAnalysisV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "schema name", - "name": "schema_name", - "in": "query" - }, - { - "type": "string", - "description": "sql", - "name": "sql", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DirectGetSQLAnalysisResV1" - } - } - } - } - }, - "/v1/sql_audit": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Direct audit sql", - "tags": [ - "sql_audit" - ], - "summary": "直接审核SQL", - "operationId": "directAuditV1", - "deprecated": true, - "parameters": [ - { - "description": "sqls that should be audited", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/DirectAuditReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DirectAuditResV1" - } - } - } - } - }, - "/v1/sql_lineage_analysis": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Analyze SQL and return column-level lineage", - "tags": [ - "sql_analysis" - ], - "summary": "SQL列级血缘分析", - "operationId": "sqlLineageAnalyzeV1", - "parameters": [ - { - "description": "sql lineage analyze request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SQLLineageAnalyzeReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/SQLLineageAnalyzeResV1" - } - } - } - } - }, - "/v1/statistic/instances/resource_overview_statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance overview statistics including average score, high priority SQL count and pending workflow count", - "tags": [ - "statistic" - ], - "summary": "获取实例概览统计信息", - "operationId": "getInstanceOverviewStatisticsV1", - "parameters": [ - { - "type": "array", - "items": { - "type": "string" - }, - "description": "filter by db service ids", - "name": "filter_by_db_service_ids", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetInstanceOverviewStatisticsRes" - } - } - } - } - }, - "/v1/statistic/instances/sql_average_execution_time": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get average execution time of sql", - "tags": [ - "statistic" - ], - "summary": "获取sql上线平均耗时,按平均耗时降序排列", - "operationId": "getSqlAverageExecutionTimeV1", - "parameters": [ - { - "type": "integer", - "description": "the limit of result item number", - "name": "limit", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSqlAverageExecutionTimeResV1" - } - } - } - } - }, - "/v1/statistic/instances/sql_execution_fail_percent": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql execution fail percent", - "tags": [ - "statistic" - ], - "summary": "获取SQL上线失败率,按失败率降序排列", - "operationId": "getSqlExecutionFailPercentV1", - "parameters": [ - { - "type": "integer", - "description": "the limit of result item number", - "name": "limit", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSqlExecutionFailPercentResV1" - } - } - } - } - }, - "/v1/statistic/instances/type_percent": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get database instances' types percent", - "tags": [ - "statistic" - ], - "summary": "获取数据源类型百分比", - "operationId": "getInstancesTypePercentV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetInstancesTypePercentResV1" - } - } - } - } - }, - "/v1/statistic/license/usage": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get usage of license", - "tags": [ - "statistic" - ], - "summary": "获取License使用情况", - "operationId": "getLicenseUsageV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetLicenseUsageResV1" - } - } - } - } - }, - "/v1/statistic/workflows/audit_pass_percent": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow audit pass percent", - "tags": [ - "statistic" - ], - "summary": "获取工单审核通过率", - "operationId": "getWorkflowAuditPassPercentV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowAuditPassPercentResV1" - } - } - } - } - }, - "/v1/statistic/workflows/counts": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow counts", - "tags": [ - "statistic" - ], - "summary": "获取工单数量统计数据", - "operationId": "getWorkflowCountV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowCountsResV1" - } - } - } - } - }, - "/v1/statistic/workflows/duration_of_waiting_for_audit": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get duration from workflow being created to audited", - "tags": [ - "statistic" - ], - "summary": "获取工单从创建到审核结束的平均时长", - "operationId": "getWorkflowDurationOfWaitingForAuditV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowDurationOfWaitingForAuditResV1" - } - } - } - } - }, - "/v1/statistic/workflows/duration_of_waiting_for_execution": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get duration from workflow being created to executed", - "tags": [ - "statistic" - ], - "summary": "获取工单各从审核完毕到执行上线的平均时长", - "operationId": "getWorkflowDurationOfWaitingForExecutionV1", - "deprecated": true, - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowDurationOfWaitingForExecutionResV1" - } - } - } - } - }, - "/v1/statistic/workflows/each_day_counts": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get counts of created workflow each day", - "tags": [ - "statistic" - ], - "summary": "获取每天工单创建数量", - "operationId": "getWorkflowCreatedCountEachDayV1", - "parameters": [ - { - "type": "string", - "description": "filter date from.(format:yyyy-mm-dd)", - "name": "filter_date_from", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "filter date to.(format:yyyy-mm-dd)", - "name": "filter_date_to", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowCreatedCountsEachDayResV1" - } - } - } - } - }, - "/v1/statistic/workflows/instance_type_percent": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflows percent counted by instance type", - "tags": [ - "statistic" - ], - "summary": "获取按数据源类型统计的工单百分比", - "operationId": "getWorkflowPercentCountedByInstanceTypeV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowPercentCountedByInstanceTypeResV1" - } - } - } - } - }, - "/v1/statistic/workflows/pass_percent": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow pass percent", - "tags": [ - "statistic" - ], - "summary": "获取工单通过率", - "operationId": "getWorkflowPassPercentV1", - "deprecated": true, - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowPassPercentResV1" - } - } - } - } - }, - "/v1/statistic/workflows/rejected_percent_group_by_creator": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflows rejected percent group by creator. The result will be sorted by rejected percent in descending order", - "tags": [ - "statistic" - ], - "summary": "获取各个用户提交的工单驳回率,按驳回率降序排列", - "operationId": "getWorkflowRejectedPercentGroupByCreatorV1", - "parameters": [ - { - "type": "integer", - "description": "the limit of result item number", - "name": "limit", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowRejectedPercentGroupByCreatorResV1" - } - } - } - } - }, - "/v1/statistic/workflows/rejected_percent_group_by_instance": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow rejected percent group by instance. The result will be sorted by rejected percent in descending order", - "tags": [ - "statistic" - ], - "summary": "获取各个数据源相关的工单驳回率,按驳回率降序排列", - "operationId": "getWorkflowRejectedPercentGroupByInstanceV1", - "deprecated": true, - "parameters": [ - { - "type": "integer", - "description": "the limit of result item number", - "name": "limit", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowRejectedPercentGroupByInstanceResV1" - } - } - } - } - }, - "/v1/statistic/workflows/status_count": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get count of workflow status", - "tags": [ - "statistic" - ], - "summary": "获取各种状态工单的数量", - "operationId": "getWorkflowStatusCountV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowStatusCountResV1" - } - } - } - } - }, - "/v1/system/module_red_dots": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get the red dot prompt information in the system", - "tags": [ - "system" - ], - "summary": "查询系统各模块的红点提示信息", - "operationId": "GetSystemModuleRedDots", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSystemModuleRedDotsRes" - } - } - } - } - }, - "/v1/system/module_status": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get module status for module in the system", - "tags": [ - "system" - ], - "summary": "查询系统功能支持情况信息", - "operationId": "getSystemModuleStatus", - "parameters": [ - { - "enum": [ - "MySQL", - "Oracle", - "TiDB", - "OceanBase For MySQL", - "PostgreSQL", - "DB2", - "SQL Server" - ], - "type": "string", - "description": "db type", - "name": "db_type", - "in": "query" - }, - { - "enum": [ - "execute_sql_file_mode", - "sql_optimization", - "backup", - "knowledge_base" - ], - "type": "string", - "description": "module name", - "name": "module_name", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetModuleStatusResV1" - } - } - } - } - }, - "/v1/task_groups/audit": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "audit task group.\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.\n4. file[input_zip_file]: it is zip file, sql will be parsed from it.", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "task" - ], - "summary": "审核任务组", - "operationId": "auditTaskGroupIdV1", - "parameters": [ - { - "type": "integer", - "description": "group id of tasks", - "name": "task_group_id", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "sqls for audit", - "name": "sql", - "in": "formData" - }, - { - "type": "boolean", - "description": "enable backup", - "name": "enable_backup", - "in": "formData" - }, - { - "type": "integer", - "description": "backup max rows", - "name": "backup_max_rows", - "in": "formData" - }, - { - "type": "string", - "description": "file order method", - "name": "file_order_method", - "in": "formData" - }, - { - "type": "file", - "description": "input SQL file", - "name": "input_sql_file", - "in": "formData" - }, - { - "type": "file", - "description": "input mybatis XML file", - "name": "input_mybatis_xml_file", - "in": "formData" - }, - { - "type": "file", - "description": "input ZIP file", - "name": "input_zip_file", - "in": "formData" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/AuditTaskGroupResV1" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get task", - "tags": [ - "task" - ], - "summary": "获取Sql扫描任务信息", - "operationId": "getAuditTaskV1", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditTaskResV1" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/backup_strategy": { - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update back up strategy for all sqls in task", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "更新工单中数据源对应所有SQL的备份策略", - "operationId": "UpdateTaskBackupStrategyV1", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "description": "update back up strategy for sqls in workflow", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateTaskBackupStrategyReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/origin_file": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get SQL origin file of the audit task", - "tags": [ - "task" - ], - "summary": "获取指定审核任务的原始文件", - "operationId": "DownloadAuditFile", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sql_content": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get SQL content for the audit task", - "tags": [ - "task" - ], - "summary": "获取指定扫描任务的SQL内容", - "operationId": "getAuditTaskSQLContentV1", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditTaskSQLContentResV1" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sql_file": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "download SQL file for the audit task", - "tags": [ - "task" - ], - "summary": "下载指定扫描任务的SQL文件", - "operationId": "downloadAuditTaskSQLFileV1", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "sql file", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sql_report": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "download report file of all SQLs information belong to the specified audit task", - "tags": [ - "task" - ], - "summary": "下载指定扫描任务的SQLs信息报告", - "operationId": "downloadAuditTaskSQLReportV1", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "select unique (fingerprint and audit result) for task sql", - "name": "no_duplicate", - "in": "query" - } - ], - "responses": { - "200": { - "description": "sql report csv file", - "schema": { - "type": "file" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get information of all SQLs belong to the specified audit task", - "tags": [ - "task" - ], - "summary": "获取指定扫描任务的SQLs信息", - "operationId": "getAuditTaskSQLsV1", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "enum": [ - "initialized", - "doing", - "succeeded", - "failed", - "manually_executed", - "execute_rollback" - ], - "type": "string", - "description": "filter: exec status of task sql", - "name": "filter_exec_status", - "in": "query" - }, - { - "enum": [ - "initialized", - "doing", - "finished" - ], - "type": "string", - "description": "filter: audit status of task sql", - "name": "filter_audit_status", - "in": "query" - }, - { - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "type": "string", - "description": "filter: audit level of task sql", - "name": "filter_audit_level", - "in": "query" - }, - { - "type": "boolean", - "description": "select unique (fingerprint and audit result) for task sql", - "name": "no_duplicate", - "in": "query" - }, - { - "type": "string", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "page size", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditTaskSQLsResV1" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sqls/{number}": { - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "modify the relevant information of a certain SQL in the audit task", - "consumes": [ - "application/json" - ], - "tags": [ - "task" - ], - "summary": "修改扫描任务中某条SQL的相关信息", - "operationId": "updateAuditTaskSQLsV1", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql number", - "name": "number", - "in": "path", - "required": true - }, - { - "description": "modify the relevant information of a certain SQL in the audit task", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateAuditTaskSQLsReqV1" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sqls/{number}/analysis": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get SQL explain and related table metadata for analysis", - "tags": [ - "task" - ], - "summary": "获取task相关的SQL执行计划和表元数据", - "operationId": "getTaskAnalysisData", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "sql number", - "name": "number", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetTaskAnalysisDataResV1" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sqls/{number}/rewrite": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "启动特定任务中某条SQL语句的异步重写任务,返回任务状态", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "task" - ], - "summary": "启动异步SQL重写任务", - "operationId": "RewriteSQL", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "sql number", - "name": "number", - "in": "path", - "required": true - }, - { - "description": "request body", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RewriteSQLReq" - } - } - ], - "responses": { - "200": { - "description": "成功启动异步重写任务", - "schema": { - "$ref": "#/definitions/AsyncRewriteTaskStatusRes" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sqls/{number}/rewrite/status": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取特定任务中某条SQL语句的异步重写任务状态", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "task" - ], - "summary": "获取异步重写任务状态", - "operationId": "GetAsyncRewriteTaskStatus", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "sql number", - "name": "number", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "成功返回任务状态", - "schema": { - "$ref": "#/definitions/AsyncRewriteTaskStatusRes" - } - } - } - } - }, - "/v1/tasks/audits/{task_id}/sqls/{sql_id}/backup_strategy": { - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update back up strategy for one sql in workflow", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "更新单条SQL的备份策略", - "operationId": "UpdateSqlBackupStrategyV1", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql id", - "name": "sql_id", - "in": "path", - "required": true - }, - { - "description": "update back up strategy for one sql in workflow", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateSqlBackupStrategyReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v1/tasks/file_order_methods": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get file order method", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "task" - ], - "summary": "获取文件上线排序方式", - "operationId": "getSqlFileOrderMethodV1", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSqlFileOrderMethodResV1" - } - } - } - } - }, - "/v1/user_tips": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get user tip list", - "tags": [ - "user" - ], - "summary": "获取用户提示列表", - "operationId": "getUserTipListV1", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "filter_project", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetUserTipsResV1" - } - } - } - } - }, - "/v1/workflows/statistic_of_instances": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Get Workflows Statistic Of Instances", - "tags": [ - "workflow" - ], - "summary": "获取实例上工单的统计信息", - "operationId": "GetWorkflowStatisticOfInstances", - "parameters": [ - { - "type": "string", - "description": "instance id", - "name": "instance_id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowStatisticOfInstancesResV1" - } - } - } - } - }, - "/v2/audit_files": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Direct audit sql from SQL files and MyBatis files", - "tags": [ - "sql_audit" - ], - "summary": "直接从文件内容提取SQL并审核,SQL文件暂时只支持一次解析一个文件", - "operationId": "directAuditFilesV2", - "parameters": [ - { - "description": "files that should be audited", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/DirectAuditFileReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DirectAuditResV2" - } - } - } - } - }, - "/v2/configurations/drivers": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get drivers", - "tags": [ - "configuration" - ], - "summary": "获取当前 server 支持的审核类型", - "operationId": "getDriversV2", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetDriversRes" - } - } - } - } - }, - "/v2/dashboard/accounts": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global account list with filtering and pagination.\nPagination: page_index is 1-based; offset is (page_index-1)*page_size. Values of page_index less than 1 are normalized to 1; page_size less than 1 may fall back to a default on the server.", - "tags": [ - "GlobalDashboard" - ], - "summary": "获取全局账号管理列表", - "operationId": "GetGlobalAccountListV2", - "parameters": [ - { - "type": "integer", - "description": "1-based page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "Number of items per page", - "name": "page_size", - "in": "query", - "required": true - }, - { - "enum": [ - "expiring_soon", - "active" - ], - "type": "string", - "description": "filter by card; expiring_soon 即将过期, active 我的可用账号", - "name": "filter_card", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search keyword", - "name": "keyword", - "in": "query" - }, - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_instance_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GlobalAccountListResV2" - } - } - } - } - }, - "/v2/dashboard/accounts/statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global account statistics;", - "tags": [ - "GlobalDashboard" - ], - "summary": "获取全局账号管理统计数据", - "operationId": "GetGlobalAccountStatisticsV2", - "parameters": [ - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_instance_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GlobalAccountStatisticsResV2" - } - } - } - } - }, - "/v2/dashboard/sql_manage/statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global sql manage statistics;", - "tags": [ - "GlobalDashboard" - ], - "summary": "获取全局 SQL 治理统计看板", - "operationId": "GetGlobalSqlManageStatisticsV2", - "parameters": [ - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_instance_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GlobalSqlManageStatisticsResV2" - } - } - } - } - }, - "/v2/dashboard/sql_manage/tasks": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global sql manage task list with filtering and pagination.\nPagination: 1-based page_index with offset (page_index-1)*page_size; page_index and page_size are required query parameters (non-zero).", - "tags": [ - "GlobalDashboard" - ], - "summary": "获取全局 SQL 治理任务列表", - "operationId": "GetGlobalSqlManageTaskListV2", - "parameters": [ - { - "type": "integer", - "description": "1-based page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "Number of items per page", - "name": "page_size", - "in": "query", - "required": true - }, - { - "enum": [ - "pending", - "optimized" - ], - "type": "string", - "description": "filter by card; pending 待我优化, optimized 优化完成", - "name": "filter_card", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search keyword", - "name": "keyword", - "in": "query" - }, - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_instance_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GlobalSqlManageTaskListResV2" - } - } - } - } - }, - "/v2/dashboard/workflows": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global workflow list with filtering and pagination.\nPagination uses two mutually exclusive modes. Aggregate mode (omit workflow_type): merge sql_release and data_export ordered by time; use cursor (empty on first request, then data.next_cursor from the previous response) and page_size; page_index is not used for paging. Single-type mode (workflow_type set): list only that type with standard page_index (1-based) and page_size; cursor is ignored. Do not rely on mixing cursor tokens with workflow_type in one flow.", - "tags": [ - "GlobalDashboard" - ], - "summary": "获取全局工单管理列表", - "operationId": "GetGlobalWorkflowListV2", - "parameters": [ - { - "type": "string", - "description": "Aggregate mode only (omit workflow_type): opaque cursor string; leave empty on the first request, then pass the previous response's data.next_cursor. Ignored when workflow_type is set.", - "name": "cursor", - "in": "query" - }, - { - "type": "integer", - "description": "Page size; required in both aggregate and single-type modes.", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "Single-type mode only (workflow_type set): 1-based page index. When workflow_type is omitted, this value is ignored for pagination (use cursor instead).", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "fuzzy search keyword", - "name": "keyword", - "in": "query" - }, - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "archived", - "pending_for_me", - "initiated_by_me", - "view_all" - ], - "type": "string", - "description": "filter by card type; archived 已完成工单, pending_for_me 待我处理, initiated_by_me 我发起, view_all 查看全部", - "name": "filter_card", - "in": "query" - }, - { - "enum": [ - "sql_release", - "data_export" - ], - "type": "string", - "description": "filter by workflow type; sql_release SQL上线工单, data_export 数据导出工单", - "name": "workflow_type", - "in": "query" - }, - { - "enum": [ - "pending_approval", - "pending_action", - "in_progress", - "exporting", - "rejected", - "cancelled", - "failed", - "completed", - "unknown" - ], - "type": "string", - "description": "filter by unified workflow status; intersects with the card status set, applied to both sql_release and data_export workflows", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "filter by update time from", - "name": "filter_update_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter by update time to", - "name": "filter_update_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter by create user id", - "name": "filter_create_user_id", - "in": "query" - }, - { - "type": "string", - "description": "filter create time from", - "name": "filter_create_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter create time to", - "name": "filter_create_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter by ops type dictionary item uid; empty means no filter; applies to sql_release and data_export", - "name": "filter_by_ops_type_uid", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GlobalWorkflowListResV2" - } - } - } - } - }, - "/v2/dashboard/workflows/exports": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "export global dashboard workflows as CSV or Excel; filter/permission semantics match GET /v2/dashboard/workflows (no pagination). workflow_type=sql_release|data_export|omit(common columns with workflow type). First column includes project name for global layouts. Max 10000 workflows (sum of both types when workflow_type omitted).", - "tags": [ - "GlobalDashboard" - ], - "summary": "导出全局工单管理列表", - "operationId": "ExportGlobalWorkflowsV2", - "parameters": [ - { - "type": "string", - "description": "fuzzy search keyword", - "name": "keyword", - "in": "query" - }, - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "archived", - "pending_for_me", - "initiated_by_me", - "view_all" - ], - "type": "string", - "description": "filter by card type; archived 已完成工单, pending_for_me 待我处理, initiated_by_me 我发起, view_all 查看全部", - "name": "filter_card", - "in": "query" - }, - { - "enum": [ - "sql_release", - "data_export" - ], - "type": "string", - "description": "sql_release SQL上线完整列; data_export 数据导出列; omit/empty 全量公共列(含工单类型)", - "name": "workflow_type", - "in": "query" - }, - { - "enum": [ - "pending_approval", - "pending_action", - "in_progress", - "exporting", - "rejected", - "cancelled", - "failed", - "completed", - "unknown" - ], - "type": "string", - "description": "filter by unified workflow status", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "filter by update time from", - "name": "filter_update_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter by update time to", - "name": "filter_update_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter by create user id", - "name": "filter_create_user_id", - "in": "query" - }, - { - "type": "string", - "description": "filter create time from", - "name": "filter_create_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter create time to", - "name": "filter_create_time_to", - "in": "query" - }, - { - "type": "string", - "description": "filter by ops type dictionary item uid; empty means no filter; applies to sql_release and data_export; same semantics as GET /v2/dashboard/workflows", - "name": "filter_by_ops_type_uid", - "in": "query" - }, - { - "enum": [ - "csv", - "excel" - ], - "type": "string", - "description": "export format: csv or excel, default csv", - "name": "export_format", - "in": "query" - } - ], - "responses": { - "200": { - "description": "export workflow", - "schema": { - "type": "file" - } - } - } - } - }, - "/v2/dashboard/workflows/statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get global workflow statistics, returns archived, pending_for_me, initiated_by_me, and view_all counts", - "tags": [ - "GlobalDashboard" - ], - "summary": "获取全局工单管理统计数据", - "operationId": "GetGlobalWorkflowStatisticsV2", - "parameters": [ - { - "type": "string", - "description": "filter by project uid", - "name": "filter_project_uid", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_instance_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GlobalWorkflowStatisticsResV2" - } - } - } - } - }, - "/v2/projects/{project_name}/audit_plans": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan info list", - "tags": [ - "audit_plan" - ], - "summary": "获取扫描任务信息列表", - "operationId": "getAuditPlansV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "filter audit plan db type", - "name": "filter_audit_plan_db_type", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search audit plan name", - "name": "fuzzy_search_audit_plan_name", - "in": "query" - }, - { - "type": "string", - "description": "filter audit plan type", - "name": "filter_audit_plan_type", - "in": "query" - }, - { - "type": "string", - "description": "filter audit plan instance name", - "name": "filter_audit_plan_instance_name", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditPlansResV2" - } - } - } - } - }, - "/v2/projects/{project_name}/audit_plans/{audit_plan_id}/sqls/upload": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "upload intance audit plan SQLs", - "tags": [ - "instance_audit_plan" - ], - "summary": "同步SQL到扫描任务", - "operationId": "UploadInstanceAuditPlanSQLsV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan id", - "name": "audit_plan_id", - "in": "path", - "required": true - }, - { - "description": "upload instance audit plan SQLs request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UploadInstanceAuditPlanSQLsReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit plan report SQLs", - "tags": [ - "audit_plan" - ], - "summary": "获取指定扫描任务的SQL扫描详情", - "operationId": "getAuditPlanReportsSQLs", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan report id", - "name": "audit_plan_report_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditPlanReportSQLsResV2" - } - } - } - } - }, - "/v2/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls/{number}/analysis": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get SQL explain and related table metadata for analysis", - "tags": [ - "audit_plan" - ], - "summary": "获取task相关的SQL执行计划和表元数据", - "operationId": "getAuditPlantAnalysisDataV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan report id", - "name": "audit_plan_report_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql number", - "name": "number", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditPlanAnalysisDataResV2" - } - } - } - } - }, - "/v2/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/full": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "full sync audit plan SQLs", - "tags": [ - "audit_plan" - ], - "summary": "全量同步SQL到扫描任务", - "operationId": "fullSyncAuditPlanSQLsV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "description": "full sync audit plan SQLs request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/FullSyncAuditPlanSQLsReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/partial": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "partial sync audit plan SQLs", - "tags": [ - "audit_plan" - ], - "summary": "增量同步SQL到扫描任务", - "operationId": "partialSyncAuditPlanSQLsV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "audit plan name", - "name": "audit_plan_name", - "in": "path", - "required": true - }, - { - "description": "partial sync audit plan SQLs request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PartialSyncAuditPlanSQLsReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/instance_audit_plans": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance audit plan info list", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取实例扫描任务列表", - "operationId": "getInstanceAuditPlansV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "filter by environment tag", - "name": "filter_by_environment_tag", - "in": "query" - }, - { - "type": "string", - "description": "filter by db type", - "name": "filter_by_db_type", - "in": "query" - }, - { - "type": "string", - "description": "filter by instance id", - "name": "filter_by_instance_id", - "in": "query" - }, - { - "type": "string", - "description": "filter instance audit plan type", - "name": "filter_by_audit_plan_type", - "in": "query" - }, - { - "type": "string", - "description": "filter instance audit plan active status", - "name": "filter_by_active_status", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search", - "name": "fuzzy_search", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetInstanceAuditPlansRes" - } - } - } - } - }, - "/v2/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance audit plan detail", - "tags": [ - "instance_audit_plan" - ], - "summary": "获取实例扫描任务详情", - "operationId": "getInstanceAuditPlanDetailV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance audit plan id", - "name": "instance_audit_plan_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetInstanceAuditPlanDetailRes" - } - } - } - } - }, - "/v2/projects/{project_name}/instance_tips": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance tip list", - "tags": [ - "instance" - ], - "summary": "获取实例提示列表", - "operationId": "getInstanceTipListV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "filter db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "filter by environment tag", - "name": "filter_by_environment_tag", - "in": "query" - }, - { - "type": "string", - "description": "filter workflow template id", - "name": "filter_workflow_template_id", - "in": "query" - }, - { - "enum": [ - "create_audit_plan", - "create_workflow", - "sql_manage", - "create_optimization", - "create_pipeline", - "create_version", - "view_sql_insight" - ], - "type": "string", - "description": "functional module", - "name": "functional_module", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetInstanceTipsResV2" - } - } - } - } - }, - "/v2/projects/{project_name}/instances/{instance_name}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get instance db", - "tags": [ - "instance" - ], - "summary": "获取实例信息", - "operationId": "getInstanceV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetInstanceResV2" - } - } - } - } - }, - "/v2/projects/{project_name}/sql_manages": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql manage list", - "tags": [ - "SqlManage" - ], - "summary": "获取管控sql列表", - "operationId": "GetSqlManageListV2", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy search sql fingerprint", - "name": "fuzzy_search_sql_fingerprint", - "in": "query" - }, - { - "type": "string", - "description": "assignee", - "name": "filter_assignee", - "in": "query" - }, - { - "type": "string", - "description": "instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "audit_plan", - "sql_audit_record" - ], - "type": "string", - "description": "source", - "name": "filter_source", - "in": "query" - }, - { - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "type": "string", - "description": "audit level", - "name": "filter_audit_level", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time from", - "name": "filter_last_audit_start_time_from", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time to", - "name": "filter_last_audit_start_time_to", - "in": "query" - }, - { - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited", - "sent" - ], - "type": "string", - "description": "status", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "rule name", - "name": "filter_rule_name", - "in": "query" - }, - { - "type": "string", - "description": "db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "filter by business", - "name": "filter_business", - "in": "query" - }, - { - "type": "string", - "description": "filter by environment tag", - "name": "filter_by_environment_tag", - "in": "query" - }, - { - "enum": [ - "high", - "low" - ], - "type": "string", - "description": "priority", - "name": "filter_priority", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search endpoint", - "name": "fuzzy_search_endpoint", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search schema name", - "name": "fuzzy_search_schema_name", - "in": "query" - }, - { - "enum": [ - "first_appear_timestamp", - "last_receive_timestamp", - "fp_count" - ], - "type": "string", - "description": "sort field", - "name": "sort_field", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "sort order", - "name": "sort_order", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSqlManageListResp" - } - } - } - } - }, - "/v2/projects/{project_name}/sql_manages/exports": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "export sql manage as CSV or Excel", - "tags": [ - "SqlManage" - ], - "summary": "导出SQL管控", - "operationId": "exportSqlManageV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy search sql fingerprint", - "name": "fuzzy_search_sql_fingerprint", - "in": "query" - }, - { - "type": "string", - "description": "assignee", - "name": "filter_assignee", - "in": "query" - }, - { - "type": "string", - "description": "filter by environment tag", - "name": "filter_by_environment_tag", - "in": "query" - }, - { - "enum": [ - "high", - "low" - ], - "type": "string", - "description": "priority", - "name": "filter_priority", - "in": "query" - }, - { - "type": "string", - "description": "instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "audit_plan", - "sql_audit_record" - ], - "type": "string", - "description": "source", - "name": "filter_source", - "in": "query" - }, - { - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "type": "string", - "description": "audit level", - "name": "filter_audit_level", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time from", - "name": "filter_last_audit_start_time_from", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time to", - "name": "filter_last_audit_start_time_to", - "in": "query" - }, - { - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited" - ], - "type": "string", - "description": "status", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "rule name", - "name": "filter_rule_name", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search endpoint", - "name": "fuzzy_search_endpoint", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search schema name", - "name": "fuzzy_search_schema_name", - "in": "query" - }, - { - "enum": [ - "first_appear_timestamp", - "last_receive_timestamp", - "fp_count" - ], - "type": "string", - "description": "sort field", - "name": "sort_field", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "sort order", - "name": "sort_order", - "in": "query" - }, - { - "enum": [ - "csv", - "excel" - ], - "type": "string", - "description": "export format", - "name": "export_format", - "in": "query" - } - ], - "responses": { - "200": { - "description": "export sql manage", - "schema": { - "type": "file" - } - } - } - } - }, - "/v2/projects/{project_name}/sql_optimization_records": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql optimization records", - "tags": [ - "sql_optimization" - ], - "summary": "获取SQL优化记录列表", - "operationId": "GetOptimizationRecordsV2", - "parameters": [ - { - "type": "string", - "description": "fuzzy search for optimization_id or create_username", - "name": "fuzzy_search", - "in": "query" - }, - { - "type": "string", - "description": "filter instance name", - "name": "filter_instance_name", - "in": "query" - }, - { - "type": "string", - "description": "filter create time from", - "name": "filter_create_time_from", - "in": "query" - }, - { - "type": "string", - "description": "filter create time to", - "name": "filter_create_time_to", - "in": "query" - }, - { - "enum": [ - "optimizing", - "failed", - "finish" - ], - "type": "string", - "description": "filter status", - "name": "filter_status", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetOptimizationRecordsRes" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "optimize sql\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.\n4. file[input_zip_file]: it is ZIP file that sql will be parsed from xml or sql file inside it.\n5. formData[git_http_url]:the url which scheme is http(s) and end with .git.\n6. formData[git_user_name]:The name of the user who owns the repository read access.\n7. formData[git_user_password]:The password corresponding to git_user_name.", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sql_optimization" - ], - "summary": "优化SQL", - "operationId": "SQLOptimizeV2", - "parameters": [ - { - "description": "sqls that should be optimization", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/OptimizeSQLReq" - } - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "instance name", - "name": "instance_name", - "in": "formData" - }, - { - "type": "string", - "description": "schema of instance", - "name": "schema_name", - "in": "formData" - }, - { - "type": "string", - "description": "db type of instance", - "name": "db_type", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "optimization name", - "name": "optimization_name", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "sqls for audit", - "name": "sql_content", - "in": "formData" - }, - { - "type": "string", - "description": "explain info", - "name": "explain_info", - "in": "formData" - }, - { - "type": "string", - "description": "metadata", - "name": "metadata", - "in": "formData" - }, - { - "type": "boolean", - "description": "enable high analysis", - "name": "enable_high_analysis", - "in": "formData" - }, - { - "type": "file", - "description": "input SQL file", - "name": "input_sql_file", - "in": "formData" - }, - { - "type": "file", - "description": "input ZIP file", - "name": "input_zip_file", - "in": "formData" - }, - { - "type": "file", - "description": "input mybatis XML file", - "name": "input_mybatis_xml_file", - "in": "formData" - }, - { - "type": "string", - "description": "git repository url", - "name": "git_http_url", - "in": "formData" - }, - { - "type": "string", - "description": "the name of user to clone the repository", - "name": "git_user_name", - "in": "formData" - }, - { - "type": "string", - "description": "the password corresponding to git_user_name", - "name": "git_user_password", - "in": "formData" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/OptimizeSQLRes" - } - } - } - } - }, - "/v2/projects/{project_name}/sql_optimization_records/{optimization_record_id}/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql optimization record", - "tags": [ - "sql_optimization" - ], - "summary": "获取SQL优化语句详情", - "operationId": "GetOptimizationSQLDetailV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql optimization record id", - "name": "optimization_record_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetOptimizationDetailRes" - } - } - } - } - }, - "/v2/projects/{project_name}/sql_optimization_records/{optimization_record_id}/feedback": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "add optimized sql feedback", - "consumes": [ - "application/json" - ], - "tags": [ - "sql_optimization" - ], - "summary": "添加SQL优化语句反馈", - "operationId": "AddOptimizedSQLFeedback", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql optimization record id", - "name": "optimization_record_id", - "in": "path", - "required": true - }, - { - "description": "add optimized sql feedback req", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/OptimizedSQLFeedbackReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/sql_optimization_records/{optimization_record_id}/feedback/{feedback_id}/": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "delete optimized sql feedback", - "tags": [ - "sql_optimization" - ], - "summary": "删除SQL优化语句反馈", - "operationId": "DeleteOptimizedSQLFeedback", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql optimization record id", - "name": "optimization_record_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "feedback id", - "name": "feedback_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update optimized sql feedback", - "consumes": [ - "application/json" - ], - "tags": [ - "sql_optimization" - ], - "summary": "更新SQL优化语句反馈", - "operationId": "UpdateOptimizedSQLFeedback", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "sql optimization record id", - "name": "optimization_record_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "feedback id", - "name": "feedback_id", - "in": "path", - "required": true - }, - { - "description": "update optimized sql feedback req", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateOptimizedSQLFeedbackReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "create workflow", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "创建工单", - "operationId": "createWorkflowV2", - "parameters": [ - { - "description": "create workflow request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateWorkflowReqV2" - } - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/CreateWorkflowResV2" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/cancel": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "batch cancel workflows", - "tags": [ - "workflow" - ], - "summary": "批量取消工单", - "operationId": "batchCancelWorkflowsV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "batch cancel workflows request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/BatchCancelWorkflowsReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/complete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "this api will directly change the work order status to finished without real online operation", - "tags": [ - "workflow" - ], - "summary": "批量完成工单", - "operationId": "batchCompleteWorkflowsV2", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "batch complete workflows request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/BatchCompleteWorkflowsReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/{workflow_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get workflow detail", - "tags": [ - "workflow" - ], - "summary": "获取工单详情", - "operationId": "getWorkflowV2", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowResV2" - } - } - } - }, - "patch": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update workflow when it is rejected to creator.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "更新工单(工单被驳回、工单被关闭、执行成功、执行失败后才可更新)", - "operationId": "updateWorkflowV2", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "update workflow request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateWorkflowReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/{workflow_id}/cancel": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "cancel workflow", - "tags": [ - "workflow" - ], - "summary": "审批关闭(中止)", - "operationId": "cancelWorkflowV2", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/{workflow_id}/steps/{workflow_step_id}/approve": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "approve workflow", - "tags": [ - "workflow" - ], - "summary": "审批通过", - "operationId": "approveWorkflowV2", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow step id", - "name": "workflow_step_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "workflow approve request", - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/ApproveWorkflowReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/{workflow_id}/steps/{workflow_step_id}/reject": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "reject workflow", - "tags": [ - "workflow" - ], - "summary": "审批驳回", - "operationId": "rejectWorkflowV2", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "workflow step id", - "name": "workflow_step_id", - "in": "path", - "required": true - }, - { - "description": "workflow approve request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RejectWorkflowReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/{workflow_id}/tasks": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get summary of workflow instance tasks", - "tags": [ - "workflow" - ], - "summary": "获取工单数据源任务概览", - "operationId": "getSummaryOfInstanceTasksV2", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetWorkflowTasksResV2" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/{workflow_id}/tasks/execute": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "execute tasks on workflow", - "tags": [ - "workflow" - ], - "summary": "多数据源批量上线", - "operationId": "executeTasksOnWorkflowV2", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/execute": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "execute one task on workflow", - "tags": [ - "workflow" - ], - "summary": "工单提交单个数据源上线", - "operationId": "executeOneTaskOnWorkflowV2", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v2/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/schedule": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "update workflow schedule.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "workflow" - ], - "summary": "设置工单数据源定时上线时间(设置为空则代表取消定时时间,需要SQL审核流程都通过后才可以设置)", - "operationId": "updateWorkflowScheduleV2", - "parameters": [ - { - "type": "string", - "description": "workflow id", - "name": "workflow_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "update workflow schedule request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateWorkflowScheduleReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - }, - "/v2/sql_audit": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "Direct audit sql", - "tags": [ - "sql_audit" - ], - "summary": "直接审核SQL", - "operationId": "directAuditV2", - "parameters": [ - { - "description": "sqls that should be audited", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/DirectAuditReqV2" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DirectAuditResV2" - } - } - } - } - }, - "/v2/tasks/audits/{task_id}/files": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit task file list", - "tags": [ - "task" - ], - "summary": "获取审核任务文件概览列表", - "operationId": "getAuditFileList", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "page size", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditFileListRes" - } - } - } - } - }, - "/v2/tasks/audits/{task_id}/files/{file_id}/": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get audit task file execute statistic", - "tags": [ - "task" - ], - "summary": "获取审核任务文件执行概览", - "operationId": "getAuditFileExecStatistic", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "file id", - "name": "file_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditFileExecStatisticRes" - } - } - } - } - }, - "/v2/tasks/audits/{task_id}/sqls": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get information of all SQLs belong to the specified audit task", - "tags": [ - "task" - ], - "summary": "获取指定扫描任务的SQLs信息", - "operationId": "getAuditTaskSQLsV2", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "enum": [ - "initialized", - "doing", - "succeeded", - "failed", - "manually_executed", - "terminating", - "terminate_succeeded", - "terminate_failed", - "execute_rollback", - "not_executed" - ], - "type": "string", - "description": "filter: exec status of task sql", - "name": "filter_exec_status", - "in": "query" - }, - { - "enum": [ - "initialized", - "doing", - "finished" - ], - "type": "string", - "description": "filter: audit status of task sql", - "name": "filter_audit_status", - "in": "query" - }, - { - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "type": "string", - "description": "filter: audit level of task sql", - "name": "filter_audit_level", - "in": "query" - }, - { - "type": "boolean", - "description": "select unique (fingerprint and audit result) for task sql", - "name": "no_duplicate", - "in": "query" - }, - { - "type": "integer", - "description": "filter: audit file id of task", - "name": "filter_audit_file_id", - "in": "query" - }, - { - "type": "string", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "page size", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAuditTaskSQLsResV2" - } - } - } - } - }, - "/v2/tasks/audits/{task_id}/sqls/{number}/analysis": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get SQL explain and related table metadata for analysis", - "tags": [ - "task" - ], - "summary": "获取task相关的SQL执行计划和表元数据", - "operationId": "getTaskAnalysisDataV2", - "parameters": [ - { - "type": "string", - "description": "task id", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "sql number", - "name": "number", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "whether to calculate and return affected rows, default is true", - "name": "affectRowsEnabled", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetTaskAnalysisDataResV2" - } - } - } - } - }, - "/v3/projects/{project_name}/sql_manages": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "get sql manage list", - "tags": [ - "SqlManage" - ], - "summary": "获取SQL管控列表", - "operationId": "GetSqlManageListV3", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "fuzzy search sql fingerprint", - "name": "fuzzy_search_sql_fingerprint", - "in": "query" - }, - { - "type": "string", - "description": "assignee", - "name": "filter_assignee", - "in": "query" - }, - { - "type": "string", - "description": "instance id", - "name": "filter_instance_id", - "in": "query" - }, - { - "enum": [ - "audit_plan", - "sql_audit_record" - ], - "type": "string", - "description": "source", - "name": "filter_source", - "in": "query" - }, - { - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "type": "string", - "description": "audit level", - "name": "filter_audit_level", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time from", - "name": "filter_last_audit_start_time_from", - "in": "query" - }, - { - "type": "string", - "description": "last audit start time to", - "name": "filter_last_audit_start_time_to", - "in": "query" - }, - { - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited", - "sent" - ], - "type": "string", - "description": "status", - "name": "filter_status", - "in": "query" - }, - { - "type": "string", - "description": "rule name", - "name": "filter_rule_name", - "in": "query" - }, - { - "type": "string", - "description": "db type", - "name": "filter_db_type", - "in": "query" - }, - { - "type": "string", - "description": "filter by name of environment tag", - "name": "filter_by_environment_tag", - "in": "query" - }, - { - "enum": [ - "high", - "low" - ], - "type": "string", - "description": "priority", - "name": "filter_priority", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search endpoint", - "name": "fuzzy_search_endpoint", - "in": "query" - }, - { - "type": "string", - "description": "fuzzy search schema name", - "name": "fuzzy_search_schema_name", - "in": "query" - }, - { - "enum": [ - "first_appear_timestamp", - "last_receive_timestamp", - "fp_count" - ], - "type": "string", - "description": "sort field", - "name": "sort_field", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "sort order", - "name": "sort_order", - "in": "query" - }, - { - "type": "integer", - "description": "page index", - "name": "page_index", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "size of per page", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSqlManageListResp" - } - } - } - } - }, - "/v3/projects/{project_name}/workflows/complete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "this api will directly change the work order status to finished without real online operation", - "tags": [ - "workflow" - ], - "summary": "批量完成工单", - "operationId": "batchCompleteWorkflowsV3", - "parameters": [ - { - "type": "string", - "description": "project name", - "name": "project_name", - "in": "path", - "required": true - }, - { - "description": "batch complete workflows request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/BatchCompleteWorkflowsReqV3" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/BaseRes" - } - } - } - } - } - }, - "definitions": { - "BaseRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GlobalAccountListDataV2": { - "type": "object", - "properties": { - "accounts": { - "type": "array", - "items": { - "$ref": "#/definitions/GlobalAccountListItemV2" - } - }, - "can_manage": { - "description": "是否有管理权限", - "type": "boolean" - } - } - }, - "GlobalAccountListItemV2": { - "type": "object", - "properties": { - "account_name": { - "description": "账号名称", - "type": "string" - }, - "account_uid": { - "description": "账号ID", - "type": "string" - }, - "expired_time": { - "description": "过期时间,前端应显示剩余时间,若小于7天则需要用警告图标配合加粗红色文字警示", - "type": "string" - }, - "instance_id": { - "description": "实例ID", - "type": "string" - }, - "instance_name": { - "description": "实例名称", - "type": "string" - }, - "project_name": { - "description": "项目名称", - "type": "string" - }, - "project_uid": { - "description": "项目ID", - "type": "string" - }, - "status": { - "description": "状态展示: 活跃,临期,已过期,已锁定", - "type": "string", - "enum": [ - "active", - "expiring", - "expired", - "locked" - ] - } - } - }, - "GlobalAccountListResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/GlobalAccountListDataV2" - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GlobalAccountStatisticsData": { - "type": "object", - "properties": { - "active_account_count": { - "description": "我的可用账号卡片,展示我的可用账号数量", - "type": "integer" - }, - "expiring_soon_count": { - "description": "即将过期卡片,展示即将过期的账号数量", - "type": "integer" - } - } - }, - "GlobalAccountStatisticsResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "description": "统计数据", - "type": "object", - "$ref": "#/definitions/GlobalAccountStatisticsData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GlobalSqlManageStatisticsResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/GlobalSqlManageStatisticsV2" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GlobalSqlManageStatisticsV2": { - "type": "object", - "properties": { - "optimized_this_week_count": { - "description": "优化完成卡片,展示历史优化完成的SQL数量", - "type": "integer" - }, - "pending_sql_count": { - "description": "待我优化卡片,展示需要我处理的SQL数量", - "type": "integer" - } - } - }, - "GlobalSqlManageTaskItemV2": { - "type": "object", - "properties": { - "avg_time": { - "description": "平均耗时(秒),来自采集 info;无慢日志等指标时 JSON 为 null(非 0)", - "type": "number" - }, - "count": { - "description": "执行频次;info 中无 counter 等时为 null(非 0)", - "type": "integer" - }, - "instance_id": { - "description": "实例ID", - "type": "string" - }, - "instance_name": { - "description": "实例名称", - "type": "string" - }, - "last_seen_at": { - "description": "最后一次捕捉时间", - "type": "string" - }, - "project_name": { - "description": "项目名称", - "type": "string" - }, - "project_uid": { - "description": "项目ID", - "type": "string" - }, - "source": { - "description": "来源,如:慢日志、库表元数据等,根据数据源id和项目id跳转到智能扫描详情", - "type": "string" - }, - "sql_fingerprint": { - "description": "SQL 指纹", - "type": "string" - }, - "status": { - "description": "SQL治理任务状态:待处理,已优化,已忽略,人工审核中,已分配", - "type": "string", - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited", - "sent" - ] - }, - "suggestion": { - "description": "管理员派单备注;无备注时为空字符串", - "type": "string" - } - } - }, - "GlobalSqlManageTaskListResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/GlobalSqlManageTaskItemV2" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GlobalWorkflowListData": { - "type": "object", - "properties": { - "has_more": { - "description": "是否还有更多数据", - "type": "boolean" - }, - "next_cursor": { - "description": "游标分页:下一页游标", - "type": "string" - }, - "total_nums": { - "description": "总条数", - "type": "integer" - }, - "workflows": { - "description": "工单列表", - "type": "array", - "items": { - "$ref": "#/definitions/GlobalWorkflowListItem" - } - } - } - }, - "GlobalWorkflowListItem": { - "type": "object", - "properties": { - "assignee": { - "description": "当前处理人姓名", - "type": "string" - }, - "create_user_name": { - "type": "string" - }, - "created_at": { - "description": "创建时间", - "type": "string" - }, - "current_step_assignee_user_name_list": { - "description": "当前处理人姓名列表", - "type": "array", - "items": { - "type": "string" - } - }, - "instance_id": { - "description": "实例ID", - "type": "string" - }, - "instance_name": { - "description": "实例名称", - "type": "string" - }, - "ops_type": { - "description": "OpsType 运维类型(跨项目按工单所属项目字典批量解析);未设置或字典项已删时省略", - "type": "object", - "$ref": "#/definitions/OpsType" - }, - "priority": { - "description": "High, Medium, Low", - "type": "string" - }, - "project_name": { - "description": "项目名称", - "type": "string" - }, - "project_uid": { - "description": "项目ID", - "type": "string" - }, - "status": { - "description": "工单状态", - "type": "string", - "enum": [ - "pending_approval", - "pending_action", - "in_progress", - "exporting", - "rejected", - "cancelled", - "failed", - "completed", - "unknown" - ] - }, - "updated_at": { - "description": "更新时间", - "type": "string" - }, - "workflow_desc": { - "description": "工单描述", - "type": "string" - }, - "workflow_id": { - "description": "工单ID", - "type": "string" - }, - "workflow_name": { - "description": "工单名称", - "type": "string" - }, - "workflow_type": { - "description": "工单类型", - "type": "string", - "enum": [ - "sql_release", - "data_export" - ] - } - } - }, - "GlobalWorkflowListResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/GlobalWorkflowListData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GlobalWorkflowStatisticsResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/GlobalWorkflowStatisticsV2" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GlobalWorkflowStatisticsV2": { - "type": "object", - "properties": { - "archived_count": { - "description": "已完成的工单数量", - "type": "integer" - }, - "initiated_by_me_count": { - "description": "我发起的工单数量", - "type": "integer" - }, - "pending_for_me_count": { - "description": "待我处理的工单数量", - "type": "integer" - }, - "view_all_count": { - "description": "查看全部的工单数量", - "type": "integer" - } - } - }, - "OpsType": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "uid": { - "type": "string" - } - } - }, - "AuditResultInfo": { - "type": "object", - "properties": { - "errorInfo": { - "type": "string" - }, - "message": { - "type": "string" - } - } - }, - "I18nAuditResultInfo": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/AuditResultInfo" - } - }, - "RuleCategoryStatistic": { - "type": "object", - "properties": { - "category": { - "type": "string", - "enum": [ - "audit_accuracy", - "audit_purpose", - "operand", - "sql" - ] - }, - "count": { - "type": "integer" - }, - "tag": { - "type": "string" - } - } - }, - "AdvisedIndex": { - "type": "object", - "properties": { - "has_advice": { - "type": "boolean" - }, - "indexes": { - "type": "array", - "items": { - "$ref": "#/definitions/IndexInfo" - } - }, - "other_advice": { - "type": "string" - }, - "state": { - "type": "string" - } - } - }, - "Analysis": { - "type": "object", - "properties": { - "detail": { - "type": "array", - "items": { - "$ref": "#/definitions/AnalysisDetail" - } - }, - "improvement_desc": { - "type": "string" - }, - "improvement_rate": { - "type": "number" - }, - "state": { - "type": "string" - }, - "total_score": { - "type": "number" - } - } - }, - "AnalysisDetail": { - "type": "object", - "properties": { - "category": { - "type": "string" - }, - "optimized_score": { - "type": "number" - }, - "original_score": { - "type": "number" - } - } - }, - "IndexInfo": { - "type": "object", - "properties": { - "create_index_statement": { - "type": "string" - }, - "reason": { - "type": "string" - } - } - }, - "OptimizeDetail": { - "type": "object", - "properties": { - "state": { - "type": "string" - }, - "steps": { - "type": "array", - "items": { - "$ref": "#/definitions/OptimizeStep" - } - } - } - }, - "OptimizeStep": { - "type": "object", - "properties": { - "analysis": { - "type": "object", - "$ref": "#/definitions/Analysis" - }, - "chat_id": { - "type": "string" - }, - "optimized_sql": { - "type": "string" - }, - "query_plan": { - "type": "object", - "$ref": "#/definitions/QueryPlan" - }, - "rule_desc": { - "type": "string" - }, - "rule_id": { - "type": "string" - }, - "rule_name": { - "type": "string" - } - } - }, - "QueryPlan": { - "type": "object", - "properties": { - "query_plan_desc": { - "type": "array", - "items": { - "$ref": "#/definitions/QueryPlanNode" - } - }, - "state": { - "type": "string" - } - } - }, - "QueryPlanNode": { - "type": "object", - "properties": { - "children": { - "type": "array", - "items": { - "$ref": "#/definitions/QueryPlanNode" - } - }, - "operator": { - "type": "string" - }, - "summary": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "TotalAnalysis": { - "type": "object", - "properties": { - "detail": { - "type": "array", - "items": { - "$ref": "#/definitions/AnalysisDetail" - } - }, - "improvement_desc": { - "type": "string" - }, - "improvement_rate": { - "type": "number" - }, - "state": { - "type": "string" - }, - "total_score": { - "type": "number" - } - } - }, - "AIHubBannerData": { - "type": "object", - "properties": { - "modules": { - "description": "按模块分组的Banner卡片", - "type": "array", - "items": { - "$ref": "#/definitions/AIModuleBannerCards" - } - } - } - }, - "AIHubExecutionRecord": { - "type": "object", - "properties": { - "estimated_upgrade": { - "description": "预估提升", - "type": "number" - }, - "function_module": { - "description": "功能模块", - "type": "string", - "enum": [ - "smart_correction", - "performance_engine" - ] - }, - "id": { - "description": "记录ID", - "type": "integer" - }, - "operation_time": { - "description": "操作时间", - "type": "string" - }, - "process_status": { - "description": "处理状态", - "type": "string", - "enum": [ - "pending", - "running", - "completed", - "failed" - ] - }, - "source_project": { - "description": "来源项目", - "type": "string" - }, - "sql_snippet": { - "description": "SQL片段", - "type": "string" - }, - "value_dimension": { - "description": "价值维度", - "type": "string", - "enum": [ - "security", - "performance", - "correction", - "maintenance", - "code_standard" - ] - } - } - }, - "AIHubManagementViewData": { - "type": "object", - "properties": { - "modules": { - "description": "按模块分组的分析数据", - "type": "array", - "items": { - "$ref": "#/definitions/AIModuleAnalysis" - } - } - } - }, - "AIHubStrategicValueData": { - "type": "object", - "properties": { - "ai_strategic_insight": { - "description": "AI战略洞察", - "type": "object", - "$ref": "#/definitions/AIStrategicInsight" - }, - "efficiency_cards": { - "description": "效能卡片列表", - "type": "array", - "items": { - "$ref": "#/definitions/EfficiencyCard" - } - } - } - }, - "AIModuleAnalysis": { - "type": "object", - "properties": { - "ai_module_type": { - "description": "AI模块类型", - "type": "string", - "enum": [ - "smart_correction", - "performance_engine" - ] - }, - "project_io_analysis": { - "description": "项目组投入产出分析", - "type": "array", - "items": { - "$ref": "#/definitions/ProjectIOAnalysis" - } - }, - "top_problem_distribution": { - "description": "Top问题分布", - "type": "array", - "items": { - "$ref": "#/definitions/TopProblemDistribution" - } - } - } - }, - "AIModuleBannerCards": { - "type": "object", - "properties": { - "ai_module_type": { - "description": "AI模块类型", - "type": "string", - "enum": [ - "smart_correction", - "performance_engine" - ] - }, - "banner_cards": { - "description": "Banner卡片列表", - "type": "array", - "items": { - "$ref": "#/definitions/BannerCard" - } - }, - "is_enabled": { - "description": "功能是否启用", - "type": "boolean", - "example": true - } - } - }, - "AIStrategicInsight": { - "type": "object", - "properties": { - "description": { - "description": "描述", - "type": "string" - }, - "title": { - "description": "标题", - "type": "string" - } - } - }, - "AbnormalAuditPlanInstance": { - "type": "object", - "properties": { - "abnormal_status_code": { - "type": "integer" - }, - "instance_audit_plan_id": { - "type": "integer" - }, - "instance_name": { - "type": "string", - "example": "MySQL" - }, - "token_exp": { - "type": "integer", - "example": 1747129752 - } - } - }, - "AffectRows": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "err_message": { - "type": "string" - } - } - }, - "AssociateWorkflows": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "canceled", - "exec_failed", - "executing", - "finished" - ] - }, - "workflow_id": { - "type": "string" - }, - "workflow_name": { - "type": "string" - } - } - }, - "AsyncRewriteTask": { - "type": "object", - "properties": { - "end_time": { - "description": "结束时间", - "type": "string" - }, - "error_message": { - "description": "错误信息", - "type": "string" - }, - "result": { - "description": "重写结果", - "type": "object", - "$ref": "#/definitions/RewriteSQLData" - }, - "sql_number": { - "description": "SQL编号", - "type": "string" - }, - "start_time": { - "description": "开始时间", - "type": "string" - }, - "status": { - "description": "任务状态", - "type": "string", - "enum": [ - "pending", - "running", - "completed", - "failed" - ] - }, - "task_id": { - "description": "任务ID", - "type": "string" - } - } - }, - "AsyncRewriteTaskStatusRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AsyncRewriteTask" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "AuditFileResp": { - "type": "object", - "properties": { - "file_name": { - "type": "string" - } - } - }, - "AuditPlan": { - "type": "object", - "properties": { - "audit_plan_params": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanParamReqV1" - } - }, - "audit_plan_type": { - "type": "string", - "example": "slow log" - }, - "high_priority_conditions": { - "type": "array", - "items": { - "$ref": "#/definitions/HighPriorityConditionReq" - } - }, - "need_mark_high_priority_sql": { - "type": "boolean" - }, - "rule_template_name": { - "type": "string", - "example": "default_MySQL" - } - } - }, - "AuditPlanCount": { - "type": "object", - "properties": { - "audit_plan_count": { - "type": "integer" - }, - "audit_plan_desc": { - "type": "string" - }, - "audit_plan_type": { - "type": "string" - } - } - }, - "AuditPlanMetaV1": { - "type": "object", - "properties": { - "audit_plan_params": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanParamResV1" - } - }, - "audit_plan_type": { - "type": "string" - }, - "audit_plan_type_desc": { - "type": "string" - }, - "audit_plan_type_tips": { - "type": "string" - }, - "high_priority_conditions": { - "type": "array", - "items": { - "$ref": "#/definitions/HighPriorityConditionResV1" - } - }, - "instance_type": { - "type": "string" - } - } - }, - "AuditPlanParamReqV1": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "AuditPlanParamResV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "enums_value": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumsValueResV1" - } - }, - "key": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "string", - "int", - "bool", - "password" - ] - }, - "value": { - "type": "string" - } - } - }, - "AuditPlanReportResV1": { - "type": "object", - "properties": { - "audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error", - "" - ] - }, - "audit_plan_report_id": { - "type": "string", - "example": "1" - }, - "audit_plan_report_timestamp": { - "type": "string", - "example": "RFC3339" - }, - "pass_rate": { - "type": "number" - }, - "score": { - "type": "integer" - } - } - }, - "AuditPlanReportSQLResV1": { - "type": "object", - "properties": { - "audit_plan_report_sql": { - "type": "string", - "example": "select * from t1 where id = 1" - }, - "audit_plan_report_sql_audit_result": { - "type": "string", - "example": "same format as task audit result" - }, - "number": { - "type": "integer", - "example": 1 - } - } - }, - "AuditPlanRes": { - "type": "object", - "properties": { - "audit_plan_params": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanParamResV1" - } - }, - "audit_plan_type": { - "type": "object", - "$ref": "#/definitions/AuditPlanTypeResBase" - }, - "high_priority_conditions": { - "type": "array", - "items": { - "$ref": "#/definitions/HighPriorityConditionResV1" - } - }, - "need_mark_high_priority_sql": { - "type": "boolean" - }, - "rule_template_name": { - "type": "string", - "example": "default_MySQL" - } - } - }, - "AuditPlanResV1": { - "type": "object", - "properties": { - "audit_plan_cron": { - "type": "string", - "example": "0 */2 * * *" - }, - "audit_plan_db_type": { - "type": "string", - "example": "mysql" - }, - "audit_plan_instance_database": { - "type": "string", - "example": "app1" - }, - "audit_plan_instance_name": { - "type": "string", - "example": "test_mysql" - }, - "audit_plan_meta": { - "type": "object", - "$ref": "#/definitions/AuditPlanMetaV1" - }, - "audit_plan_name": { - "type": "string", - "example": "audit_for_java_app1" - }, - "audit_plan_token": { - "type": "string", - "example": "it's a JWT Token for scanner" - }, - "rule_template_name": { - "type": "string", - "example": "default_MySQL" - } - } - }, - "AuditPlanRuleTemplate": { - "type": "object", - "properties": { - "is_global_rule_template": { - "type": "boolean" - }, - "name": { - "type": "string" - } - } - }, - "AuditPlanSQLDataResV1": { - "type": "object", - "properties": { - "rows": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - }, - "AuditPlanSQLHeadV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "field_name": { - "type": "string" - }, - "sortable": { - "type": "boolean" - }, - "type": { - "type": "string", - "enum": [ - "sql" - ] - } - } - }, - "AuditPlanSQLMetaResV1": { - "type": "object", - "properties": { - "filter_meta_list": { - "type": "array", - "items": { - "$ref": "#/definitions/FilterMeta" - } - }, - "head": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanSQLHeadV1" - } - } - } - }, - "AuditPlanSQLReqV1": { - "type": "object", - "properties": { - "audit_plan_sql_counter": { - "type": "string", - "example": "6" - }, - "audit_plan_sql_fingerprint": { - "type": "string", - "example": "select * from t1 where id = ?" - }, - "audit_plan_sql_last_receive_text": { - "type": "string", - "example": "select * from t1 where id = 1" - }, - "audit_plan_sql_last_receive_timestamp": { - "type": "string", - "example": "RFC3339" - }, - "audit_plan_sql_schema": { - "type": "string", - "example": "db1" - }, - "db_user": { - "type": "string", - "example": "database_user001" - }, - "endpoint": { - "type": "string", - "example": "10.186.1.2" - }, - "first_query_at": { - "type": "string", - "example": "2023-09-12T02:48:01.317880Z" - }, - "query_time_avg": { - "type": "number", - "example": 3.22 - }, - "query_time_max": { - "type": "number", - "example": 5.22 - } - } - }, - "AuditPlanSQLResV1": { - "type": "object", - "properties": { - "head": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanSQLHeadV1" - } - }, - "rows": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - }, - "AuditPlanTypeResBase": { - "type": "object", - "properties": { - "active_status": { - "type": "string", - "enum": [ - "normal", - "disabled" - ] - }, - "audit_plan_id": { - "type": "integer" - }, - "desc": { - "type": "string" - }, - "last_collection_status": { - "type": "string", - "enum": [ - "normal", - "abnormal" - ] - }, - "token": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "AuditPlanTypesV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "instance_type": { - "type": "string", - "enum": [ - "MySQL", - "Oracle", - "TiDB", - "OceanBase For MySQL", - "" - ] - }, - "type": { - "type": "string" - } - } - }, - "AuditResDataV1": { - "type": "object", - "properties": { - "audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error", - "" - ] - }, - "pass_rate": { - "type": "number" - }, - "score": { - "type": "integer" - }, - "sql_results": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditSQLResV1" - } - } - } - }, - "AuditResult": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "error_info": { - "type": "string" - }, - "execution_failed": { - "type": "boolean", - "example": false - }, - "i18n_audit_result_info": { - "type": "object", - "$ref": "#/definitions/I18nAuditResultInfo" - }, - "level": { - "type": "string", - "example": "warn" - }, - "message": { - "type": "string", - "example": "避免使用不必要的内置函数md5()" - }, - "rule_name": { - "type": "string" - } - } - }, - "AuditSQLResV1": { - "type": "object", - "properties": { - "audit_level": { - "type": "string" - }, - "audit_result": { - "type": "string" - }, - "exec_sql": { - "type": "string" - }, - "number": { - "type": "integer" - } - } - }, - "AuditTaskGroupRes": { - "type": "object", - "properties": { - "task_group_id": { - "type": "integer" - }, - "tasks": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditTaskResV1" - } - } - } - }, - "AuditTaskGroupResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AuditTaskGroupRes" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "AuditTaskResV1": { - "type": "object", - "properties": { - "audit_files": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditFileResp" - } - }, - "audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error", - "" - ] - }, - "backup_conflict_with_instance": { - "description": "当数据源备份开启,工单备份关闭,则需要提示审核人工单备份策略与数据源备份策略不一致", - "type": "boolean" - }, - "backup_max_rows": { - "type": "integer" - }, - "enable_backup": { - "type": "boolean" - }, - "exec_end_time": { - "type": "string" - }, - "exec_fail_reason": { - "type": "string" - }, - "exec_fail_sql_count": { - "type": "integer" - }, - "exec_fail_sql_id": { - "type": "integer" - }, - "exec_fail_sql_number": { - "type": "integer" - }, - "exec_fail_stage": { - "type": "string" - }, - "exec_mode": { - "type": "string" - }, - "exec_start_time": { - "type": "string" - }, - "file_order_method": { - "type": "string" - }, - "instance_db_type": { - "type": "string" - }, - "instance_name": { - "type": "string" - }, - "instance_schema": { - "type": "string", - "example": "db1" - }, - "pass_rate": { - "type": "number" - }, - "score": { - "type": "integer" - }, - "sql_source": { - "type": "string", - "enum": [ - "form_data", - "sql_file", - "mybatis_xml_file", - "audit_plan", - "zip_file", - "git_repository" - ] - }, - "status": { - "type": "string", - "enum": [ - "initialized", - "audited", - "executing", - "exec_success", - "exec_failed", - "manually_executed" - ] - }, - "task_id": { - "type": "integer" - } - } - }, - "AuditTaskSQLContentResV1": { - "type": "object", - "properties": { - "sql": { - "type": "string", - "example": "alter table tb1 drop columns c1" - } - } - }, - "AuditTaskSQLResV1": { - "type": "object", - "properties": { - "audit_level": { - "type": "string" - }, - "audit_result": { - "type": "string" - }, - "audit_status": { - "type": "string" - }, - "description": { - "type": "string" - }, - "exec_result": { - "type": "string" - }, - "exec_sql": { - "type": "string" - }, - "exec_status": { - "type": "string" - }, - "number": { - "type": "integer" - }, - "rollback_sqls": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "AuditTasksGroupResV1": { - "type": "object", - "properties": { - "task_group_id": { - "type": "integer" - } - } - }, - "AuditWhitelistResV1": { - "type": "object", - "properties": { - "audit_whitelist_id": { - "type": "integer" - }, - "desc": { - "type": "string" - }, - "last_match_time": { - "type": "string" - }, - "match_type": { - "type": "string" - }, - "matched_count": { - "type": "integer" - }, - "value": { - "type": "string" - } - } - }, - "AuditedSQLCount": { - "type": "object", - "properties": { - "risk_sql_count": { - "type": "integer" - }, - "total_sql_count": { - "type": "integer" - } - } - }, - "AutoCreateAndExecuteWorkflowResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AutoCreateAndExecuteWorkflowResV1Data" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "AutoCreateAndExecuteWorkflowResV1Data": { - "type": "object", - "properties": { - "workflow_id": { - "type": "string" - }, - "workflow_status": { - "type": "string" - } - } - }, - "BackupSqlData": { - "type": "object", - "properties": { - "backup_result": { - "type": "string" - }, - "backup_sqls": { - "type": "array", - "items": { - "type": "string" - } - }, - "backup_status": { - "type": "string", - "enum": [ - "waiting_for_execution", - "executing", - "failed", - "succeed" - ] - }, - "backup_strategy": { - "type": "string", - "enum": [ - "none", - "manual", - "reverse_sql", - "original_row" - ] - }, - "description": { - "type": "string" - }, - "exec_order": { - "type": "integer" - }, - "exec_sql_id": { - "type": "integer" - }, - "exec_status": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "instance_name": { - "type": "string" - }, - "origin_sql": { - "type": "string" - }, - "origin_task_id": { - "type": "integer" - } - } - }, - "BackupSqlListRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/BackupSqlData" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "BannerCard": { - "type": "object", - "properties": { - "evidence_value": { - "description": "具体指标分值", - "type": "string", - "example": "22" - }, - "metric_evaluation": { - "description": "效能评价", - "type": "string", - "example": "高危风险消除率 79%" - }, - "need_display": { - "description": "是否需要展示", - "type": "boolean", - "example": true - } - } - }, - "BatchAssociateWorkflowsWithVersionReqV1": { - "type": "object", - "properties": { - "workflow_ids": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "BatchCancelWorkflowsReqV1": { - "type": "object", - "properties": { - "workflow_names": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "BatchCheckInstanceConnectionsReqV1": { - "type": "object", - "properties": { - "instances": { - "type": "array", - "items": { - "$ref": "#/definitions/InstanceForCheckConnection" - } - } - } - }, - "BatchCompleteWorkflowsReqV1": { - "type": "object", - "properties": { - "workflow_names": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "BatchExecuteWorkflowsReqV1": { - "type": "object", - "properties": { - "workflow_ids": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "BatchGetInstanceConnectionsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/InstanceConnectionResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "BatchReleaseWorkflowReqV1": { - "type": "object", - "properties": { - "release_workflows": { - "type": "array", - "items": { - "$ref": "#/definitions/ReleaseWorkflows" - } - } - } - }, - "BatchUpdateSqlManageReq": { - "type": "object", - "properties": { - "assignees": { - "type": "array", - "items": { - "type": "string" - } - }, - "priority": { - "type": "string", - "enum": [ - "", - "high" - ] - }, - "remark": { - "type": "string" - }, - "sql_manage_id_list": { - "type": "array", - "items": { - "type": "integer" - } - }, - "status": { - "type": "string", - "enum": [ - "solved", - "ignored", - "manual_audited" - ] - } - } - }, - "BlacklistResV1": { - "type": "object", - "properties": { - "blacklist_id": { - "type": "integer" - }, - "content": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "last_match_time": { - "type": "string" - }, - "matched_count": { - "type": "integer" - }, - "type": { - "type": "string", - "enum": [ - "sql", - "fp_sql", - "ip", - "cidr", - "host", - "instance" - ] - } - } - }, - "ChartPoint": { - "type": "object", - "properties": { - "info": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "status": { - "type": "integer" - }, - "x": { - "type": "string" - }, - "y": { - "type": "number" - } - } - }, - "CheckLicenseResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "content": { - "type": "string" - }, - "license": { - "type": "array", - "items": { - "$ref": "#/definitions/LicenseItem" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "CloneProjectRuleTemplateReqV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "new_rule_template_name": { - "type": "string" - } - } - }, - "CloneRuleTemplateReqV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "new_rule_template_name": { - "type": "string" - } - } - }, - "CodingConfigurationV1": { - "type": "object", - "properties": { - "coding_url": { - "type": "string" - }, - "is_coding_enabled": { - "type": "boolean" - } - } - }, - "CodingResp": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - } - }, - "CompanyNotice": { - "type": "object", - "properties": { - "notice_str": { - "type": "string" - } - } - }, - "CreatInstanceAuditPlanRes": { - "type": "object", - "properties": { - "instance_audit_plan_id": { - "type": "string" - } - } - }, - "CreatInstanceAuditPlanResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/CreatInstanceAuditPlanRes" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "CreateAuditPlanReqV1": { - "type": "object", - "properties": { - "audit_plan_cron": { - "type": "string", - "example": "0 */2 * * *" - }, - "audit_plan_instance_database": { - "type": "string", - "example": "app1" - }, - "audit_plan_instance_name": { - "type": "string", - "example": "test_mysql" - }, - "audit_plan_instance_type": { - "type": "string", - "example": "mysql" - }, - "audit_plan_name": { - "type": "string", - "example": "audit_plan_for_java_repo_1" - }, - "audit_plan_params": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanParamReqV1" - } - }, - "audit_plan_type": { - "type": "string", - "example": "slow log" - }, - "rule_template_name": { - "type": "string", - "example": "default_MySQL" - } - } - }, - "CreateAuditTaskReqV1": { - "type": "object", - "properties": { - "backup_max_rows": { - "type": "integer" - }, - "enable_backup": { - "type": "boolean" - }, - "exec_mode": { - "type": "string", - "enum": [ - "sql_file", - "sqls" - ] - }, - "file_order_method": { - "type": "string" - }, - "instance_name": { - "type": "string", - "example": "inst_1" - }, - "instance_schema": { - "type": "string", - "example": "db1" - }, - "rule_template_name": { - "type": "string" - }, - "sql": { - "type": "string", - "example": "alter table tb1 drop columns c1" - } - } - }, - "CreateAuditTasksGroupReqV1": { - "type": "object", - "properties": { - "exec_mode": { - "type": "string", - "enum": [ - "sql_file", - "sqls" - ] - }, - "file_order_method": { - "type": "string" - }, - "instances": { - "type": "array", - "items": { - "$ref": "#/definitions/InstanceForCreatingTask" - } - } - } - }, - "CreateAuditTasksGroupResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AuditTasksGroupResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "CreateAuditWhitelistReqV1": { - "type": "object", - "properties": { - "desc": { - "type": "string", - "example": "used for rapid release" - }, - "match_type": { - "type": "string", - "enum": [ - "exact_match", - "fp_match" - ], - "example": "exact_match" - }, - "value": { - "type": "string", - "example": "create table" - } - } - }, - "CreateBlacklistReqV1": { - "type": "object", - "properties": { - "content": { - "type": "string", - "example": "select * from t1" - }, - "desc": { - "type": "string", - "example": "used for rapid release" - }, - "type": { - "type": "string", - "enum": [ - "sql", - "fp_sql", - "ip", - "cidr", - "host", - "instance" - ], - "example": "sql" - } - } - }, - "CreateCustomRuleReqV1": { - "type": "object", - "properties": { - "annotation": { - "type": "string", - "example": "this is test rule" - }, - "db_type": { - "type": "string", - "example": "MySQL" - }, - "desc": { - "type": "string", - "example": "this is test rule" - }, - "level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "example": "notice" - }, - "rule_script": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "type": "string", - "example": "DDL规则" - } - } - }, - "CreateInstanceAuditPlanReqV1": { - "type": "object", - "properties": { - "audit_plans": { - "description": "扫描类型", - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlan" - } - }, - "instance_id": { - "type": "string" - } - } - }, - "CreatePipelineReqV1": { - "type": "object", - "properties": { - "address": { - "description": "关联流水线地址", - "type": "string" - }, - "description": { - "description": "流水线描述", - "type": "string" - }, - "name": { - "description": "流水线名称", - "type": "string" - }, - "nodes": { - "description": "节点信息", - "type": "array", - "items": { - "$ref": "#/definitions/pipelineNodeBase" - } - } - } - }, - "CreatePipelineResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/createPipelineResData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "CreateProjectRuleTemplateReqV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "rule_list": { - "type": "array", - "items": { - "$ref": "#/definitions/RuleReqV1" - } - }, - "rule_template_name": { - "type": "string" - }, - "rule_version": { - "type": "integer" - } - } - }, - "CreateRollbackWorkflowReq": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "rollback_sql_ids": { - "type": "array", - "items": { - "type": "integer" - } - }, - "sql_version_id": { - "type": "integer" - }, - "task_ids": { - "type": "array", - "items": { - "type": "integer" - } - }, - "workflow_subject": { - "type": "string" - }, - "workflow_template_id": { - "type": "integer" - } - } - }, - "CreateRollbackWorkflowRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/CreateRollbackWorkflowResData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "CreateRollbackWorkflowResData": { - "type": "object", - "properties": { - "workflow_id": { - "type": "string" - } - } - }, - "CreateRuleTemplateReqV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "rule_list": { - "type": "array", - "items": { - "$ref": "#/definitions/RuleReqV1" - } - }, - "rule_template_name": { - "type": "string" - }, - "rule_version": { - "type": "integer" - } - } - }, - "CreateSQLAuditRecordResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/SQLAuditRecordResData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "CreateSqlVersionReqV1": { - "type": "object", - "properties": { - "create_sql_version_stage": { - "type": "array", - "items": { - "$ref": "#/definitions/CreateSqlVersionStage" - } - }, - "desc": { - "type": "string" - }, - "version": { - "type": "string", - "example": "2.23" - } - } - }, - "CreateSqlVersionRes": { - "type": "object", - "properties": { - "sql_version_id": { - "type": "integer" - } - } - }, - "CreateSqlVersionResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/CreateSqlVersionRes" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "CreateSqlVersionStage": { - "type": "object", - "properties": { - "create_stages_instance_dep": { - "type": "array", - "items": { - "$ref": "#/definitions/CreateStagesInstanceDep" - } - }, - "name": { - "type": "string", - "example": "生产" - }, - "stage_sequence": { - "type": "integer" - } - } - }, - "CreateStagesInstanceDep": { - "type": "object", - "properties": { - "next_stage_instance_id": { - "type": "string" - }, - "stage_instance_id": { - "type": "string" - } - } - }, - "CreateWorkflowReqV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "task_ids": { - "type": "array", - "items": { - "type": "integer" - } - }, - "workflow_subject": { - "type": "string" - } - } - }, - "CreateWorkflowTemplateReqV1": { - "type": "object", - "properties": { - "allow_submit_when_less_audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ] - }, - "desc": { - "type": "string" - }, - "is_default": { - "type": "boolean" - }, - "workflow_step_template_list": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkFlowStepTemplateReqV1" - } - }, - "workflow_template_name": { - "type": "string" - }, - "workflow_type": { - "type": "string", - "enum": [ - "workflow", - "data_export" - ] - } - } - }, - "CustomRuleResV1": { - "type": "object", - "properties": { - "annotation": { - "type": "string", - "example": "this is test rule" - }, - "categories": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "db_type": { - "type": "string", - "example": "MySQL" - }, - "desc": { - "type": "string", - "example": "this is test rule" - }, - "level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "example": "notice" - }, - "rule_id": { - "type": "string" - }, - "rule_script": { - "type": "string" - }, - "type": { - "type": "string", - "example": "DDL规则" - } - } - }, - "DBPerformanceImproveOverview": { - "type": "object", - "properties": { - "avg_performance_improve": { - "type": "number" - }, - "instance_name": { - "type": "string" - } - } - }, - "DBTypeAuditPlan": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanCount" - } - }, - "db_type": { - "type": "string" - } - } - }, - "DBTypeHealth": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "health_instance_names": { - "type": "array", - "items": { - "type": "string" - } - }, - "unhealth_instance_names": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "DashboardResV1": { - "type": "object", - "properties": { - "workflow_statistics": { - "type": "object", - "$ref": "#/definitions/WorkflowStatisticsResV1" - } - } - }, - "DatabaseComparisonObject": { - "type": "object", - "properties": { - "instance_id": { - "type": "string" - }, - "schema_name": { - "type": "string" - } - } - }, - "DatabaseComparisonResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/SchemaObject" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "DatabaseComparisonStatements": { - "type": "object", - "properties": { - "base_sql": { - "type": "object", - "$ref": "#/definitions/SQLStatement" - }, - "comparison_sql": { - "type": "object", - "$ref": "#/definitions/SQLStatement" - } - } - }, - "DatabaseComparisonStatementsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/DatabaseComparisonStatements" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "DatabaseDiffModifySQL": { - "type": "object", - "properties": { - "audit_error": { - "type": "string" - }, - "modify_sqls": { - "type": "array", - "items": { - "$ref": "#/definitions/SQLStatementWithAuditResult" - } - }, - "schema_name": { - "type": "string" - } - } - }, - "DatabaseDiffObject": { - "type": "object", - "properties": { - "inconsistent_num": { - "type": "integer" - }, - "object_type": { - "type": "string", - "enum": [ - "TABLE", - "VIEW", - "PROCEDURE", - "TIGGER", - "EVENT", - "FUNCTION" - ] - }, - "objects_diff_result": { - "type": "array", - "items": { - "$ref": "#/definitions/ObjectDiffResult" - } - } - } - }, - "DatabaseDriverLogosV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "logo": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "DatabaseDriverOptionsV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "default_port": { - "type": "integer" - }, - "params": { - "type": "array", - "items": { - "$ref": "#/definitions/InstanceAdditionalParamResV1" - } - } - } - }, - "DatabaseObject": { - "type": "object", - "properties": { - "object_name": { - "type": "string" - }, - "object_type": { - "type": "string", - "enum": [ - "TABLE", - "VIEW", - "PROCEDURE", - "TIGGER", - "EVENT", - "FUNCTION" - ] - } - } - }, - "DatabaseSchemaObject": { - "type": "object", - "properties": { - "base_schema_name": { - "type": "string" - }, - "comparison_schema_name": { - "type": "string" - }, - "database_objects": { - "type": "array", - "items": { - "$ref": "#/definitions/DatabaseObject" - } - } - } - }, - "DepBetweenStageInstance": { - "type": "object", - "properties": { - "next_stage_instance_id": { - "type": "string" - }, - "next_stage_instance_name": { - "type": "string" - }, - "stage_instance_id": { - "type": "string" - }, - "stage_instance_name": { - "type": "string" - } - } - }, - "DingTalkConfigurationV1": { - "type": "object", - "properties": { - "app_key": { - "type": "string" - }, - "is_enable_ding_talk_notify": { - "type": "boolean" - } - } - }, - "DirectAuditFileReqV1": { - "type": "object", - "properties": { - "file_contents": { - "description": "调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现\n每个数组元素是一个文件内容", - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "select * from t1; select * from t2;" - ] - }, - "instance_name": { - "type": "string", - "example": "instance1" - }, - "instance_type": { - "type": "string", - "example": "MySQL" - }, - "project_name": { - "type": "string", - "example": "project1" - }, - "schema_name": { - "type": "string", - "example": "schema1" - }, - "sql_type": { - "type": "string", - "enum": [ - "sql", - "mybatis", - "" - ], - "example": "sql" - } - } - }, - "DirectAuditReqV1": { - "type": "object", - "properties": { - "instance_name": { - "type": "string", - "example": "instance1" - }, - "instance_type": { - "type": "string", - "example": "MySQL" - }, - "project_name": { - "type": "string", - "example": "project1" - }, - "schema_name": { - "type": "string", - "example": "schema1" - }, - "sql_content": { - "description": "调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现", - "type": "string", - "example": "select * from t1; select * from t2;" - }, - "sql_type": { - "type": "string", - "enum": [ - "sql", - "mybatis", - "" - ], - "example": "sql" - } - } - }, - "DirectAuditResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AuditResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "DirectGetSQLAnalysisResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/SqlAnalysisResDataV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "DriversResV1": { - "type": "object", - "properties": { - "driver_name_list": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "EdgeResponse": { - "type": "object", - "properties": { - "from_id": { - "description": "存储Node的ID", - "type": "string" - }, - "is_directed": { - "description": "是否有向", - "type": "boolean" - }, - "to_id": { - "description": "存储Node的ID", - "type": "string" - }, - "weight": { - "description": "权重", - "type": "integer" - } - } - }, - "EfficiencyCard": { - "type": "object", - "properties": { - "evidence_value": { - "description": "具体指标分值", - "type": "string", - "example": "高危拦截35次" - }, - "metric_evaluation": { - "description": "效能评价", - "type": "string", - "example": "S级,+450%,123h" - }, - "metric_title": { - "description": "效能指标标题", - "type": "string", - "enum": [ - "security_defense", - "resource_cost", - "code_standard", - "rd_efficiency", - "query_performance" - ] - } - } - }, - "EnumsValueResV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "ExplainClassicResult": { - "type": "object", - "properties": { - "head": { - "type": "array", - "items": { - "$ref": "#/definitions/TableMetaItemHeadResV1" - } - }, - "rows": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - }, - "ExplainValidationDetail": { - "type": "object", - "properties": { - "after_cost": { - "type": "number" - }, - "after_plan": { - "type": "string" - }, - "before_cost": { - "type": "number" - }, - "before_plan": { - "type": "string" - }, - "perform_improve_per": { - "type": "number" - } - } - }, - "FeishuConfigurationV1": { - "type": "object", - "properties": { - "app_id": { - "type": "string" - }, - "is_feishu_notification_enabled": { - "type": "boolean" - } - } - }, - "FileToSort": { - "type": "object", - "properties": { - "file_id": { - "type": "integer" - }, - "new_index": { - "type": "integer" - } - } - }, - "Filter": { - "type": "object", - "properties": { - "filter_between_value": { - "type": "object", - "$ref": "#/definitions/FilterBetweenValue" - }, - "filter_compare_value": { - "type": "string" - }, - "filter_name": { - "type": "string" - } - } - }, - "FilterBetweenValue": { - "type": "object", - "properties": { - "from": { - "type": "string" - }, - "to": { - "type": "string" - } - } - }, - "FilterMeta": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "filter_input_type": { - "type": "string", - "enum": [ - "int", - "string", - "date_time" - ] - }, - "filter_name": { - "type": "string" - }, - "filter_op_type": { - "type": "string", - "enum": [ - "equal", - "between" - ] - }, - "filter_tip_list": { - "type": "array", - "items": { - "$ref": "#/definitions/FilterTip" - } - } - } - }, - "FilterTip": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "group": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "FullSyncAuditPlanSQLsReqV1": { - "type": "object", - "properties": { - "audit_plan_sql_list": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanSQLReqV1" - } - } - } - }, - "GenModifySQLResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/DatabaseDiffModifySQL" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GenModifylSQLReqV1": { - "type": "object", - "properties": { - "base_instance_id": { - "type": "string" - }, - "comparison_instance_id": { - "type": "string" - }, - "database_schema_objects": { - "type": "array", - "items": { - "$ref": "#/definitions/DatabaseSchemaObject" - } - } - } - }, - "GetAIHubBannerResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AIHubBannerData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetAIHubExecutionDataResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/AIHubExecutionRecord" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "description": "总数", - "type": "integer" - } - } - }, - "GetAIHubManagementViewResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AIHubManagementViewData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetAIHubStrategicValueResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AIHubStrategicValueData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetAbnormalAuditPlanInstancesResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/AbnormalAuditPlanInstance" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetAuditPlanAnalysisDataResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/GetSQLAnalysisDataResItemV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetAuditPlanMetasResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanMetaV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetAuditPlanNotifyConfigResDataV1": { - "type": "object", - "properties": { - "enable_email_notify": { - "type": "boolean" - }, - "enable_web_hook_notify": { - "type": "boolean" - }, - "notify_interval": { - "type": "integer" - }, - "notify_level": { - "type": "string" - }, - "web_hook_template": { - "type": "string" - }, - "web_hook_url": { - "type": "string" - } - } - }, - "GetAuditPlanNotifyConfigResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/GetAuditPlanNotifyConfigResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetAuditPlanReportResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AuditPlanReportResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetAuditPlanReportSQLsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanReportSQLResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetAuditPlanReportsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanReportResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetAuditPlanResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AuditPlanResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetAuditPlanSQLDataReqV1": { - "type": "object", - "properties": { - "filter_list": { - "type": "array", - "items": { - "$ref": "#/definitions/Filter" - } - }, - "is_asc": { - "type": "boolean" - }, - "order_by": { - "type": "string" - }, - "page_index": { - "type": "integer" - }, - "page_size": { - "type": "integer" - } - } - }, - "GetAuditPlanSQLDataResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AuditPlanSQLDataResV1" - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetAuditPlanSQLExportReqV1": { - "type": "object", - "properties": { - "export_format": { - "description": "导出格式:csv 或 excel", - "type": "string", - "enum": [ - "csv", - "excel" - ], - "example": "excel" - }, - "filter_list": { - "type": "array", - "items": { - "$ref": "#/definitions/Filter" - } - }, - "is_asc": { - "type": "boolean" - }, - "order_by": { - "type": "string" - } - } - }, - "GetAuditPlanSQLMetaResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AuditPlanSQLMetaResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetAuditPlanSQLsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AuditPlanSQLResV1" - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetAuditPlanTypesResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanTypesV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetAuditPlansResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetAuditTaskResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AuditTaskResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetAuditTaskSQLContentResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AuditTaskSQLContentResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetAuditTaskSQLsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditTaskSQLResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetAuditWhitelistResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditWhitelistResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetBlacklistResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/BlacklistResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetCodingConfigurationResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/CodingConfigurationV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetCompanyNoticeResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/CompanyNotice" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetComparisonStatementsReqV1": { - "type": "object", - "properties": { - "database_comparison_object": { - "type": "object", - "$ref": "#/definitions/GetDatabaseComparisonReqV1" - }, - "database_object": { - "type": "object", - "$ref": "#/definitions/DatabaseObject" - } - } - }, - "GetCustomRuleResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/CustomRuleResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetCustomRulesResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/CustomRuleResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetDBPerformanceImproveOverviewResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/DBPerformanceImproveOverview" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetDashboardResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/DashboardResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetDatabaseComparisonReqV1": { - "type": "object", - "properties": { - "base_db_object": { - "type": "object", - "$ref": "#/definitions/DatabaseComparisonObject" - }, - "comparison_db_object": { - "type": "object", - "$ref": "#/definitions/DatabaseComparisonObject" - } - } - }, - "GetDatabaseDriverLogosResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/DatabaseDriverLogosV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetDatabaseDriverOptionsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/DatabaseDriverOptionsV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetDepBetweenStageInstanceResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/DepBetweenStageInstance" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetDingTalkConfigurationResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/DingTalkConfigurationV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetDriverRuleVersionTipsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/GetDriverRuleVersionTipsV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetDriverRuleVersionTipsV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string", - "example": "mysql" - }, - "rule_versions": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "GetDriversResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/DriversResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetFeishuAuditConfigurationResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/FeishuConfigurationV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetGlobalSqlManageListResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/GlobalSqlManage" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetGlobalSqlManageStatisticsResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetInstanceAuditPlanDetailResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/InstanceAuditPlanDetailResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetInstanceAuditPlanOverviewResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/InstanceAuditPlanInfo" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetInstanceAuditPlansResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/InstanceAuditPlanResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetInstanceConnectableResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/InstanceConnectableResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetInstanceHealthResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/DBTypeHealth" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetInstanceOverviewStatisticsRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/InstanceOverviewStatistics" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetInstanceSchemaResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/InstanceSchemaResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetInstanceTipsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/InstanceTipResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetInstancesTypePercentResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/InstancesTypePercentV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetKnowledgeBaseListRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/KnowledgeBase" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetKnowledgeBaseTagListRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Tag" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetKnowledgeGraphResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/GraphResponse" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetLicenseResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "content": { - "type": "string" - }, - "license": { - "type": "array", - "items": { - "$ref": "#/definitions/LicenseItem" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetLicenseUsageResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/LicenseUsageV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetModuleStatusResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/ModuleStatusRes" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetOperationsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/OperationResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetOptimizationOverviewResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/OptimizationRecordOverview" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetOptimizationRecordRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/OptimizationDetail" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetOptimizationRecordsRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/OptimizationRecord" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetOptimizationSQLRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/OptimizationSQLDetail" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetOptimizationSQLsRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/OptimizationSQL" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetPipelineDetailResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/pipelineDetailData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetPipelinesResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "description": "流水线列表数据", - "type": "array", - "items": { - "$ref": "#/definitions/pipelineDetail" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "description": "流水线总数", - "type": "integer" - } - } - }, - "GetProjectRuleTemplateResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/RuleProjectTemplateDetailResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetProjectRuleTemplatesResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/ProjectRuleTemplateResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetProjectScoreResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/ProjectScore" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetProjectStatisticsResDataV1": { - "type": "object", - "properties": { - "audit_plan_total": { - "type": "integer" - }, - "instance_total": { - "type": "integer" - }, - "member_total": { - "type": "integer" - }, - "rule_template_total": { - "type": "integer" - }, - "whitelist_total": { - "type": "integer" - }, - "workflow_total": { - "type": "integer" - } - } - }, - "GetProjectStatisticsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/GetProjectStatisticsResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetReportPushConfigsListResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/ReportPushConfigList" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetRiskAuditPlanResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/RiskAuditPlan" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetRoleUserCountResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/RoleUserCount" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetRuleCategoryStatisticResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "$ref": "#/definitions/RuleCategoryStatistic" - } - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetRuleKnowledgeResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/RuleKnowledgeResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetRuleTemplateResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/RuleTemplateDetailResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetRuleTemplateTipsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/RuleTemplateTipResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetRuleTemplatesResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/RuleTemplateResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetRuleTypeByDBTypeResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/RuleTypeV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetRulesResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/RuleResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetSQLAnalysisDataResItemV1": { - "type": "object", - "properties": { - "sql_explain": { - "type": "object", - "$ref": "#/definitions/SQLExplain" - }, - "table_metas": { - "type": "array", - "items": { - "$ref": "#/definitions/TableMeta" - } - } - } - }, - "GetSQLAuditRecordResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/SQLAuditRecord" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetSQLAuditRecordTagTipsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "type": "string" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetSQLAuditRecordsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/SQLAuditRecord" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetSqlAverageExecutionTimeResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/SqlAverageExecutionTime" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetSqlDEVRecordListResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/SqlDEVRecord" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetSqlExecutionFailPercentResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/SqlExecutionFailPercent" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetSqlFileOrderMethodResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/SqlFileOrderMethodRes" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetSqlManageListResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/SqlManage" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "sql_manage_bad_num": { - "type": "integer" - }, - "sql_manage_optimized_num": { - "type": "integer" - }, - "sql_manage_total_num": { - "type": "integer" - } - } - }, - "GetSqlManageRuleTipsResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/RuleTips" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetSqlManageSqlAnalysisResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "description": "V1版本不能引用V2版本的结构体,所以只能复制一份", - "type": "object", - "$ref": "#/definitions/SqlAnalysis" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetSqlPerformanceInsightsRelatedSQLResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/RelatedSQLInfo" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetSqlPerformanceInsightsRelatedTransactionResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/RelatedTransactionInfo" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetSqlPerformanceInsightsResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/SqlPerformanceInsights" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetSqlVersionDetailResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/SqlVersionDetailResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetSqlVersionListResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/SqlVersionResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetSystemModuleRedDotsRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/ModuleRedDots" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetTableMetadataResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/InstanceTableMeta" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetTaskAnalysisDataResItemV1": { - "type": "object", - "properties": { - "sql_explain": { - "type": "object", - "$ref": "#/definitions/SQLExplain" - }, - "table_metas": { - "type": "array", - "items": { - "$ref": "#/definitions/TableMeta" - } - } - } - }, - "GetTaskAnalysisDataResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/GetTaskAnalysisDataResItemV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetUserTipsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/UserTipResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWechatAuditConfigurationResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/WechatConfigurationV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowAuditPassPercentResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/WorkflowAuditPassPercentV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowCountsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/WorkflowCountsV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowCreatedCountsEachDayResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/WorkflowCreatedCountsEachDayV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowDurationOfWaitingForAuditResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/WorkflowStageDuration" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowDurationOfWaitingForExecutionResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/WorkflowStageDuration" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowPassPercentResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/WorkflowPassPercentV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowPercentCountedByInstanceTypeResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/WorkflowPercentCountedByInstanceTypeV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowRejectedPercentGroupByCreatorResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkflowRejectedPercentGroupByCreator" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowRejectedPercentGroupByInstanceResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkflowRejectedPercentGroupByInstance" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/WorkflowResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowStatisticOfInstancesResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkflowStatisticOfInstance" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowStatusCountResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/WorkflowStatusCountV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowTasksItemV1": { - "type": "object", - "properties": { - "current_step_assignee_user_name_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "exec_end_time": { - "type": "string" - }, - "exec_start_time": { - "type": "string" - }, - "execution_user_name": { - "type": "string" - }, - "instance_maintenance_times": { - "type": "array", - "items": { - "$ref": "#/definitions/MaintenanceTimeResV1" - } - }, - "instance_name": { - "type": "string" - }, - "schedule_time": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_execution", - "exec_scheduled", - "exec_failed", - "exec_succeeded", - "executing", - "manually_executed" - ] - }, - "task_id": { - "type": "integer" - }, - "task_pass_rate": { - "type": "number" - }, - "task_score": { - "type": "integer" - } - } - }, - "GetWorkflowTasksResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/GetWorkflowTasksItemV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowTemplateListResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkflowTemplateDetailResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowTemplateResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/WorkflowTemplateDetailResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkflowDetailResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetWorkflowsThatCanBeAssociatedToVersionResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/AssociateWorkflows" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GlobalSqlManage": { - "type": "object", - "properties": { - "audit_result": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditResult" - } - }, - "first_appear_timestamp": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "instance_id": { - "type": "string" - }, - "instance_name": { - "type": "string" - }, - "problem_descriptions": { - "description": "根据来源信息拼接", - "type": "array", - "items": { - "type": "string" - } - }, - "project_name": { - "type": "string" - }, - "project_priority": { - "type": "string", - "enum": [ - "high", - "medium", - "low" - ] - }, - "project_uid": { - "type": "string" - }, - "source": { - "type": "object", - "$ref": "#/definitions/Source" - }, - "sql": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited", - "sent" - ] - } - } - }, - "GlobalWorkflowStatisticsResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GraphResponse": { - "type": "object", - "properties": { - "edges": { - "description": "边集合", - "type": "array", - "items": { - "$ref": "#/definitions/EdgeResponse" - } - }, - "nodes": { - "description": "节点集合", - "type": "array", - "items": { - "$ref": "#/definitions/NodeResponse" - } - } - } - }, - "HighPriorityConditionReq": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "operator": { - "type": "string", - "default": ">", - "enum": [ - ">", - "=", - "<" - ] - }, - "value": { - "type": "string" - } - } - }, - "HighPriorityConditionResV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "enums_value": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumsValueResV1" - } - }, - "key": { - "type": "string" - }, - "operator": { - "type": "object", - "$ref": "#/definitions/OperatorResV1" - }, - "type": { - "type": "string", - "enum": [ - "string", - "int", - "bool", - "password" - ] - }, - "value": { - "type": "string" - } - } - }, - "InstanceAdditionalParamResV1": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "参数项中文名" - }, - "name": { - "type": "string", - "example": "param name" - }, - "type": { - "type": "string", - "example": "int" - }, - "value": { - "type": "string", - "example": "0" - } - } - }, - "InstanceAuditPlanDetailResV1": { - "type": "object", - "properties": { - "audit_plans": { - "description": "扫描类型", - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanRes" - } - }, - "business": { - "description": "This parameter is deprecated", - "type": "string", - "example": "test" - }, - "environment": { - "type": "string", - "example": "prod" - }, - "instance_id": { - "type": "string", - "example": "instance_id" - }, - "instance_name": { - "type": "string", - "example": "test_mysql" - }, - "instance_type": { - "type": "string", - "example": "mysql" - } - } - }, - "InstanceAuditPlanInfo": { - "type": "object", - "properties": { - "active_status": { - "type": "string", - "enum": [ - "normal", - "disabled" - ] - }, - "audit_plan_db_type": { - "type": "string", - "example": "mysql" - }, - "audit_plan_instance_name": { - "type": "string", - "example": "test_mysql" - }, - "audit_plan_rule_template": { - "type": "object", - "$ref": "#/definitions/AuditPlanRuleTemplate" - }, - "audit_plan_type": { - "type": "object", - "$ref": "#/definitions/AuditPlanTypeResBase" - }, - "exec_cmd": { - "type": "string", - "example": "./scanner xxx" - }, - "id": { - "type": "integer" - }, - "last_collection_status": { - "type": "string", - "enum": [ - "normal", - "abnormal" - ] - }, - "last_collection_time": { - "type": "string" - }, - "token_exp": { - "type": "integer", - "example": 1747129752 - }, - "total_sql_nums": { - "type": "integer" - }, - "unsolved_sql_nums": { - "type": "integer" - } - } - }, - "InstanceAuditPlanResV1": { - "type": "object", - "properties": { - "active_status": { - "type": "string", - "enum": [ - "normal", - "disabled" - ] - }, - "audit_plan_types": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanTypeResBase" - } - }, - "create_time": { - "description": "TODO 采集状态", - "type": "string" - }, - "creator": { - "type": "string" - }, - "environment": { - "type": "string" - }, - "instance_audit_plan_id": { - "type": "integer" - }, - "instance_id": { - "type": "string" - }, - "instance_name": { - "type": "string" - }, - "instance_type": { - "type": "string" - } - } - }, - "InstanceConnectableResV1": { - "type": "object", - "properties": { - "connect_error_message": { - "type": "string" - }, - "is_instance_connectable": { - "type": "boolean" - } - } - }, - "InstanceConnectionResV1": { - "type": "object", - "properties": { - "connect_error_message": { - "type": "string" - }, - "instance_name": { - "type": "string" - }, - "is_instance_connectable": { - "type": "boolean" - } - } - }, - "InstanceForCheckConnection": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - }, - "InstanceForCreatingTask": { - "type": "object", - "properties": { - "instance_name": { - "type": "string" - }, - "instance_schema": { - "type": "string" - } - } - }, - "InstanceInfo": { - "type": "object", - "properties": { - "instance_id": { - "type": "string" - }, - "instance_name": { - "type": "string" - } - } - }, - "InstanceOverviewStatistics": { - "type": "object", - "properties": { - "avg_score": { - "type": "number" - }, - "high_priority_sql_count": { - "type": "integer" - }, - "instance_id": { - "type": "string" - }, - "pending_workflow_count": { - "type": "integer" - } - } - }, - "InstanceSchemaResV1": { - "type": "object", - "properties": { - "schema_name_list": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "InstanceTableMeta": { - "type": "object", - "properties": { - "columns": { - "type": "object", - "$ref": "#/definitions/TableColumns" - }, - "create_table_sql": { - "type": "string" - }, - "indexes": { - "type": "object", - "$ref": "#/definitions/TableIndexes" - }, - "name": { - "type": "string" - }, - "schema": { - "type": "string" - } - } - }, - "InstanceTipResV1": { - "type": "object", - "properties": { - "backup_max_rows": { - "type": "integer" - }, - "enable_backup": { - "type": "boolean" - }, - "host": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "instance_name": { - "type": "string" - }, - "instance_type": { - "type": "string" - }, - "port": { - "type": "string" - }, - "supported_backup_strategy": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "none", - "manual", - "reverse_sql", - "original_row" - ] - } - }, - "workflow_template_id": { - "type": "integer" - } - } - }, - "InstanceTypePercent": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "percent": { - "type": "number" - }, - "type": { - "type": "string" - } - } - }, - "InstancesTypePercentV1": { - "type": "object", - "properties": { - "instance_total_num": { - "type": "integer" - }, - "instance_type_percents": { - "type": "array", - "items": { - "$ref": "#/definitions/InstanceTypePercent" - } - } - } - }, - "KnowledgeBase": { - "type": "object", - "properties": { - "content": { - "description": "内容", - "type": "string" - }, - "description": { - "description": "描述", - "type": "string" - }, - "id": { - "description": "知识库ID", - "type": "integer" - }, - "rule_name": { - "description": "规则名称", - "type": "string" - }, - "tags": { - "description": "标签", - "type": "array", - "items": { - "$ref": "#/definitions/Tag" - } - }, - "title": { - "description": "标题", - "type": "string" - } - } - }, - "LicenseItem": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "limit": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "LicenseUsageItem": { - "type": "object", - "properties": { - "is_limited": { - "type": "boolean" - }, - "limit": { - "type": "integer" - }, - "resource_type": { - "type": "string" - }, - "resource_type_desc": { - "type": "string" - }, - "used": { - "type": "integer" - } - } - }, - "LicenseUsageV1": { - "type": "object", - "properties": { - "instances_usage": { - "type": "array", - "items": { - "$ref": "#/definitions/LicenseUsageItem" - } - }, - "users_usage": { - "type": "object", - "$ref": "#/definitions/LicenseUsageItem" - } - } - }, - "Line": { - "type": "object", - "properties": { - "line_name": { - "description": "线条名称", - "type": "string" - }, - "points": { - "description": "图表点数据", - "type": "array", - "items": { - "$ref": "#/definitions/ChartPoint" - } - } - } - }, - "ListTableBySchemaResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Table" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "LockSqlVersionReqV1": { - "type": "object", - "properties": { - "is_locked": { - "type": "boolean" - } - } - }, - "MaintenanceTimeResV1": { - "type": "object", - "properties": { - "maintenance_start_time": { - "type": "object", - "$ref": "#/definitions/TimeResV1" - }, - "maintenance_stop_time": { - "type": "object", - "$ref": "#/definitions/TimeResV1" - } - } - }, - "ModuleRedDot": { - "type": "object", - "properties": { - "has_red_dot": { - "type": "boolean" - }, - "module_name": { - "type": "string", - "enum": [ - "global_dashboard" - ] - } - } - }, - "ModuleRedDots": { - "type": "array", - "items": { - "$ref": "#/definitions/ModuleRedDot" - } - }, - "ModuleStatusRes": { - "type": "object", - "properties": { - "is_supported": { - "type": "boolean" - } - } - }, - "NodeResponse": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "weight": { - "type": "integer" - } - } - }, - "ObjectDiffResult": { - "type": "object", - "properties": { - "comparison_result": { - "type": "string", - "enum": [ - "same", - "inconsistent", - "base_not_exist", - "comparison_not_exist" - ] - }, - "object_name": { - "type": "string" - } - } - }, - "OperationResV1": { - "type": "object", - "properties": { - "op_code": { - "type": "integer" - }, - "op_desc": { - "type": "string" - } - } - }, - "OperatorResV1": { - "type": "object", - "properties": { - "operator_enums_value": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumsValueResV1" - } - }, - "operator_value": { - "type": "string" - } - } - }, - "OptimizationDetail": { - "type": "object", - "properties": { - "basic_summary": { - "type": "object", - "$ref": "#/definitions/Optimizationsummary" - }, - "created_time": { - "type": "string" - }, - "created_user": { - "type": "string" - }, - "db_type": { - "type": "string" - }, - "index_recommendations": { - "type": "array", - "items": { - "type": "string" - } - }, - "instance_name": { - "type": "string" - }, - "optimization_id": { - "type": "string" - }, - "optimization_name": { - "type": "string" - }, - "status": { - "description": "优化状态", - "type": "string" - } - } - }, - "OptimizationRecord": { - "type": "object", - "properties": { - "adoption_rate": { - "description": "优化采纳率", - "type": "number" - }, - "created_time": { - "description": "创建时间", - "type": "string" - }, - "created_user": { - "description": "创建人", - "type": "string" - }, - "db_type": { - "description": "数据库类型", - "type": "string" - }, - "instance_name": { - "description": "数据源", - "type": "string" - }, - "number_of_index": { - "description": "优化索引数量", - "type": "integer" - }, - "number_of_rule": { - "description": "优化规则数量", - "type": "integer" - }, - "optimization_id": { - "description": "优化ID", - "type": "string" - }, - "optimization_name": { - "type": "string" - }, - "performance_improve": { - "description": "优化提升性能", - "type": "number" - }, - "status": { - "description": "优化状态", - "type": "string", - "enum": [ - "optimizing", - "failed", - "finish" - ] - }, - "status_detail": { - "description": "优化状态详情", - "type": "string" - } - } - }, - "OptimizationRecordOverview": { - "type": "object", - "properties": { - "record_number": { - "type": "integer" - }, - "time": { - "type": "string" - } - } - }, - "OptimizationSQL": { - "type": "object", - "properties": { - "contributing_indices": { - "type": "string" - }, - "number": { - "type": "integer" - }, - "number_of_hit_index": { - "type": "integer" - }, - "number_of_index": { - "type": "integer" - }, - "number_of_rewrite": { - "type": "integer" - }, - "number_of_syntax_error": { - "type": "integer" - }, - "original_sql": { - "type": "string" - }, - "performance": { - "type": "number" - } - } - }, - "OptimizationSQLDetail": { - "type": "object", - "properties": { - "advised_index": { - "description": "索引建议详情", - "type": "object", - "$ref": "#/definitions/AdvisedIndex" - }, - "id": { - "type": "integer" - }, - "metadata": { - "description": "数据库元数据信息", - "type": "string" - }, - "optimization_id": { - "type": "string" - }, - "optimize": { - "description": "优化详情", - "type": "object", - "$ref": "#/definitions/OptimizeDetail" - }, - "optimize_status": { - "description": "优化状态", - "type": "string", - "enum": [ - "optimizing", - "failed", - "finish" - ] - }, - "optimized_sql_feedbacks": { - "description": "优化后的SQL反馈", - "type": "array", - "items": { - "$ref": "#/definitions/OptimizedSQLFeedback" - } - }, - "origin_query_plan": { - "description": "原始SQL查询计划", - "type": "object", - "$ref": "#/definitions/QueryPlan" - }, - "origin_sql": { - "description": "SQL Flash相关字段", - "type": "string" - }, - "status": { - "description": "SQLe 维护的状态", - "type": "string", - "enum": [ - "rewriting", - "rewrite_done", - "advise_indexing", - "advise_index_done", - "finish", - "failed" - ] - }, - "status_detail": { - "description": "SQLe 维护的状态详情", - "type": "string" - }, - "total_analysis": { - "description": "总体分析", - "type": "object", - "$ref": "#/definitions/TotalAnalysis" - }, - "total_state": { - "description": "总状态", - "type": "string" - } - } - }, - "Optimizationsummary": { - "type": "object", - "properties": { - "number_of_index": { - "type": "integer" - }, - "number_of_query": { - "type": "integer" - }, - "number_of_query_index": { - "type": "integer" - }, - "number_of_rewrite": { - "type": "integer" - }, - "number_of_rewritten_query": { - "type": "integer" - }, - "number_of_syntax_error": { - "type": "integer" - }, - "performance_gain": { - "type": "number" - } - } - }, - "OptimizeSQLReq": { - "type": "object", - "properties": { - "db_type": { - "type": "string", - "example": "MySQL" - }, - "enable_high_analysis": { - "description": "是否启用高级分析", - "type": "boolean" - }, - "explain_info": { - "type": "string" - }, - "instance_name": { - "type": "string", - "example": "instance1" - }, - "metadata": { - "type": "string" - }, - "optimization_name": { - "type": "string", - "example": "optmz_2024031412091244" - }, - "schema_name": { - "type": "string", - "example": "schema1" - }, - "sql_content": { - "type": "string", - "example": "select * from t1; select * from t2;" - } - } - }, - "OptimizeSQLRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/OptimizeSQLResData" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "OptimizeSQLResData": { - "type": "object", - "properties": { - "sql_optimization_record_id": { - "type": "string" - } - } - }, - "ParseProjectRuleTemplateFileResDataV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "name": { - "type": "string" - }, - "rule_list": { - "type": "array", - "items": { - "$ref": "#/definitions/RuleResV1" - } - }, - "rule_version": { - "type": "integer" - } - } - }, - "ParseProjectRuleTemplateFileResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/ParseProjectRuleTemplateFileResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "PartialSyncAuditPlanSQLsReqV1": { - "type": "object", - "properties": { - "audit_plan_sql_list": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanSQLReqV1" - } - } - } - }, - "PerformanceStatistics": { - "type": "object", - "properties": { - "affect_rows": { - "type": "object", - "$ref": "#/definitions/AffectRows" - } - } - }, - "PostSqlManageCodingResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/CodingResp" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "ProjectIOAnalysis": { - "type": "object", - "properties": { - "active_members": { - "description": "活跃人数", - "type": "integer" - }, - "health_score": { - "description": "健康分", - "type": "number", - "example": 92.3 - }, - "invoke_count": { - "description": "调用频次", - "type": "integer" - }, - "performance_gain": { - "description": "性能提升", - "type": "string", - "example": "+35%" - }, - "project_name": { - "description": "项目名称", - "type": "string" - }, - "time_saved": { - "description": "节省工时", - "type": "number", - "example": 45.5 - } - } - }, - "ProjectRuleTemplateResV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "rule_template_name": { - "type": "string" - } - } - }, - "ProjectScore": { - "type": "object", - "properties": { - "score": { - "type": "integer" - } - } - }, - "ReExecuteTaskOnWorkflowReq": { - "type": "object", - "properties": { - "exec_sql_ids": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "RecordSource": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": [ - "ide_plugin" - ] - }, - "value": { - "type": "string" - } - } - }, - "RefreshAuditPlanTokenReqV1": { - "type": "object", - "properties": { - "expires_in_days": { - "type": "integer" - } - } - }, - "RejectWorkflowReqV1": { - "type": "object", - "properties": { - "reason": { - "type": "string" - } - } - }, - "RelatedSQLInfo": { - "type": "object", - "properties": { - "execute_time_avg": { - "description": "平均执行时间(s)", - "type": "number" - }, - "execute_time_max": { - "description": "最大执行时间(s)", - "type": "number" - }, - "execute_time_min": { - "description": "最小执行时间(s)", - "type": "number" - }, - "execute_time_sum": { - "description": "总执行时间(s)", - "type": "number" - }, - "execution_time_trend": { - "description": "SQL 趋势图表", - "type": "object", - "$ref": "#/definitions/SqlAnalysisScatterChart" - }, - "lock_wait_time": { - "description": "锁等待时间(s)", - "type": "number" - }, - "source": { - "type": "string", - "enum": [ - "workflow", - "sql_manage" - ] - }, - "sql_fingerprint": { - "type": "string" - } - } - }, - "RelatedTransactionInfo": { - "type": "object", - "properties": { - "related_sql_info": { - "description": "相关SQL列表", - "type": "array", - "items": { - "$ref": "#/definitions/TransactionSQL" - } - }, - "transaction_info": { - "description": "事务信息", - "type": "object", - "$ref": "#/definitions/TransactionInfo" - }, - "transaction_lock_info": { - "description": "事务锁信息", - "type": "array", - "items": { - "$ref": "#/definitions/TransactionLockInfo" - } - }, - "transaction_timeline": { - "description": "事务时间线", - "type": "object", - "$ref": "#/definitions/TransactionTimeline" - } - } - }, - "ReleaseWorkflows": { - "type": "object", - "properties": { - "target_release_instances": { - "type": "array", - "items": { - "$ref": "#/definitions/TargetReleaseInstance" - } - }, - "workflow_id": { - "type": "string" - } - } - }, - "ReportPushConfigList": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "last_push_time": { - "type": "string" - }, - "push_frequency_cron": { - "type": "string" - }, - "push_user_Type": { - "type": "string", - "enum": [ - "fixed", - "permission_match" - ] - }, - "push_user_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "report_push_config_id": { - "type": "string" - }, - "trigger_type": { - "type": "string", - "enum": [ - "immediately", - "timing" - ] - }, - "type": { - "type": "string" - } - } - }, - "RewriteRule": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "rewritten_queries_str": { - "type": "string" - }, - "rule_code": { - "type": "string" - }, - "rule_name": { - "type": "string" - }, - "violated_queries_str": { - "type": "string" - } - } - }, - "RewriteSQLData": { - "type": "object", - "properties": { - "business_desc": { - "description": "重写前的SQL业务描述", - "type": "string" - }, - "business_non_equivalent_desc": { - "description": "重写前后的业务不等价性描述,为空表示等价", - "type": "string" - }, - "logic_desc": { - "description": "重写前的SQL执行逻辑描述", - "type": "string" - }, - "rewritten_sql": { - "description": "重写后的SQL", - "type": "string" - }, - "rewritten_sql_business_desc": { - "description": "重写后的SQL业务描述", - "type": "string" - }, - "rewritten_sql_logic_desc": { - "description": "重写后的SQL执行逻辑描述", - "type": "string" - }, - "suggestions": { - "description": "重写建议列表", - "type": "array", - "items": { - "$ref": "#/definitions/RewriteSuggestion" - } - } - } - }, - "RewriteSQLReq": { - "type": "object", - "properties": { - "enable_structure_type": { - "description": "是否启用结构化类型的重写", - "type": "boolean", - "default": false, - "example": false - } - } - }, - "RewriteSuggestion": { - "type": "object", - "properties": { - "audit_level": { - "description": "审核规则等级", - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ] - }, - "ddl_dcl": { - "description": "具体的数据库结构变更语句,需要在数据库中执行该变更语句之后再应用重写SQL(包含CREATE/ALTER/DROP等DDL语句,或SET等DCL语句)(适用于结构级重写)", - "type": "string" - }, - "ddl_dcl_desc": { - "description": "数据库结构变更建议说明(例如:建议添加索引、修改表结构等优化建议)(适用于结构级重写)", - "type": "string" - }, - "desc": { - "description": "重写描述(适用于所有类型)", - "type": "string" - }, - "rewritten_sql": { - "description": "重写后的SQL(适用于语句级重写和结构级重写)", - "type": "string" - }, - "rule_name": { - "description": "审核规则名称", - "type": "string" - }, - "status": { - "description": "处理状态:初始化、已处理", - "type": "string", - "default": "initial", - "enum": [ - "initial", - "processed" - ] - }, - "type": { - "description": "重写建议类型:语句级重写、结构级重写、其他", - "type": "string", - "enum": [ - "statement", - "structure", - "other" - ] - } - } - }, - "RiskAuditPlan": { - "type": "object", - "properties": { - "audit_plan_name": { - "type": "string" - }, - "audit_plan_report_id": { - "type": "integer" - }, - "audit_plan_report_timestamp": { - "type": "string" - }, - "risk_sql_count": { - "type": "integer" - }, - "trigger_audit_plan_time": { - "type": "string" - } - } - }, - "RiskWorkflow": { - "type": "object", - "properties": { - "create_user_name": { - "type": "string" - }, - "update_time": { - "type": "string" - }, - "workflow_id": { - "type": "string" - }, - "workflow_name": { - "type": "string" - }, - "workflow_status": { - "type": "string" - } - } - }, - "RoleUserCount": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "role": { - "type": "string" - } - } - }, - "RuleInfo": { - "type": "object", - "properties": { - "annotation": { - "type": "string", - "example": "this is test rule" - }, - "desc": { - "type": "string", - "example": "this is test rule" - } - } - }, - "RuleKnowledgeResV1": { - "type": "object", - "properties": { - "knowledge_content": { - "type": "string" - }, - "rule": { - "type": "object", - "$ref": "#/definitions/RuleInfo" - } - } - }, - "RuleParamReqV1": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "RuleParamResV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "key": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "string", - "int", - "bool" - ] - }, - "value": { - "type": "string" - } - } - }, - "RuleProjectTemplateDetailResV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "rule_list": { - "type": "array", - "items": { - "$ref": "#/definitions/RuleResV1" - } - }, - "rule_template_name": { - "type": "string" - }, - "rule_version": { - "type": "integer" - } - } - }, - "RuleReqV1": { - "type": "object", - "properties": { - "is_custom_rule": { - "type": "boolean" - }, - "level": { - "type": "string", - "example": "error" - }, - "name": { - "type": "string", - "example": "ddl_check_index_count" - }, - "params": { - "type": "array", - "items": { - "$ref": "#/definitions/RuleParamReqV1" - } - } - } - }, - "RuleResV1": { - "type": "object", - "properties": { - "annotation": { - "type": "string", - "example": "避免多次 table rebuild 带来的消耗、以及对线上业务的影响" - }, - "categories": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" + "swagger": "2.0", + "info": { + "description": "This is a sample server for dev.", + "title": "Sqle API Docs", + "contact": {}, + "license": {}, + "version": "1.0" + }, + "basePath": "/sqle", + "paths": { + "/v1/ai_hub/banner": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "返回按模块分组的Banner卡片列表(模块类型、Banner卡片列表)", + "produces": [ + "application/json" + ], + "tags": [ + "ai_hub" + ], + "summary": "获取AI智能中心Banner", + "operationId": "GetAIHubBanner", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAIHubBannerResp" + } + } + } + } + }, + "/v1/ai_hub/execution_data": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "返回最新10条执行数据记录(来源项目、SQL片段、功能模块、价值维度、处理状态、预估提升、时间)", + "produces": [ + "application/json" + ], + "tags": [ + "ai_hub" + ], + "summary": "获取AI智能中心执行数据", + "operationId": "GetAIHubExecutionData", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAIHubExecutionDataResp" + } + } + } + } + }, + "/v1/ai_hub/management_view": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "返回按模块分组的分析数据(模块类型、项目组投入产出分析、Top问题分布)", + "produces": [ + "application/json" + ], + "tags": [ + "ai_hub" + ], + "summary": "获取AI智能中心管理视图", + "operationId": "GetAIHubManagementView", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAIHubManagementViewResp" + } + } + } + } + }, + "/v1/ai_hub/strategic_value": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "返回AI战略洞察(标题、描述)和效能卡片列表(效能指标、效能评价、具体指标、价值描述)", + "produces": [ + "application/json" + ], + "tags": [ + "ai_hub" + ], + "summary": "获取AI智能中心战略价值", + "operationId": "GetAIHubStrategicValue", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAIHubStrategicValueResp" + } + } + } + } + }, + "/v1/audit_files": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Direct audit sql from SQL files and MyBatis files", + "tags": [ + "sql_audit" + ], + "summary": "直接从文件内容提取SQL并审核,SQL文件暂时只支持一次解析一个文件", + "operationId": "directAuditFilesV1", + "parameters": [ + { + "description": "files that should be audited", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.DirectAuditFileReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.DirectAuditResV1" + } + } + } + } + }, + "/v1/audit_plan_metas": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan metas", + "tags": [ + "audit_plan" + ], + "summary": "获取扫描任务元信息", + "operationId": "getAuditPlanMetasV1", + "parameters": [ + { + "type": "string", + "description": "filter instance type", + "name": "filter_instance_type", + "in": "query" + }, + { + "type": "string", + "description": "filter instance id", + "name": "filter_instance_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditPlanMetasResV1" + } + } + } + } + }, + "/v1/audit_plan_types": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan types", + "tags": [ + "audit_plan" + ], + "summary": "获取扫描任务类型", + "operationId": "getAuditPlanTypesV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditPlanTypesResV1" + } + } + } + } + }, + "/v1/company_notice": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get company notice info", + "tags": [ + "companyNotice" + ], + "summary": "获取企业公告", + "operationId": "getCompanyNotice", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetCompanyNoticeResp" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update company notice info", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "companyNotice" + ], + "summary": "更新企业公告", + "operationId": "updateCompanyNotice", + "parameters": [ + { + "description": "company notice", + "name": "companyNotice", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateCompanyNoticeReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/configurations/coding": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get coding configuration", + "tags": [ + "configuration" + ], + "summary": "获取Coding审核配置", + "operationId": "getCodingConfigurationV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetCodingConfigurationResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update coding configuration", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "添加或更新Coding配置", + "operationId": "UpdateCodingConfigurationV1", + "parameters": [ + { + "description": "update coding configuration req", + "name": "param", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateCodingConfigurationReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/configurations/coding/test": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "test coding configuration", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "测试Coding配置", + "operationId": "testCodingConfigV1", + "parameters": [ + { + "description": "test coding configuration req", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.TestCodingConfigurationReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.TestCodingConfigResV1" + } + } + } + } + }, + "/v1/configurations/ding_talk": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get dingTalk configuration", + "tags": [ + "configuration" + ], + "summary": "获取 dingTalk 配置", + "operationId": "getDingTalkConfigurationV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetDingTalkConfigurationResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update DingTalk configuration", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "添加或更新 DingTalk 配置", + "operationId": "updateDingTalkConfigurationV1", + "parameters": [ + { + "description": "update DingTalk configuration req", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateDingTalkConfigurationReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/configurations/ding_talk/test": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "test DingTalk configuration", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "测试 DingTalk 配置", + "operationId": "testDingTalkConfigV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.TestDingTalkConfigResV1" + } + } + } + } + }, + "/v1/configurations/drivers": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get drivers", + "tags": [ + "configuration" + ], + "summary": "获取当前 server 支持的审核类型", + "operationId": "getDriversV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetDriversResV1" + } + } + } + } + }, + "/v1/configurations/feishu_audit": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get feishu audit configuration", + "tags": [ + "configuration" + ], + "summary": "获取飞书审核配置", + "operationId": "getFeishuAuditConfigurationV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetFeishuAuditConfigurationResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update feishu audit configuration", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "添加或更新飞书配置", + "operationId": "updateFeishuAuditConfigurationV1", + "parameters": [ + { + "description": "update feishu audit configuration req", + "name": "param", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateFeishuConfigurationReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/configurations/feishu_audit/test": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "test feishu audit configuration", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "测试飞书审批配置", + "operationId": "testFeishuAuditConfigV1", + "parameters": [ + { + "description": "test feishu configuration req", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.TestFeishuConfigurationReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.TestFeishuConfigResV1" + } + } + } + } + }, + "/v1/configurations/git/test": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "test git connection", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "测试Git联通性", + "operationId": "TestGitConnectionV1", + "parameters": [ + { + "description": "test git configuration req", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.TestGitConnectionReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.TestGitConnectionResV1" + } + } + } + } + }, + "/v1/configurations/license": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sqle license", + "tags": [ + "configuration" + ], + "summary": "获取 sqle license", + "operationId": "getSQLELicenseV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetLicenseResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "set sqle license", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "configuration" + ], + "summary": "导入 sqle license", + "operationId": "setSQLELicenseV1", + "parameters": [ + { + "type": "file", + "description": "SQLE license file", + "name": "license_file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/configurations/license/check": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "parse and check sqle license", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "configuration" + ], + "summary": "解析和校验 sqle license", + "operationId": "checkSQLELicenseV1", + "parameters": [ + { + "type": "file", + "description": "SQLE license file", + "name": "license_file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.CheckLicenseResV1" + } + } + } + } + }, + "/v1/configurations/license/info": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get the information needed to generate the sqle license", + "tags": [ + "configuration" + ], + "summary": "获取生成 sqle license需要的的信息", + "operationId": "GetSQLELicenseInfoV1", + "responses": { + "200": { + "description": "server info", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/configurations/ssh_key": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get ssh public key", + "tags": [ + "configuration" + ], + "summary": "获取SSH公钥", + "operationId": "getSSHPublicKey", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.SSHPublicKeyInfoV1Rsp" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "gen ssh key", + "tags": [ + "configuration" + ], + "summary": "生成SSH密钥对", + "operationId": "genSSHPublicKey", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/configurations/wechat_audit": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get wechat audit configuration", + "tags": [ + "configuration" + ], + "summary": "获取微信审核配置", + "operationId": "getWechatAuditConfigurationV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWechatAuditConfigurationResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update wechat audit configuration", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "添加或更新微信配置", + "operationId": "updateWechatAuditConfigurationV1", + "parameters": [ + { + "description": "update wechat audit configuration req", + "name": "param", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateWechatConfigurationReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/configurations/wechat_audit/test": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "test wechat audit configuration", + "consumes": [ + "application/json" + ], + "tags": [ + "configuration" + ], + "summary": "测试微信审批配置", + "operationId": "testWechatAuditConfigV1", + "parameters": [ + { + "description": "test wechat configuration req", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.TestWechatConfigurationReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.TestWechatConfigResV1" + } + } + } + } + }, + "/v1/configurations/workflows/schedule/default_option": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get scheduled task default option", + "tags": [ + "workflow" + ], + "summary": "获取工单定时上线二次确认默认选项", + "operationId": "getScheduledTaskDefaultOptionV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.ScheduledTaskDefaultOptionV1Rsp" + } + } + } + } + }, + "/v1/custom_rules": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get all custom rule template", + "tags": [ + "rule_template" + ], + "summary": "自定义规则列表", + "operationId": "getCustomRulesV1", + "parameters": [ + { + "type": "string", + "description": "filter db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "filter desc", + "name": "filter_desc", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetCustomRulesResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create custom rule", + "tags": [ + "rule_template" + ], + "summary": "添加自定义规则", + "operationId": "createCustomRuleV1", + "parameters": [ + { + "description": "add custom rule", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.CreateCustomRuleReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/custom_rules/{db_type}/rule_types": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get rule type by db type", + "tags": [ + "rule_template" + ], + "summary": "获取规则分类", + "operationId": "getRuleTypeByDBTypeV1", + "parameters": [ + { + "type": "string", + "description": "db type", + "name": "db_type", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetRuleTypeByDBTypeResV1" + } + } + } + } + }, + "/v1/custom_rules/{rule_id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get custom rule by rule_id", + "tags": [ + "rule_template" + ], + "summary": "获取自定义规则", + "operationId": "getCustomRuleV1", + "parameters": [ + { + "type": "string", + "description": "rule id", + "name": "rule_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetCustomRuleResV1" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete custom rule", + "tags": [ + "rule_template" + ], + "summary": "删除自定义规则", + "operationId": "deleteCustomRuleV1", + "parameters": [ + { + "type": "string", + "description": "rule id", + "name": "rule_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update custom rule", + "tags": [ + "rule_template" + ], + "summary": "更新自定义规则", + "operationId": "updateCustomRuleV1", + "parameters": [ + { + "type": "string", + "description": "rule id", + "name": "rule_id", + "in": "path", + "required": true + }, + { + "description": "update custom rule", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateCustomRuleReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/dashboard": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get dashboard info", + "produces": [ + "application/json" + ], + "tags": [ + "dashboard" + ], + "summary": "获取 dashboard 信息", + "operationId": "getDashboardV1", + "parameters": [ + { + "type": "string", + "description": "filter project name", + "name": "filter_project_name", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetDashboardResV1" + } + } + } + } + }, + "/v1/dashboard/data_export_workflows": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global data export workflows list", + "tags": [ + "workflow" + ], + "summary": "获取全局导出工单列表", + "operationId": "getGlobalDataExportWorkflowsV1", + "parameters": [ + { + "type": "string", + "description": "filter create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "enum": [ + "wait_for_approve", + "wait_for_export", + "exporting", + "failed", + "rejected", + "cancel", + "finish" + ], + "type": "array", + "items": { + "type": "string" + }, + "description": "filter by workflow status,support using many status", + "name": "filter_status_list", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id in project", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "high", + "medium", + "low" + ], + "type": "string", + "description": "filter by project priority", + "name": "filter_project_priority", + "in": "query" + }, + { + "type": "string", + "description": "filter current step assignee user id", + "name": "filter_current_step_assignee_user_id", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowsResV1" + } + } + } + } + }, + "/v1/dashboard/data_export_workflows/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global data export workflows statistics", + "tags": [ + "workflow" + ], + "summary": "获取全局导出工单统计数据", + "operationId": "getGlobalDataExportWorkflowStatisticsV1", + "parameters": [ + { + "type": "string", + "description": "filter create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "enum": [ + "wait_for_approve", + "wait_for_export", + "exporting", + "failed", + "rejected", + "cancel", + "finish" + ], + "type": "array", + "items": { + "type": "string" + }, + "description": "filter by workflow status,support using many status", + "name": "filter_status_list", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id in project", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "high", + "medium", + "low" + ], + "type": "string", + "description": "filter by project priority", + "name": "filter_project_priority", + "in": "query" + }, + { + "type": "string", + "description": "filter current step assignee user id", + "name": "filter_current_step_assignee_user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GlobalWorkflowStatisticsResV1" + } + } + } + } + }, + "/v1/dashboard/sql_manages": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global sql manage list", + "tags": [ + "SqlManage" + ], + "summary": "获取全局管控sql列表", + "operationId": "GetGlobalSqlManageList", + "parameters": [ + { + "type": "string", + "description": "project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "high", + "medium", + "low" + ], + "type": "string", + "description": "project priority", + "name": "filter_project_priority", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetGlobalSqlManageListResp" + } + } + } + } + }, + "/v1/dashboard/sql_manages/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global sql manage statistics", + "tags": [ + "SqlManage" + ], + "summary": "获取全局管控sql统计信息", + "operationId": "GetGlobalSqlManageStatistics", + "parameters": [ + { + "type": "string", + "description": "project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "high", + "medium", + "low" + ], + "type": "string", + "description": "project priority", + "name": "filter_project_priority", + "in": "query" + }, + { + "type": "string", + "description": "filter current step assignee user id", + "name": "filter_current_step_assignee_user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetGlobalSqlManageStatisticsResp" + } + } + } + } + }, + "/v1/dashboard/workflows": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global workflow list", + "tags": [ + "workflow" + ], + "summary": "获取全局工单列表", + "operationId": "getGlobalWorkflowsV1", + "parameters": [ + { + "type": "string", + "description": "filter create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "executing", + "canceled", + "exec_failed", + "finished" + ], + "type": "array", + "items": { + "type": "string" + }, + "description": "filter by workflow status,, support using many status", + "name": "filter_status_list", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id in project", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "high", + "medium", + "low" + ], + "type": "string", + "description": "filter by project priority", + "name": "filter_project_priority", + "in": "query" + }, + { + "type": "string", + "description": "filter current step assignee user id", + "name": "filter_current_step_assignee_user_id", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowsResV1" + } + } + } + } + }, + "/v1/dashboard/workflows/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global workflow statistics", + "tags": [ + "workflow" + ], + "summary": "获取全局工单统计数据", + "operationId": "GetGlobalWorkflowStatistics", + "parameters": [ + { + "type": "string", + "description": "filter create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "executing", + "canceled", + "exec_failed", + "finished" + ], + "type": "array", + "items": { + "type": "string" + }, + "description": "filter by workflow status,, support using many status", + "name": "filter_status_list", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id in project", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "high", + "medium", + "low" + ], + "type": "string", + "description": "filter by project priority", + "name": "filter_project_priority", + "in": "query" + }, + { + "type": "string", + "description": "filter current step assignee user id", + "name": "filter_current_step_assignee_user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GlobalWorkflowStatisticsResV1" + } + } + } + } + }, + "/v1/database_driver_logos": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get database driver logos", + "tags": [ + "instance" + ], + "summary": "获取数据库插件的Logo图片", + "operationId": "GetDatabaseDriverLogos", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "description": "MySQL,Oracle", + "name": "db_types", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetDatabaseDriverLogosResV1" + } + } + } + } + }, + "/v1/database_driver_options": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get database driver options", + "tags": [ + "instance" + ], + "summary": "获取实例的额外属性列表", + "operationId": "getDatabaseDriverOptions", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetDatabaseDriverOptionsResV1" + } + } + } + } + }, + "/v1/import_rule_template": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get rule template file", + "tags": [ + "rule_template" + ], + "summary": "获取规则模板文件", + "operationId": "getRuleTemplateFileV1", + "parameters": [ + { + "type": "string", + "description": "instance type", + "name": "instance_type", + "in": "query", + "required": true + }, + { + "enum": [ + "csv", + "json" + ], + "type": "string", + "description": "file type", + "name": "file_type", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "sqle rule template file", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/knowledge_bases": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get knowledge base list", + "tags": [ + "knowledge_base" + ], + "summary": "获取知识库列表", + "operationId": "getKnowledgeBaseList", + "parameters": [ + { + "type": "string", + "description": "keywords", + "name": "keywords", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "description": "tags", + "name": "tags", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetKnowledgeBaseListRes" + } + } + } + } + }, + "/v1/knowledge_bases/graph": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get knowledge graph", + "tags": [ + "knowledge_base" + ], + "summary": "获取知识库知识图谱", + "operationId": "getKnowledgeGraph", + "parameters": [ + { + "type": "string", + "description": "filter by rule name", + "name": "filter_by_rule_name", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetKnowledgeGraphResp" + } + } + } + } + }, + "/v1/knowledge_bases/tags": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get tag list of knowledge base", + "tags": [ + "knowledge_base" + ], + "summary": "获取知识库标签列表", + "operationId": "getKnowledgeBaseTagList", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetKnowledgeBaseTagListRes" + } + } + } + } + }, + "/v1/operations": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get permission operations", + "tags": [ + "operation" + ], + "summary": "获取权限动作列表", + "operationId": "GetOperationsV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetOperationsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan info list", + "tags": [ + "audit_plan" + ], + "summary": "获取扫描任务信息列表", + "operationId": "getAuditPlansV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter audit plan db type", + "name": "filter_audit_plan_db_type", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search audit plan name", + "name": "fuzzy_search_audit_plan_name", + "in": "query" + }, + { + "type": "string", + "description": "filter audit plan type", + "name": "filter_audit_plan_type", + "in": "query" + }, + { + "type": "string", + "description": "filter audit plan instance name", + "name": "filter_audit_plan_instance_name", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditPlansResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create audit plan", + "consumes": [ + "application/json" + ], + "tags": [ + "audit_plan" + ], + "summary": "添加扫描任务", + "operationId": "createAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "create audit plan", + "name": "audit_plan", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.CreateAuditPlanReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan", + "tags": [ + "audit_plan" + ], + "summary": "获取指定扫描任务", + "operationId": "getAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditPlanResV1" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete audit plan", + "tags": [ + "audit_plan" + ], + "summary": "删除扫描任务", + "operationId": "deleteAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update audit plan", + "tags": [ + "audit_plan" + ], + "summary": "更新扫描任务", + "operationId": "updateAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "description": "update audit plan", + "name": "audit_plan", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateAuditPlanReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/notify_config": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan notify config", + "tags": [ + "audit_plan" + ], + "summary": "获取扫描任务消息推送设置", + "operationId": "getAuditPlanNotifyConfigV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditPlanNotifyConfigResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update audit plan notify config", + "tags": [ + "audit_plan" + ], + "summary": "更新扫描任务通知设置", + "operationId": "updateAuditPlanNotifyConfigV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "description": "update audit plan notify config", + "name": "config", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateAuditPlanNotifyConfigReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/notify_config/test": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Test audit task message push", + "tags": [ + "audit_plan" + ], + "summary": "测试扫描任务消息推送", + "operationId": "testAuditPlanNotifyConfigV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.TestAuditPlanNotifyConfigResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan report list", + "tags": [ + "audit_plan" + ], + "summary": "获取指定扫描任务的报告列表", + "operationId": "getAuditPlanReportsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditPlanReportsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan report", + "tags": [ + "audit_plan" + ], + "summary": "获取指定扫描任务的SQL扫描记录统计信息", + "operationId": "getAuditPlanReportV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan report id", + "name": "audit_plan_report_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditPlanReportResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/export": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "export audit plan report as csv", + "tags": [ + "audit_plan" + ], + "summary": "以csv的形式导出扫描报告", + "operationId": "exportAuditPlanReportV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan report id", + "name": "audit_plan_report_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "get export audit plan report", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan report SQLs", + "tags": [ + "audit_plan" + ], + "summary": "获取指定扫描任务的SQL扫描详情", + "operationId": "getAuditPlanReportsSQLsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan report id", + "name": "audit_plan_report_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditPlanReportSQLsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls/{number}/analysis": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get SQL explain and related table metadata for analysis", + "tags": [ + "audit_plan" + ], + "summary": "获取task相关的SQL执行计划和表元数据", + "operationId": "getTaskAnalysisData", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan report id", + "name": "audit_plan_report_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql number", + "name": "number", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditPlanAnalysisDataResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan SQLs", + "tags": [ + "audit_plan" + ], + "summary": "获取指定扫描任务的SQLs信息(不包括扫描结果)", + "operationId": "getAuditPlanSQLsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditPlanSQLsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/full": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "full sync audit plan SQLs", + "tags": [ + "audit_plan" + ], + "summary": "全量同步SQL到扫描任务", + "operationId": "fullSyncAuditPlanSQLsV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "description": "full sync audit plan SQLs request", + "name": "sqls", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.FullSyncAuditPlanSQLsReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/partial": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "partial sync audit plan SQLs", + "tags": [ + "audit_plan" + ], + "summary": "增量同步SQL到扫描任务", + "operationId": "partialSyncAuditPlanSQLsV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "description": "partial sync audit plan SQLs request", + "name": "sqls", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.PartialSyncAuditPlanSQLsReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_plans/{audit_plan_name}/trigger": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "trigger audit plan", + "tags": [ + "audit_plan" + ], + "summary": "触发扫描任务", + "operationId": "triggerAuditPlanV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.TriggerAuditPlanResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_whitelist": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get all whitelist", + "tags": [ + "audit_whitelist" + ], + "summary": "获取Sql审核白名单", + "operationId": "getAuditWhitelistV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy value", + "name": "fuzzy_search_value", + "in": "query" + }, + { + "type": "string", + "description": "match type", + "name": "filter_match_type", + "in": "query" + }, + { + "type": "string", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "page size", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditWhitelistResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create a sql whitelist", + "consumes": [ + "application/json" + ], + "tags": [ + "audit_whitelist" + ], + "summary": "添加SQL白名单", + "operationId": "createAuditWhitelistV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "add sql whitelist req", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.CreateAuditWhitelistReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/audit_whitelist/{audit_whitelist_id}/": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "remove sql white", + "tags": [ + "audit_whitelist" + ], + "summary": "删除SQL白名单信息", + "operationId": "deleteAuditWhitelistByIdV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit whitelist id", + "name": "audit_whitelist_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update sql whitelist by id", + "consumes": [ + "application/json" + ], + "tags": [ + "audit_whitelist" + ], + "summary": "更新SQL白名单", + "operationId": "UpdateAuditWhitelistByIdV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql audit whitelist id", + "name": "audit_whitelist_id", + "in": "path", + "required": true + }, + { + "description": "update sql whitelist req", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateAuditWhitelistReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/blacklist": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get blacklist", + "tags": [ + "blacklist" + ], + "summary": "获取黑名单列表", + "operationId": "getBlacklistV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "enum": [ + "sql", + "fp_sql", + "ip", + "cidr", + "host", + "instance" + ], + "type": "string", + "description": "filter type", + "name": "filter_type", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search content", + "name": "fuzzy_search_content", + "in": "query" + }, + { + "type": "string", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "page size", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetBlacklistResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create a blacklist", + "consumes": [ + "application/json" + ], + "tags": [ + "blacklist" + ], + "summary": "添加黑名单", + "operationId": "createBlacklistV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "add blacklist req", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.CreateBlacklistReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/blacklist/{blacklist_id}/": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete a blacklist", + "tags": [ + "blacklist" + ], + "operationId": "deleteBlackList", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "blacklist id", + "name": "blacklist_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update a blacklist", + "consumes": [ + "application/json" + ], + "tags": [ + "blacklist" + ], + "summary": "更新黑名单", + "operationId": "updateBlacklistV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "blacklist id", + "name": "blacklist_id", + "in": "path", + "required": true + }, + { + "description": "update blacklist req", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateBlacklistReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/database_comparison/comparison_statements": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get database comparison detail", + "consumes": [ + "application/json" + ], + "tags": [ + "database_comparison" + ], + "summary": "获取对比语句", + "operationId": "getComparisonStatementV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "get database comparison statement request", + "name": "database_comparison_object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.GetComparisonStatementsReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.DatabaseComparisonStatementsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/database_comparison/execute_comparison": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get database comparison", + "consumes": [ + "application/json" + ], + "tags": [ + "database_comparison" + ], + "summary": "执行数据库结构对比并获取结果", + "operationId": "executeDatabaseComparisonV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "get database comparison request", + "name": "database_comparison", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.GetDatabaseComparisonReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.DatabaseComparisonResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/database_comparison/modify_sql_statements": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "generate database diff modify sqls", + "consumes": [ + "application/json" + ], + "tags": [ + "database_comparison" + ], + "summary": "生成变更SQL", + "operationId": "genDatabaseDiffModifySQLsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "generate database diff modify sqls request", + "name": "gen_modify_sql", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.GenModifylSQLReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GenModifySQLResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance audit plan info list", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取实例扫描任务列表", + "operationId": "getInstanceAuditPlansV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter by business", + "name": "filter_by_business", + "in": "query" + }, + { + "type": "string", + "description": "filter by environment tag", + "name": "filter_by_environment_tag", + "in": "query" + }, + { + "type": "string", + "description": "filter by db type", + "name": "filter_by_db_type", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_by_instance_id", + "in": "query" + }, + { + "type": "string", + "description": "filter instance audit plan type", + "name": "filter_by_audit_plan_type", + "in": "query" + }, + { + "type": "string", + "description": "filter instance audit plan active status", + "name": "filter_by_active_status", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search", + "name": "fuzzy_search", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetInstanceAuditPlansResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create instance audit plan", + "consumes": [ + "application/json" + ], + "tags": [ + "instance_audit_plan" + ], + "summary": "添加实例扫描任务", + "operationId": "createInstanceAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "create instance audit plan", + "name": "instannce_audit_plan", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.CreateInstanceAuditPlanReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.CreatInstanceAuditPlanResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance audit plan detail", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取实例扫描任务详情", + "operationId": "getInstanceAuditPlanDetailV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetInstanceAuditPlanDetailResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update instance audit plan", + "tags": [ + "instance_audit_plan" + ], + "summary": "更新实例扫描任务配置", + "operationId": "updateInstanceAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "description": "update instance audit plan", + "name": "audit_plan", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateInstanceAuditPlanReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete instance audit plan", + "tags": [ + "instance_audit_plan" + ], + "summary": "删除实例扫描任务", + "operationId": "deleteInstanceAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "stop/start instance audit plan", + "tags": [ + "instance_audit_plan" + ], + "summary": "更新实例扫描任务状态", + "operationId": "updateInstanceAuditPlanStatusV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "description": "update instance audit plan", + "name": "audit_plan", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateInstanceAuditPlanStatusReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan overview", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取实例扫描任务概览", + "operationId": "getInstanceAuditPlanOverviewV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetInstanceAuditPlanOverviewResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete audit plan by type", + "tags": [ + "instance_audit_plan" + ], + "summary": "删除扫描任务", + "operationId": "deleteAuditPlanByTypeV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan id", + "name": "audit_plan_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "stop/start audit plan", + "tags": [ + "instance_audit_plan" + ], + "summary": "更新扫描任务状态", + "operationId": "updateAuditPlanStatusV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan id", + "name": "audit_plan_id", + "in": "path", + "required": true + }, + { + "description": "update audit plan status", + "name": "audit_plan", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateAuditPlanStatusReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/audit": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "audit plan trigger sql audit", + "tags": [ + "instance_audit_plan" + ], + "summary": "扫描任务触发sql审核", + "operationId": "auditPlanTriggerSqlAuditV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan id", + "name": "audit_plan_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/sql_data": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan SQLs", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取指定扫描任务的SQL列表", + "operationId": "getInstanceAuditPlanSQLDataV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan id", + "name": "audit_plan_id", + "in": "path", + "required": true + }, + { + "description": "audit plan sql data request", + "name": "audit_plan_sql_request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.GetAuditPlanSQLDataReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditPlanSQLDataResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/sql_export": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "export audit plan SQL report as CSV or Excel", + "tags": [ + "instance_audit_plan" + ], + "summary": "导出指定扫描任务的 SQL 列表", + "operationId": "getInstanceAuditPlanSQLExportV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan id", + "name": "audit_plan_id", + "in": "path", + "required": true + }, + { + "description": "audit plan sql export request", + "name": "audit_plan_sql_request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.GetAuditPlanSQLExportReqV1" + } + } + ], + "responses": { + "200": { + "description": "export audit plan sql report", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/sql_meta": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan SQL meta", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取指定扫描任务的SQL列表元信息", + "operationId": "getInstanceAuditPlanSQLMetaV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan id", + "name": "audit_plan_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditPlanSQLMetaResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/audit_plans/{audit_plan_id}/sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan SQLs", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取指定扫描任务的SQLs信息", + "operationId": "getInstanceAuditPlanSQLsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan id", + "name": "audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditPlanSQLsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/sqls/{id}/analysis": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get SQL explain and related table metadata for analysis", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取扫描任务相关的SQL执行计划和表元数据", + "operationId": "getAuditPlanSqlAnalysisDataV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan sql id", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "whether to calculate and return affected rows, default is true", + "name": "affectRowsEnabled", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSqlManageSqlAnalysisResp" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}/token": { + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "refresh audit plan token", + "tags": [ + "instance_audit_plan" + ], + "summary": "重置扫描任务token", + "operationId": "refreshAuditPlanTokenV1", + "parameters": [ + { + "description": "update instance audit plan token", + "name": "audit_plan", + "in": "body", + "schema": { + "$ref": "#/definitions/v1.RefreshAuditPlanTokenReqV1" + } + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/instance_tips": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance tip list", + "tags": [ + "instance" + ], + "summary": "获取实例提示列表", + "operationId": "getInstanceTipListV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "filter by business", + "name": "filter_by_business", + "in": "query" + }, + { + "type": "string", + "description": "filter workflow template id", + "name": "filter_workflow_template_id", + "in": "query" + }, + { + "enum": [ + "create_audit_plan", + "create_workflow", + "sql_manage", + "create_optimization", + "create_pipeline" + ], + "type": "string", + "description": "functional module", + "name": "functional_module", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetInstanceTipsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instances/connections": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "batch test instance db connections", + "tags": [ + "instance" + ], + "summary": "批量测试实例连通性(实例提交后)", + "operationId": "batchCheckInstanceIsConnectableByName", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "instances", + "name": "instances", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.BatchCheckInstanceConnectionsReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.BatchGetInstanceConnectionsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instances/{instance_name}/connection": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "test instance db connection", + "tags": [ + "instance" + ], + "summary": "实例连通性测试(实例提交后)", + "operationId": "checkInstanceIsConnectableByNameV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetInstanceConnectableResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instances/{instance_name}/rules": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance all rule", + "tags": [ + "instance" + ], + "summary": "获取实例应用的规则列表", + "operationId": "getInstanceRuleListV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetRulesResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instances/{instance_name}/schemas": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "instance schema list", + "tags": [ + "instance" + ], + "summary": "实例 Schema 列表", + "operationId": "getInstanceSchemasV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetInstanceSchemaResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instances/{instance_name}/schemas/{schema_name}/tables": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "list table by schema", + "tags": [ + "instance" + ], + "summary": "获取数据库下的所有表", + "operationId": "listTableBySchema", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "schema name", + "name": "schema_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.ListTableBySchemaResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/instances/{instance_name}/schemas/{schema_name}/tables/{table_name}/metadata": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get table metadata", + "tags": [ + "instance" + ], + "summary": "获取表元数据", + "operationId": "getTableMetadata", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "schema name", + "name": "schema_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "table name", + "name": "table_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetTableMetadataResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/pipelines": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get pipeline list", + "tags": [ + "pipeline" + ], + "summary": "获取流水线列表", + "operationId": "getPipelinesV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy search pipeline name and description", + "name": "fuzzy_search_name_desc", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetPipelinesResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create pipeline", + "consumes": [ + "application/json" + ], + "tags": [ + "pipeline" + ], + "summary": "创建流水线", + "operationId": "createPipelineV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "create pipeline", + "name": "pipeline", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.CreatePipelineReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.CreatePipelineResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/pipelines/{pipeline_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get pipeline detail", + "tags": [ + "pipeline" + ], + "summary": "获取流水线详情", + "operationId": "getPipelineDetailV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "pipeline id", + "name": "pipeline_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetPipelineDetailResV1" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete pipeline", + "tags": [ + "pipeline" + ], + "summary": "删除流水线", + "operationId": "deletePipelineV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "pipeline id", + "name": "pipeline_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update pipeline", + "tags": [ + "pipeline" + ], + "summary": "更新流水线", + "operationId": "updatePipelineV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "pipeline id", + "name": "pipeline_id", + "in": "path", + "required": true + }, + { + "description": "update pipeline", + "name": "pipeline", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdatePipelineReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/pipelines/{pipeline_id}/token/{node_id}/": { + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "refresh pipeline token", + "tags": [ + "pipeline" + ], + "summary": "刷新流水线节点token", + "operationId": "refreshPipelineNodeTokenV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "pipeline id", + "name": "pipeline_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "node id", + "name": "node_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/report_push_configs": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Get report push config list", + "tags": [ + "ReportPushConfig" + ], + "summary": "获取消息推送配置列表", + "operationId": "GetReportPushConfigList", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetReportPushConfigsListResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/report_push_configs/{report_push_config_id}/": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update report push config", + "tags": [ + "ReportPushConfig" + ], + "summary": "更新消息推送配置", + "operationId": "UpdateReportPushConfig", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "report push config id", + "name": "report_push_config_id", + "in": "path", + "required": true + }, + { + "description": "update report push config request", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateReportPushConfigReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/rule_template_tips": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get rule template tips in project", + "tags": [ + "rule_template" + ], + "summary": "获取项目规则模板提示", + "operationId": "getProjectRuleTemplateTipsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter db type", + "name": "filter_db_type", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetRuleTemplateTipsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/rule_templates": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get all rule template in a project", + "tags": [ + "rule_template" + ], + "summary": "项目规则模板列表", + "operationId": "getProjectRuleTemplateListV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetProjectRuleTemplatesResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create a rule template in project", + "consumes": [ + "application/json" + ], + "tags": [ + "rule_template" + ], + "summary": "添加项目规则模板", + "operationId": "createProjectRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "add rule template request", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.CreateProjectRuleTemplateReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/rule_templates/{rule_template_name}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get rule template detail in project", + "tags": [ + "rule_template" + ], + "summary": "获取项目规则模板信息", + "operationId": "getProjectRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy rule,keyword for desc and annotation", + "name": "fuzzy_keyword_rule", + "in": "query" + }, + { + "type": "string", + "description": "tags for rule", + "name": "tags", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetProjectRuleTemplateResV1" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete rule template in project", + "tags": [ + "rule_template" + ], + "summary": "删除项目规则模板", + "operationId": "deleteProjectRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update rule template in project", + "tags": [ + "rule_template" + ], + "summary": "更新项目规则模板", + "operationId": "updateProjectRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + }, + { + "description": "update rule template request", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateProjectRuleTemplateReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/rule_templates/{rule_template_name}/clone": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "clone a rule template in project", + "consumes": [ + "application/json" + ], + "tags": [ + "rule_template" + ], + "summary": "克隆项目规则模板", + "operationId": "cloneProjectRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + }, + { + "description": "clone rule template request", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.CloneProjectRuleTemplateReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/rule_templates/{rule_template_name}/export": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "export rule template in a project", + "tags": [ + "rule_template" + ], + "summary": "导出项目规则模板", + "operationId": "exportProjectRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + }, + { + "enum": [ + "csv", + "json" + ], + "type": "string", + "description": "export type", + "name": "export_type", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "sqle rule template file", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_audit_records": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql audit records", + "tags": [ + "sql_audit_record" + ], + "summary": "获取SQL审核记录列表", + "operationId": "getSQLAuditRecordsV1", + "parameters": [ + { + "type": "string", + "description": "fuzzy search tags", + "name": "fuzzy_search_tags", + "in": "query" + }, + { + "enum": [ + "auditing", + "successfully" + ], + "type": "string", + "description": "filter sql audit status", + "name": "filter_sql_audit_status", + "in": "query" + }, + { + "type": "integer", + "description": "filter instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "type": "string", + "description": "filter create time from", + "name": "filter_create_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter create time to", + "name": "filter_create_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter sql audit record ids", + "name": "filter_sql_audit_record_ids", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSQLAuditRecordsResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "SQL audit\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.\n4. file[input_zip_file]: it is ZIP file that sql will be parsed from xml or sql file inside it.\n5. formData[git_http_url]:the url which scheme is http(s) and end with .git.\n6. formData[git_user_name]:The name of the user who owns the repository read access.\n7. formData[git_branch_name]:The name of the repository branch.\n8. formData[git_user_password]:The password corresponding to git_user_name.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sql_audit_record" + ], + "summary": "SQL审核", + "operationId": "CreateSQLAuditRecordV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "formData" + }, + { + "type": "string", + "description": "schema of instance", + "name": "instance_schema", + "in": "formData" + }, + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "formData" + }, + { + "type": "string", + "description": "db type of instance", + "name": "db_type", + "in": "formData" + }, + { + "type": "string", + "description": "sqls for audit", + "name": "sqls", + "in": "formData" + }, + { + "type": "file", + "description": "input SQL file", + "name": "input_sql_file", + "in": "formData" + }, + { + "type": "file", + "description": "input mybatis XML file", + "name": "input_mybatis_xml_file", + "in": "formData" + }, + { + "type": "file", + "description": "input ZIP file", + "name": "input_zip_file", + "in": "formData" + }, + { + "type": "string", + "description": "git repository url", + "name": "git_http_url", + "in": "formData" + }, + { + "type": "string", + "description": "the name of user to clone the repository", + "name": "git_user_name", + "in": "formData" + }, + { + "type": "string", + "description": "the name of repository branch", + "name": "git_branch_name", + "in": "formData" + }, + { + "type": "string", + "description": "the password corresponding to git_user_name", + "name": "git_user_password", + "in": "formData" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.CreateSQLAuditRecordResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_audit_records/tag_tips": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql audit record tag tips", + "tags": [ + "sql_audit_record" + ], + "summary": "获取SQL审核记录标签列表", + "operationId": "GetSQLAuditRecordTagTipsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSQLAuditRecordTagTipsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_audit_records/{sql_audit_record_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql audit record info", + "tags": [ + "sql_audit_record" + ], + "summary": "获取SQL审核记录信息", + "operationId": "getSQLAuditRecordV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql audit record id", + "name": "sql_audit_record_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSQLAuditRecordResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update SQL audit record", + "consumes": [ + "application/json" + ], + "tags": [ + "sql_audit_record" + ], + "summary": "更新SQL审核记录", + "operationId": "updateSQLAuditRecordV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql audit record id", + "name": "sql_audit_record_id", + "in": "path", + "required": true + }, + { + "description": "update SQL audit record", + "name": "param", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateSQLAuditRecordReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_dev_records": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql dev record list", + "tags": [ + "SqlDEVRecord" + ], + "summary": "获取开发sql记录", + "operationId": "GetSqlDEVRecordList", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy search sql fingerprint", + "name": "fuzzy_search_sql_fingerprint", + "in": "query" + }, + { + "type": "string", + "description": "instance name", + "name": "filter_instance_name", + "in": "query" + }, + { + "enum": [ + "ide_plugin" + ], + "type": "string", + "description": "source", + "name": "filter_source", + "in": "query" + }, + { + "type": "string", + "description": "creator name", + "name": "filter_creator", + "in": "query" + }, + { + "type": "string", + "description": "last receive time from", + "name": "filter_last_receive_time_from", + "in": "query" + }, + { + "type": "string", + "description": "last receive time to", + "name": "filter_last_receive_time_to", + "in": "query" + }, + { + "enum": [ + "first_appear_timestamp", + "last_receive_timestamp", + "fp_count" + ], + "type": "string", + "description": "sort field", + "name": "sort_field", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "sort order", + "name": "sort_order", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSqlDEVRecordListResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_manages": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql manage list", + "tags": [ + "SqlManage" + ], + "summary": "获取管控sql列表", + "operationId": "GetSqlManageList", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy search sql fingerprint", + "name": "fuzzy_search_sql_fingerprint", + "in": "query" + }, + { + "type": "string", + "description": "assignee", + "name": "filter_assignee", + "in": "query" + }, + { + "type": "string", + "description": "instance name", + "name": "filter_instance_name", + "in": "query" + }, + { + "enum": [ + "audit_plan", + "sql_audit_record" + ], + "type": "string", + "description": "source", + "name": "filter_source", + "in": "query" + }, + { + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "type": "string", + "description": "audit level", + "name": "filter_audit_level", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time from", + "name": "filter_last_audit_start_time_from", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time to", + "name": "filter_last_audit_start_time_to", + "in": "query" + }, + { + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited" + ], + "type": "string", + "description": "status", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "rule name", + "name": "filter_rule_name", + "in": "query" + }, + { + "type": "string", + "description": "db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search endpoint", + "name": "fuzzy_search_endpoint", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search schema name", + "name": "fuzzy_search_schema_name", + "in": "query" + }, + { + "enum": [ + "first_appear_timestamp", + "last_receive_timestamp", + "fp_count" + ], + "type": "string", + "description": "sort field", + "name": "sort_field", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "sort order", + "name": "sort_order", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSqlManageListResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_manages/abnormal_audit_plan_instance": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get the instance of audit plan execution abnormal", + "tags": [ + "SqlManage" + ], + "summary": "获取执行异常的扫描任务实例", + "operationId": "getAbnormalInstanceAuditPlansV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAbnormalAuditPlanInstancesResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_manages/batch": { + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "batch update sql manage", + "tags": [ + "SqlManage" + ], + "summary": "批量更新SQL管控", + "operationId": "BatchUpdateSqlManage", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "batch update sql manage request", + "name": "BatchUpdateSqlManageReq", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.BatchUpdateSqlManageReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_manages/exports": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "export sql manage", + "tags": [ + "SqlManage" + ], + "summary": "导出SQL管控", + "operationId": "exportSqlManageV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy search sql fingerprint", + "name": "fuzzy_search_sql_fingerprint", + "in": "query" + }, + { + "type": "string", + "description": "assignee", + "name": "filter_assignee", + "in": "query" + }, + { + "type": "string", + "description": "filter by business", + "name": "filter_business", + "in": "query" + }, + { + "enum": [ + "high", + "low" + ], + "type": "string", + "description": "priority", + "name": "filter_priority", + "in": "query" + }, + { + "type": "string", + "description": "instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "audit_plan", + "sql_audit_record" + ], + "type": "string", + "description": "source", + "name": "filter_source", + "in": "query" + }, + { + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "type": "string", + "description": "audit level", + "name": "filter_audit_level", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time from", + "name": "filter_last_audit_start_time_from", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time to", + "name": "filter_last_audit_start_time_to", + "in": "query" + }, + { + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited" + ], + "type": "string", + "description": "status", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "rule name", + "name": "filter_rule_name", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search endpoint", + "name": "fuzzy_search_endpoint", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search schema name", + "name": "fuzzy_search_schema_name", + "in": "query" + }, + { + "enum": [ + "first_appear_timestamp", + "last_receive_timestamp", + "fp_count" + ], + "type": "string", + "description": "sort field", + "name": "sort_field", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "sort order", + "name": "sort_order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "export sql manage", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_manages/rule_tips": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql manage rule tips", + "tags": [ + "SqlManage" + ], + "summary": "获取管控规则tips", + "operationId": "GetSqlManageRuleTips", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSqlManageRuleTipsResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_manages/send": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql manage analysis", + "tags": [ + "SqlManage" + ], + "summary": "推送SQL管控结果到外部系统", + "operationId": "SendSqlManage", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "batch update sql manage request", + "name": "SqlManageCodingReq", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.SqlManageCodingReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.PostSqlManageCodingResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_manages/{sql_manage_id}/sql_analysis": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql manage analysis", + "tags": [ + "SqlManage" + ], + "summary": "获取SQL管控SQL分析", + "operationId": "GetSqlManageSqlAnalysisV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql manage id", + "name": "sql_manage_id", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "whether to calculate and return affected rows, default is true", + "name": "affectRowsEnabled", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSqlManageSqlAnalysisResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_manages/{sql_manage_id}/sql_analysis_chart": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql manage analysis", + "tags": [ + "SqlManage" + ], + "summary": "获取SQL管控SQL执行计划Cost趋势图表", + "operationId": "GetSqlManageSqlAnalysisChartV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql manage id", + "name": "sql_manage_id", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "latest_point_enabled", + "name": "latest_point_enabled", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "start time", + "name": "start_time", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "end time", + "name": "end_time", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "metric_name", + "name": "metric_name", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.SqlManageAnalysisChartResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_optimization_records": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql optimization records", + "tags": [ + "sql_optimization" + ], + "summary": "获取SQL优化记录列表", + "operationId": "getOptimizationRecords", + "parameters": [ + { + "type": "string", + "description": "fuzzy search for optimization_id or create_username", + "name": "fuzzy_search", + "in": "query" + }, + { + "type": "string", + "description": "filter instance name", + "name": "filter_instance_name", + "in": "query" + }, + { + "type": "string", + "description": "filter create time from", + "name": "filter_create_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter create time to", + "name": "filter_create_time_to", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetOptimizationRecordsRes" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "optimize sql\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.\n4. file[input_zip_file]: it is ZIP file that sql will be parsed from xml or sql file inside it.\n5. formData[git_http_url]:the url which scheme is http(s) and end with .git.\n6. formData[git_user_name]:The name of the user who owns the repository read access.\n7. formData[git_user_password]:The password corresponding to git_user_name.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sql_optimization" + ], + "summary": "优化SQL", + "operationId": "OptimizeSQLReq", + "parameters": [ + { + "description": "sqls that should be optimization", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.OptimizeSQLReq" + } + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "formData" + }, + { + "type": "string", + "description": "schema of instance", + "name": "schema_name", + "in": "formData" + }, + { + "type": "string", + "description": "db type of instance", + "name": "db_type", + "in": "formData" + }, + { + "type": "string", + "description": "sqls for audit", + "name": "sql_content", + "in": "formData" + }, + { + "type": "string", + "description": "optimization name", + "name": "optimization_name", + "in": "formData", + "required": true + }, + { + "type": "file", + "description": "input SQL file", + "name": "input_sql_file", + "in": "formData" + }, + { + "type": "file", + "description": "input mybatis XML file", + "name": "input_mybatis_xml_file", + "in": "formData" + }, + { + "type": "file", + "description": "input ZIP file", + "name": "input_zip_file", + "in": "formData" + }, + { + "type": "string", + "description": "git repository url", + "name": "git_http_url", + "in": "formData" + }, + { + "type": "string", + "description": "the name of user to clone the repository", + "name": "git_user_name", + "in": "formData" + }, + { + "type": "string", + "description": "the password corresponding to git_user_name", + "name": "git_user_password", + "in": "formData" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.OptimizeSQLRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_optimization_records/{optimization_record_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql optimization record", + "tags": [ + "sql_optimization" + ], + "summary": "获取SQL优化记录", + "operationId": "GetOptimizationRecordReq", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql optimization record id", + "name": "optimization_record_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql", + "name": "sql", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetOptimizationRecordRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_optimization_records/{optimization_record_id}/sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql optimization sqls", + "tags": [ + "sql_optimization" + ], + "summary": "获取SQL优化语句列表", + "operationId": "getOptimizationSQLs", + "parameters": [ + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "optimization record id", + "name": "optimization_record_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetOptimizationSQLsRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_optimization_records/{optimization_record_id}/sqls/{number}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql optimization record", + "tags": [ + "sql_optimization" + ], + "summary": "获取SQL优化语句详情", + "operationId": "GetOptimizationReq", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql optimization record id", + "name": "optimization_record_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "optimization record sql number", + "name": "number", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetOptimizationSQLRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_performance_insights": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql manage sql performance insights", + "tags": [ + "SqlInsight" + ], + "summary": "获取SQL管控SQL性能洞察图表数据", + "operationId": "GetSqlPerformanceInsights", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "enum": [ + "comprehensive_trend", + "slow_sql_trend", + "top_sql_trend", + "active_session_trend" + ], + "type": "string", + "description": "metric name", + "name": "metric_name", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "start time", + "name": "start_time", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "end time", + "name": "end_time", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "instance id", + "name": "instance_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSqlPerformanceInsightsResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_performance_insights/related_sql": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Get related SQL for the selected time range in SQL performance insights", + "tags": [ + "SqlInsight" + ], + "summary": "获取sql洞察 时间选区 的关联SQL", + "operationId": "GetSqlPerformanceInsightsRelatedSQL", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance id", + "name": "instance_id", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "start time", + "name": "start_time", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "end time", + "name": "end_time", + "in": "query", + "required": true + }, + { + "enum": [ + "workflow", + "sql_manage", + "workbench" + ], + "type": "string", + "description": "filter by SQL source", + "name": "filter_source", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "order by field", + "name": "order_by", + "in": "query" + }, + { + "type": "boolean", + "description": "is ascending order", + "name": "is_asc", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSqlPerformanceInsightsRelatedSQLResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_performance_insights/related_sql/related_transaction": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Get related transaction for the selected SQL in SQL performance insights", + "tags": [ + "SqlInsight" + ], + "summary": "获取sql洞察 相关SQL中具体一条SQL 的关联事务", + "operationId": "GetSqlPerformanceInsightsRelatedTransaction", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance id", + "name": "instance_id", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "sql id", + "name": "sql_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSqlPerformanceInsightsRelatedTransactionResp" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_versions": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "sql version list", + "consumes": [ + "application/json" + ], + "tags": [ + "sql_version" + ], + "summary": "获取SQL版本列表", + "operationId": "getSqlVersionListV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter by created at from", + "name": "filter_by_created_at_from", + "in": "query" + }, + { + "type": "string", + "description": "filter by created at to", + "name": "filter_by_created_at_to", + "in": "query" + }, + { + "type": "string", + "description": "filter by lock time from", + "name": "filter_by_lock_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter by lock time to", + "name": "filter_by_lock_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter by version status", + "name": "filter_by_version_status", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search", + "name": "fuzzy_search", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSqlVersionListResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create sql version", + "consumes": [ + "application/json" + ], + "tags": [ + "sql_version" + ], + "summary": "创建SQL版本记录", + "operationId": "createSqlVersionV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "create sql version request", + "name": "sql_version", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.CreateSqlVersionReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.CreateSqlVersionResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_versions/{sql_version_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql version detail", + "tags": [ + "sql_version" + ], + "summary": "获取SQL版本详情", + "operationId": "getSqlVersionDetailV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSqlVersionDetailResV1" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete sql version", + "tags": [ + "sql_version" + ], + "summary": "删除SQL版本", + "operationId": "deleteSqlVersionV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update sql version", + "tags": [ + "sql_version" + ], + "summary": "更新SQL版本信息", + "operationId": "updateSqlVersionV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + }, + { + "description": "update sql version request", + "name": "sql_version", + "in": "body", + "schema": { + "$ref": "#/definitions/v1.UpdateSqlVersionReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_versions/{sql_version_id}/batch_execute_workflows": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "batch execute workflows", + "tags": [ + "sql_version" + ], + "summary": "工单批量上线", + "operationId": "batchExecuteWorkflowsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + }, + { + "description": "batch execute workflows request", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.BatchExecuteWorkflowsReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_versions/{sql_version_id}/batch_release_workflows": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "batch release workflow", + "tags": [ + "sql_version" + ], + "summary": "批量发布工单(在版本的下一阶段创建工单)", + "operationId": "batchReleaseWorkflowsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + }, + { + "description": "batch release workflow request", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.BatchReleaseWorkflowReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_versions/{sql_version_id}/lock": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "lock sql version", + "tags": [ + "sql_version" + ], + "summary": "锁定SQL版本", + "operationId": "lockSqlVersionV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + }, + { + "description": "lock sql version request", + "name": "sql_version", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.LockSqlVersionReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_versions/{sql_version_id}/sql_version_stages/{sql_version_stage_id}/associate_workflows": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflows that can be associated to version", + "tags": [ + "sql_version" + ], + "summary": "获取可与版本关联的工单", + "operationId": "GetWorkflowsThatCanBeAssociatedToVersionV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version stage id", + "name": "sql_version_stage_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowsThatCanBeAssociatedToVersionResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "batch associate workflows with version", + "tags": [ + "sql_version" + ], + "summary": "批量关联工单到版本", + "operationId": "batchAssociateWorkflowsWithVersionV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version stage id", + "name": "sql_version_stage_id", + "in": "path", + "required": true + }, + { + "description": "batch associate workflows with version request", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.BatchAssociateWorkflowsWithVersionReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/sql_versions/{sql_version_id}/sql_version_stages/{sql_version_stage_id}/dependencies": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get dependencies between stage instance", + "tags": [ + "sql_version" + ], + "summary": "获取当前阶段与下一阶段实例的依赖信息", + "operationId": "getDependenciesBetweenStageInstanceV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version id", + "name": "sql_version_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql version stage id", + "name": "sql_version_stage_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetDepBetweenStageInstanceResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/audit_plans": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "statistic audit plan", + "tags": [ + "statistic" + ], + "summary": "获取各类型数据源上的扫描任务数量", + "operationId": "statisticAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.StatisticAuditPlanResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/audited_sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "statistics audited sql", + "tags": [ + "statistic" + ], + "summary": "获取审核SQL总数,以及触发审核规则的SQL数量", + "operationId": "statisticsAuditedSQLV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.StatisticsAuditedSQLResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/instance_health": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance health", + "tags": [ + "statistic" + ], + "summary": "获取各类型数据源的健康情况", + "operationId": "GetInstanceHealthV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetInstanceHealthResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/optimization_performance_improve_overview": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get db optimization performance improvements", + "tags": [ + "sql_optimization" + ], + "summary": "获取实例性能提升概览", + "operationId": "getDBPerformanceImproveOverview", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetDBPerformanceImproveOverviewResp" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/optimization_record_overview": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql optimization record overview", + "tags": [ + "sql_optimization" + ], + "summary": "获取SQL优化记录概览", + "operationId": "getOptimizationOverview", + "parameters": [ + { + "type": "string", + "description": "create time from", + "name": "filter_create_time_from", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "create time to", + "name": "filter_create_time_to", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetOptimizationOverviewResp" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/project_score": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get project score", + "tags": [ + "statistic" + ], + "summary": "获取项目分数", + "operationId": "GetProjectScoreV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetProjectScoreResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/risk_audit_plans": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get risk audit plan", + "tags": [ + "statistic" + ], + "summary": "获取扫描任务报告评分低于60的扫描任务", + "operationId": "getRiskAuditPlanV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetRiskAuditPlanResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/risk_workflow": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "statistic risk workflow", + "tags": [ + "statistic" + ], + "summary": "获取存在风险的工单", + "operationId": "statisticRiskWorkflowV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.StatisticRiskWorkflowResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/role_user": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get role user count", + "tags": [ + "statistic" + ], + "summary": "获取各角色类型对应的成员数量", + "operationId": "getRoleUserCountV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetRoleUserCountResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistic/workflow_status": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "statistic workflow status", + "tags": [ + "statistic" + ], + "summary": "获取项目下工单各个状态的数量", + "operationId": "statisticWorkflowStatusV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowStatusCountResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get project statistics", + "tags": [ + "statistic" + ], + "summary": "获取项目统计信息", + "operationId": "getProjectStatisticsV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetProjectStatisticsResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/task_groups": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create tasks group.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "创建审核任务组", + "operationId": "createAuditTasksV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "parameters for creating audit tasks group", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.CreateAuditTasksGroupReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.CreateAuditTasksGroupResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/tasks/audits": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create and audit a task, you can upload sql content in three ways, any one can be used, but only one is effective.\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "创建Sql扫描任务并提交审核", + "operationId": "createAndAuditTaskV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "schema of instance", + "name": "instance_schema", + "in": "formData" + }, + { + "type": "boolean", + "description": "enable backup", + "name": "enable_backup", + "in": "formData" + }, + { + "type": "integer", + "description": "backup max rows", + "name": "backup_max_rows", + "in": "formData" + }, + { + "type": "string", + "description": "sqls for audit", + "name": "sql", + "in": "formData" + }, + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "formData" + }, + { + "type": "file", + "description": "input SQL file", + "name": "input_sql_file", + "in": "formData" + }, + { + "type": "file", + "description": "input mybatis XML file", + "name": "input_mybatis_xml_file", + "in": "formData" + }, + { + "type": "file", + "description": "input ZIP file", + "name": "input_zip_file", + "in": "formData" + }, + { + "type": "string", + "description": "exec mode", + "name": "exec_mode", + "in": "formData" + }, + { + "type": "string", + "description": "file order method", + "name": "file_order_method", + "in": "formData" + }, + { + "description": "create and audit task", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.CreateAuditTaskReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditTaskResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/workflow_template": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow template detail; query by workflow_template_id or by workflow_type default template", + "tags": [ + "workflow" + ], + "summary": "获取审批流程模板详情", + "operationId": "getWorkflowTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "enum": [ + "workflow", + "data_export" + ], + "type": "string", + "description": "filter workflow type", + "name": "workflow_type", + "in": "query" + }, + { + "type": "integer", + "description": "workflow template id", + "name": "workflow_template_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowTemplateResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/workflow_template/{workflow_type}/": { + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update the workflow template", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "更新Sql审批流程模板", + "operationId": "updateWorkflowTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "enum": [ + "workflow", + "data_export" + ], + "type": "string", + "description": "workflow type", + "name": "workflow_type", + "in": "path", + "required": true + }, + { + "description": "create workflow template", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateWorkflowTemplateReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflow_templates": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow template list", + "tags": [ + "workflow" + ], + "summary": "获取审批流程模板列表", + "operationId": "getWorkflowTemplateListV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "enum": [ + "workflow", + "data_export" + ], + "type": "string", + "description": "filter workflow type", + "name": "workflow_type", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowTemplateListResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create workflow template", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "创建审批流程模板", + "operationId": "createWorkflowTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "create workflow template", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.CreateWorkflowTemplateReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowTemplateResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/workflow_templates/{workflow_template_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow template by id", + "tags": [ + "workflow" + ], + "summary": "根据ID获取审批流程模板详情", + "operationId": "getWorkflowTemplateByIdV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "workflow template id", + "name": "workflow_template_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowTemplateResV1" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete workflow template by id", + "tags": [ + "workflow" + ], + "summary": "删除审批流程模板", + "operationId": "deleteWorkflowTemplateV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "workflow template id", + "name": "workflow_template_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update workflow template by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "根据ID更新审批流程模板", + "operationId": "updateWorkflowTemplateByIdV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "workflow template id", + "name": "workflow_template_id", + "in": "path", + "required": true + }, + { + "description": "update workflow template", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateWorkflowTemplateByIdReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow list", + "tags": [ + "workflow" + ], + "summary": "获取工单列表", + "operationId": "getWorkflowsV1", + "parameters": [ + { + "type": "string", + "description": "filter subject", + "name": "filter_subject", + "in": "query" + }, + { + "type": "string", + "description": "filter by workflow_id", + "name": "filter_workflow_id", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search by workflow description", + "name": "fuzzy_search_workflow_desc", + "in": "query" + }, + { + "type": "string", + "description": "filter create time from", + "name": "filter_create_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter create time to", + "name": "filter_create_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter_task_execute_start_time_from", + "name": "filter_task_execute_start_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter_task_execute_start_time_to", + "name": "filter_task_execute_start_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "executing", + "canceled", + "exec_failed", + "finished" + ], + "type": "string", + "description": "filter workflow status", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "filter current step assignee user id", + "name": "filter_current_step_assignee_user_id", + "in": "query" + }, + { + "type": "string", + "description": "filter instance id", + "name": "filter_task_instance_id", + "in": "query" + }, + { + "type": "string", + "description": "filter sql version id", + "name": "filter_sql_version_id", + "in": "query" + }, + { + "type": "integer", + "description": "filter workflow template id", + "name": "filter_workflow_template_id", + "in": "query" + }, + { + "type": "string", + "description": "filter by ops type dictionary item uid; empty means no filter", + "name": "filter_by_ops_type_uid", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy matching subject/workflow_id", + "name": "fuzzy_keyword", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowsResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create workflow", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "创建工单", + "operationId": "createWorkflowV1", + "deprecated": true, + "parameters": [ + { + "description": "create workflow request", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.CreateWorkflowReqV1" + } + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/auto_create_and_execute": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "auto create task group, audit SQL, create workflow, approve and execute workflow (sys user only)", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "自动创建工单、审核SQL、审批和上线工单(仅sys用户)", + "operationId": "autoCreateAndExecuteWorkflowV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instances JSON array", + "name": "instances", + "in": "formData", + "required": true + }, + { + "enum": [ + "sql_file", + "sqls" + ], + "type": "string", + "description": "exec mode", + "name": "exec_mode", + "in": "formData" + }, + { + "type": "string", + "description": "file order method", + "name": "file_order_method", + "in": "formData" + }, + { + "type": "string", + "description": "sqls for audit", + "name": "sql", + "in": "formData" + }, + { + "type": "string", + "description": "workflow subject", + "name": "workflow_subject", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "workflow description", + "name": "desc", + "in": "formData" + }, + { + "type": "file", + "description": "input SQL file", + "name": "input_sql_file", + "in": "formData" + }, + { + "type": "file", + "description": "input mybatis XML file", + "name": "input_mybatis_xml_file", + "in": "formData" + }, + { + "type": "file", + "description": "input ZIP file", + "name": "input_zip_file", + "in": "formData" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.AutoCreateAndExecuteWorkflowResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/cancel": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "batch cancel workflows", + "tags": [ + "workflow" + ], + "summary": "批量取消工单", + "operationId": "batchCancelWorkflowsV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "batch cancel workflows request", + "name": "BatchCancelWorkflowsReqV1", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.BatchCancelWorkflowsReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/complete": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "this api will directly change the work order status to finished without real online operation", + "tags": [ + "workflow" + ], + "summary": "批量完成工单", + "operationId": "batchCompleteWorkflowsV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "batch complete workflows request", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.BatchCompleteWorkflowsReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/exports": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "export workflow as CSV or Excel", + "tags": [ + "workflow" + ], + "summary": "导出工单", + "operationId": "exportWorkflowV1", + "parameters": [ + { + "type": "string", + "description": "filter subject", + "name": "filter_subject", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search by workflow description", + "name": "fuzzy_search_workflow_desc", + "in": "query" + }, + { + "type": "string", + "description": "filter create time from", + "name": "filter_create_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter create time to", + "name": "filter_create_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter_task_execute_start_time_from", + "name": "filter_task_execute_start_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter_task_execute_start_time_to", + "name": "filter_task_execute_start_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "executing", + "canceled", + "exec_failed", + "finished" + ], + "type": "string", + "description": "filter workflow status", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "filter current step assignee user id", + "name": "filter_current_step_assignee_user_id", + "in": "query" + }, + { + "type": "string", + "description": "filter instance id", + "name": "filter_task_instance_id", + "in": "query" + }, + { + "type": "string", + "description": "filter by ops type dictionary item uid; empty means no filter", + "name": "filter_by_ops_type_uid", + "in": "query" + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy matching subject/workflow_id/desc", + "name": "fuzzy_keyword", + "in": "query" + }, + { + "enum": [ + "csv", + "excel" + ], + "type": "string", + "description": "export format", + "name": "export_format", + "in": "query" + } + ], + "responses": { + "200": { + "description": "export workflow", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_id}/backup_sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get backup sql list", + "tags": [ + "workflow" + ], + "summary": "获取工单下所有回滚SQL的列表", + "operationId": "GetBackupSqlListV1", + "parameters": [ + { + "enum": [ + "initialized", + "doing", + "succeeded", + "failed", + "manually_executed", + "terminating", + "terminate_succeeded", + "terminate_failed", + "execute_rollback" + ], + "type": "string", + "description": "filter: exec status of task sql", + "name": "filter_exec_status", + "in": "query" + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "filter: instance id in workflow", + "name": "filter_instance_id", + "in": "query" + }, + { + "type": "string", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "page size", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.BackupSqlListRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_id}/create_rollback_workflow": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create rollback workflow", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "创建回滚工单", + "operationId": "CreateRollbackWorkflow", + "parameters": [ + { + "description": "create rollback workflow request", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.CreateRollbackWorkflowReq" + } + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "origin workflow id to rollback", + "name": "workflow_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.CreateRollbackWorkflowRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/terminate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "terminate multiple task by project and workflow", + "tags": [ + "workflow" + ], + "summary": "终止工单下多个上线任务", + "operationId": "terminateMultipleTaskByWorkflowV1", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/attachment": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow attachment", + "tags": [ + "workflow" + ], + "summary": "获取工单的task附件", + "operationId": "getWorkflowAttachment", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "get workflow attachment", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/backup_files/download": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "download SQL back up file for the audit task", + "tags": [ + "task" + ], + "summary": "下载工单中的SQL备份", + "operationId": "downloadBackupFileV1", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "sql file", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/order_file": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update sql file order", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "修改文件上线顺序", + "operationId": "updateSqlFileOrderV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "description": "instance body v1.UpdateSqlFileOrderV1Req true", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateSqlFileOrderV1Req" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSqlFileOrderMethodResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/re_execute": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "re-execute task on workflow", + "tags": [ + "workflow" + ], + "summary": "单数据源SQL重新上线", + "operationId": "reExecuteTaskOnWorkflowV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "description": "re-execute task on workflow request", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.ReExecuteTaskOnWorkflowReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/terminate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "execute one task on workflow", + "tags": [ + "workflow" + ], + "summary": "终止单个上线任务", + "operationId": "terminateSingleTaskByWorkflowV1", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_name}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow detail", + "tags": [ + "workflow" + ], + "summary": "获取工单详情", + "operationId": "getWorkflowV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update workflow when it is rejected to creator.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "更新工单(驳回后才可更新)", + "operationId": "updateWorkflowV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "update workflow request", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateWorkflowReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_name}/cancel": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "cancel workflow", + "tags": [ + "workflow" + ], + "summary": "审批关闭(中止)", + "operationId": "cancelWorkflowV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_name}/steps/{workflow_step_id}/approve": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "approve workflow", + "tags": [ + "workflow" + ], + "summary": "审批通过", + "operationId": "approveWorkflowV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow step id", + "name": "workflow_step_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_name}/steps/{workflow_step_id}/reject": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "reject workflow", + "tags": [ + "workflow" + ], + "summary": "审批驳回", + "operationId": "rejectWorkflowV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow step id", + "name": "workflow_step_id", + "in": "path", + "required": true + }, + { + "description": "workflow approve request", + "name": "workflow_approve", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.RejectWorkflowReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_name}/tasks": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get summary of workflow instance tasks", + "tags": [ + "workflow" + ], + "summary": "获取工单数据源任务概览", + "operationId": "getSummaryOfInstanceTasksV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowTasksResV1" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_name}/tasks/execute": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "execute tasks on workflow", + "tags": [ + "workflow" + ], + "summary": "多数据源批量上线", + "operationId": "executeTasksOnWorkflowV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_name}/tasks/{task_id}/execute": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "execute one task on workflow", + "tags": [ + "workflow" + ], + "summary": "工单提交单个数据源上线", + "operationId": "executeOneTaskOnWorkflowV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/projects/{project_name}/workflows/{workflow_name}/tasks/{task_id}/schedule": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update workflow schedule.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "设置工单数据源定时上线时间(设置为空则代表取消定时时间,需要SQL审核流程都通过后才可以设置)", + "operationId": "updateWorkflowScheduleV1", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "workflow name", + "name": "workflow_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "update workflow schedule request", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateWorkflowScheduleReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/rule_knowledge/db_types/{db_type}/custom_rules/{rule_name}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get custom rule knowledge", + "tags": [ + "rule_template" + ], + "summary": "查看自定义规则知识库", + "operationId": "getCustomRuleKnowledgeV1", + "parameters": [ + { + "type": "string", + "description": "rule name", + "name": "rule_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "db type of rule", + "name": "db_type", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetRuleKnowledgeResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update custom rule knowledge", + "tags": [ + "rule_template" + ], + "summary": "更新自定义规则知识库", + "operationId": "updateCustomRuleKnowledge", + "parameters": [ + { + "type": "string", + "description": "rule name", + "name": "rule_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "db type of rule", + "name": "db_type", + "in": "path", + "required": true + }, + { + "description": "update rule knowledge", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateRuleKnowledgeReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/rule_knowledge/db_types/{db_type}/rules/{rule_name}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get rule knowledge", + "tags": [ + "rule_template" + ], + "summary": "查看规则知识库", + "operationId": "getRuleKnowledgeV1", + "parameters": [ + { + "type": "string", + "description": "rule name", + "name": "rule_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "db type of rule", + "name": "db_type", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetRuleKnowledgeResV1" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update rule knowledge", + "tags": [ + "rule_template" + ], + "summary": "更新规则知识库", + "operationId": "updateRuleKnowledge", + "parameters": [ + { + "type": "string", + "description": "rule name", + "name": "rule_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "db type of rule", + "name": "db_type", + "in": "path", + "required": true + }, + { + "description": "update rule knowledge", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateRuleKnowledgeReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/rule_template_tips": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global rule template tips", + "tags": [ + "rule_template" + ], + "summary": "获取全局规则模板提示", + "operationId": "getRuleTemplateTipsV1", + "parameters": [ + { + "type": "string", + "description": "filter db type", + "name": "filter_db_type", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetRuleTemplateTipsResV1" + } + } + } + } + }, + "/v1/rule_templates": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get all global rule template", + "tags": [ + "rule_template" + ], + "summary": "全局规则模板列表", + "operationId": "getRuleTemplateListV1", + "parameters": [ + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetRuleTemplatesResV1" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create a global rule template", + "consumes": [ + "application/json" + ], + "tags": [ + "rule_template" + ], + "summary": "添加全局规则模板", + "operationId": "createRuleTemplateV1", + "parameters": [ + { + "description": "add rule template request", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.CreateRuleTemplateReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/rule_templates/parse": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "parse rule template", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "rule_template" + ], + "summary": "解析规则模板文件", + "operationId": "importProjectRuleTemplateV1", + "parameters": [ + { + "enum": [ + "csv", + "json" + ], + "type": "string", + "description": "file type", + "name": "file_type", + "in": "formData", + "required": true + }, + { + "type": "file", + "description": "SQLE rule template file", + "name": "rule_template_file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.ParseProjectRuleTemplateFileResV1" + } + }, + "400": { + "description": "return error file", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/rule_templates/{rule_template_name}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global rule template", + "tags": [ + "rule_template" + ], + "summary": "获取全局规则模板信息", + "operationId": "getRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy rule,keyword for desc and annotation", + "name": "fuzzy_keyword_rule", + "in": "query" + }, + { + "type": "string", + "description": "tags for rule", + "name": "tags", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetRuleTemplateResV1" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete global rule template", + "tags": [ + "rule_template" + ], + "summary": "删除全局规则模板", + "operationId": "deleteRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update global rule template", + "tags": [ + "rule_template" + ], + "summary": "更新全局规则模板", + "operationId": "updateRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + }, + { + "description": "update rule template request", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateRuleTemplateReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/rule_templates/{rule_template_name}/clone": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "clone a rule template", + "consumes": [ + "application/json" + ], + "tags": [ + "rule_template" + ], + "summary": "克隆全局规则模板", + "operationId": "CloneRuleTemplateV1", + "parameters": [ + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + }, + { + "description": "clone rule template request", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.CloneRuleTemplateReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/rule_templates/{rule_template_name}/export": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "export rule template", + "tags": [ + "rule_template" + ], + "summary": "导出全局规则模板", + "operationId": "exportRuleTemplateV1", + "parameters": [ + { + "enum": [ + "csv", + "json" + ], + "type": "string", + "description": "export type", + "name": "export_type", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "rule template name", + "name": "rule_template_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "sqle rule template file", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/rules": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get all rule template", + "tags": [ + "rule_template" + ], + "summary": "规则列表", + "operationId": "getRuleListV1", + "parameters": [ + { + "type": "string", + "description": "filter db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy rule,keyword for desc and annotation", + "name": "fuzzy_keyword_rule", + "in": "query" + }, + { + "type": "string", + "description": "filter global rule template name", + "name": "filter_global_rule_template_name", + "in": "query" + }, + { + "type": "string", + "description": "filter rule name list", + "name": "filter_rule_names", + "in": "query" + }, + { + "type": "integer", + "description": "filter rule version", + "name": "filter_rule_version", + "in": "query" + }, + { + "type": "string", + "description": "filter tags", + "name": "tags", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetRulesResV1" + } + } + } + } + }, + "/v1/rules/categoryStatistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get all rule category statistics", + "tags": [ + "rule_template" + ], + "summary": "获取规则分类统计信息", + "operationId": "getCategoryStatistics", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetRuleCategoryStatisticResV1" + } + } + } + } + }, + "/v1/rules_version_tips": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get the rule versions contained in plugins", + "tags": [ + "rule_template" + ], + "summary": "获取插件包含的规则版本", + "operationId": "GetDriverRuleVersionTips", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetDriverRuleVersionTipsResV1" + } + } + } + } + }, + "/v1/sql_analysis": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Direct get sql analysis result", + "tags": [ + "sql_analysis" + ], + "summary": "直接获取SQL分析结果", + "operationId": "directGetSQLAnalysisV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "schema name", + "name": "schema_name", + "in": "query" + }, + { + "type": "string", + "description": "sql", + "name": "sql", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.DirectGetSQLAnalysisResV1" + } + } + } + } + }, + "/v1/sql_audit": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Direct audit sql", + "tags": [ + "sql_audit" + ], + "summary": "直接审核SQL", + "operationId": "directAuditV1", + "deprecated": true, + "parameters": [ + { + "description": "sqls that should be audited", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.DirectAuditReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.DirectAuditResV1" + } + } + } + } + }, + "/v1/sql_lineage_analysis": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Analyze SQL and return column-level lineage", + "tags": [ + "sql_analysis" + ], + "summary": "SQL列级血缘分析", + "operationId": "sqlLineageAnalyzeV1", + "parameters": [ + { + "description": "sql lineage analyze request", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.SQLLineageAnalyzeReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.SQLLineageAnalyzeResV1" + } + } + } + } + }, + "/v1/statistic/instances/resource_overview_statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance overview statistics including average score, high priority SQL count and pending workflow count", + "tags": [ + "statistic" + ], + "summary": "获取实例概览统计信息", + "operationId": "getInstanceOverviewStatisticsV1", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "description": "filter by db service ids", + "name": "filter_by_db_service_ids", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetInstanceOverviewStatisticsRes" + } + } + } + } + }, + "/v1/statistic/instances/sql_average_execution_time": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get average execution time of sql", + "tags": [ + "statistic" + ], + "summary": "获取sql上线平均耗时,按平均耗时降序排列", + "operationId": "getSqlAverageExecutionTimeV1", + "parameters": [ + { + "type": "integer", + "description": "the limit of result item number", + "name": "limit", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSqlAverageExecutionTimeResV1" + } + } + } + } + }, + "/v1/statistic/instances/sql_execution_fail_percent": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql execution fail percent", + "tags": [ + "statistic" + ], + "summary": "获取SQL上线失败率,按失败率降序排列", + "operationId": "getSqlExecutionFailPercentV1", + "parameters": [ + { + "type": "integer", + "description": "the limit of result item number", + "name": "limit", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSqlExecutionFailPercentResV1" + } + } + } + } + }, + "/v1/statistic/instances/type_percent": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get database instances' types percent", + "tags": [ + "statistic" + ], + "summary": "获取数据源类型百分比", + "operationId": "getInstancesTypePercentV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetInstancesTypePercentResV1" + } + } + } + } + }, + "/v1/statistic/license/usage": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get usage of license", + "tags": [ + "statistic" + ], + "summary": "获取License使用情况", + "operationId": "getLicenseUsageV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetLicenseUsageResV1" + } + } + } + } + }, + "/v1/statistic/workflows/audit_pass_percent": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow audit pass percent", + "tags": [ + "statistic" + ], + "summary": "获取工单审核通过率", + "operationId": "getWorkflowAuditPassPercentV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowAuditPassPercentResV1" + } + } + } + } + }, + "/v1/statistic/workflows/counts": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow counts", + "tags": [ + "statistic" + ], + "summary": "获取工单数量统计数据", + "operationId": "getWorkflowCountV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowCountsResV1" + } + } + } + } + }, + "/v1/statistic/workflows/duration_of_waiting_for_audit": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get duration from workflow being created to audited", + "tags": [ + "statistic" + ], + "summary": "获取工单从创建到审核结束的平均时长", + "operationId": "getWorkflowDurationOfWaitingForAuditV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowDurationOfWaitingForAuditResV1" + } + } + } + } + }, + "/v1/statistic/workflows/duration_of_waiting_for_execution": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get duration from workflow being created to executed", + "tags": [ + "statistic" + ], + "summary": "获取工单各从审核完毕到执行上线的平均时长", + "operationId": "getWorkflowDurationOfWaitingForExecutionV1", + "deprecated": true, + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowDurationOfWaitingForExecutionResV1" + } + } + } + } + }, + "/v1/statistic/workflows/each_day_counts": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get counts of created workflow each day", + "tags": [ + "statistic" + ], + "summary": "获取每天工单创建数量", + "operationId": "getWorkflowCreatedCountEachDayV1", + "parameters": [ + { + "type": "string", + "description": "filter date from.(format:yyyy-mm-dd)", + "name": "filter_date_from", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "filter date to.(format:yyyy-mm-dd)", + "name": "filter_date_to", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowCreatedCountsEachDayResV1" + } + } + } + } + }, + "/v1/statistic/workflows/instance_type_percent": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflows percent counted by instance type", + "tags": [ + "statistic" + ], + "summary": "获取按数据源类型统计的工单百分比", + "operationId": "getWorkflowPercentCountedByInstanceTypeV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowPercentCountedByInstanceTypeResV1" + } + } + } + } + }, + "/v1/statistic/workflows/pass_percent": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow pass percent", + "tags": [ + "statistic" + ], + "summary": "获取工单通过率", + "operationId": "getWorkflowPassPercentV1", + "deprecated": true, + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowPassPercentResV1" + } + } + } + } + }, + "/v1/statistic/workflows/rejected_percent_group_by_creator": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflows rejected percent group by creator. The result will be sorted by rejected percent in descending order", + "tags": [ + "statistic" + ], + "summary": "获取各个用户提交的工单驳回率,按驳回率降序排列", + "operationId": "getWorkflowRejectedPercentGroupByCreatorV1", + "parameters": [ + { + "type": "integer", + "description": "the limit of result item number", + "name": "limit", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowRejectedPercentGroupByCreatorResV1" + } + } + } + } + }, + "/v1/statistic/workflows/rejected_percent_group_by_instance": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow rejected percent group by instance. The result will be sorted by rejected percent in descending order", + "tags": [ + "statistic" + ], + "summary": "获取各个数据源相关的工单驳回率,按驳回率降序排列", + "operationId": "getWorkflowRejectedPercentGroupByInstanceV1", + "deprecated": true, + "parameters": [ + { + "type": "integer", + "description": "the limit of result item number", + "name": "limit", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowRejectedPercentGroupByInstanceResV1" + } + } + } + } + }, + "/v1/statistic/workflows/status_count": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get count of workflow status", + "tags": [ + "statistic" + ], + "summary": "获取各种状态工单的数量", + "operationId": "getWorkflowStatusCountV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowStatusCountResV1" + } + } + } + } + }, + "/v1/system/module_red_dots": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get the red dot prompt information in the system", + "tags": [ + "system" + ], + "summary": "查询系统各模块的红点提示信息", + "operationId": "GetSystemModuleRedDots", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSystemModuleRedDotsRes" + } + } + } + } + }, + "/v1/system/module_status": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get module status for module in the system", + "tags": [ + "system" + ], + "summary": "查询系统功能支持情况信息", + "operationId": "getSystemModuleStatus", + "parameters": [ + { + "enum": [ + "MySQL", + "Oracle", + "TiDB", + "OceanBase For MySQL", + "PostgreSQL", + "DB2", + "SQL Server" + ], + "type": "string", + "description": "db type", + "name": "db_type", + "in": "query" + }, + { + "enum": [ + "execute_sql_file_mode", + "sql_optimization", + "backup", + "knowledge_base" + ], + "type": "string", + "description": "module name", + "name": "module_name", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetModuleStatusResV1" + } + } + } + } + }, + "/v1/task_groups/audit": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "audit task group.\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.\n4. file[input_zip_file]: it is zip file, sql will be parsed from it.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "审核任务组", + "operationId": "auditTaskGroupIdV1", + "parameters": [ + { + "type": "integer", + "description": "group id of tasks", + "name": "task_group_id", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "sqls for audit", + "name": "sql", + "in": "formData" + }, + { + "type": "boolean", + "description": "enable backup", + "name": "enable_backup", + "in": "formData" + }, + { + "type": "integer", + "description": "backup max rows", + "name": "backup_max_rows", + "in": "formData" + }, + { + "type": "string", + "description": "file order method", + "name": "file_order_method", + "in": "formData" + }, + { + "type": "file", + "description": "input SQL file", + "name": "input_sql_file", + "in": "formData" + }, + { + "type": "file", + "description": "input mybatis XML file", + "name": "input_mybatis_xml_file", + "in": "formData" + }, + { + "type": "file", + "description": "input ZIP file", + "name": "input_zip_file", + "in": "formData" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.AuditTaskGroupResV1" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get task", + "tags": [ + "task" + ], + "summary": "获取Sql扫描任务信息", + "operationId": "getAuditTaskV1", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditTaskResV1" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/backup_strategy": { + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update back up strategy for all sqls in task", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "更新工单中数据源对应所有SQL的备份策略", + "operationId": "UpdateTaskBackupStrategyV1", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "description": "update back up strategy for sqls in workflow", + "name": "strategy", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateTaskBackupStrategyReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/origin_file": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get SQL origin file of the audit task", + "tags": [ + "task" + ], + "summary": "获取指定审核任务的原始文件", + "operationId": "DownloadAuditFile", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sql_content": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get SQL content for the audit task", + "tags": [ + "task" + ], + "summary": "获取指定扫描任务的SQL内容", + "operationId": "getAuditTaskSQLContentV1", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditTaskSQLContentResV1" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sql_file": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "download SQL file for the audit task", + "tags": [ + "task" + ], + "summary": "下载指定扫描任务的SQL文件", + "operationId": "downloadAuditTaskSQLFileV1", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "sql file", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sql_report": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "download report file of all SQLs information belong to the specified audit task", + "tags": [ + "task" + ], + "summary": "下载指定扫描任务的SQLs信息报告", + "operationId": "downloadAuditTaskSQLReportV1", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "select unique (fingerprint and audit result) for task sql", + "name": "no_duplicate", + "in": "query" + } + ], + "responses": { + "200": { + "description": "sql report csv file", + "schema": { + "type": "file" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get information of all SQLs belong to the specified audit task", + "tags": [ + "task" + ], + "summary": "获取指定扫描任务的SQLs信息", + "operationId": "getAuditTaskSQLsV1", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "enum": [ + "initialized", + "doing", + "succeeded", + "failed", + "manually_executed", + "execute_rollback" + ], + "type": "string", + "description": "filter: exec status of task sql", + "name": "filter_exec_status", + "in": "query" + }, + { + "enum": [ + "initialized", + "doing", + "finished" + ], + "type": "string", + "description": "filter: audit status of task sql", + "name": "filter_audit_status", + "in": "query" + }, + { + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "type": "string", + "description": "filter: audit level of task sql", + "name": "filter_audit_level", + "in": "query" + }, + { + "type": "boolean", + "description": "select unique (fingerprint and audit result) for task sql", + "name": "no_duplicate", + "in": "query" + }, + { + "type": "string", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "page size", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetAuditTaskSQLsResV1" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sqls/{number}": { + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "modify the relevant information of a certain SQL in the audit task", + "consumes": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "修改扫描任务中某条SQL的相关信息", + "operationId": "updateAuditTaskSQLsV1", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql number", + "name": "number", + "in": "path", + "required": true + }, + { + "description": "modify the relevant information of a certain SQL in the audit task", + "name": "audit_plan", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateAuditTaskSQLsReqV1" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sqls/{number}/analysis": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get SQL explain and related table metadata for analysis", + "tags": [ + "task" + ], + "summary": "获取task相关的SQL执行计划和表元数据", + "operationId": "getTaskAnalysisData", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "sql number", + "name": "number", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetTaskAnalysisDataResV1" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sqls/{number}/rewrite": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "启动特定任务中某条SQL语句的异步重写任务,返回任务状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "启动异步SQL重写任务", + "operationId": "RewriteSQL", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "sql number", + "name": "number", + "in": "path", + "required": true + }, + { + "description": "request body", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.RewriteSQLReq" + } + } + ], + "responses": { + "200": { + "description": "成功启动异步重写任务", + "schema": { + "$ref": "#/definitions/v1.AsyncRewriteTaskStatusRes" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sqls/{number}/rewrite/status": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取特定任务中某条SQL语句的异步重写任务状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "获取异步重写任务状态", + "operationId": "GetAsyncRewriteTaskStatus", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "sql number", + "name": "number", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "成功返回任务状态", + "schema": { + "$ref": "#/definitions/v1.AsyncRewriteTaskStatusRes" + } + } + } + } + }, + "/v1/tasks/audits/{task_id}/sqls/{sql_id}/backup_strategy": { + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update back up strategy for one sql in workflow", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "更新单条SQL的备份策略", + "operationId": "UpdateSqlBackupStrategyV1", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql id", + "name": "sql_id", + "in": "path", + "required": true + }, + { + "description": "update back up strategy for one sql in workflow", + "name": "strategy", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UpdateSqlBackupStrategyReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v1/tasks/file_order_methods": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get file order method", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "获取文件上线排序方式", + "operationId": "getSqlFileOrderMethodV1", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSqlFileOrderMethodResV1" + } + } + } + } + }, + "/v1/user_tips": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get user tip list", + "tags": [ + "user" + ], + "summary": "获取用户提示列表", + "operationId": "getUserTipListV1", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "filter_project", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetUserTipsResV1" + } + } + } + } + }, + "/v1/workflows/statistic_of_instances": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Get Workflows Statistic Of Instances", + "tags": [ + "workflow" + ], + "summary": "获取实例上工单的统计信息", + "operationId": "GetWorkflowStatisticOfInstances", + "parameters": [ + { + "type": "string", + "description": "instance id", + "name": "instance_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetWorkflowStatisticOfInstancesResV1" + } + } + } + } + }, + "/v2/audit_files": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Direct audit sql from SQL files and MyBatis files", + "tags": [ + "sql_audit" + ], + "summary": "直接从文件内容提取SQL并审核,SQL文件暂时只支持一次解析一个文件", + "operationId": "directAuditFilesV2", + "parameters": [ + { + "description": "files that should be audited", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2.DirectAuditFileReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.DirectAuditResV2" + } + } + } + } + }, + "/v2/configurations/drivers": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get drivers", + "tags": [ + "configuration" + ], + "summary": "获取当前 server 支持的审核类型", + "operationId": "getDriversV2", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetDriversRes" + } + } + } + } + }, + "/v2/dashboard/accounts": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global account list with filtering and pagination.\nPagination: page_index is 1-based; offset is (page_index-1)*page_size. Values of page_index less than 1 are normalized to 1; page_size less than 1 may fall back to a default on the server.", + "tags": [ + "GlobalDashboard" + ], + "summary": "获取全局账号管理列表", + "operationId": "GetGlobalAccountListV2", + "parameters": [ + { + "type": "integer", + "description": "1-based page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "Number of items per page", + "name": "page_size", + "in": "query", + "required": true + }, + { + "enum": [ + "expiring_soon", + "active" + ], + "type": "string", + "description": "filter by card; expiring_soon 即将过期, active 我的可用账号", + "name": "filter_card", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search keyword", + "name": "keyword", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_instance_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dashboard.GlobalAccountListResV2" + } + } + } + } + }, + "/v2/dashboard/accounts/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global account statistics;", + "tags": [ + "GlobalDashboard" + ], + "summary": "获取全局账号管理统计数据", + "operationId": "GetGlobalAccountStatisticsV2", + "parameters": [ + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_instance_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dashboard.GlobalAccountStatisticsResV2" + } + } + } + } + }, + "/v2/dashboard/sql_manage/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global sql manage statistics;", + "tags": [ + "GlobalDashboard" + ], + "summary": "获取全局 SQL 治理统计看板", + "operationId": "GetGlobalSqlManageStatisticsV2", + "parameters": [ + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_instance_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dashboard.GlobalSqlManageStatisticsResV2" + } + } + } + } + }, + "/v2/dashboard/sql_manage/tasks": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global sql manage task list with filtering and pagination.\nPagination: 1-based page_index with offset (page_index-1)*page_size; page_index and page_size are required query parameters (non-zero).", + "tags": [ + "GlobalDashboard" + ], + "summary": "获取全局 SQL 治理任务列表", + "operationId": "GetGlobalSqlManageTaskListV2", + "parameters": [ + { + "type": "integer", + "description": "1-based page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "Number of items per page", + "name": "page_size", + "in": "query", + "required": true + }, + { + "enum": [ + "pending", + "optimized" + ], + "type": "string", + "description": "filter by card; pending 待我优化, optimized 优化完成", + "name": "filter_card", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search keyword", + "name": "keyword", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_instance_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dashboard.GlobalSqlManageTaskListResV2" + } + } + } + } + }, + "/v2/dashboard/workflows": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global workflow list with filtering and pagination.\nPagination uses two mutually exclusive modes. Aggregate mode (omit workflow_type): merge sql_release and data_export ordered by time; use cursor (empty on first request, then data.next_cursor from the previous response) and page_size; page_index is not used for paging. Single-type mode (workflow_type set): list only that type with standard page_index (1-based) and page_size; cursor is ignored. Do not rely on mixing cursor tokens with workflow_type in one flow.", + "tags": [ + "GlobalDashboard" + ], + "summary": "获取全局工单管理列表", + "operationId": "GetGlobalWorkflowListV2", + "parameters": [ + { + "type": "string", + "description": "Aggregate mode only (omit workflow_type): opaque cursor string; leave empty on the first request, then pass the previous response's data.next_cursor. Ignored when workflow_type is set.", + "name": "cursor", + "in": "query" + }, + { + "type": "integer", + "description": "Page size; required in both aggregate and single-type modes.", + "name": "page_size", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "Single-type mode only (workflow_type set): 1-based page index. When workflow_type is omitted, this value is ignored for pagination (use cursor instead).", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "fuzzy search keyword", + "name": "keyword", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "archived", + "pending_for_me", + "initiated_by_me", + "view_all" + ], + "type": "string", + "description": "filter by card type; archived 已完成工单, pending_for_me 待我处理, initiated_by_me 我发起, view_all 查看全部", + "name": "filter_card", + "in": "query" + }, + { + "enum": [ + "sql_release", + "data_export" + ], + "type": "string", + "description": "filter by workflow type; sql_release SQL上线工单, data_export 数据导出工单", + "name": "workflow_type", + "in": "query" + }, + { + "enum": [ + "pending_approval", + "pending_action", + "in_progress", + "exporting", + "rejected", + "cancelled", + "failed", + "completed", + "unknown" + ], + "type": "string", + "description": "filter by unified workflow status; intersects with the card status set, applied to both sql_release and data_export workflows", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "filter by update time from", + "name": "filter_update_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter by update time to", + "name": "filter_update_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter by create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "type": "string", + "description": "filter create time from", + "name": "filter_create_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter create time to", + "name": "filter_create_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter by ops type dictionary item uid; empty means no filter; applies to sql_release and data_export", + "name": "filter_by_ops_type_uid", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dashboard.GlobalWorkflowListResV2" + } + } + } + } + }, + "/v2/dashboard/workflows/exports": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "export global dashboard workflows as CSV or Excel; filter/permission semantics match GET /v2/dashboard/workflows (no pagination). workflow_type=sql_release|data_export|omit(common columns with workflow type). First column includes project name for global layouts. Max 10000 workflows (sum of both types when workflow_type omitted).", + "tags": [ + "GlobalDashboard" + ], + "summary": "导出全局工单管理列表", + "operationId": "ExportGlobalWorkflowsV2", + "parameters": [ + { + "type": "string", + "description": "fuzzy search keyword", + "name": "keyword", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "archived", + "pending_for_me", + "initiated_by_me", + "view_all" + ], + "type": "string", + "description": "filter by card type; archived 已完成工单, pending_for_me 待我处理, initiated_by_me 我发起, view_all 查看全部", + "name": "filter_card", + "in": "query" + }, + { + "enum": [ + "sql_release", + "data_export" + ], + "type": "string", + "description": "sql_release SQL上线完整列; data_export 数据导出列; omit/empty 全量公共列(含工单类型)", + "name": "workflow_type", + "in": "query" + }, + { + "enum": [ + "pending_approval", + "pending_action", + "in_progress", + "exporting", + "rejected", + "cancelled", + "failed", + "completed", + "unknown" + ], + "type": "string", + "description": "filter by unified workflow status", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "filter by update time from", + "name": "filter_update_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter by update time to", + "name": "filter_update_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter by create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "type": "string", + "description": "filter create time from", + "name": "filter_create_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter create time to", + "name": "filter_create_time_to", + "in": "query" + }, + { + "type": "string", + "description": "filter by ops type dictionary item uid; empty means no filter; applies to sql_release and data_export; same semantics as GET /v2/dashboard/workflows", + "name": "filter_by_ops_type_uid", + "in": "query" + }, + { + "enum": [ + "csv", + "excel" + ], + "type": "string", + "description": "export format: csv or excel, default csv", + "name": "export_format", + "in": "query" + } + ], + "responses": { + "200": { + "description": "export workflow", + "schema": { + "type": "file" + } + } + } + } + }, + "/v2/dashboard/workflows/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global workflow statistics, returns archived, pending_for_me, initiated_by_me, and view_all counts", + "tags": [ + "GlobalDashboard" + ], + "summary": "获取全局工单管理统计数据", + "operationId": "GetGlobalWorkflowStatisticsV2", + "parameters": [ + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_instance_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dashboard.GlobalWorkflowStatisticsResV2" + } + } + } + } + }, + "/v2/projects/{project_name}/audit_plans": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan info list", + "tags": [ + "audit_plan" + ], + "summary": "获取扫描任务信息列表", + "operationId": "getAuditPlansV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter audit plan db type", + "name": "filter_audit_plan_db_type", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search audit plan name", + "name": "fuzzy_search_audit_plan_name", + "in": "query" + }, + { + "type": "string", + "description": "filter audit plan type", + "name": "filter_audit_plan_type", + "in": "query" + }, + { + "type": "string", + "description": "filter audit plan instance name", + "name": "filter_audit_plan_instance_name", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetAuditPlansResV2" + } + } + } + } + }, + "/v2/projects/{project_name}/audit_plans/{audit_plan_id}/sqls/upload": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "upload intance audit plan SQLs", + "tags": [ + "instance_audit_plan" + ], + "summary": "同步SQL到扫描任务", + "operationId": "UploadInstanceAuditPlanSQLsV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan id", + "name": "audit_plan_id", + "in": "path", + "required": true + }, + { + "description": "upload instance audit plan SQLs request", + "name": "sqls", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2.UploadInstanceAuditPlanSQLsReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit plan report SQLs", + "tags": [ + "audit_plan" + ], + "summary": "获取指定扫描任务的SQL扫描详情", + "operationId": "getAuditPlanReportsSQLs", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan report id", + "name": "audit_plan_report_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetAuditPlanReportSQLsResV2" + } + } + } + } + }, + "/v2/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls/{number}/analysis": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get SQL explain and related table metadata for analysis", + "tags": [ + "audit_plan" + ], + "summary": "获取task相关的SQL执行计划和表元数据", + "operationId": "getAuditPlantAnalysisDataV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan report id", + "name": "audit_plan_report_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql number", + "name": "number", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetAuditPlanAnalysisDataResV2" + } + } + } + } + }, + "/v2/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/full": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "full sync audit plan SQLs", + "tags": [ + "audit_plan" + ], + "summary": "全量同步SQL到扫描任务", + "operationId": "fullSyncAuditPlanSQLsV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "description": "full sync audit plan SQLs request", + "name": "sqls", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2.FullSyncAuditPlanSQLsReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/partial": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "partial sync audit plan SQLs", + "tags": [ + "audit_plan" + ], + "summary": "增量同步SQL到扫描任务", + "operationId": "partialSyncAuditPlanSQLsV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "audit plan name", + "name": "audit_plan_name", + "in": "path", + "required": true + }, + { + "description": "partial sync audit plan SQLs request", + "name": "sqls", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2.PartialSyncAuditPlanSQLsReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/instance_audit_plans": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance audit plan info list", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取实例扫描任务列表", + "operationId": "getInstanceAuditPlansV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter by environment tag", + "name": "filter_by_environment_tag", + "in": "query" + }, + { + "type": "string", + "description": "filter by db type", + "name": "filter_by_db_type", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id", + "name": "filter_by_instance_id", + "in": "query" + }, + { + "type": "string", + "description": "filter instance audit plan type", + "name": "filter_by_audit_plan_type", + "in": "query" + }, + { + "type": "string", + "description": "filter instance audit plan active status", + "name": "filter_by_active_status", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search", + "name": "fuzzy_search", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetInstanceAuditPlansRes" + } + } + } + } + }, + "/v2/projects/{project_name}/instance_audit_plans/{instance_audit_plan_id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance audit plan detail", + "tags": [ + "instance_audit_plan" + ], + "summary": "获取实例扫描任务详情", + "operationId": "getInstanceAuditPlanDetailV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance audit plan id", + "name": "instance_audit_plan_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetInstanceAuditPlanDetailRes" + } + } + } + } + }, + "/v2/projects/{project_name}/instance_tips": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance tip list", + "tags": [ + "instance" + ], + "summary": "获取实例提示列表", + "operationId": "getInstanceTipListV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "filter db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "filter by environment tag", + "name": "filter_by_environment_tag", + "in": "query" + }, + { + "type": "string", + "description": "filter workflow template id", + "name": "filter_workflow_template_id", + "in": "query" + }, + { + "enum": [ + "create_audit_plan", + "create_workflow", + "sql_manage", + "create_optimization", + "create_pipeline", + "create_version", + "view_sql_insight" + ], + "type": "string", + "description": "functional module", + "name": "functional_module", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetInstanceTipsResV2" + } + } + } + } + }, + "/v2/projects/{project_name}/instances/{instance_name}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get instance db", + "tags": [ + "instance" + ], + "summary": "获取实例信息", + "operationId": "getInstanceV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetInstanceResV2" + } + } + } + } + }, + "/v2/projects/{project_name}/sql_manages": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql manage list", + "tags": [ + "SqlManage" + ], + "summary": "获取管控sql列表", + "operationId": "GetSqlManageListV2", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy search sql fingerprint", + "name": "fuzzy_search_sql_fingerprint", + "in": "query" + }, + { + "type": "string", + "description": "assignee", + "name": "filter_assignee", + "in": "query" + }, + { + "type": "string", + "description": "instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "audit_plan", + "sql_audit_record" + ], + "type": "string", + "description": "source", + "name": "filter_source", + "in": "query" + }, + { + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "type": "string", + "description": "audit level", + "name": "filter_audit_level", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time from", + "name": "filter_last_audit_start_time_from", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time to", + "name": "filter_last_audit_start_time_to", + "in": "query" + }, + { + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited", + "sent" + ], + "type": "string", + "description": "status", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "rule name", + "name": "filter_rule_name", + "in": "query" + }, + { + "type": "string", + "description": "db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "filter by business", + "name": "filter_business", + "in": "query" + }, + { + "type": "string", + "description": "filter by environment tag", + "name": "filter_by_environment_tag", + "in": "query" + }, + { + "enum": [ + "high", + "low" + ], + "type": "string", + "description": "priority", + "name": "filter_priority", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search endpoint", + "name": "fuzzy_search_endpoint", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search schema name", + "name": "fuzzy_search_schema_name", + "in": "query" + }, + { + "enum": [ + "first_appear_timestamp", + "last_receive_timestamp", + "fp_count" + ], + "type": "string", + "description": "sort field", + "name": "sort_field", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "sort order", + "name": "sort_order", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetSqlManageListResp" + } + } + } + } + }, + "/v2/projects/{project_name}/sql_manages/exports": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "export sql manage as CSV or Excel", + "tags": [ + "SqlManage" + ], + "summary": "导出SQL管控", + "operationId": "exportSqlManageV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy search sql fingerprint", + "name": "fuzzy_search_sql_fingerprint", + "in": "query" + }, + { + "type": "string", + "description": "assignee", + "name": "filter_assignee", + "in": "query" + }, + { + "type": "string", + "description": "filter by environment tag", + "name": "filter_by_environment_tag", + "in": "query" + }, + { + "enum": [ + "high", + "low" + ], + "type": "string", + "description": "priority", + "name": "filter_priority", + "in": "query" + }, + { + "type": "string", + "description": "instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "audit_plan", + "sql_audit_record" + ], + "type": "string", + "description": "source", + "name": "filter_source", + "in": "query" + }, + { + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "type": "string", + "description": "audit level", + "name": "filter_audit_level", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time from", + "name": "filter_last_audit_start_time_from", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time to", + "name": "filter_last_audit_start_time_to", + "in": "query" + }, + { + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited" + ], + "type": "string", + "description": "status", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "rule name", + "name": "filter_rule_name", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search endpoint", + "name": "fuzzy_search_endpoint", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search schema name", + "name": "fuzzy_search_schema_name", + "in": "query" + }, + { + "enum": [ + "first_appear_timestamp", + "last_receive_timestamp", + "fp_count" + ], + "type": "string", + "description": "sort field", + "name": "sort_field", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "sort order", + "name": "sort_order", + "in": "query" + }, + { + "enum": [ + "csv", + "excel" + ], + "type": "string", + "description": "export format", + "name": "export_format", + "in": "query" + } + ], + "responses": { + "200": { + "description": "export sql manage", + "schema": { + "type": "file" + } + } + } + } + }, + "/v2/projects/{project_name}/sql_optimization_records": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql optimization records", + "tags": [ + "sql_optimization" + ], + "summary": "获取SQL优化记录列表", + "operationId": "GetOptimizationRecordsV2", + "parameters": [ + { + "type": "string", + "description": "fuzzy search for optimization_id or create_username", + "name": "fuzzy_search", + "in": "query" + }, + { + "type": "string", + "description": "filter instance name", + "name": "filter_instance_name", + "in": "query" + }, + { + "type": "string", + "description": "filter create time from", + "name": "filter_create_time_from", + "in": "query" + }, + { + "type": "string", + "description": "filter create time to", + "name": "filter_create_time_to", + "in": "query" + }, + { + "enum": [ + "optimizing", + "failed", + "finish" + ], + "type": "string", + "description": "filter status", + "name": "filter_status", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetOptimizationRecordsRes" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "optimize sql\n1. formData[sql]: sql content;\n2. file[input_sql_file]: it is a sql file;\n3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.\n4. file[input_zip_file]: it is ZIP file that sql will be parsed from xml or sql file inside it.\n5. formData[git_http_url]:the url which scheme is http(s) and end with .git.\n6. formData[git_user_name]:The name of the user who owns the repository read access.\n7. formData[git_user_password]:The password corresponding to git_user_name.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sql_optimization" + ], + "summary": "优化SQL", + "operationId": "SQLOptimizeV2", + "parameters": [ + { + "description": "sqls that should be optimization", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2.OptimizeSQLReq" + } + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "instance name", + "name": "instance_name", + "in": "formData" + }, + { + "type": "string", + "description": "schema of instance", + "name": "schema_name", + "in": "formData" + }, + { + "type": "string", + "description": "db type of instance", + "name": "db_type", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "optimization name", + "name": "optimization_name", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "sqls for audit", + "name": "sql_content", + "in": "formData" + }, + { + "type": "string", + "description": "explain info", + "name": "explain_info", + "in": "formData" + }, + { + "type": "string", + "description": "metadata", + "name": "metadata", + "in": "formData" + }, + { + "type": "boolean", + "description": "enable high analysis", + "name": "enable_high_analysis", + "in": "formData" + }, + { + "type": "file", + "description": "input SQL file", + "name": "input_sql_file", + "in": "formData" + }, + { + "type": "file", + "description": "input ZIP file", + "name": "input_zip_file", + "in": "formData" + }, + { + "type": "file", + "description": "input mybatis XML file", + "name": "input_mybatis_xml_file", + "in": "formData" + }, + { + "type": "string", + "description": "git repository url", + "name": "git_http_url", + "in": "formData" + }, + { + "type": "string", + "description": "the name of user to clone the repository", + "name": "git_user_name", + "in": "formData" + }, + { + "type": "string", + "description": "the password corresponding to git_user_name", + "name": "git_user_password", + "in": "formData" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.OptimizeSQLRes" + } + } + } + } + }, + "/v2/projects/{project_name}/sql_optimization_records/{optimization_record_id}/detail": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql optimization record", + "tags": [ + "sql_optimization" + ], + "summary": "获取SQL优化语句详情", + "operationId": "GetOptimizationSQLDetailV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql optimization record id", + "name": "optimization_record_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetOptimizationDetailRes" + } + } + } + } + }, + "/v2/projects/{project_name}/sql_optimization_records/{optimization_record_id}/feedback": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "add optimized sql feedback", + "consumes": [ + "application/json" + ], + "tags": [ + "sql_optimization" + ], + "summary": "添加SQL优化语句反馈", + "operationId": "AddOptimizedSQLFeedback", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql optimization record id", + "name": "optimization_record_id", + "in": "path", + "required": true + }, + { + "description": "add optimized sql feedback req", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2.OptimizedSQLFeedbackReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/sql_optimization_records/{optimization_record_id}/feedback/{feedback_id}/": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "delete optimized sql feedback", + "tags": [ + "sql_optimization" + ], + "summary": "删除SQL优化语句反馈", + "operationId": "DeleteOptimizedSQLFeedback", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql optimization record id", + "name": "optimization_record_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "feedback id", + "name": "feedback_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update optimized sql feedback", + "consumes": [ + "application/json" + ], + "tags": [ + "sql_optimization" + ], + "summary": "更新SQL优化语句反馈", + "operationId": "UpdateOptimizedSQLFeedback", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "sql optimization record id", + "name": "optimization_record_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "feedback id", + "name": "feedback_id", + "in": "path", + "required": true + }, + { + "description": "update optimized sql feedback req", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2.UpdateOptimizedSQLFeedbackReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "create workflow", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "创建工单", + "operationId": "createWorkflowV2", + "parameters": [ + { + "description": "create workflow request", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2.CreateWorkflowReqV2" + } + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.CreateWorkflowResV2" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/cancel": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "batch cancel workflows", + "tags": [ + "workflow" + ], + "summary": "批量取消工单", + "operationId": "batchCancelWorkflowsV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "batch cancel workflows request", + "name": "BatchCancelWorkflowsReqV2", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2.BatchCancelWorkflowsReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/complete": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "this api will directly change the work order status to finished without real online operation", + "tags": [ + "workflow" + ], + "summary": "批量完成工单", + "operationId": "batchCompleteWorkflowsV2", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "batch complete workflows request", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2.BatchCompleteWorkflowsReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/{workflow_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get workflow detail", + "tags": [ + "workflow" + ], + "summary": "获取工单详情", + "operationId": "getWorkflowV2", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetWorkflowResV2" + } + } + } + }, + "patch": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update workflow when it is rejected to creator.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "更新工单(工单被驳回、工单被关闭、执行成功、执行失败后才可更新)", + "operationId": "updateWorkflowV2", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "update workflow request", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2.UpdateWorkflowReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/{workflow_id}/cancel": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "cancel workflow", + "tags": [ + "workflow" + ], + "summary": "审批关闭(中止)", + "operationId": "cancelWorkflowV2", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/{workflow_id}/steps/{workflow_step_id}/approve": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "approve workflow", + "tags": [ + "workflow" + ], + "summary": "审批通过", + "operationId": "approveWorkflowV2", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow step id", + "name": "workflow_step_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "workflow approve request", + "name": "workflow_approve", + "in": "body", + "schema": { + "$ref": "#/definitions/v2.ApproveWorkflowReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/{workflow_id}/steps/{workflow_step_id}/reject": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "reject workflow", + "tags": [ + "workflow" + ], + "summary": "审批驳回", + "operationId": "rejectWorkflowV2", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow step id", + "name": "workflow_step_id", + "in": "path", + "required": true + }, + { + "description": "workflow approve request", + "name": "workflow_approve", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2.RejectWorkflowReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/{workflow_id}/tasks": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get summary of workflow instance tasks", + "tags": [ + "workflow" + ], + "summary": "获取工单数据源任务概览", + "operationId": "getSummaryOfInstanceTasksV2", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetWorkflowTasksResV2" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/{workflow_id}/tasks/execute": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "execute tasks on workflow", + "tags": [ + "workflow" + ], + "summary": "多数据源批量上线", + "operationId": "executeTasksOnWorkflowV2", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/execute": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "execute one task on workflow", + "tags": [ + "workflow" + ], + "summary": "工单提交单个数据源上线", + "operationId": "executeOneTaskOnWorkflowV2", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v2/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/schedule": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "update workflow schedule.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "workflow" + ], + "summary": "设置工单数据源定时上线时间(设置为空则代表取消定时时间,需要SQL审核流程都通过后才可以设置)", + "operationId": "updateWorkflowScheduleV2", + "parameters": [ + { + "type": "string", + "description": "workflow id", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "update workflow schedule request", + "name": "instance", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2.UpdateWorkflowScheduleReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + }, + "/v2/sql_audit": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Direct audit sql", + "tags": [ + "sql_audit" + ], + "summary": "直接审核SQL", + "operationId": "directAuditV2", + "parameters": [ + { + "description": "sqls that should be audited", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2.DirectAuditReqV2" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.DirectAuditResV2" + } + } + } + } + }, + "/v2/tasks/audits/{task_id}/files": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit task file list", + "tags": [ + "task" + ], + "summary": "获取审核任务文件概览列表", + "operationId": "getAuditFileList", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "page size", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetAuditFileListRes" + } + } + } + } + }, + "/v2/tasks/audits/{task_id}/files/{file_id}/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get audit task file execute statistic", + "tags": [ + "task" + ], + "summary": "获取审核任务文件执行概览", + "operationId": "getAuditFileExecStatistic", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "file id", + "name": "file_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetAuditFileExecStatisticRes" + } + } + } + } + }, + "/v2/tasks/audits/{task_id}/sqls": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get information of all SQLs belong to the specified audit task", + "tags": [ + "task" + ], + "summary": "获取指定扫描任务的SQLs信息", + "operationId": "getAuditTaskSQLsV2", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "enum": [ + "initialized", + "doing", + "succeeded", + "failed", + "manually_executed", + "terminating", + "terminate_succeeded", + "terminate_failed", + "execute_rollback", + "not_executed" + ], + "type": "string", + "description": "filter: exec status of task sql", + "name": "filter_exec_status", + "in": "query" + }, + { + "enum": [ + "initialized", + "doing", + "finished" + ], + "type": "string", + "description": "filter: audit status of task sql", + "name": "filter_audit_status", + "in": "query" + }, + { + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "type": "string", + "description": "filter: audit level of task sql", + "name": "filter_audit_level", + "in": "query" + }, + { + "type": "boolean", + "description": "select unique (fingerprint and audit result) for task sql", + "name": "no_duplicate", + "in": "query" + }, + { + "type": "integer", + "description": "filter: audit file id of task", + "name": "filter_audit_file_id", + "in": "query" + }, + { + "type": "string", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "page size", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetAuditTaskSQLsResV2" + } + } + } + } + }, + "/v2/tasks/audits/{task_id}/sqls/{number}/analysis": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get SQL explain and related table metadata for analysis", + "tags": [ + "task" + ], + "summary": "获取task相关的SQL执行计划和表元数据", + "operationId": "getTaskAnalysisDataV2", + "parameters": [ + { + "type": "string", + "description": "task id", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "sql number", + "name": "number", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "whether to calculate and return affected rows, default is true", + "name": "affectRowsEnabled", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.GetTaskAnalysisDataResV2" + } + } + } + } + }, + "/v3/projects/{project_name}/sql_manages": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get sql manage list", + "tags": [ + "SqlManage" + ], + "summary": "获取SQL管控列表", + "operationId": "GetSqlManageListV3", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "fuzzy search sql fingerprint", + "name": "fuzzy_search_sql_fingerprint", + "in": "query" + }, + { + "type": "string", + "description": "assignee", + "name": "filter_assignee", + "in": "query" + }, + { + "type": "string", + "description": "instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "audit_plan", + "sql_audit_record" + ], + "type": "string", + "description": "source", + "name": "filter_source", + "in": "query" + }, + { + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "type": "string", + "description": "audit level", + "name": "filter_audit_level", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time from", + "name": "filter_last_audit_start_time_from", + "in": "query" + }, + { + "type": "string", + "description": "last audit start time to", + "name": "filter_last_audit_start_time_to", + "in": "query" + }, + { + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited", + "sent" + ], + "type": "string", + "description": "status", + "name": "filter_status", + "in": "query" + }, + { + "type": "string", + "description": "rule name", + "name": "filter_rule_name", + "in": "query" + }, + { + "type": "string", + "description": "db type", + "name": "filter_db_type", + "in": "query" + }, + { + "type": "string", + "description": "filter by name of environment tag", + "name": "filter_by_environment_tag", + "in": "query" + }, + { + "enum": [ + "high", + "low" + ], + "type": "string", + "description": "priority", + "name": "filter_priority", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search endpoint", + "name": "fuzzy_search_endpoint", + "in": "query" + }, + { + "type": "string", + "description": "fuzzy search schema name", + "name": "fuzzy_search_schema_name", + "in": "query" + }, + { + "enum": [ + "first_appear_timestamp", + "last_receive_timestamp", + "fp_count" + ], + "type": "string", + "description": "sort field", + "name": "sort_field", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "sort order", + "name": "sort_order", + "in": "query" + }, + { + "type": "integer", + "description": "page index", + "name": "page_index", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "size of per page", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v3.GetSqlManageListResp" + } + } + } + } + }, + "/v3/projects/{project_name}/workflows/complete": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "this api will directly change the work order status to finished without real online operation", + "tags": [ + "workflow" + ], + "summary": "批量完成工单", + "operationId": "batchCompleteWorkflowsV3", + "parameters": [ + { + "type": "string", + "description": "project name", + "name": "project_name", + "in": "path", + "required": true + }, + { + "description": "batch complete workflows request", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3.BatchCompleteWorkflowsReqV3" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/controller.BaseRes" + } + } + } + } + } + }, + "definitions": { + "controller.BaseRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "dashboard.GlobalAccountListDataV2": { + "type": "object", + "properties": { + "accounts": { + "type": "array", + "items": { + "$ref": "#/definitions/dashboard.GlobalAccountListItemV2" + } + }, + "can_manage": { + "description": "是否有管理权限", + "type": "boolean" + } + } + }, + "dashboard.GlobalAccountListItemV2": { + "type": "object", + "properties": { + "account_name": { + "description": "账号名称", + "type": "string" + }, + "account_uid": { + "description": "账号ID", + "type": "string" + }, + "expired_time": { + "description": "过期时间,前端应显示剩余时间,若小于7天则需要用警告图标配合加粗红色文字警示", + "type": "string" + }, + "instance_id": { + "description": "实例ID", + "type": "string" + }, + "instance_name": { + "description": "实例名称", + "type": "string" + }, + "project_name": { + "description": "项目名称", + "type": "string" + }, + "project_uid": { + "description": "项目ID", + "type": "string" + }, + "status": { + "description": "状态展示: 活跃,临期,已过期,已锁定", + "type": "string", + "enum": [ + "active", + "expiring", + "expired", + "locked" + ] + } + } + }, + "dashboard.GlobalAccountListResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/dashboard.GlobalAccountListDataV2" + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "dashboard.GlobalAccountStatisticsData": { + "type": "object", + "properties": { + "active_account_count": { + "description": "我的可用账号卡片,展示我的可用账号数量", + "type": "integer" + }, + "expiring_soon_count": { + "description": "即将过期卡片,展示即将过期的账号数量", + "type": "integer" + } + } + }, + "dashboard.GlobalAccountStatisticsResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "description": "统计数据", + "type": "object", + "$ref": "#/definitions/dashboard.GlobalAccountStatisticsData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "dashboard.GlobalSqlManageStatisticsResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/dashboard.GlobalSqlManageStatisticsV2" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "dashboard.GlobalSqlManageStatisticsV2": { + "type": "object", + "properties": { + "optimized_this_week_count": { + "description": "优化完成卡片,展示历史优化完成的SQL数量", + "type": "integer" + }, + "pending_sql_count": { + "description": "待我优化卡片,展示需要我处理的SQL数量", + "type": "integer" + } + } + }, + "dashboard.GlobalSqlManageTaskItemV2": { + "type": "object", + "properties": { + "avg_time": { + "description": "平均耗时(秒),来自采集 info;无慢日志等指标时 JSON 为 null(非 0)", + "type": "number" + }, + "count": { + "description": "执行频次;info 中无 counter 等时为 null(非 0)", + "type": "integer" + }, + "instance_id": { + "description": "实例ID", + "type": "string" + }, + "instance_name": { + "description": "实例名称", + "type": "string" + }, + "last_seen_at": { + "description": "最后一次捕捉时间", + "type": "string" + }, + "project_name": { + "description": "项目名称", + "type": "string" + }, + "project_uid": { + "description": "项目ID", + "type": "string" + }, + "source": { + "description": "来源,如:慢日志、库表元数据等,根据数据源id和项目id跳转到智能扫描详情", + "type": "string" + }, + "sql_fingerprint": { + "description": "SQL 指纹", + "type": "string" + }, + "status": { + "description": "SQL治理任务状态:待处理,已优化,已忽略,人工审核中,已分配", + "type": "string", + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited", + "sent" + ] + }, + "suggestion": { + "description": "管理员派单备注;无备注时为空字符串", + "type": "string" + } + } + }, + "dashboard.GlobalSqlManageTaskListResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/dashboard.GlobalSqlManageTaskItemV2" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "dashboard.GlobalWorkflowListData": { + "type": "object", + "properties": { + "has_more": { + "description": "是否还有更多数据", + "type": "boolean" + }, + "next_cursor": { + "description": "游标分页:下一页游标", + "type": "string" + }, + "total_nums": { + "description": "总条数", + "type": "integer" + }, + "workflows": { + "description": "工单列表", + "type": "array", + "items": { + "$ref": "#/definitions/dashboard.GlobalWorkflowListItem" + } + } + } + }, + "dashboard.GlobalWorkflowListItem": { + "type": "object", + "properties": { + "create_user_name": { + "type": "string" + }, + "created_at": { + "description": "创建时间", + "type": "string" + }, + "current_step_assignee_user_name_list": { + "description": "当前处理人姓名列表", + "type": "array", + "items": { + "type": "string" + } + }, + "instance_id": { + "description": "实例ID", + "type": "string" + }, + "instance_name": { + "description": "实例名称", + "type": "string" + }, + "ops_type": { + "description": "OpsType 运维类型(跨项目按工单所属项目字典批量解析);未设置或字典项已删时省略", + "type": "object", + "$ref": "#/definitions/dms.OpsType" + }, + "priority": { + "description": "High, Medium, Low", + "type": "string" + }, + "project_name": { + "description": "项目名称", + "type": "string" + }, + "project_uid": { + "description": "项目ID", + "type": "string" + }, + "status": { + "description": "工单状态", + "type": "string", + "enum": [ + "pending_approval", + "pending_action", + "in_progress", + "exporting", + "rejected", + "cancelled", + "failed", + "completed", + "unknown" + ] + }, + "updated_at": { + "description": "更新时间", + "type": "string" + }, + "workflow_desc": { + "description": "工单描述", + "type": "string" + }, + "workflow_id": { + "description": "工单ID", + "type": "string" + }, + "workflow_name": { + "description": "工单名称", + "type": "string" + }, + "workflow_type": { + "description": "工单类型", + "type": "string", + "enum": [ + "sql_release", + "data_export" + ] + } + } + }, + "dashboard.GlobalWorkflowListResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/dashboard.GlobalWorkflowListData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "dashboard.GlobalWorkflowStatisticsResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/dashboard.GlobalWorkflowStatisticsV2" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "dashboard.GlobalWorkflowStatisticsV2": { + "type": "object", + "properties": { + "archived_count": { + "description": "已完成的工单数量", + "type": "integer" + }, + "initiated_by_me_count": { + "description": "我发起的工单数量", + "type": "integer" + }, + "pending_for_me_count": { + "description": "待我处理的工单数量", + "type": "integer" + }, + "view_all_count": { + "description": "查看全部的工单数量", + "type": "integer" + } + } + }, + "dms.OpsType": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "uid": { + "type": "string" + } } - } }, - "db_type": { - "type": "string", - "example": "mysql" - }, - "desc": { - "type": "string" + "model.AuditResultInfo": { + "type": "object", + "properties": { + "errorInfo": { + "type": "string" + }, + "message": { + "type": "string" + } + } }, - "has_audit_power": { - "type": "boolean" + "model.I18nAuditResultInfo": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/model.AuditResultInfo" + } }, - "has_rewrite_power": { - "type": "boolean" + "model.RuleCategoryStatistic": { + "type": "object", + "properties": { + "category": { + "type": "string", + "enum": [ + "audit_accuracy", + "audit_purpose", + "operand", + "sql" + ] + }, + "count": { + "type": "integer" + }, + "tag": { + "type": "string" + } + } + }, + "sql_flash.AdvisedIndex": { + "type": "object", + "properties": { + "has_advice": { + "type": "boolean" + }, + "indexes": { + "type": "array", + "items": { + "$ref": "#/definitions/sql_flash.IndexInfo" + } + }, + "other_advice": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "sql_flash.Analysis": { + "type": "object", + "properties": { + "detail": { + "type": "array", + "items": { + "$ref": "#/definitions/sql_flash.AnalysisDetail" + } + }, + "improvement_desc": { + "type": "string" + }, + "improvement_rate": { + "type": "number" + }, + "state": { + "type": "string" + }, + "total_score": { + "type": "number" + } + } + }, + "sql_flash.AnalysisDetail": { + "type": "object", + "properties": { + "category": { + "type": "string" + }, + "optimized_score": { + "type": "number" + }, + "original_score": { + "type": "number" + } + } + }, + "sql_flash.IndexInfo": { + "type": "object", + "properties": { + "create_index_statement": { + "type": "string" + }, + "reason": { + "type": "string" + } + } }, - "is_custom_rule": { - "type": "boolean" + "sql_flash.OptimizeDetail": { + "type": "object", + "properties": { + "state": { + "type": "string" + }, + "steps": { + "type": "array", + "items": { + "$ref": "#/definitions/sql_flash.OptimizeStep" + } + } + } + }, + "sql_flash.OptimizeStep": { + "type": "object", + "properties": { + "analysis": { + "type": "object", + "$ref": "#/definitions/sql_flash.Analysis" + }, + "chat_id": { + "type": "string" + }, + "optimized_sql": { + "type": "string" + }, + "query_plan": { + "type": "object", + "$ref": "#/definitions/sql_flash.QueryPlan" + }, + "rule_desc": { + "type": "string" + }, + "rule_id": { + "type": "string" + }, + "rule_name": { + "type": "string" + } + } + }, + "sql_flash.QueryPlan": { + "type": "object", + "properties": { + "query_plan_desc": { + "type": "array", + "items": { + "$ref": "#/definitions/sql_flash.QueryPlanNode" + } + }, + "state": { + "type": "string" + } + } + }, + "sql_flash.QueryPlanNode": { + "type": "object", + "properties": { + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/sql_flash.QueryPlanNode" + } + }, + "operator": { + "type": "string" + }, + "summary": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "sql_flash.TotalAnalysis": { + "type": "object", + "properties": { + "detail": { + "type": "array", + "items": { + "$ref": "#/definitions/sql_flash.AnalysisDetail" + } + }, + "improvement_desc": { + "type": "string" + }, + "improvement_rate": { + "type": "number" + }, + "state": { + "type": "string" + }, + "total_score": { + "type": "number" + } + } + }, + "v1.AIHubBannerData": { + "type": "object", + "properties": { + "modules": { + "description": "按模块分组的Banner卡片", + "type": "array", + "items": { + "$ref": "#/definitions/v1.AIModuleBannerCards" + } + } + } }, - "level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "example": "error" + "v1.AIHubExecutionRecord": { + "type": "object", + "properties": { + "estimated_upgrade": { + "description": "预估提升", + "type": "number" + }, + "function_module": { + "description": "功能模块", + "type": "string", + "enum": [ + "smart_correction", + "performance_engine" + ] + }, + "id": { + "description": "记录ID", + "type": "integer" + }, + "operation_time": { + "description": "操作时间", + "type": "string" + }, + "process_status": { + "description": "处理状态", + "type": "string", + "enum": [ + "pending", + "running", + "completed", + "failed" + ] + }, + "source_project": { + "description": "来源项目", + "type": "string" + }, + "sql_snippet": { + "description": "SQL片段", + "type": "string" + }, + "value_dimension": { + "description": "价值维度", + "type": "string", + "enum": [ + "security", + "performance", + "correction", + "maintenance", + "code_standard" + ] + } + } + }, + "v1.AIHubManagementViewData": { + "type": "object", + "properties": { + "modules": { + "description": "按模块分组的分析数据", + "type": "array", + "items": { + "$ref": "#/definitions/v1.AIModuleAnalysis" + } + } + } }, - "params": { - "type": "array", - "items": { - "$ref": "#/definitions/RuleParamResV1" - } + "v1.AIHubStrategicValueData": { + "type": "object", + "properties": { + "ai_strategic_insight": { + "description": "AI战略洞察", + "type": "object", + "$ref": "#/definitions/v1.AIStrategicInsight" + }, + "efficiency_cards": { + "description": "效能卡片列表", + "type": "array", + "items": { + "$ref": "#/definitions/v1.EfficiencyCard" + } + } + } + }, + "v1.AIModuleAnalysis": { + "type": "object", + "properties": { + "ai_module_type": { + "description": "AI模块类型", + "type": "string", + "enum": [ + "smart_correction", + "performance_engine" + ] + }, + "project_io_analysis": { + "description": "项目组投入产出分析", + "type": "array", + "items": { + "$ref": "#/definitions/v1.ProjectIOAnalysis" + } + }, + "top_problem_distribution": { + "description": "Top问题分布", + "type": "array", + "items": { + "$ref": "#/definitions/v1.TopProblemDistribution" + } + } + } + }, + "v1.AIModuleBannerCards": { + "type": "object", + "properties": { + "ai_module_type": { + "description": "AI模块类型", + "type": "string", + "enum": [ + "smart_correction", + "performance_engine" + ] + }, + "banner_cards": { + "description": "Banner卡片列表", + "type": "array", + "items": { + "$ref": "#/definitions/v1.BannerCard" + } + }, + "is_enabled": { + "description": "功能是否启用", + "type": "boolean", + "example": true + } + } + }, + "v1.AIStrategicInsight": { + "type": "object", + "properties": { + "description": { + "description": "描述", + "type": "string" + }, + "title": { + "description": "标题", + "type": "string" + } + } + }, + "v1.AbnormalAuditPlanInstance": { + "type": "object", + "properties": { + "abnormal_status_code": { + "type": "integer" + }, + "instance_audit_plan_id": { + "type": "integer" + }, + "instance_name": { + "type": "string", + "example": "MySQL" + }, + "token_exp": { + "type": "integer", + "example": 1747129752 + } + } + }, + "v1.AffectRows": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "err_message": { + "type": "string" + } + } }, - "rule_name": { - "type": "string" + "v1.AssociateWorkflows": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "canceled", + "exec_failed", + "executing", + "finished" + ] + }, + "workflow_id": { + "type": "string" + }, + "workflow_name": { + "type": "string" + } + } + }, + "v1.AsyncRewriteTask": { + "type": "object", + "properties": { + "end_time": { + "description": "结束时间", + "type": "string" + }, + "error_message": { + "description": "错误信息", + "type": "string" + }, + "result": { + "description": "重写结果", + "type": "object", + "$ref": "#/definitions/v1.RewriteSQLData" + }, + "sql_number": { + "description": "SQL编号", + "type": "string" + }, + "start_time": { + "description": "开始时间", + "type": "string" + }, + "status": { + "description": "任务状态", + "type": "string", + "enum": [ + "pending", + "running", + "completed", + "failed" + ] + }, + "task_id": { + "description": "任务ID", + "type": "string" + } + } + }, + "v1.AsyncRewriteTaskStatusRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AsyncRewriteTask" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.AuditFileResp": { + "type": "object", + "properties": { + "file_name": { + "type": "string" + } + } }, - "type": { - "type": "string", - "example": "全局配置" + "v1.AuditPlan": { + "type": "object", + "properties": { + "audit_plan_params": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanParamReqV1" + } + }, + "audit_plan_type": { + "type": "string", + "example": "slow log" + }, + "high_priority_conditions": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.HighPriorityConditionReq" + } + }, + "need_mark_high_priority_sql": { + "type": "boolean" + }, + "rule_template_name": { + "type": "string", + "example": "default_MySQL" + } + } + }, + "v1.AuditPlanCount": { + "type": "object", + "properties": { + "audit_plan_count": { + "type": "integer" + }, + "audit_plan_desc": { + "type": "string" + }, + "audit_plan_type": { + "type": "string" + } + } + }, + "v1.AuditPlanMetaV1": { + "type": "object", + "properties": { + "audit_plan_params": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanParamResV1" + } + }, + "audit_plan_type": { + "type": "string" + }, + "audit_plan_type_desc": { + "type": "string" + }, + "audit_plan_type_tips": { + "type": "string" + }, + "high_priority_conditions": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.HighPriorityConditionResV1" + } + }, + "instance_type": { + "type": "string" + } + } + }, + "v1.AuditPlanParamReqV1": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } }, - "version": { - "type": "integer" - } - } - }, - "RuleRespV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "rule_name": { - "type": "string" - } - } - }, - "RuleTemplateDetailResV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "rule_list": { - "type": "array", - "items": { - "$ref": "#/definitions/RuleResV1" - } - }, - "rule_template_name": { - "type": "string" - }, - "rule_version": { - "type": "integer" - } - } - }, - "RuleTemplateResV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" + "v1.AuditPlanParamResV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "enums_value": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.EnumsValueResV1" + } + }, + "key": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "string", + "int", + "bool", + "password" + ] + }, + "value": { + "type": "string" + } + } + }, + "v1.AuditPlanReportResV1": { + "type": "object", + "properties": { + "audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error", + "" + ] + }, + "audit_plan_report_id": { + "type": "string", + "example": "1" + }, + "audit_plan_report_timestamp": { + "type": "string", + "example": "RFC3339" + }, + "pass_rate": { + "type": "number" + }, + "score": { + "type": "integer" + } + } + }, + "v1.AuditPlanReportSQLResV1": { + "type": "object", + "properties": { + "audit_plan_report_sql": { + "type": "string", + "example": "select * from t1 where id = 1" + }, + "audit_plan_report_sql_audit_result": { + "type": "string", + "example": "same format as task audit result" + }, + "number": { + "type": "integer", + "example": 1 + } + } + }, + "v1.AuditPlanRes": { + "type": "object", + "properties": { + "audit_plan_params": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanParamResV1" + } + }, + "audit_plan_type": { + "type": "object", + "$ref": "#/definitions/v1.AuditPlanTypeResBase" + }, + "high_priority_conditions": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.HighPriorityConditionResV1" + } + }, + "need_mark_high_priority_sql": { + "type": "boolean" + }, + "rule_template_name": { + "type": "string", + "example": "default_MySQL" + } + } + }, + "v1.AuditPlanResV1": { + "type": "object", + "properties": { + "audit_plan_cron": { + "type": "string", + "example": "0 */2 * * *" + }, + "audit_plan_db_type": { + "type": "string", + "example": "mysql" + }, + "audit_plan_instance_database": { + "type": "string", + "example": "app1" + }, + "audit_plan_instance_name": { + "type": "string", + "example": "test_mysql" + }, + "audit_plan_meta": { + "type": "object", + "$ref": "#/definitions/v1.AuditPlanMetaV1" + }, + "audit_plan_name": { + "type": "string", + "example": "audit_for_java_app1" + }, + "audit_plan_token": { + "type": "string", + "example": "it's a JWT Token for scanner" + }, + "rule_template_name": { + "type": "string", + "example": "default_MySQL" + } + } + }, + "v1.AuditPlanRuleTemplate": { + "type": "object", + "properties": { + "is_global_rule_template": { + "type": "boolean" + }, + "name": { + "type": "string" + } + } }, - "desc": { - "type": "string" + "v1.AuditPlanSQLDataResV1": { + "type": "object", + "properties": { + "rows": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "v1.AuditPlanSQLHeadV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "field_name": { + "type": "string" + }, + "sortable": { + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "sql" + ] + } + } + }, + "v1.AuditPlanSQLMetaResV1": { + "type": "object", + "properties": { + "filter_meta_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.FilterMeta" + } + }, + "head": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanSQLHeadV1" + } + } + } + }, + "v1.AuditPlanSQLReqV1": { + "type": "object", + "properties": { + "audit_plan_sql_counter": { + "type": "string", + "example": "6" + }, + "audit_plan_sql_fingerprint": { + "type": "string", + "example": "select * from t1 where id = ?" + }, + "audit_plan_sql_last_receive_text": { + "type": "string", + "example": "select * from t1 where id = 1" + }, + "audit_plan_sql_last_receive_timestamp": { + "type": "string", + "example": "RFC3339" + }, + "audit_plan_sql_schema": { + "type": "string", + "example": "db1" + }, + "db_user": { + "type": "string", + "example": "database_user001" + }, + "endpoint": { + "type": "string", + "example": "10.186.1.2" + }, + "first_query_at": { + "type": "string", + "example": "2023-09-12T02:48:01.317880Z" + }, + "query_time_avg": { + "type": "number", + "example": 3.22 + }, + "query_time_max": { + "type": "number", + "example": 5.22 + } + } + }, + "v1.AuditPlanSQLResV1": { + "type": "object", + "properties": { + "head": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanSQLHeadV1" + } + }, + "rows": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "v1.AuditPlanTypeResBase": { + "type": "object", + "properties": { + "active_status": { + "type": "string", + "enum": [ + "normal", + "disabled" + ] + }, + "audit_plan_id": { + "type": "integer" + }, + "desc": { + "type": "string" + }, + "last_collection_status": { + "type": "string", + "enum": [ + "normal", + "abnormal" + ] + }, + "token": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "v1.AuditPlanTypesV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "instance_type": { + "type": "string", + "enum": [ + "MySQL", + "Oracle", + "TiDB", + "OceanBase For MySQL", + "" + ] + }, + "type": { + "type": "string" + } + } + }, + "v1.AuditResDataV1": { + "type": "object", + "properties": { + "audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error", + "" + ] + }, + "pass_rate": { + "type": "number" + }, + "score": { + "type": "integer" + }, + "sql_results": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditSQLResV1" + } + } + } + }, + "v1.AuditResult": { + "type": "object", + "properties": { + "error_info": { + "type": "string" + }, + "execution_failed": { + "type": "boolean" + }, + "level": { + "type": "string", + "example": "warn" + }, + "message": { + "type": "string", + "example": "避免使用不必要的内置函数md5()" + }, + "rule_name": { + "type": "string" + } + } + }, + "v1.AuditSQLResV1": { + "type": "object", + "properties": { + "audit_level": { + "type": "string" + }, + "audit_result": { + "type": "string" + }, + "exec_sql": { + "type": "string" + }, + "number": { + "type": "integer" + } + } + }, + "v1.AuditTaskGroupRes": { + "type": "object", + "properties": { + "task_group_id": { + "type": "integer" + }, + "tasks": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditTaskResV1" + } + } + } + }, + "v1.AuditTaskGroupResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AuditTaskGroupRes" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.AuditTaskResV1": { + "type": "object", + "properties": { + "audit_files": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditFileResp" + } + }, + "audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error", + "" + ] + }, + "backup_conflict_with_instance": { + "description": "当数据源备份开启,工单备份关闭,则需要提示审核人工单备份策略与数据源备份策略不一致", + "type": "boolean" + }, + "backup_max_rows": { + "type": "integer" + }, + "enable_backup": { + "type": "boolean" + }, + "exec_end_time": { + "type": "string" + }, + "exec_fail_reason": { + "type": "string" + }, + "exec_fail_sql_count": { + "type": "integer" + }, + "exec_fail_sql_id": { + "type": "integer" + }, + "exec_fail_sql_number": { + "type": "integer" + }, + "exec_fail_stage": { + "type": "string" + }, + "exec_mode": { + "type": "string" + }, + "exec_start_time": { + "type": "string" + }, + "file_order_method": { + "type": "string" + }, + "instance_db_type": { + "type": "string" + }, + "instance_name": { + "type": "string" + }, + "instance_schema": { + "type": "string", + "example": "db1" + }, + "pass_rate": { + "type": "number" + }, + "score": { + "type": "integer" + }, + "sql_source": { + "type": "string", + "enum": [ + "form_data", + "sql_file", + "mybatis_xml_file", + "audit_plan", + "zip_file", + "git_repository" + ] + }, + "status": { + "type": "string", + "enum": [ + "initialized", + "audited", + "executing", + "exec_success", + "exec_failed", + "manually_executed" + ] + }, + "task_id": { + "type": "integer" + } + } + }, + "v1.AuditTaskSQLContentResV1": { + "type": "object", + "properties": { + "sql": { + "type": "string", + "example": "alter table tb1 drop columns c1" + } + } }, - "rule_template_name": { - "type": "string" + "v1.AuditTaskSQLResV1": { + "type": "object", + "properties": { + "audit_level": { + "type": "string" + }, + "audit_result": { + "type": "string" + }, + "audit_status": { + "type": "string" + }, + "description": { + "type": "string" + }, + "exec_result": { + "type": "string" + }, + "exec_sql": { + "type": "string" + }, + "exec_status": { + "type": "string" + }, + "number": { + "type": "integer" + }, + "rollback_sqls": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "v1.AuditTasksGroupResV1": { + "type": "object", + "properties": { + "task_group_id": { + "type": "integer" + } + } }, - "rule_version": { - "type": "integer" - } - } - }, - "RuleTemplateTipResV1": { - "type": "object", - "properties": { - "db_type": { - "type": "string" + "v1.AuditWhitelistResV1": { + "type": "object", + "properties": { + "audit_whitelist_id": { + "type": "integer" + }, + "desc": { + "type": "string" + }, + "last_match_time": { + "type": "string" + }, + "match_type": { + "type": "string" + }, + "matched_count": { + "type": "integer" + }, + "value": { + "type": "string" + } + } + }, + "v1.AuditedSQLCount": { + "type": "object", + "properties": { + "risk_sql_count": { + "type": "integer" + }, + "total_sql_count": { + "type": "integer" + } + } }, - "is_default_rule_template": { - "type": "boolean" + "v1.AutoCreateAndExecuteWorkflowResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AutoCreateAndExecuteWorkflowResV1Data" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.AutoCreateAndExecuteWorkflowResV1Data": { + "type": "object", + "properties": { + "workflow_id": { + "type": "string" + }, + "workflow_status": { + "type": "string" + } + } }, - "rule_template_id": { - "type": "string" + "v1.BackupSqlData": { + "type": "object", + "properties": { + "backup_result": { + "type": "string" + }, + "backup_sqls": { + "type": "array", + "items": { + "type": "string" + } + }, + "backup_status": { + "type": "string", + "enum": [ + "waiting_for_execution", + "executing", + "failed", + "succeed" + ] + }, + "backup_strategy": { + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "original_row" + ] + }, + "description": { + "type": "string" + }, + "exec_order": { + "type": "integer" + }, + "exec_sql_id": { + "type": "integer" + }, + "exec_status": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "instance_name": { + "type": "string" + }, + "origin_sql": { + "type": "string" + }, + "origin_task_id": { + "type": "integer" + } + } + }, + "v1.BackupSqlListRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.BackupSqlData" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.BannerCard": { + "type": "object", + "properties": { + "evidence_value": { + "description": "具体指标分值", + "type": "string", + "example": "22" + }, + "metric_evaluation": { + "description": "效能评价", + "type": "string", + "example": "高危风险消除率 79%" + }, + "need_display": { + "description": "是否需要展示", + "type": "boolean", + "example": true + } + } + }, + "v1.BatchAssociateWorkflowsWithVersionReqV1": { + "type": "object", + "properties": { + "workflow_ids": { + "type": "array", + "items": { + "type": "string" + } + } + } }, - "rule_template_name": { - "type": "string" + "v1.BatchCancelWorkflowsReqV1": { + "type": "object", + "properties": { + "workflow_names": { + "type": "array", + "items": { + "type": "string" + } + } + } }, - "rule_version": { - "type": "integer" - } - } - }, - "RuleTips": { - "type": "object", - "properties": { - "db_type": { - "type": "string" - }, - "rule": { - "type": "array", - "items": { - "$ref": "#/definitions/RuleRespV1" - } - } - } - }, - "RuleTypeV1": { - "type": "object", - "properties": { - "is_custom_rule_type": { - "type": "boolean" + "v1.BatchCheckInstanceConnectionsReqV1": { + "type": "object", + "properties": { + "instances": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.InstanceForCheckConnection" + } + } + } }, - "rule_count": { - "type": "integer" + "v1.BatchCompleteWorkflowsReqV1": { + "type": "object", + "properties": { + "workflow_names": { + "type": "array", + "items": { + "type": "string" + } + } + } }, - "rule_type": { - "type": "string" - } - } - }, - "SQLAuditRecord": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "creator": { - "type": "string" - }, - "instance": { - "type": "object", - "$ref": "#/definitions/SQLAuditRecordInstance" - }, - "sql_audit_record_id": { - "type": "string" - }, - "sql_audit_status": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "task": { - "type": "object", - "$ref": "#/definitions/AuditTaskResV1" - } - } - }, - "SQLAuditRecordInstance": { - "type": "object", - "properties": { - "db_host": { - "type": "string", - "example": "10.10.10.10" - }, - "db_port": { - "type": "string", - "example": "3306" - } - } - }, - "SQLAuditRecordResData": { - "type": "object", - "properties": { - "sql_audit_record_id": { - "type": "string" - }, - "task": { - "type": "object", - "$ref": "#/definitions/AuditTaskResV1" - } - } - }, - "SQLAuditResult": { - "type": "object", - "properties": { - "db_type": { - "type": "string" + "v1.BatchExecuteWorkflowsReqV1": { + "type": "object", + "properties": { + "workflow_ids": { + "type": "array", + "items": { + "type": "string" + } + } + } }, - "error_info": { - "type": "string" + "v1.BatchGetInstanceConnectionsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.InstanceConnectionResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.BatchReleaseWorkflowReqV1": { + "type": "object", + "properties": { + "release_workflows": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.ReleaseWorkflows" + } + } + } }, - "execution_failed": { - "type": "boolean", - "example": false + "v1.BatchUpdateSqlManageReq": { + "type": "object", + "properties": { + "assignees": { + "type": "array", + "items": { + "type": "string" + } + }, + "priority": { + "type": "string", + "enum": [ + "", + "high" + ] + }, + "remark": { + "type": "string" + }, + "sql_manage_id_list": { + "type": "array", + "items": { + "type": "integer" + } + }, + "status": { + "type": "string", + "enum": [ + "solved", + "ignored", + "manual_audited" + ] + } + } + }, + "v1.BlacklistResV1": { + "type": "object", + "properties": { + "blacklist_id": { + "type": "integer" + }, + "content": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "last_match_time": { + "type": "string" + }, + "matched_count": { + "type": "integer" + }, + "type": { + "type": "string", + "enum": [ + "sql", + "fp_sql", + "ip", + "cidr", + "host", + "instance" + ] + } + } + }, + "v1.ChartPoint": { + "type": "object", + "properties": { + "info": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "status": { + "type": "integer" + }, + "x": { + "type": "string" + }, + "y": { + "type": "number" + } + } + }, + "v1.CheckLicenseResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "content": { + "type": "string" + }, + "license": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.LicenseItem" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.CloneProjectRuleTemplateReqV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "new_rule_template_name": { + "type": "string" + } + } }, - "i18n_audit_result_info": { - "type": "object", - "$ref": "#/definitions/I18nAuditResultInfo" + "v1.CloneRuleTemplateReqV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "new_rule_template_name": { + "type": "string" + } + } }, - "level": { - "type": "string", - "example": "warn" + "v1.CodingConfigurationV1": { + "type": "object", + "properties": { + "coding_url": { + "type": "string" + }, + "is_coding_enabled": { + "type": "boolean" + } + } }, - "message": { - "type": "string", - "example": "避免使用不必要的内置函数md5()" + "v1.CodingResp": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + } }, - "rule_name": { - "type": "string" - } - } - }, - "SQLExplain": { - "type": "object", - "properties": { - "classic_result": { - "type": "object", - "$ref": "#/definitions/ExplainClassicResult" + "v1.CompanyNotice": { + "type": "object", + "properties": { + "notice_str": { + "type": "string" + } + } }, - "cost": { - "type": "number" + "v1.CreatInstanceAuditPlanRes": { + "type": "object", + "properties": { + "instance_audit_plan_id": { + "type": "string" + } + } }, - "err_message": { - "type": "string" + "v1.CreatInstanceAuditPlanResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.CreatInstanceAuditPlanRes" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.CreateAuditPlanReqV1": { + "type": "object", + "properties": { + "audit_plan_cron": { + "type": "string", + "example": "0 */2 * * *" + }, + "audit_plan_instance_database": { + "type": "string", + "example": "app1" + }, + "audit_plan_instance_name": { + "type": "string", + "example": "test_mysql" + }, + "audit_plan_instance_type": { + "type": "string", + "example": "mysql" + }, + "audit_plan_name": { + "type": "string", + "example": "audit_plan_for_java_repo_1" + }, + "audit_plan_params": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanParamReqV1" + } + }, + "audit_plan_type": { + "type": "string", + "example": "slow log" + }, + "rule_template_name": { + "type": "string", + "example": "default_MySQL" + } + } + }, + "v1.CreateAuditTaskReqV1": { + "type": "object", + "properties": { + "backup_max_rows": { + "type": "integer" + }, + "enable_backup": { + "type": "boolean" + }, + "exec_mode": { + "type": "string", + "enum": [ + "sql_file", + "sqls" + ] + }, + "file_order_method": { + "type": "string" + }, + "instance_name": { + "type": "string", + "example": "inst_1" + }, + "instance_schema": { + "type": "string", + "example": "db1" + }, + "rule_template_name": { + "type": "string" + }, + "sql": { + "type": "string", + "example": "alter table tb1 drop columns c1" + } + } + }, + "v1.CreateAuditTasksGroupReqV1": { + "type": "object", + "properties": { + "exec_mode": { + "type": "string", + "enum": [ + "sql_file", + "sqls" + ] + }, + "file_order_method": { + "type": "string" + }, + "instances": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.InstanceForCreatingTask" + } + } + } + }, + "v1.CreateAuditTasksGroupResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AuditTasksGroupResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.CreateAuditWhitelistReqV1": { + "type": "object", + "properties": { + "desc": { + "type": "string", + "example": "used for rapid release" + }, + "match_type": { + "type": "string", + "enum": [ + "exact_match", + "fp_match" + ], + "example": "exact_match" + }, + "value": { + "type": "string", + "example": "create table" + } + } + }, + "v1.CreateBlacklistReqV1": { + "type": "object", + "properties": { + "content": { + "type": "string", + "example": "select * from t1" + }, + "desc": { + "type": "string", + "example": "used for rapid release" + }, + "type": { + "type": "string", + "enum": [ + "sql", + "fp_sql", + "ip", + "cidr", + "host", + "instance" + ], + "example": "sql" + } + } + }, + "v1.CreateCustomRuleReqV1": { + "type": "object", + "properties": { + "annotation": { + "type": "string", + "example": "this is test rule" + }, + "db_type": { + "type": "string", + "example": "MySQL" + }, + "desc": { + "type": "string", + "example": "this is test rule" + }, + "level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "example": "notice" + }, + "rule_script": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "example": "DDL规则" + } + } + }, + "v1.CreateInstanceAuditPlanReqV1": { + "type": "object", + "properties": { + "audit_plans": { + "description": "扫描类型", + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlan" + } + }, + "instance_id": { + "type": "string" + } + } + }, + "v1.CreatePipelineReqV1": { + "type": "object", + "properties": { + "address": { + "description": "关联流水线地址", + "type": "string" + }, + "description": { + "description": "流水线描述", + "type": "string" + }, + "name": { + "description": "流水线名称", + "type": "string" + }, + "nodes": { + "description": "节点信息", + "type": "array", + "items": { + "$ref": "#/definitions/v1.pipelineNodeBase" + } + } + } + }, + "v1.CreatePipelineResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.createPipelineResData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.CreateProjectRuleTemplateReqV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "rule_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RuleReqV1" + } + }, + "rule_template_name": { + "type": "string" + }, + "rule_version": { + "type": "integer" + } + } + }, + "v1.CreateRollbackWorkflowReq": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "rollback_sql_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "sql_version_id": { + "type": "integer" + }, + "task_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "workflow_subject": { + "type": "string" + }, + "workflow_template_id": { + "type": "integer" + } + } + }, + "v1.CreateRollbackWorkflowRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.CreateRollbackWorkflowResData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.CreateRollbackWorkflowResData": { + "type": "object", + "properties": { + "workflow_id": { + "type": "string" + } + } }, - "sql": { - "type": "string" - } - } - }, - "SQLLineageAnalyzeReqV1": { - "type": "object", - "properties": { - "default_schema": { - "type": "string" - }, - "instance_type": { - "type": "string" - }, - "result_columns": { - "type": "array", - "items": { - "type": "string" - } - }, - "sql": { - "type": "string" - } - } - }, - "SQLLineageAnalyzeResDataV1": { - "type": "object", - "properties": { - "result": { - "type": "object", - "$ref": "#/definitions/SQLLineageAnalyzeResultV1" - } - } - }, - "SQLLineageAnalyzeResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/SQLLineageAnalyzeResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "SQLLineageAnalyzeResultV1": { - "type": "object", - "properties": { - "edges": { - "type": "array", - "items": { - "$ref": "#/definitions/SQLLineageEdgeV1" - } - }, - "nodes": { - "type": "array", - "items": { - "$ref": "#/definitions/SQLLineageNodeV1" - } - }, - "original_sql": { - "type": "string" - }, - "result_columns": { - "type": "array", - "items": { - "$ref": "#/definitions/SQLLineageResultColumnV1" - } - }, - "source_columns": { - "type": "array", - "items": { - "$ref": "#/definitions/SQLLineageColumnRefV1" - } - }, - "tables": { - "type": "array", - "items": { - "$ref": "#/definitions/SQLLineageTableRefV1" - } - }, - "title": { - "type": "string" - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "SQLLineageColumnRefV1": { - "type": "object", - "properties": { - "column": { - "type": "string" + "v1.CreateRuleTemplateReqV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "rule_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RuleReqV1" + } + }, + "rule_template_name": { + "type": "string" + }, + "rule_version": { + "type": "integer" + } + } + }, + "v1.CreateSQLAuditRecordResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.SQLAuditRecordResData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.CreateSqlVersionReqV1": { + "type": "object", + "properties": { + "create_sql_version_stage": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.CreateSqlVersionStage" + } + }, + "desc": { + "type": "string" + }, + "version": { + "type": "string", + "example": "2.23" + } + } + }, + "v1.CreateSqlVersionRes": { + "type": "object", + "properties": { + "sql_version_id": { + "type": "integer" + } + } }, - "schema": { - "type": "string" + "v1.CreateSqlVersionResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.CreateSqlVersionRes" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.CreateSqlVersionStage": { + "type": "object", + "properties": { + "create_stages_instance_dep": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.CreateStagesInstanceDep" + } + }, + "name": { + "type": "string", + "example": "生产" + }, + "stage_sequence": { + "type": "integer" + } + } + }, + "v1.CreateStagesInstanceDep": { + "type": "object", + "properties": { + "next_stage_instance_id": { + "type": "string" + }, + "stage_instance_id": { + "type": "string" + } + } }, - "table": { - "type": "string" - } - } - }, - "SQLLineageEdgeV1": { - "type": "object", - "properties": { - "from_id": { - "type": "string" + "v1.CreateWorkflowReqV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "task_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "workflow_subject": { + "type": "string" + } + } + }, + "v1.CreateWorkflowTemplateReqV1": { + "type": "object", + "properties": { + "allow_submit_when_less_audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ] + }, + "desc": { + "type": "string" + }, + "is_default": { + "type": "boolean" + }, + "workflow_step_template_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.WorkFlowStepTemplateReqV1" + } + }, + "workflow_template_name": { + "type": "string" + }, + "workflow_type": { + "type": "string", + "enum": [ + "workflow", + "data_export" + ] + } + } + }, + "v1.CustomRuleResV1": { + "type": "object", + "properties": { + "annotation": { + "type": "string", + "example": "this is test rule" + }, + "categories": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "db_type": { + "type": "string", + "example": "MySQL" + }, + "desc": { + "type": "string", + "example": "this is test rule" + }, + "level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "example": "notice" + }, + "rule_id": { + "type": "string" + }, + "rule_script": { + "type": "string" + }, + "type": { + "type": "string", + "example": "DDL规则" + } + } + }, + "v1.DBPerformanceImproveOverview": { + "type": "object", + "properties": { + "avg_performance_improve": { + "type": "number" + }, + "instance_name": { + "type": "string" + } + } }, - "to_id": { - "type": "string" + "v1.DBTypeAuditPlan": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanCount" + } + }, + "db_type": { + "type": "string" + } + } + }, + "v1.DBTypeHealth": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "health_instance_names": { + "type": "array", + "items": { + "type": "string" + } + }, + "unhealth_instance_names": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "v1.DashboardResV1": { + "type": "object", + "properties": { + "workflow_statistics": { + "type": "object", + "$ref": "#/definitions/v1.WorkflowStatisticsResV1" + } + } }, - "type": { - "type": "string" - } - } - }, - "SQLLineageNodeV1": { - "type": "object", - "properties": { - "column": { - "type": "string" + "v1.DatabaseComparisonObject": { + "type": "object", + "properties": { + "instance_id": { + "type": "string" + }, + "schema_name": { + "type": "string" + } + } }, - "expr": { - "type": "string" + "v1.DatabaseComparisonResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SchemaObject" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.DatabaseComparisonStatements": { + "type": "object", + "properties": { + "base_sql": { + "type": "object", + "$ref": "#/definitions/v1.SQLStatement" + }, + "comparison_sql": { + "type": "object", + "$ref": "#/definitions/v1.SQLStatement" + } + } + }, + "v1.DatabaseComparisonStatementsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.DatabaseComparisonStatements" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.DatabaseDiffModifySQL": { + "type": "object", + "properties": { + "audit_error": { + "type": "string" + }, + "modify_sqls": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SQLStatementWithAuditResult" + } + }, + "schema_name": { + "type": "string" + } + } + }, + "v1.DatabaseDiffObject": { + "type": "object", + "properties": { + "inconsistent_num": { + "type": "integer" + }, + "object_type": { + "type": "string", + "enum": [ + "TABLE", + "VIEW", + "PROCEDURE", + "TIGGER", + "EVENT", + "FUNCTION" + ] + }, + "objects_diff_result": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.ObjectDiffResult" + } + } + } + }, + "v1.DatabaseDriverLogosV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "logo": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "v1.DatabaseDriverOptionsV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.InstanceAdditionalParamResV1" + } + } + } + }, + "v1.DatabaseObject": { + "type": "object", + "properties": { + "object_name": { + "type": "string" + }, + "object_type": { + "type": "string", + "enum": [ + "TABLE", + "VIEW", + "PROCEDURE", + "TIGGER", + "EVENT", + "FUNCTION" + ] + } + } + }, + "v1.DatabaseSchemaObject": { + "type": "object", + "properties": { + "base_schema_name": { + "type": "string" + }, + "comparison_schema_name": { + "type": "string" + }, + "database_objects": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.DatabaseObject" + } + } + } + }, + "v1.DepBetweenStageInstance": { + "type": "object", + "properties": { + "next_stage_instance_id": { + "type": "string" + }, + "next_stage_instance_name": { + "type": "string" + }, + "stage_instance_id": { + "type": "string" + }, + "stage_instance_name": { + "type": "string" + } + } + }, + "v1.DingTalkConfigurationV1": { + "type": "object", + "properties": { + "app_key": { + "type": "string" + }, + "is_enable_ding_talk_notify": { + "type": "boolean" + } + } }, - "id": { - "type": "string" + "v1.DirectAuditFileReqV1": { + "type": "object", + "properties": { + "file_contents": { + "description": "调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现\n每个数组元素是一个文件内容", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "select * from t1; select * from t2;" + ] + }, + "instance_name": { + "type": "string", + "example": "instance1" + }, + "instance_type": { + "type": "string", + "example": "MySQL" + }, + "project_name": { + "type": "string", + "example": "project1" + }, + "schema_name": { + "type": "string", + "example": "schema1" + }, + "sql_type": { + "type": "string", + "enum": [ + "sql", + "mybatis", + "" + ], + "example": "sql" + } + } + }, + "v1.DirectAuditReqV1": { + "type": "object", + "properties": { + "instance_name": { + "type": "string", + "example": "instance1" + }, + "instance_type": { + "type": "string", + "example": "MySQL" + }, + "project_name": { + "type": "string", + "example": "project1" + }, + "schema_name": { + "type": "string", + "example": "schema1" + }, + "sql_content": { + "description": "调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现", + "type": "string", + "example": "select * from t1; select * from t2;" + }, + "sql_type": { + "type": "string", + "enum": [ + "sql", + "mybatis", + "" + ], + "example": "sql" + } + } + }, + "v1.DirectAuditResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AuditResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.DirectGetSQLAnalysisResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SqlAnalysisResDataV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.DriversResV1": { + "type": "object", + "properties": { + "driver_name_list": { + "type": "array", + "items": { + "type": "string" + } + } + } }, - "name": { - "type": "string" + "v1.EdgeResponse": { + "type": "object", + "properties": { + "from_id": { + "description": "存储Node的ID", + "type": "string" + }, + "is_directed": { + "description": "是否有向", + "type": "boolean" + }, + "to_id": { + "description": "存储Node的ID", + "type": "string" + }, + "weight": { + "description": "权重", + "type": "integer" + } + } + }, + "v1.EfficiencyCard": { + "type": "object", + "properties": { + "evidence_value": { + "description": "具体指标分值", + "type": "string", + "example": "高危拦截35次" + }, + "metric_evaluation": { + "description": "效能评价", + "type": "string", + "example": "S级,+450%,123h" + }, + "metric_title": { + "description": "效能指标标题", + "type": "string", + "enum": [ + "security_defense", + "resource_cost", + "code_standard", + "rd_efficiency", + "query_performance" + ] + } + } + }, + "v1.EnumsValueResV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "value": { + "type": "string" + } + } }, - "schema": { - "type": "string" + "v1.ExplainClassicResult": { + "type": "object", + "properties": { + "head": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.TableMetaItemHeadResV1" + } + }, + "rows": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "v1.ExplainValidationDetail": { + "type": "object", + "properties": { + "after_cost": { + "type": "number" + }, + "after_plan": { + "type": "string" + }, + "before_cost": { + "type": "number" + }, + "before_plan": { + "type": "string" + }, + "perform_improve_per": { + "type": "number" + } + } + }, + "v1.FeishuConfigurationV1": { + "type": "object", + "properties": { + "app_id": { + "type": "string" + }, + "is_feishu_notification_enabled": { + "type": "boolean" + } + } }, - "table": { - "type": "string" + "v1.FileToSort": { + "type": "object", + "properties": { + "file_id": { + "type": "integer" + }, + "new_index": { + "type": "integer" + } + } }, - "type": { - "type": "string" - } - } - }, - "SQLLineageResultColumnV1": { - "type": "object", - "properties": { - "expression": { - "type": "string" - }, - "name": { - "type": "string" - }, - "sources": { - "type": "array", - "items": { - "$ref": "#/definitions/SQLLineageColumnRefV1" - } - } - } - }, - "SQLLineageTableRefV1": { - "type": "object", - "properties": { - "alias": { - "type": "string" + "v1.Filter": { + "type": "object", + "properties": { + "filter_between_value": { + "type": "object", + "$ref": "#/definitions/v1.FilterBetweenValue" + }, + "filter_compare_value": { + "type": "string" + }, + "filter_name": { + "type": "string" + } + } + }, + "v1.FilterBetweenValue": { + "type": "object", + "properties": { + "from": { + "type": "string" + }, + "to": { + "type": "string" + } + } }, - "schema": { - "type": "string" + "v1.FilterMeta": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "filter_input_type": { + "type": "string", + "enum": [ + "int", + "string", + "date_time" + ] + }, + "filter_name": { + "type": "string" + }, + "filter_op_type": { + "type": "string", + "enum": [ + "equal", + "between" + ] + }, + "filter_tip_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.FilterTip" + } + } + } + }, + "v1.FilterTip": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "group": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "v1.FullSyncAuditPlanSQLsReqV1": { + "type": "object", + "properties": { + "audit_plan_sql_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanSQLReqV1" + } + } + } }, - "table": { - "type": "string" - } - } - }, - "SQLQueryConfigResV1": { - "type": "object", - "properties": { - "allow_query_when_less_than_audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ] - }, - "audit_enabled": { - "type": "boolean" - }, - "max_pre_query_rows": { - "type": "integer" - }, - "query_timeout_second": { - "type": "integer" - } - } - }, - "SQLStatement": { - "type": "object", - "properties": { - "audit_error": { - "type": "string" - }, - "sql_statement_with_audit": { - "type": "object", - "$ref": "#/definitions/SQLStatementWithAuditResult" - } - } - }, - "SQLStatementWithAuditResult": { - "type": "object", - "properties": { - "audit_results": { - "type": "array", - "items": { - "$ref": "#/definitions/SQLAuditResult" - } - }, - "sql_statement": { - "type": "string" - } - } - }, - "SSHPublicKeyInfo": { - "type": "object", - "properties": { - "public_key": { - "type": "string" - } - } - }, - "SSHPublicKeyInfoV1Rsp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/SSHPublicKeyInfo" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "ScatterPoint": { - "type": "object", - "properties": { - "execute_time": { - "description": "执行时间", - "type": "number" - }, - "id": { - "description": "SQL ID", - "type": "integer" - }, - "info": { - "description": "额外信息", - "type": "array", - "items": { + "v1.GenModifySQLResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.DatabaseDiffModifySQL" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GenModifylSQLReqV1": { + "type": "object", + "properties": { + "base_instance_id": { + "type": "string" + }, + "comparison_instance_id": { + "type": "string" + }, + "database_schema_objects": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.DatabaseSchemaObject" + } + } + } + }, + "v1.GetAIHubBannerResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AIHubBannerData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetAIHubExecutionDataResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AIHubExecutionRecord" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "description": "总数", + "type": "integer" + } + } + }, + "v1.GetAIHubManagementViewResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AIHubManagementViewData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetAIHubStrategicValueResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AIHubStrategicValueData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetAbnormalAuditPlanInstancesResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AbnormalAuditPlanInstance" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetAuditPlanAnalysisDataResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.GetSQLAnalysisDataResItemV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetAuditPlanMetasResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanMetaV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetAuditPlanNotifyConfigResDataV1": { + "type": "object", + "properties": { + "enable_email_notify": { + "type": "boolean" + }, + "enable_web_hook_notify": { + "type": "boolean" + }, + "notify_interval": { + "type": "integer" + }, + "notify_level": { + "type": "string" + }, + "web_hook_template": { + "type": "string" + }, + "web_hook_url": { + "type": "string" + } + } + }, + "v1.GetAuditPlanNotifyConfigResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.GetAuditPlanNotifyConfigResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetAuditPlanReportResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AuditPlanReportResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetAuditPlanReportSQLsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanReportSQLResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetAuditPlanReportsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanReportResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetAuditPlanResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AuditPlanResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetAuditPlanSQLDataReqV1": { + "type": "object", + "properties": { + "filter_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.Filter" + } + }, + "is_asc": { + "type": "boolean" + }, + "order_by": { + "type": "string" + }, + "page_index": { + "type": "integer" + }, + "page_size": { + "type": "integer" + } + } + }, + "v1.GetAuditPlanSQLDataResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AuditPlanSQLDataResV1" + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetAuditPlanSQLExportReqV1": { + "type": "object", + "properties": { + "export_format": { + "description": "导出格式:csv 或 excel", + "type": "string", + "enum": [ + "csv", + "excel" + ], + "example": "excel" + }, + "filter_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.Filter" + } + }, + "is_asc": { + "type": "boolean" + }, + "order_by": { + "type": "string" + } + } + }, + "v1.GetAuditPlanSQLMetaResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AuditPlanSQLMetaResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetAuditPlanSQLsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AuditPlanSQLResV1" + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetAuditPlanTypesResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanTypesV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetAuditPlansResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetAuditTaskResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AuditTaskResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetAuditTaskSQLContentResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AuditTaskSQLContentResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetAuditTaskSQLsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditTaskSQLResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetAuditWhitelistResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditWhitelistResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetBlacklistResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.BlacklistResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetCodingConfigurationResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.CodingConfigurationV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetCompanyNoticeResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.CompanyNotice" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetComparisonStatementsReqV1": { + "type": "object", + "properties": { + "database_comparison_object": { + "type": "object", + "$ref": "#/definitions/v1.GetDatabaseComparisonReqV1" + }, + "database_object": { + "type": "object", + "$ref": "#/definitions/v1.DatabaseObject" + } + } + }, + "v1.GetCustomRuleResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.CustomRuleResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetCustomRulesResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.CustomRuleResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetDBPerformanceImproveOverviewResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.DBPerformanceImproveOverview" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetDashboardResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.DashboardResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetDatabaseComparisonReqV1": { + "type": "object", + "properties": { + "base_db_object": { + "type": "object", + "$ref": "#/definitions/v1.DatabaseComparisonObject" + }, + "comparison_db_object": { + "type": "object", + "$ref": "#/definitions/v1.DatabaseComparisonObject" + } + } + }, + "v1.GetDatabaseDriverLogosResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.DatabaseDriverLogosV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetDatabaseDriverOptionsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.DatabaseDriverOptionsV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetDepBetweenStageInstanceResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.DepBetweenStageInstance" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetDingTalkConfigurationResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.DingTalkConfigurationV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetDriverRuleVersionTipsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.GetDriverRuleVersionTipsV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetDriverRuleVersionTipsV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string", + "example": "mysql" + }, + "rule_versions": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "v1.GetDriversResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.DriversResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetFeishuAuditConfigurationResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.FeishuConfigurationV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetGlobalSqlManageListResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.GlobalSqlManage" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetGlobalSqlManageStatisticsResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetInstanceAuditPlanDetailResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.InstanceAuditPlanDetailResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetInstanceAuditPlanOverviewResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.InstanceAuditPlanInfo" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetInstanceAuditPlansResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.InstanceAuditPlanResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetInstanceConnectableResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.InstanceConnectableResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetInstanceHealthResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.DBTypeHealth" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetInstanceOverviewStatisticsRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.InstanceOverviewStatistics" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetInstanceSchemaResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.InstanceSchemaResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetInstanceTipsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.InstanceTipResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetInstancesTypePercentResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.InstancesTypePercentV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetKnowledgeBaseListRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.KnowledgeBase" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetKnowledgeBaseTagListRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.Tag" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetKnowledgeGraphResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.GraphResponse" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetLicenseResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "content": { + "type": "string" + }, + "license": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.LicenseItem" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetLicenseUsageResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.LicenseUsageV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetModuleStatusResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.ModuleStatusRes" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetOperationsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.OperationResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetOptimizationOverviewResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.OptimizationRecordOverview" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetOptimizationRecordRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.OptimizationDetail" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetOptimizationRecordsRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.OptimizationRecord" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetOptimizationSQLRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.OptimizationSQLDetail" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetOptimizationSQLsRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.OptimizationSQL" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetPipelineDetailResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.pipelineDetailData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetPipelinesResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "description": "流水线列表数据", + "type": "array", + "items": { + "$ref": "#/definitions/v1.pipelineDetail" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "description": "流水线总数", + "type": "integer" + } + } + }, + "v1.GetProjectRuleTemplateResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.RuleProjectTemplateDetailResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetProjectRuleTemplatesResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.ProjectRuleTemplateResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetProjectScoreResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.ProjectScore" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetProjectStatisticsResDataV1": { + "type": "object", + "properties": { + "audit_plan_total": { + "type": "integer" + }, + "instance_total": { + "type": "integer" + }, + "member_total": { + "type": "integer" + }, + "rule_template_total": { + "type": "integer" + }, + "whitelist_total": { + "type": "integer" + }, + "workflow_total": { + "type": "integer" + } + } + }, + "v1.GetProjectStatisticsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.GetProjectStatisticsResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetReportPushConfigsListResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.ReportPushConfigList" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetRiskAuditPlanResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RiskAuditPlan" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetRoleUserCountResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RoleUserCount" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetRuleCategoryStatisticResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/model.RuleCategoryStatistic" + } + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetRuleKnowledgeResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.RuleKnowledgeResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetRuleTemplateResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.RuleTemplateDetailResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetRuleTemplateTipsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RuleTemplateTipResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetRuleTemplatesResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RuleTemplateResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetRuleTypeByDBTypeResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RuleTypeV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetRulesResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RuleResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetSQLAnalysisDataResItemV1": { + "type": "object", + "properties": { + "sql_explain": { + "type": "object", + "$ref": "#/definitions/v1.SQLExplain" + }, + "table_metas": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.TableMeta" + } + } + } + }, + "v1.GetSQLAuditRecordResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.SQLAuditRecord" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetSQLAuditRecordTagTipsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetSQLAuditRecordsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SQLAuditRecord" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetSqlAverageExecutionTimeResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SqlAverageExecutionTime" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetSqlDEVRecordListResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SqlDEVRecord" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetSqlExecutionFailPercentResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SqlExecutionFailPercent" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetSqlFileOrderMethodResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.SqlFileOrderMethodRes" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetSqlManageListResp": { "type": "object", - "additionalProperties": { - "type": "string" + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SqlManage" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "sql_manage_bad_num": { + "type": "integer" + }, + "sql_manage_optimized_num": { + "type": "integer" + }, + "sql_manage_total_num": { + "type": "integer" + } + } + }, + "v1.GetSqlManageRuleTipsResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RuleTips" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetSqlManageSqlAnalysisResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "description": "V1版本不能引用V2版本的结构体,所以只能复制一份", + "type": "object", + "$ref": "#/definitions/v1.SqlAnalysis" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetSqlPerformanceInsightsRelatedSQLResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RelatedSQLInfo" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetSqlPerformanceInsightsRelatedTransactionResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.RelatedTransactionInfo" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetSqlPerformanceInsightsResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.SqlPerformanceInsights" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetSqlVersionDetailResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.SqlVersionDetailResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetSqlVersionListResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SqlVersionResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetSystemModuleRedDotsRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.ModuleRedDots" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetTableMetadataResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.InstanceTableMeta" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetTaskAnalysisDataResItemV1": { + "type": "object", + "properties": { + "sql_explain": { + "type": "object", + "$ref": "#/definitions/v1.SQLExplain" + }, + "table_metas": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.TableMeta" + } + } + } + }, + "v1.GetTaskAnalysisDataResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.GetTaskAnalysisDataResItemV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetUserTipsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.UserTipResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWechatAuditConfigurationResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.WechatConfigurationV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWorkflowAuditPassPercentResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.WorkflowAuditPassPercentV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWorkflowCountsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.WorkflowCountsV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWorkflowCreatedCountsEachDayResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.WorkflowCreatedCountsEachDayV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWorkflowDurationOfWaitingForAuditResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.WorkflowStageDuration" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWorkflowDurationOfWaitingForExecutionResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.WorkflowStageDuration" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWorkflowPassPercentResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.WorkflowPassPercentV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWorkflowPercentCountedByInstanceTypeResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.WorkflowPercentCountedByInstanceTypeV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWorkflowRejectedPercentGroupByCreatorResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.WorkflowRejectedPercentGroupByCreator" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWorkflowRejectedPercentGroupByInstanceResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.WorkflowRejectedPercentGroupByInstance" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWorkflowResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.WorkflowResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWorkflowStatisticOfInstancesResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.WorkflowStatisticOfInstance" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWorkflowStatusCountResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.WorkflowStatusCountV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWorkflowTasksItemV1": { + "type": "object", + "properties": { + "current_step_assignee_user_name_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "exec_end_time": { + "type": "string" + }, + "exec_start_time": { + "type": "string" + }, + "execution_user_name": { + "type": "string" + }, + "instance_maintenance_times": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.MaintenanceTimeResV1" + } + }, + "instance_name": { + "type": "string" + }, + "schedule_time": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "exec_scheduled", + "exec_failed", + "exec_succeeded", + "executing", + "manually_executed" + ] + }, + "task_id": { + "type": "integer" + }, + "task_pass_rate": { + "type": "number" + }, + "task_score": { + "type": "integer" + } + } + }, + "v1.GetWorkflowTasksResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.GetWorkflowTasksItemV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWorkflowTemplateListResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.WorkflowTemplateDetailResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWorkflowTemplateResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.WorkflowTemplateDetailResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GetWorkflowsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.WorkflowDetailResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetWorkflowsThatCanBeAssociatedToVersionResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AssociateWorkflows" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.GlobalSqlManage": { + "type": "object", + "properties": { + "audit_result": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditResult" + } + }, + "first_appear_timestamp": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "instance_id": { + "type": "string" + }, + "instance_name": { + "type": "string" + }, + "problem_descriptions": { + "description": "根据来源信息拼接", + "type": "array", + "items": { + "type": "string" + } + }, + "project_name": { + "type": "string" + }, + "project_priority": { + "type": "string", + "enum": [ + "high", + "medium", + "low" + ] + }, + "project_uid": { + "type": "string" + }, + "source": { + "type": "object", + "$ref": "#/definitions/v1.Source" + }, + "sql": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited", + "sent" + ] + } + } + }, + "v1.GlobalWorkflowStatisticsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v1.GraphResponse": { + "type": "object", + "properties": { + "edges": { + "description": "边集合", + "type": "array", + "items": { + "$ref": "#/definitions/v1.EdgeResponse" + } + }, + "nodes": { + "description": "节点集合", + "type": "array", + "items": { + "$ref": "#/definitions/v1.NodeResponse" + } + } + } + }, + "v1.HighPriorityConditionReq": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "operator": { + "type": "string", + "default": "\u003e", + "enum": [ + "\u003e", + "=", + "\u003c" + ] + }, + "value": { + "type": "string" + } + } + }, + "v1.HighPriorityConditionResV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "enums_value": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.EnumsValueResV1" + } + }, + "key": { + "type": "string" + }, + "operator": { + "type": "object", + "$ref": "#/definitions/v1.OperatorResV1" + }, + "type": { + "type": "string", + "enum": [ + "string", + "int", + "bool", + "password" + ] + }, + "value": { + "type": "string" + } + } + }, + "v1.InstanceAdditionalParamResV1": { + "type": "object", + "properties": { + "description": { + "type": "string", + "example": "参数项中文名" + }, + "name": { + "type": "string", + "example": "param name" + }, + "type": { + "type": "string", + "example": "int" + }, + "value": { + "type": "string", + "example": "0" + } + } + }, + "v1.InstanceAuditPlanDetailResV1": { + "type": "object", + "properties": { + "audit_plans": { + "description": "扫描类型", + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanRes" + } + }, + "business": { + "description": "This parameter is deprecated", + "type": "string", + "example": "test" + }, + "environment": { + "type": "string", + "example": "prod" + }, + "instance_id": { + "type": "string", + "example": "instance_id" + }, + "instance_name": { + "type": "string", + "example": "test_mysql" + }, + "instance_type": { + "type": "string", + "example": "mysql" + } + } + }, + "v1.InstanceAuditPlanInfo": { + "type": "object", + "properties": { + "active_status": { + "type": "string", + "enum": [ + "normal", + "disabled" + ] + }, + "audit_plan_db_type": { + "type": "string", + "example": "mysql" + }, + "audit_plan_instance_name": { + "type": "string", + "example": "test_mysql" + }, + "audit_plan_rule_template": { + "type": "object", + "$ref": "#/definitions/v1.AuditPlanRuleTemplate" + }, + "audit_plan_type": { + "type": "object", + "$ref": "#/definitions/v1.AuditPlanTypeResBase" + }, + "exec_cmd": { + "type": "string", + "example": "./scanner xxx" + }, + "id": { + "type": "integer" + }, + "last_collection_status": { + "type": "string", + "enum": [ + "normal", + "abnormal" + ] + }, + "last_collection_time": { + "type": "string" + }, + "token_exp": { + "type": "integer", + "example": 1747129752 + }, + "total_sql_nums": { + "type": "integer" + }, + "unsolved_sql_nums": { + "type": "integer" + } + } + }, + "v1.InstanceAuditPlanResV1": { + "type": "object", + "properties": { + "active_status": { + "type": "string", + "enum": [ + "normal", + "disabled" + ] + }, + "audit_plan_types": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanTypeResBase" + } + }, + "business": { + "description": "This parameter is deprecated", + "type": "string" + }, + "create_time": { + "description": "TODO 采集状态", + "type": "string" + }, + "creator": { + "type": "string" + }, + "environment": { + "type": "string" + }, + "instance_audit_plan_id": { + "type": "integer" + }, + "instance_id": { + "type": "string" + }, + "instance_name": { + "type": "string" + }, + "instance_type": { + "type": "string" + } + } + }, + "v1.InstanceConnectableResV1": { + "type": "object", + "properties": { + "connect_error_message": { + "type": "string" + }, + "is_instance_connectable": { + "type": "boolean" + } } - } - }, - "is_in_transaction": { - "description": "是否在事务中", - "type": "boolean" - }, - "sql": { - "description": "SQL语句", - "type": "string" - }, - "time": { - "description": "时间点", - "type": "string" - } - } - }, - "ScheduleTaskDefaultOption": { - "type": "object", - "properties": { - "default_selector": { - "type": "string", - "enum": [ - "wechat", - "feishu" - ] - } - } - }, - "ScheduledTaskDefaultOptionV1Rsp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/ScheduleTaskDefaultOption" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "SchemaObject": { - "type": "object", - "properties": { - "base_schema_name": { - "type": "string" - }, - "comparison_result": { - "type": "string", - "enum": [ - "same", - "inconsistent", - "base_not_exist", - "comparison_not_exist" - ] - }, - "comparison_schema_name": { - "type": "string" - }, - "database_diff_objects": { - "type": "array", - "items": { - "$ref": "#/definitions/DatabaseDiffObject" - } - }, - "inconsistent_num": { - "type": "integer" - } - } - }, - "Source": { - "type": "object", - "properties": { - "sql_source_desc": { - "type": "string" - }, - "sql_source_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "sql_source_type": { - "type": "string" - } - } - }, - "SqlAnalysis": { - "type": "object", - "properties": { - "performance_statistics": { - "type": "object", - "$ref": "#/definitions/PerformanceStatistics" - }, - "sql_explain": { - "type": "object", - "$ref": "#/definitions/SQLExplain" - }, - "table_metas": { - "type": "object", - "$ref": "#/definitions/TableMetas" - } - } - }, - "SqlAnalysisChart": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "points": { - "type": "array", - "items": { - "$ref": "#/definitions/ChartPoint" - } - }, - "x_info": { - "type": "string" - }, - "y_info": { - "type": "string" - } - } - }, - "SqlAnalysisResDataV1": { - "type": "object", - "properties": { - "sql_explain": { - "type": "object", - "$ref": "#/definitions/SQLExplain" - }, - "table_metas": { - "type": "array", - "items": { - "$ref": "#/definitions/TableMeta" - } - } - } - }, - "SqlAnalysisScatterChart": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "points": { - "type": "array", - "items": { - "$ref": "#/definitions/ScatterPoint" - } - }, - "x_info": { - "type": "string" - }, - "y_info": { - "type": "string" - } - } - }, - "SqlAverageExecutionTime": { - "type": "object", - "properties": { - "average_execution_seconds": { - "type": "integer" - }, - "instance_name": { - "type": "string" }, - "max_execution_seconds": { - "type": "integer" - }, - "min_execution_seconds": { - "type": "integer" - } - } - }, - "SqlDEVRecord": { - "type": "object", - "properties": { - "audit_result": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditResult" - } - }, - "creator": { - "description": "create user name", - "type": "string" - }, - "first_appear_timestamp": { - "type": "string" - }, - "fp_count": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "instance_name": { - "type": "string" - }, - "last_receive_timestamp": { - "type": "string" - }, - "schema_name": { - "type": "string" - }, - "source": { - "type": "object", - "$ref": "#/definitions/RecordSource" - }, - "sql": { - "type": "string" - }, - "sql_fingerprint": { - "type": "string" - } - } - }, - "SqlExecutionFailPercent": { - "type": "object", - "properties": { - "instance_name": { - "type": "string" - }, - "percent": { - "type": "number" - } - } - }, - "SqlFileOrderMethod": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "order_method": { - "type": "string" - } - } - }, - "SqlFileOrderMethodRes": { - "type": "object", - "properties": { - "methods": { - "type": "array", - "items": { - "$ref": "#/definitions/SqlFileOrderMethod" - } - } - } - }, - "SqlManage": { - "type": "object", - "properties": { - "assignees": { - "type": "array", - "items": { - "type": "string" - } - }, - "audit_result": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditResult" - } - }, - "audit_status": { - "type": "string", - "enum": [ - "being_audited" - ] - }, - "endpoints": { - "type": "array", - "items": { - "type": "string" - } - }, - "first_appear_timestamp": { - "type": "string" - }, - "fp_count": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "instance_name": { - "type": "string" - }, - "last_receive_timestamp": { - "type": "string" - }, - "priority": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "schema_name": { - "type": "string" - }, - "source": { - "type": "object", - "$ref": "#/definitions/Source" - }, - "sql": { - "type": "string" - }, - "sql_fingerprint": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "unhandled", - "solved", - "ignored", - "manual_audited", - "sent" - ] - } - } - }, - "SqlManageAnalysisChartResp": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/SqlAnalysisChart" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "SqlManageCodingReq": { - "type": "object", - "properties": { - "coding_project_name": { - "type": "string" - }, - "priority": { - "type": "string", - "enum": [ - "LOW", - "MEDIUM", - "HIGH", - "EMERGENCY" - ] - }, - "sql_manage_id_list": { - "type": "array", - "items": { - "type": "integer" - } - }, - "type": { - "type": "string", - "enum": [ - "DEFECT", - "MISSION", - "REQUIREMENT", - "EPIC", - "SUB_TASK" - ] - } - } - }, - "SqlPerformanceInsights": { - "type": "object", - "properties": { - "lines": { - "description": "图表线条数据", - "type": "array", - "items": { - "$ref": "#/definitions/Line" - } - }, - "message": { - "description": "提示信息", - "type": "string" - }, - "task_enable": { - "description": "是否启用任务", - "type": "boolean" - }, - "task_support": { - "description": "是否支持任务", - "type": "boolean" - }, - "x_info": { - "description": "X轴信息", - "type": "string" - }, - "y_info": { - "description": "Y轴信息", - "type": "string" - } - } - }, - "SqlVersionDetailResV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "sql_version_id": { - "type": "integer" - }, - "sql_version_stage_detail": { - "type": "array", - "items": { - "$ref": "#/definitions/SqlVersionStageDetail" - } - }, - "status": { - "type": "string", - "enum": [ - "is_being_released", - "locked" - ] - }, - "version": { - "type": "string" - } - } - }, - "SqlVersionResV1": { - "type": "object", - "properties": { - "created_at": { - "type": "string" + "v1.InstanceConnectionResV1": { + "type": "object", + "properties": { + "connect_error_message": { + "type": "string" + }, + "instance_name": { + "type": "string" + }, + "is_instance_connectable": { + "type": "boolean" + } + } + }, + "v1.InstanceForCheckConnection": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } }, - "deletable": { - "type": "boolean" + "v1.InstanceForCreatingTask": { + "type": "object", + "properties": { + "instance_name": { + "type": "string" + }, + "instance_schema": { + "type": "string" + } + } }, - "desc": { - "type": "string" + "v1.InstanceInfo": { + "type": "object", + "properties": { + "instance_id": { + "type": "string" + }, + "instance_name": { + "type": "string" + } + } }, - "lock_time": { - "type": "string" + "v1.InstanceOverviewStatistics": { + "type": "object", + "properties": { + "avg_score": { + "type": "number" + }, + "high_priority_sql_count": { + "type": "integer" + }, + "instance_id": { + "type": "string" + }, + "pending_workflow_count": { + "type": "integer" + } + } + }, + "v1.InstanceSchemaResV1": { + "type": "object", + "properties": { + "schema_name_list": { + "type": "array", + "items": { + "type": "string" + } + } + } }, - "lockable": { - "type": "boolean" + "v1.InstanceTableMeta": { + "type": "object", + "properties": { + "columns": { + "type": "object", + "$ref": "#/definitions/v1.TableColumns" + }, + "create_table_sql": { + "type": "string" + }, + "indexes": { + "type": "object", + "$ref": "#/definitions/v1.TableIndexes" + }, + "name": { + "type": "string" + }, + "schema": { + "type": "string" + } + } + }, + "v1.InstanceTipResV1": { + "type": "object", + "properties": { + "backup_max_rows": { + "type": "integer" + }, + "enable_backup": { + "type": "boolean" + }, + "host": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "instance_name": { + "type": "string" + }, + "instance_type": { + "type": "string" + }, + "port": { + "type": "string" + }, + "supported_backup_strategy": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "original_row" + ] + } + }, + "workflow_template_id": { + "type": "integer" + } + } + }, + "v1.InstanceTypePercent": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "percent": { + "type": "number" + }, + "type": { + "type": "string" + } + } + }, + "v1.InstancesTypePercentV1": { + "type": "object", + "properties": { + "instance_total_num": { + "type": "integer" + }, + "instance_type_percents": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.InstanceTypePercent" + } + } + } + }, + "v1.KnowledgeBase": { + "type": "object", + "properties": { + "content": { + "description": "内容", + "type": "string" + }, + "description": { + "description": "描述", + "type": "string" + }, + "id": { + "description": "知识库ID", + "type": "integer" + }, + "rule_name": { + "description": "规则名称", + "type": "string" + }, + "tags": { + "description": "标签", + "type": "array", + "items": { + "$ref": "#/definitions/v1.Tag" + } + }, + "title": { + "description": "标题", + "type": "string" + } + } + }, + "v1.LicenseItem": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "limit": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "v1.LicenseUsageItem": { + "type": "object", + "properties": { + "is_limited": { + "type": "boolean" + }, + "limit": { + "type": "integer" + }, + "resource_type": { + "type": "string" + }, + "resource_type_desc": { + "type": "string" + }, + "used": { + "type": "integer" + } + } + }, + "v1.LicenseUsageV1": { + "type": "object", + "properties": { + "instances_usage": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.LicenseUsageItem" + } + }, + "users_usage": { + "type": "object", + "$ref": "#/definitions/v1.LicenseUsageItem" + } + } + }, + "v1.Line": { + "type": "object", + "properties": { + "line_name": { + "description": "线条名称", + "type": "string" + }, + "points": { + "description": "图表点数据", + "type": "array", + "items": { + "$ref": "#/definitions/v1.ChartPoint" + } + } + } + }, + "v1.ListTableBySchemaResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.Table" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.LockSqlVersionReqV1": { + "type": "object", + "properties": { + "is_locked": { + "type": "boolean" + } + } }, - "status": { - "type": "string", - "enum": [ - "is_being_released", - "locked" - ] + "v1.MaintenanceTimeResV1": { + "type": "object", + "properties": { + "maintenance_start_time": { + "type": "object", + "$ref": "#/definitions/v1.TimeResV1" + }, + "maintenance_stop_time": { + "type": "object", + "$ref": "#/definitions/v1.TimeResV1" + } + } + }, + "v1.ModuleRedDot": { + "type": "object", + "properties": { + "has_red_dot": { + "type": "boolean" + }, + "module_name": { + "type": "string", + "enum": [ + "global_dashboard" + ] + } + } + }, + "v1.ModuleRedDots": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.ModuleRedDot" + } }, - "version": { - "type": "string" + "v1.ModuleStatusRes": { + "type": "object", + "properties": { + "is_supported": { + "type": "boolean" + } + } }, - "version_id": { - "type": "integer" - } - } - }, - "SqlVersionStageDetail": { - "type": "object", - "properties": { - "stage_id": { - "type": "integer" - }, - "stage_instances": { - "type": "array", - "items": { - "$ref": "#/definitions/VersionStageInstance" - } - }, - "stage_name": { - "type": "string" - }, - "stage_sequence": { - "type": "integer" - }, - "workflow_details": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkflowDetailWithInstance" - } - } - } - }, - "StatisticAuditPlanResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/DBTypeAuditPlan" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "StatisticRiskWorkflowResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/RiskWorkflow" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "StatisticsAuditedSQLResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AuditedSQLCount" - }, - "message": { - "type": "string", - "example": "ok" - }, - "risk_rate": { - "type": "integer" - } - } - }, - "Table": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - }, - "TableColumns": { - "type": "object", - "properties": { - "head": { - "type": "array", - "items": { - "$ref": "#/definitions/TableMetaItemHeadResV1" - } - }, - "rows": { - "type": "array", - "items": { + "v1.NodeResponse": { "type": "object", - "additionalProperties": { - "type": "string" + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "weight": { + "type": "integer" + } + } + }, + "v1.ObjectDiffResult": { + "type": "object", + "properties": { + "comparison_result": { + "type": "string", + "enum": [ + "same", + "inconsistent", + "base_not_exist", + "comparison_not_exist" + ] + }, + "object_name": { + "type": "string" + } + } + }, + "v1.OperationResV1": { + "type": "object", + "properties": { + "op_code": { + "type": "integer" + }, + "op_desc": { + "type": "string" + } } - } - } - } - }, - "TableIndexes": { - "type": "object", - "properties": { - "head": { - "type": "array", - "items": { - "$ref": "#/definitions/TableMetaItemHeadResV1" - } - }, - "rows": { - "type": "array", - "items": { + }, + "v1.OperatorResV1": { "type": "object", - "additionalProperties": { - "type": "string" + "properties": { + "operator_enums_value": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.EnumsValueResV1" + } + }, + "operator_value": { + "type": "string" + } + } + }, + "v1.OptimizationDetail": { + "type": "object", + "properties": { + "basic_summary": { + "type": "object", + "$ref": "#/definitions/v1.Optimizationsummary" + }, + "created_time": { + "type": "string" + }, + "created_user": { + "type": "string" + }, + "db_type": { + "type": "string" + }, + "index_recommendations": { + "type": "array", + "items": { + "type": "string" + } + }, + "instance_name": { + "type": "string" + }, + "optimization_id": { + "type": "string" + }, + "optimization_name": { + "type": "string" + }, + "status": { + "description": "优化状态", + "type": "string" + } + } + }, + "v1.OptimizationRecord": { + "type": "object", + "properties": { + "created_time": { + "description": "创建时间", + "type": "string" + }, + "created_user": { + "description": "创建人", + "type": "string" + }, + "db_type": { + "description": "数据库类型", + "type": "string" + }, + "instance_name": { + "description": "数据源", + "type": "string" + }, + "optimization_id": { + "description": "优化ID", + "type": "string" + }, + "optimization_name": { + "type": "string" + }, + "performance_gain": { + "description": "优化提升性能", + "type": "number" + }, + "status": { + "description": "优化状态", + "type": "string" + } + } + }, + "v1.OptimizationRecordOverview": { + "type": "object", + "properties": { + "record_number": { + "type": "integer" + }, + "time": { + "type": "string" + } } - } - } - } - }, - "TableMeta": { - "type": "object", - "properties": { - "columns": { - "type": "object", - "$ref": "#/definitions/TableColumns" }, - "create_table_sql": { - "type": "string" + "v1.OptimizationSQL": { + "type": "object", + "properties": { + "contributing_indices": { + "type": "string" + }, + "number": { + "type": "integer" + }, + "number_of_hit_index": { + "type": "integer" + }, + "number_of_index": { + "type": "integer" + }, + "number_of_rewrite": { + "type": "integer" + }, + "number_of_syntax_error": { + "type": "integer" + }, + "original_sql": { + "type": "string" + }, + "performance": { + "type": "number" + } + } + }, + "v1.OptimizationSQLDetail": { + "type": "object", + "properties": { + "explain_validation_details": { + "type": "object", + "$ref": "#/definitions/v1.ExplainValidationDetail" + }, + "index_recommendations": { + "description": "索引建议", + "type": "array", + "items": { + "type": "string" + } + }, + "optimized_sql": { + "description": "优化后的SQL", + "type": "string" + }, + "original_sql": { + "description": "原始SQL", + "type": "string" + }, + "triggered_rule": { + "description": "触发的规则", + "type": "array", + "items": { + "$ref": "#/definitions/v1.RewriteRule" + } + } + } + }, + "v1.Optimizationsummary": { + "type": "object", + "properties": { + "number_of_index": { + "type": "integer" + }, + "number_of_query": { + "type": "integer" + }, + "number_of_query_index": { + "type": "integer" + }, + "number_of_rewrite": { + "type": "integer" + }, + "number_of_rewritten_query": { + "type": "integer" + }, + "number_of_syntax_error": { + "type": "integer" + }, + "performance_gain": { + "type": "number" + } + } + }, + "v1.OptimizeSQLReq": { + "type": "object", + "properties": { + "db_type": { + "type": "string", + "example": "MySQL" + }, + "instance_name": { + "type": "string", + "example": "instance1" + }, + "optimization_name": { + "type": "string", + "example": "optmz_2024031412091244" + }, + "schema_name": { + "type": "string", + "example": "schema1" + }, + "sql_content": { + "type": "string", + "example": "select * from t1; select * from t2;" + } + } + }, + "v1.OptimizeSQLRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.OptimizeSQLResData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.OptimizeSQLResData": { + "type": "object", + "properties": { + "sql_optimization_record_id": { + "type": "string" + } + } }, - "indexes": { - "type": "object", - "$ref": "#/definitions/TableIndexes" + "v1.ParseProjectRuleTemplateFileResDataV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "name": { + "type": "string" + }, + "rule_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RuleResV1" + } + }, + "rule_version": { + "type": "integer" + } + } + }, + "v1.ParseProjectRuleTemplateFileResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.ParseProjectRuleTemplateFileResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.PartialSyncAuditPlanSQLsReqV1": { + "type": "object", + "properties": { + "audit_plan_sql_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanSQLReqV1" + } + } + } }, - "message": { - "type": "string" + "v1.PerformanceStatistics": { + "type": "object", + "properties": { + "affect_rows": { + "type": "object", + "$ref": "#/definitions/v1.AffectRows" + } + } }, - "name": { - "type": "string" + "v1.PostSqlManageCodingResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.CodingResp" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.ProjectIOAnalysis": { + "type": "object", + "properties": { + "active_members": { + "description": "活跃人数", + "type": "integer" + }, + "health_score": { + "description": "健康分", + "type": "number", + "example": 92.3 + }, + "invoke_count": { + "description": "调用频次", + "type": "integer" + }, + "performance_gain": { + "description": "性能提升", + "type": "string", + "example": "+35%" + }, + "project_name": { + "description": "项目名称", + "type": "string" + }, + "time_saved": { + "description": "节省工时", + "type": "number", + "example": 45.5 + } + } + }, + "v1.ProjectRuleTemplateResV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "rule_template_name": { + "type": "string" + } + } + }, + "v1.ProjectScore": { + "type": "object", + "properties": { + "score": { + "type": "integer" + } + } }, - "schema": { - "type": "string" - } - } - }, - "TableMetaItemHeadResV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "field_name": { - "type": "string" - } - } - }, - "TableMetas": { - "type": "object", - "properties": { - "err_message": { - "type": "string" - }, - "table_meta_items": { - "type": "array", - "items": { - "$ref": "#/definitions/TableMeta" - } - } - } - }, - "Tag": { - "type": "object", - "properties": { - "id": { - "description": "标签ID", - "type": "integer" - }, - "name": { - "description": "标签名称", - "type": "string" - }, - "sub_tags": { - "description": "子标签", - "type": "array", - "items": { - "$ref": "#/definitions/Tag" - } - } - } - }, - "TargetReleaseInstance": { - "type": "object", - "properties": { - "instance_id": { - "type": "string" + "v1.ReExecuteTaskOnWorkflowReq": { + "type": "object", + "properties": { + "exec_sql_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } }, - "instance_schema": { - "type": "string" + "v1.RecordSource": { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": [ + "ide_plugin" + ] + }, + "value": { + "type": "string" + } + } + }, + "v1.RefreshAuditPlanTokenReqV1": { + "type": "object", + "properties": { + "expires_in_days": { + "type": "integer" + } + } }, - "target_instance_id": { - "type": "string" + "v1.RejectWorkflowReqV1": { + "type": "object", + "properties": { + "reason": { + "type": "string" + } + } }, - "target_instance_schema": { - "type": "string" - } - } - }, - "TestAuditPlanNotifyConfigResDataV1": { - "type": "object", - "properties": { - "is_notify_send_normal": { - "type": "boolean" - }, - "send_error_message": { - "type": "string" - } - } - }, - "TestAuditPlanNotifyConfigResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/TestAuditPlanNotifyConfigResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "TestCodingConfigResDataV1": { - "type": "object", - "properties": { - "error_message": { - "type": "string" - }, - "is_message_sent_normally": { - "type": "boolean" - } - } - }, - "TestCodingConfigResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/TestCodingConfigResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "TestCodingConfigurationReqV1": { - "type": "object", - "properties": { - "coding_project_name": { - "type": "string" - } - } - }, - "TestDingTalkConfigResDataV1": { - "type": "object", - "properties": { - "is_ding_talk_send_normal": { - "type": "boolean" - }, - "send_error_message": { - "type": "string" - } - } - }, - "TestDingTalkConfigResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/TestDingTalkConfigResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "TestFeishuConfigResDataV1": { - "type": "object", - "properties": { - "error_message": { - "type": "string" - }, - "is_message_sent_normally": { - "type": "boolean" - } - } - }, - "TestFeishuConfigResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/TestFeishuConfigResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "TestFeishuConfigurationReqV1": { - "type": "object", - "properties": { - "account": { - "type": "string" - }, - "account_type": { - "type": "string", - "enum": [ - "email", - "phone" - ] - } - } - }, - "TestGitConnectionReqV1": { - "type": "object", - "properties": { - "git_http_url": { - "type": "string" + "v1.RelatedSQLInfo": { + "type": "object", + "properties": { + "execute_time_avg": { + "description": "平均执行时间(s)", + "type": "number" + }, + "execute_time_max": { + "description": "最大执行时间(s)", + "type": "number" + }, + "execute_time_min": { + "description": "最小执行时间(s)", + "type": "number" + }, + "execute_time_sum": { + "description": "总执行时间(s)", + "type": "number" + }, + "execution_time_trend": { + "description": "SQL 趋势图表", + "type": "object", + "$ref": "#/definitions/v1.SqlAnalysisScatterChart" + }, + "lock_wait_time": { + "description": "锁等待时间(s)", + "type": "number" + }, + "source": { + "type": "string", + "enum": [ + "workflow", + "sql_manage" + ] + }, + "sql_fingerprint": { + "type": "string" + } + } + }, + "v1.RelatedTransactionInfo": { + "type": "object", + "properties": { + "related_sql_info": { + "description": "相关SQL列表", + "type": "array", + "items": { + "$ref": "#/definitions/v1.TransactionSQL" + } + }, + "transaction_info": { + "description": "事务信息", + "type": "object", + "$ref": "#/definitions/v1.TransactionInfo" + }, + "transaction_lock_info": { + "description": "事务锁信息", + "type": "array", + "items": { + "$ref": "#/definitions/v1.TransactionLockInfo" + } + }, + "transaction_timeline": { + "description": "事务时间线", + "type": "object", + "$ref": "#/definitions/v1.TransactionTimeline" + } + } + }, + "v1.ReleaseWorkflows": { + "type": "object", + "properties": { + "target_release_instances": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.TargetReleaseInstance" + } + }, + "workflow_id": { + "type": "string" + } + } + }, + "v1.ReportPushConfigList": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "last_push_time": { + "type": "string" + }, + "push_frequency_cron": { + "type": "string" + }, + "push_user_Type": { + "type": "string", + "enum": [ + "fixed", + "permission_match" + ] + }, + "push_user_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "report_push_config_id": { + "type": "string" + }, + "trigger_type": { + "type": "string", + "enum": [ + "immediately", + "timing" + ] + }, + "type": { + "type": "string" + } + } + }, + "v1.RewriteRule": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "rewritten_queries_str": { + "type": "string" + }, + "rule_code": { + "type": "string" + }, + "rule_name": { + "type": "string" + }, + "violated_queries_str": { + "type": "string" + } + } + }, + "v1.RewriteSQLData": { + "type": "object", + "properties": { + "business_desc": { + "description": "重写前的SQL业务描述", + "type": "string" + }, + "business_non_equivalent_desc": { + "description": "重写前后的业务不等价性描述,为空表示等价", + "type": "string" + }, + "logic_desc": { + "description": "重写前的SQL执行逻辑描述", + "type": "string" + }, + "rewritten_sql": { + "description": "重写后的SQL", + "type": "string" + }, + "rewritten_sql_business_desc": { + "description": "重写后的SQL业务描述", + "type": "string" + }, + "rewritten_sql_logic_desc": { + "description": "重写后的SQL执行逻辑描述", + "type": "string" + }, + "suggestions": { + "description": "重写建议列表", + "type": "array", + "items": { + "$ref": "#/definitions/v1.RewriteSuggestion" + } + } + } + }, + "v1.RewriteSQLReq": { + "type": "object", + "properties": { + "enable_structure_type": { + "description": "是否启用结构化类型的重写", + "type": "boolean", + "default": false, + "example": false + } + } }, - "git_user_name": { - "type": "string" + "v1.RewriteSuggestion": { + "type": "object", + "properties": { + "audit_level": { + "description": "审核规则等级", + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ] + }, + "ddl_dcl": { + "description": "具体的数据库结构变更语句,需要在数据库中执行该变更语句之后再应用重写SQL(包含CREATE/ALTER/DROP等DDL语句,或SET等DCL语句)(适用于结构级重写)", + "type": "string" + }, + "ddl_dcl_desc": { + "description": "数据库结构变更建议说明(例如:建议添加索引、修改表结构等优化建议)(适用于结构级重写)", + "type": "string" + }, + "desc": { + "description": "重写描述(适用于所有类型)", + "type": "string" + }, + "rewritten_sql": { + "description": "重写后的SQL(适用于语句级重写和结构级重写)", + "type": "string" + }, + "rule_name": { + "description": "审核规则名称", + "type": "string" + }, + "status": { + "description": "处理状态:初始化、已处理", + "type": "string", + "default": "initial", + "enum": [ + "initial", + "processed" + ] + }, + "type": { + "description": "重写建议类型:语句级重写、结构级重写、其他", + "type": "string", + "enum": [ + "statement", + "structure", + "other" + ] + } + } + }, + "v1.RiskAuditPlan": { + "type": "object", + "properties": { + "audit_plan_name": { + "type": "string" + }, + "audit_plan_report_id": { + "type": "integer" + }, + "audit_plan_report_timestamp": { + "type": "string" + }, + "risk_sql_count": { + "type": "integer" + }, + "trigger_audit_plan_time": { + "type": "string" + } + } + }, + "v1.RiskWorkflow": { + "type": "object", + "properties": { + "create_user_name": { + "type": "string" + }, + "update_time": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "workflow_name": { + "type": "string" + }, + "workflow_status": { + "type": "string" + } + } + }, + "v1.RoleUserCount": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "role": { + "type": "string" + } + } }, - "git_user_password": { - "type": "string" - } - } - }, - "TestGitConnectionResDataV1": { - "type": "object", - "properties": { - "branches": { - "type": "array", - "items": { - "type": "string" - } - }, - "error_message": { - "type": "string" - }, - "is_connected_success": { - "type": "boolean" - } - } - }, - "TestGitConnectionResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/TestGitConnectionResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "TestWechatConfigResDataV1": { - "type": "object", - "properties": { - "error_message": { - "type": "string" - }, - "is_message_sent_normally": { - "type": "boolean" - } - } - }, - "TestWechatConfigResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/TestWechatConfigResDataV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "TestWechatConfigurationReqV1": { - "type": "object", - "properties": { - "wechat_id": { - "type": "string" - } - } - }, - "TimeResV1": { - "type": "object", - "properties": { - "hour": { - "type": "integer" - }, - "minute": { - "type": "integer" - } - } - }, - "TopProblemDistribution": { - "type": "object", - "properties": { - "percentage": { - "description": "占比", - "type": "number" - }, - "problem_type": { - "description": "问题类型", - "type": "string" - } - } - }, - "TransactionInfo": { - "type": "object", - "properties": { - "lock_type": { - "description": "锁类型", - "type": "string", - "enum": [ - "SHARED", - "EXCLUSIVE", - "INTENTION_SHARED", - "INTENTION_EXCLUSIVE", - "SHARED_INTENTION_EXCLUSIVE", - "ROW_LOCK", - "TABLE_LOCK", - "METADATA_LOCK" - ] - }, - "transaction_duration": { - "description": "事务持续时间", - "type": "number" - }, - "transaction_end_time": { - "description": "事务结束时间", - "type": "string" - }, - "transaction_id": { - "description": "事务ID", - "type": "string" - }, - "transaction_start_time": { - "description": "事务开始时间", - "type": "string" - }, - "transaction_state": { - "description": "事务状态", - "type": "string", - "enum": [ - "RUNNING", - "COMPLETED" - ] - } - } - }, - "TransactionLockInfo": { - "type": "object", - "properties": { - "create_lock_sql": { - "description": "创建锁的SQL语句", - "type": "string" - }, - "lock_type": { - "description": "锁类型", - "type": "string", - "enum": [ - "SHARED", - "EXCLUSIVE", - "INTENTION_SHARED", - "INTENTION_EXCLUSIVE", - "SHARED_INTENTION_EXCLUSIVE", - "ROW_LOCK", - "TABLE_LOCK", - "METADATA_LOCK" - ] - }, - "table_name": { - "description": "表名", - "type": "string" - } - } - }, - "TransactionSQL": { - "type": "object", - "properties": { - "execute_duration": { - "description": "执行时长", - "type": "number" - }, - "lock_type": { - "description": "锁类型", - "type": "string", - "enum": [ - "SHARED", - "EXCLUSIVE", - "INTENTION_SHARED", - "INTENTION_EXCLUSIVE", - "SHARED_INTENTION_EXCLUSIVE", - "ROW_LOCK", - "TABLE_LOCK", - "METADATA_LOCK" - ] - }, - "sql": { - "description": "SQL语句", - "type": "string" - } - } - }, - "TransactionTimeline": { - "type": "object", - "properties": { - "current_step_index": { - "description": "当前步骤索引", - "type": "integer" - }, - "timeline": { - "description": "时间线项目列表", - "type": "array", - "items": { - "$ref": "#/definitions/TransactionTimelineItem" - } - } - } - }, - "TransactionTimelineItem": { - "type": "object", - "properties": { - "description": { - "description": "描述信息", - "type": "string" - }, - "start_time": { - "description": "开始时间", - "type": "string" - } - } - }, - "TriggerAuditPlanResV1": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AuditPlanReportResV1" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "UpdateAuditPlanNotifyConfigReqV1": { - "type": "object", - "properties": { - "enable_email_notify": { - "type": "boolean" - }, - "enable_web_hook_notify": { - "type": "boolean" - }, - "notify_interval": { - "type": "integer", - "default": 10 - }, - "notify_level": { - "type": "string", - "default": "warn", - "enum": [ - "normal", - "notice", - "warn", - "error" - ] - }, - "web_hook_template": { - "type": "string" - }, - "web_hook_url": { - "type": "string" - } - } - }, - "UpdateAuditPlanReqV1": { - "type": "object", - "properties": { - "audit_plan_cron": { - "type": "string", - "example": "0 */2 * * *" - }, - "audit_plan_instance_database": { - "type": "string", - "example": "app1" - }, - "audit_plan_instance_name": { - "type": "string", - "example": "test_mysql" - }, - "audit_plan_params": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanParamReqV1" - } - }, - "rule_template_name": { - "type": "string", - "example": "default_MySQL" - } - } - }, - "UpdateAuditPlanStatusReqV1": { - "type": "object", - "properties": { - "active": { - "description": "任务状态", - "type": "string", - "enum": [ - "normal", - "disabled" - ] - } - } - }, - "UpdateAuditTaskSQLsReqV1": { - "type": "object", - "properties": { - "description": { - "type": "string" - } - } - }, - "UpdateAuditWhitelistReqV1": { - "type": "object", - "properties": { - "desc": { - "type": "string", - "example": "used for rapid release" - }, - "match_type": { - "type": "string", - "enum": [ - "exact_match", - "fp_match" - ], - "example": "exact_match" - }, - "value": { - "type": "string", - "example": "create table" - } - } - }, - "UpdateBlacklistReqV1": { - "type": "object", - "properties": { - "content": { - "type": "string", - "example": "select * from t1" - }, - "desc": { - "type": "string", - "example": "used for rapid release" - }, - "type": { - "type": "string", - "enum": [ - "sql", - "fp_sql", - "ip", - "cidr", - "host", - "instance" - ], - "example": "sql" - } - } - }, - "UpdateCodingConfigurationReqV1": { - "type": "object", - "properties": { - "coding_url": { - "type": "string" + "v1.RuleInfo": { + "type": "object", + "properties": { + "annotation": { + "type": "string", + "example": "this is test rule" + }, + "desc": { + "type": "string", + "example": "this is test rule" + } + } + }, + "v1.RuleKnowledgeResV1": { + "type": "object", + "properties": { + "knowledge_content": { + "type": "string" + }, + "rule": { + "type": "object", + "$ref": "#/definitions/v1.RuleInfo" + } + } }, - "is_coding_enabled": { - "type": "boolean" + "v1.RuleParamReqV1": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } }, - "token": { - "type": "string" - } - } - }, - "UpdateCompanyNoticeReq": { - "type": "object", - "properties": { - "notice_str": { - "type": "string" - } - } - }, - "UpdateCustomRuleReqV1": { - "type": "object", - "properties": { - "annotation": { - "type": "string", - "example": "this is test rule" - }, - "desc": { - "type": "string", - "example": "this is test rule" - }, - "level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ], - "example": "notice" - }, - "rule_script": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "type": "string", - "example": "DDL规则" - } - } - }, - "UpdateDingTalkConfigurationReqV1": { - "type": "object", - "required": [ - "app_key", - "app_secret", - "is_enable_ding_talk_notify" - ], - "properties": { - "app_key": { - "type": "string" - }, - "app_secret": { - "type": "string" - }, - "is_enable_ding_talk_notify": { - "type": "boolean" - } - } - }, - "UpdateFeishuConfigurationReqV1": { - "type": "object", - "required": [ - "app_id", - "app_secret", - "is_feishu_notification_enabled" - ], - "properties": { - "app_id": { - "type": "string" - }, - "app_secret": { - "type": "string" - }, - "is_feishu_notification_enabled": { - "type": "boolean" - } - } - }, - "UpdateInstanceAuditPlanReqV1": { - "type": "object", - "properties": { - "audit_plans": { - "description": "扫描类型", - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlan" - } - } - } - }, - "UpdateInstanceAuditPlanStatusReqV1": { - "type": "object", - "properties": { - "active": { - "description": "任务状态", - "type": "string", - "enum": [ - "normal", - "disabled" - ] - } - } - }, - "UpdatePipelineReqV1": { - "type": "object", - "properties": { - "address": { - "description": "关联流水线地址", - "type": "string" - }, - "description": { - "description": "流水线描述", - "type": "string" - }, - "name": { - "description": "流水线名称", - "type": "string" - }, - "nodes": { - "description": "节点信息", - "type": "array", - "items": { - "$ref": "#/definitions/updatePipelineNode" - } - } - } - }, - "UpdateProjectRuleTemplateReqV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "rule_list": { - "type": "array", - "items": { - "$ref": "#/definitions/RuleReqV1" - } - } - } - }, - "UpdateReportPushConfigReqV1": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "push_frequency_cron": { - "type": "string" - }, - "push_user_Type": { - "type": "string", - "enum": [ - "fixed", - "permission_match" - ] - }, - "push_user_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "trigger_type": { - "type": "string", - "enum": [ - "immediately", - "timing" - ] - } - } - }, - "UpdateRuleKnowledgeReq": { - "type": "object", - "properties": { - "knowledge_content": { - "type": "string" - } - } - }, - "UpdateRuleTemplateReqV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "rule_list": { - "type": "array", - "items": { - "$ref": "#/definitions/RuleReqV1" - } - } - } - }, - "UpdateSQLAuditRecordReqV1": { - "type": "object", - "properties": { - "tags": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "UpdateSqlBackupStrategyReq": { - "type": "object", - "properties": { - "strategy": { - "type": "string", - "enum": [ - "none", - "manual", - "reverse_sql", - "original_row" - ] - } - } - }, - "UpdateSqlFileOrderV1Req": { - "type": "object", - "properties": { - "files_to_sort": { - "type": "array", - "items": { - "$ref": "#/definitions/FileToSort" - } - } - } - }, - "UpdateSqlVersionReqV1": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "update_sql_version_stage": { - "type": "array", - "items": { - "$ref": "#/definitions/UpdateSqlVersionStage" - } - }, - "version": { - "type": "string", - "example": "2.23" - } - } - }, - "UpdateSqlVersionStage": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "生产" - }, - "stage_sequence": { - "type": "integer" - }, - "update_stages_instance_dep": { - "type": "array", - "items": { - "$ref": "#/definitions/UpdateStagesInstanceDep" - } - } - } - }, - "UpdateStagesInstanceDep": { - "type": "object", - "properties": { - "next_stage_instance_id": { - "type": "string" - }, - "stage_instance_id": { - "type": "string" - } - } - }, - "UpdateTaskBackupStrategyReq": { - "type": "object", - "properties": { - "strategy": { - "type": "string", - "enum": [ - "none", - "manual", - "reverse_sql", - "original_row" - ] - } - } - }, - "UpdateWechatConfigurationReqV1": { - "type": "object", - "required": [ - "is_wechat_notification_enabled" - ], - "properties": { - "corp_id": { - "type": "string" - }, - "corp_secret": { - "type": "string" - }, - "is_wechat_notification_enabled": { - "type": "boolean" - } - } - }, - "UpdateWorkflowReqV1": { - "type": "object", - "properties": { - "task_ids": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "UpdateWorkflowScheduleReqV1": { - "type": "object", - "properties": { - "schedule_time": { - "type": "string" - } - } - }, - "UpdateWorkflowTemplateByIdReqV1": { - "type": "object", - "properties": { - "allow_submit_when_less_audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ] - }, - "desc": { - "type": "string" - }, - "is_default": { - "type": "boolean" - }, - "workflow_step_template_list": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkFlowStepTemplateReqV1" - } - }, - "workflow_template_name": { - "type": "string" - } - } - }, - "UpdateWorkflowTemplateReqV1": { - "type": "object", - "properties": { - "allow_submit_when_less_audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ] - }, - "desc": { - "type": "string" - }, - "workflow_step_template_list": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkFlowStepTemplateReqV1" - } - } - } - }, - "UserTipResV1": { - "type": "object", - "properties": { - "user_id": { - "type": "string" - }, - "user_name": { - "type": "string" - } - } - }, - "VersionStageInstance": { - "type": "object", - "properties": { - "instance_schema": { - "type": "string" + "v1.RuleParamResV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "key": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "string", + "int", + "bool" + ] + }, + "value": { + "type": "string" + } + } + }, + "v1.RuleProjectTemplateDetailResV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "rule_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RuleResV1" + } + }, + "rule_template_name": { + "type": "string" + }, + "rule_version": { + "type": "integer" + } + } + }, + "v1.RuleReqV1": { + "type": "object", + "properties": { + "is_custom_rule": { + "type": "boolean" + }, + "level": { + "type": "string", + "example": "error" + }, + "name": { + "type": "string", + "example": "ddl_check_index_count" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RuleParamReqV1" + } + } + } + }, + "v1.RuleResV1": { + "type": "object", + "properties": { + "annotation": { + "type": "string", + "example": "避免多次 table rebuild 带来的消耗、以及对线上业务的影响" + }, + "categories": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "db_type": { + "type": "string", + "example": "mysql" + }, + "desc": { + "type": "string" + }, + "has_audit_power": { + "type": "boolean" + }, + "has_rewrite_power": { + "type": "boolean" + }, + "is_custom_rule": { + "type": "boolean" + }, + "level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "example": "error" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RuleParamResV1" + } + }, + "rule_name": { + "type": "string" + }, + "type": { + "type": "string", + "example": "全局配置" + }, + "version": { + "type": "integer" + } + } + }, + "v1.RuleRespV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "rule_name": { + "type": "string" + } + } }, - "instances_id": { - "type": "string" + "v1.RuleTemplateDetailResV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "rule_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RuleResV1" + } + }, + "rule_template_name": { + "type": "string" + }, + "rule_version": { + "type": "integer" + } + } + }, + "v1.RuleTemplateResV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "rule_template_name": { + "type": "string" + }, + "rule_version": { + "type": "integer" + } + } + }, + "v1.RuleTemplateTipResV1": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "is_default_rule_template": { + "type": "boolean" + }, + "rule_template_id": { + "type": "string" + }, + "rule_template_name": { + "type": "string" + }, + "rule_version": { + "type": "integer" + } + } + }, + "v1.RuleTips": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "rule": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RuleRespV1" + } + } + } + }, + "v1.RuleTypeV1": { + "type": "object", + "properties": { + "is_custom_rule_type": { + "type": "boolean" + }, + "rule_count": { + "type": "integer" + }, + "rule_type": { + "type": "string" + } + } + }, + "v1.SQLAuditRecord": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "creator": { + "type": "string" + }, + "instance": { + "type": "object", + "$ref": "#/definitions/v1.SQLAuditRecordInstance" + }, + "sql_audit_record_id": { + "type": "string" + }, + "sql_audit_status": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "task": { + "type": "object", + "$ref": "#/definitions/v1.AuditTaskResV1" + } + } + }, + "v1.SQLAuditRecordInstance": { + "type": "object", + "properties": { + "db_host": { + "type": "string", + "example": "10.10.10.10" + }, + "db_port": { + "type": "string", + "example": "3306" + } + } + }, + "v1.SQLAuditRecordResData": { + "type": "object", + "properties": { + "sql_audit_record_id": { + "type": "string" + }, + "task": { + "type": "object", + "$ref": "#/definitions/v1.AuditTaskResV1" + } + } }, - "instances_name": { - "type": "string" - } - } - }, - "WechatConfigurationV1": { - "type": "object", - "properties": { - "corp_id": { - "type": "string" - }, - "is_wechat_notification_enabled": { - "type": "boolean" - } - } - }, - "WorkFlowStepTemplateReqV1": { - "type": "object", - "properties": { - "approved_by_authorized": { - "type": "boolean" - }, - "assignee_user_id_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "desc": { - "type": "string" - }, - "execute_by_authorized": { - "type": "boolean" - }, - "type": { - "type": "string", - "enum": [ - "sql_review", - "sql_execute", - "export_review", - "export_execute" - ] - } - } - }, - "WorkFlowStepTemplateResV1": { - "type": "object", - "properties": { - "approved_by_authorized": { - "type": "boolean" + "v1.SQLAuditResult": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "error_info": { + "type": "string" + }, + "execution_failed": { + "type": "boolean", + "example": false + }, + "i18n_audit_result_info": { + "type": "object", + "$ref": "#/definitions/model.I18nAuditResultInfo" + }, + "level": { + "type": "string", + "example": "warn" + }, + "message": { + "type": "string", + "example": "避免使用不必要的内置函数md5()" + }, + "rule_name": { + "type": "string" + } + } + }, + "v1.SQLExplain": { + "type": "object", + "properties": { + "classic_result": { + "description": "explain result in table format", + "type": "object", + "$ref": "#/definitions/v1.ExplainClassicResult" + }, + "cost": { + "type": "number" + }, + "message": { + "type": "string" + }, + "sql": { + "type": "string" + } + } + }, + "v1.SQLLineageAnalyzeReqV1": { + "type": "object", + "properties": { + "default_schema": { + "type": "string" + }, + "instance_type": { + "type": "string" + }, + "result_columns": { + "type": "array", + "items": { + "type": "string" + } + }, + "sql": { + "type": "string" + } + } + }, + "v1.SQLLineageAnalyzeResDataV1": { + "type": "object", + "properties": { + "result": { + "type": "object", + "$ref": "#/definitions/v1.SQLLineageAnalyzeResultV1" + } + } }, - "assignee_user_id_list": { - "type": "array", - "items": { - "type": "string" - } + "v1.SQLLineageAnalyzeResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.SQLLineageAnalyzeResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.SQLLineageAnalyzeResultV1": { + "type": "object", + "properties": { + "edges": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SQLLineageEdgeV1" + } + }, + "nodes": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SQLLineageNodeV1" + } + }, + "original_sql": { + "type": "string" + }, + "result_columns": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SQLLineageResultColumnV1" + } + }, + "source_columns": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SQLLineageColumnRefV1" + } + }, + "tables": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SQLLineageTableRefV1" + } + }, + "title": { + "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "v1.SQLLineageColumnRefV1": { + "type": "object", + "properties": { + "column": { + "type": "string" + }, + "schema": { + "type": "string" + }, + "table": { + "type": "string" + } + } + }, + "v1.SQLLineageEdgeV1": { + "type": "object", + "properties": { + "from_id": { + "type": "string" + }, + "to_id": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "v1.SQLLineageNodeV1": { + "type": "object", + "properties": { + "column": { + "type": "string" + }, + "expr": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "schema": { + "type": "string" + }, + "table": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "v1.SQLLineageResultColumnV1": { + "type": "object", + "properties": { + "expression": { + "type": "string" + }, + "name": { + "type": "string" + }, + "sources": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SQLLineageColumnRefV1" + } + } + } + }, + "v1.SQLLineageTableRefV1": { + "type": "object", + "properties": { + "alias": { + "type": "string" + }, + "schema": { + "type": "string" + }, + "table": { + "type": "string" + } + } + }, + "v1.SQLQueryConfigResV1": { + "type": "object", + "properties": { + "allow_query_when_less_than_audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ] + }, + "audit_enabled": { + "type": "boolean" + }, + "max_pre_query_rows": { + "type": "integer" + }, + "query_timeout_second": { + "type": "integer" + } + } + }, + "v1.SQLStatement": { + "type": "object", + "properties": { + "audit_error": { + "type": "string" + }, + "sql_statement_with_audit": { + "type": "object", + "$ref": "#/definitions/v1.SQLStatementWithAuditResult" + } + } }, - "desc": { - "type": "string" + "v1.SQLStatementWithAuditResult": { + "type": "object", + "properties": { + "audit_results": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SQLAuditResult" + } + }, + "sql_statement": { + "type": "string" + } + } + }, + "v1.SSHPublicKeyInfo": { + "type": "object", + "properties": { + "public_key": { + "type": "string" + } + } }, - "execute_by_authorized": { - "type": "boolean" + "v1.SSHPublicKeyInfoV1Rsp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.SSHPublicKeyInfo" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.ScatterPoint": { + "type": "object", + "properties": { + "execute_time": { + "description": "执行时间", + "type": "number" + }, + "id": { + "description": "SQL ID", + "type": "integer" + }, + "info": { + "description": "额外信息", + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "is_in_transaction": { + "description": "是否在事务中", + "type": "boolean" + }, + "sql": { + "description": "SQL语句", + "type": "string" + }, + "time": { + "description": "时间点", + "type": "string" + } + } + }, + "v1.ScheduleTaskDefaultOption": { + "type": "object", + "properties": { + "default_selector": { + "type": "string", + "enum": [ + "wechat", + "feishu" + ] + } + } }, - "number": { - "type": "integer" + "v1.ScheduledTaskDefaultOptionV1Rsp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.ScheduleTaskDefaultOption" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.SchemaObject": { + "type": "object", + "properties": { + "base_schema_name": { + "type": "string" + }, + "comparison_result": { + "type": "string", + "enum": [ + "same", + "inconsistent", + "base_not_exist", + "comparison_not_exist" + ] + }, + "comparison_schema_name": { + "type": "string" + }, + "database_diff_objects": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.DatabaseDiffObject" + } + }, + "inconsistent_num": { + "type": "integer" + } + } + }, + "v1.Source": { + "type": "object", + "properties": { + "sql_source_desc": { + "type": "string" + }, + "sql_source_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "sql_source_type": { + "type": "string" + } + } + }, + "v1.SqlAnalysis": { + "type": "object", + "properties": { + "performance_statistics": { + "type": "object", + "$ref": "#/definitions/v1.PerformanceStatistics" + }, + "sql_explain": { + "type": "object", + "$ref": "#/definitions/v1.SQLExplain" + }, + "table_metas": { + "type": "object", + "$ref": "#/definitions/v1.TableMetas" + } + } + }, + "v1.SqlAnalysisChart": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "points": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.ChartPoint" + } + }, + "x_info": { + "type": "string" + }, + "y_info": { + "type": "string" + } + } + }, + "v1.SqlAnalysisResDataV1": { + "type": "object", + "properties": { + "sql_explain": { + "type": "object", + "$ref": "#/definitions/v1.SQLExplain" + }, + "table_metas": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.TableMeta" + } + } + } + }, + "v1.SqlAnalysisScatterChart": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "points": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.ScatterPoint" + } + }, + "x_info": { + "type": "string" + }, + "y_info": { + "type": "string" + } + } + }, + "v1.SqlAverageExecutionTime": { + "type": "object", + "properties": { + "average_execution_seconds": { + "type": "integer" + }, + "instance_name": { + "type": "string" + }, + "max_execution_seconds": { + "type": "integer" + }, + "min_execution_seconds": { + "type": "integer" + } + } + }, + "v1.SqlDEVRecord": { + "type": "object", + "properties": { + "audit_result": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditResult" + } + }, + "creator": { + "description": "create user name", + "type": "string" + }, + "first_appear_timestamp": { + "type": "string" + }, + "fp_count": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "instance_name": { + "type": "string" + }, + "last_receive_timestamp": { + "type": "string" + }, + "schema_name": { + "type": "string" + }, + "source": { + "type": "object", + "$ref": "#/definitions/v1.RecordSource" + }, + "sql": { + "type": "string" + }, + "sql_fingerprint": { + "type": "string" + } + } + }, + "v1.SqlExecutionFailPercent": { + "type": "object", + "properties": { + "instance_name": { + "type": "string" + }, + "percent": { + "type": "number" + } + } }, - "type": { - "type": "string" - } - } - }, - "WorkflowAuditPassPercentV1": { - "type": "object", - "properties": { - "audit_pass_percent": { - "type": "number" - } - } - }, - "WorkflowCountsV1": { - "type": "object", - "properties": { - "today_count": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "WorkflowCreatedCountsEachDayItem": { - "type": "object", - "properties": { - "date": { - "type": "string", - "example": "2022-08-24" - }, - "value": { - "type": "integer" - } - } - }, - "WorkflowCreatedCountsEachDayV1": { - "type": "object", - "properties": { - "samples": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkflowCreatedCountsEachDayItem" - } - } - } - }, - "WorkflowDetailResV1": { - "type": "object", - "properties": { - "create_time": { - "type": "string" - }, - "create_user_name": { - "type": "string" - }, - "current_step_assignee_user_name_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "current_step_type": { - "type": "string", - "enum": [ - "sql_review", - "sql_execute" - ] - }, - "desc": { - "type": "string" - }, - "instance_info": { - "type": "array", - "items": { - "$ref": "#/definitions/InstanceInfo" - } - }, - "ops_type": { - "description": "OpsType 运维类型(项目字典批量解析);未设置或字典项已删时省略", - "type": "object", - "$ref": "#/definitions/OpsType" - }, - "project_name": { - "type": "string" - }, - "project_priority": { - "type": "string" - }, - "project_uid": { - "type": "string" - }, - "sql_version_name": { - "type": "array", - "items": { - "type": "string" - } - }, - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_approve", - "wait_for_execution", - "wait_for_export", - "rejected", - "canceled", - "cancel", - "exec_failed", - "failed", - "executing", - "exporting", - "finished", - "finish" - ] - }, - "workflow_id": { - "type": "string" - }, - "workflow_name": { - "type": "string" - }, - "workflow_template_id": { - "type": "integer" - }, - "workflow_template_name": { - "type": "string" - } - } - }, - "WorkflowDetailWithInstance": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "canceled", - "exec_failed", - "executing", - "finished" - ] - }, - "workflow_exec_time": { - "type": "string" - }, - "workflow_id": { - "type": "string" - }, - "workflow_instances": { - "type": "array", - "items": { - "$ref": "#/definitions/VersionStageInstance" - } - }, - "workflow_name": { - "type": "string" - }, - "workflow_release_status": { - "type": "string", - "enum": [ - "wait_for_release", - "released", - "not_need_release" - ] - }, - "workflow_sequence": { - "type": "integer" - } - } - }, - "WorkflowPassPercentV1": { - "type": "object", - "properties": { - "audit_pass_percent": { - "type": "number" - }, - "execution_success_percent": { - "type": "number" - } - } - }, - "WorkflowPercentCountedByInstanceType": { - "type": "object", - "properties": { - "count": { - "type": "integer" + "v1.SqlFileOrderMethod": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "order_method": { + "type": "string" + } + } }, - "instance_type": { - "type": "string" + "v1.SqlFileOrderMethodRes": { + "type": "object", + "properties": { + "methods": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SqlFileOrderMethod" + } + } + } }, - "percent": { - "type": "number" - } - } - }, - "WorkflowPercentCountedByInstanceTypeV1": { - "type": "object", - "properties": { - "workflow_percents": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkflowPercentCountedByInstanceType" - } - }, - "workflow_total_num": { - "type": "integer" - } - } - }, - "WorkflowRecordResV1": { - "type": "object", - "properties": { - "current_step_number": { - "type": "integer" - }, - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "canceled", - "exec_failed", - "executing", - "finished" - ] - }, - "tasks": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkflowTaskItem" - } - }, - "workflow_step_list": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkflowStepResV1" - } - } - } - }, - "WorkflowRejectedPercentGroupByCreator": { - "type": "object", - "properties": { - "creator": { - "type": "string" + "v1.SqlManage": { + "type": "object", + "properties": { + "appear_num": { + "type": "integer" + }, + "assignees": { + "type": "array", + "items": { + "type": "string" + } + }, + "audit_result": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditResult" + } + }, + "endpoint": { + "type": "string" + }, + "first_appear_time": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "instance_name": { + "type": "string" + }, + "last_appear_time": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "schema_name": { + "type": "string" + }, + "source": { + "type": "object", + "$ref": "#/definitions/v1.Source" + }, + "sql": { + "type": "string" + }, + "sql_fingerprint": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited", + "sent" + ] + } + } + }, + "v1.SqlManageAnalysisChartResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.SqlAnalysisChart" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.SqlManageCodingReq": { + "type": "object", + "properties": { + "coding_project_name": { + "type": "string" + }, + "priority": { + "type": "string", + "enum": [ + "LOW", + "MEDIUM", + "HIGH", + "EMERGENCY" + ] + }, + "sql_manage_id_list": { + "type": "array", + "items": { + "type": "integer" + } + }, + "type": { + "type": "string", + "enum": [ + "DEFECT", + "MISSION", + "REQUIREMENT", + "EPIC", + "SUB_TASK" + ] + } + } + }, + "v1.SqlPerformanceInsights": { + "type": "object", + "properties": { + "lines": { + "description": "图表线条数据", + "type": "array", + "items": { + "$ref": "#/definitions/v1.Line" + } + }, + "message": { + "description": "提示信息", + "type": "string" + }, + "task_enable": { + "description": "是否启用任务", + "type": "boolean" + }, + "task_support": { + "description": "是否支持任务", + "type": "boolean" + }, + "x_info": { + "description": "X轴信息", + "type": "string" + }, + "y_info": { + "description": "Y轴信息", + "type": "string" + } + } + }, + "v1.SqlVersionDetailResV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "sql_version_id": { + "type": "integer" + }, + "sql_version_stage_detail": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.SqlVersionStageDetail" + } + }, + "status": { + "type": "string", + "enum": [ + "is_being_released", + "locked" + ] + }, + "version": { + "type": "string" + } + } + }, + "v1.SqlVersionResV1": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "deletable": { + "type": "boolean" + }, + "desc": { + "type": "string" + }, + "lock_time": { + "type": "string" + }, + "lockable": { + "type": "boolean" + }, + "status": { + "type": "string", + "enum": [ + "is_being_released", + "locked" + ] + }, + "version": { + "type": "string" + }, + "version_id": { + "type": "integer" + } + } + }, + "v1.SqlVersionStageDetail": { + "type": "object", + "properties": { + "stage_id": { + "type": "integer" + }, + "stage_instances": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.VersionStageInstance" + } + }, + "stage_name": { + "type": "string" + }, + "stage_sequence": { + "type": "integer" + }, + "workflow_details": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.WorkflowDetailWithInstance" + } + } + } + }, + "v1.StatisticAuditPlanResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.DBTypeAuditPlan" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.StatisticRiskWorkflowResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RiskWorkflow" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.StatisticsAuditedSQLResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AuditedSQLCount" + }, + "message": { + "type": "string", + "example": "ok" + }, + "risk_rate": { + "type": "integer" + } + } + }, + "v1.Table": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } }, - "rejected_percent": { - "type": "number" + "v1.TableColumns": { + "type": "object", + "properties": { + "head": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.TableMetaItemHeadResV1" + } + }, + "rows": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "v1.TableIndexes": { + "type": "object", + "properties": { + "head": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.TableMetaItemHeadResV1" + } + }, + "rows": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "v1.TableMeta": { + "type": "object", + "properties": { + "columns": { + "type": "object", + "$ref": "#/definitions/v1.TableColumns" + }, + "create_table_sql": { + "type": "string" + }, + "indexes": { + "type": "object", + "$ref": "#/definitions/v1.TableIndexes" + }, + "message": { + "type": "string" + }, + "name": { + "type": "string" + }, + "schema": { + "type": "string" + } + } + }, + "v1.TableMetaItemHeadResV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "field_name": { + "type": "string" + } + } }, - "workflow_total_num": { - "type": "integer" - } - } - }, - "WorkflowRejectedPercentGroupByInstance": { - "type": "object", - "properties": { - "instance_name": { - "type": "string" + "v1.TableMetas": { + "type": "object", + "properties": { + "err_message": { + "type": "string" + }, + "table_meta_items": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.TableMeta" + } + } + } + }, + "v1.Tag": { + "type": "object", + "properties": { + "id": { + "description": "标签ID", + "type": "integer" + }, + "name": { + "description": "标签名称", + "type": "string" + }, + "sub_tags": { + "description": "子标签", + "type": "array", + "items": { + "$ref": "#/definitions/v1.Tag" + } + } + } + }, + "v1.TargetReleaseInstance": { + "type": "object", + "properties": { + "instance_id": { + "type": "string" + }, + "instance_schema": { + "type": "string" + }, + "target_instance_id": { + "type": "string" + }, + "target_instance_schema": { + "type": "string" + } + } + }, + "v1.TestAuditPlanNotifyConfigResDataV1": { + "type": "object", + "properties": { + "is_notify_send_normal": { + "type": "boolean" + }, + "send_error_message": { + "type": "string" + } + } }, - "rejected_percent": { - "type": "number" + "v1.TestAuditPlanNotifyConfigResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.TestAuditPlanNotifyConfigResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.TestCodingConfigResDataV1": { + "type": "object", + "properties": { + "error_message": { + "type": "string" + }, + "is_message_sent_normally": { + "type": "boolean" + } + } }, - "workflow_total_num": { - "type": "integer" - } - } - }, - "WorkflowResV1": { - "type": "object", - "properties": { - "create_time": { - "type": "string" - }, - "create_user_name": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "mode": { - "type": "string", - "enum": [ - "same_sqls", - "different_sqls" - ] - }, - "record": { - "type": "object", - "$ref": "#/definitions/WorkflowRecordResV1" - }, - "record_history_list": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkflowRecordResV1" - } - }, - "workflow_name": { - "type": "string" - } - } - }, - "WorkflowStageDuration": { - "type": "object", - "properties": { - "minutes": { - "type": "integer" - } - } - }, - "WorkflowStatisticOfInstance": { - "type": "object", - "properties": { - "instance_id": { - "type": "integer" - }, - "unfinished_count": { - "type": "integer" - } - } - }, - "WorkflowStatisticsResV1": { - "type": "object", - "properties": { - "my_need_execute_workflow_number": { - "type": "integer" + "v1.TestCodingConfigResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.TestCodingConfigResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.TestCodingConfigurationReqV1": { + "type": "object", + "properties": { + "coding_project_name": { + "type": "string" + } + } }, - "my_need_review_workflow_number": { - "type": "integer" + "v1.TestDingTalkConfigResDataV1": { + "type": "object", + "properties": { + "is_ding_talk_send_normal": { + "type": "boolean" + }, + "send_error_message": { + "type": "string" + } + } }, - "my_on_process_workflow_number": { - "type": "integer" + "v1.TestDingTalkConfigResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.TestDingTalkConfigResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.TestFeishuConfigResDataV1": { + "type": "object", + "properties": { + "error_message": { + "type": "string" + }, + "is_message_sent_normally": { + "type": "boolean" + } + } }, - "my_rejected_workflow_number": { - "type": "integer" + "v1.TestFeishuConfigResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.TestFeishuConfigResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.TestFeishuConfigurationReqV1": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "account_type": { + "type": "string", + "enum": [ + "email", + "phone" + ] + } + } + }, + "v1.TestGitConnectionReqV1": { + "type": "object", + "properties": { + "git_http_url": { + "type": "string" + }, + "git_user_name": { + "type": "string" + }, + "git_user_password": { + "type": "string" + } + } + }, + "v1.TestGitConnectionResDataV1": { + "type": "object", + "properties": { + "branches": { + "type": "array", + "items": { + "type": "string" + } + }, + "error_message": { + "type": "string" + }, + "is_connected_success": { + "type": "boolean" + } + } + }, + "v1.TestGitConnectionResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.TestGitConnectionResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.TestWechatConfigResDataV1": { + "type": "object", + "properties": { + "error_message": { + "type": "string" + }, + "is_message_sent_normally": { + "type": "boolean" + } + } }, - "need_me_to_execute_workflow_number": { - "type": "integer" + "v1.TestWechatConfigResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.TestWechatConfigResDataV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.TestWechatConfigurationReqV1": { + "type": "object", + "properties": { + "wechat_id": { + "type": "string" + } + } }, - "need_me_to_review_workflow_number": { - "type": "integer" - } - } - }, - "WorkflowStatusCountV1": { - "type": "object", - "properties": { - "closed_count": { - "type": "integer" + "v1.TimeResV1": { + "type": "object", + "properties": { + "hour": { + "type": "integer" + }, + "minute": { + "type": "integer" + } + } }, - "executing_count": { - "type": "integer" + "v1.TopProblemDistribution": { + "type": "object", + "properties": { + "percentage": { + "description": "占比", + "type": "number" + }, + "problem_type": { + "description": "问题类型", + "type": "string" + } + } + }, + "v1.TransactionInfo": { + "type": "object", + "properties": { + "lock_type": { + "description": "锁类型", + "type": "string", + "enum": [ + "SHARED", + "EXCLUSIVE", + "INTENTION_SHARED", + "INTENTION_EXCLUSIVE", + "SHARED_INTENTION_EXCLUSIVE", + "ROW_LOCK", + "TABLE_LOCK", + "METADATA_LOCK" + ] + }, + "transaction_duration": { + "description": "事务持续时间", + "type": "number" + }, + "transaction_end_time": { + "description": "事务结束时间", + "type": "string" + }, + "transaction_id": { + "description": "事务ID", + "type": "string" + }, + "transaction_start_time": { + "description": "事务开始时间", + "type": "string" + }, + "transaction_state": { + "description": "事务状态", + "type": "string", + "enum": [ + "RUNNING", + "COMPLETED" + ] + } + } + }, + "v1.TransactionLockInfo": { + "type": "object", + "properties": { + "create_lock_sql": { + "description": "创建锁的SQL语句", + "type": "string" + }, + "lock_type": { + "description": "锁类型", + "type": "string", + "enum": [ + "SHARED", + "EXCLUSIVE", + "INTENTION_SHARED", + "INTENTION_EXCLUSIVE", + "SHARED_INTENTION_EXCLUSIVE", + "ROW_LOCK", + "TABLE_LOCK", + "METADATA_LOCK" + ] + }, + "table_name": { + "description": "表名", + "type": "string" + } + } + }, + "v1.TransactionSQL": { + "type": "object", + "properties": { + "execute_duration": { + "description": "执行时长", + "type": "number" + }, + "lock_type": { + "description": "锁类型", + "type": "string", + "enum": [ + "SHARED", + "EXCLUSIVE", + "INTENTION_SHARED", + "INTENTION_EXCLUSIVE", + "SHARED_INTENTION_EXCLUSIVE", + "ROW_LOCK", + "TABLE_LOCK", + "METADATA_LOCK" + ] + }, + "sql": { + "description": "SQL语句", + "type": "string" + } + } + }, + "v1.TransactionTimeline": { + "type": "object", + "properties": { + "current_step_index": { + "description": "当前步骤索引", + "type": "integer" + }, + "timeline": { + "description": "时间线项目列表", + "type": "array", + "items": { + "$ref": "#/definitions/v1.TransactionTimelineItem" + } + } + } + }, + "v1.TransactionTimelineItem": { + "type": "object", + "properties": { + "description": { + "description": "描述信息", + "type": "string" + }, + "start_time": { + "description": "开始时间", + "type": "string" + } + } + }, + "v1.TriggerAuditPlanResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.AuditPlanReportResV1" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v1.UpdateAuditPlanNotifyConfigReqV1": { + "type": "object", + "properties": { + "enable_email_notify": { + "type": "boolean" + }, + "enable_web_hook_notify": { + "type": "boolean" + }, + "notify_interval": { + "type": "integer", + "default": 10 + }, + "notify_level": { + "type": "string", + "default": "warn", + "enum": [ + "normal", + "notice", + "warn", + "error" + ] + }, + "web_hook_template": { + "type": "string" + }, + "web_hook_url": { + "type": "string" + } + } + }, + "v1.UpdateAuditPlanReqV1": { + "type": "object", + "properties": { + "audit_plan_cron": { + "type": "string", + "example": "0 */2 * * *" + }, + "audit_plan_instance_database": { + "type": "string", + "example": "app1" + }, + "audit_plan_instance_name": { + "type": "string", + "example": "test_mysql" + }, + "audit_plan_params": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanParamReqV1" + } + }, + "rule_template_name": { + "type": "string", + "example": "default_MySQL" + } + } + }, + "v1.UpdateAuditPlanStatusReqV1": { + "type": "object", + "properties": { + "active": { + "description": "任务状态", + "type": "string", + "enum": [ + "normal", + "disabled" + ] + } + } + }, + "v1.UpdateAuditTaskSQLsReqV1": { + "type": "object", + "properties": { + "description": { + "type": "string" + } + } }, - "executing_failed_count": { - "type": "integer" + "v1.UpdateAuditWhitelistReqV1": { + "type": "object", + "properties": { + "desc": { + "type": "string", + "example": "used for rapid release" + }, + "match_type": { + "type": "string", + "enum": [ + "exact_match", + "fp_match" + ], + "example": "exact_match" + }, + "value": { + "type": "string", + "example": "create table" + } + } + }, + "v1.UpdateBlacklistReqV1": { + "type": "object", + "properties": { + "content": { + "type": "string", + "example": "select * from t1" + }, + "desc": { + "type": "string", + "example": "used for rapid release" + }, + "type": { + "type": "string", + "enum": [ + "sql", + "fp_sql", + "ip", + "cidr", + "host", + "instance" + ], + "example": "sql" + } + } + }, + "v1.UpdateCodingConfigurationReqV1": { + "type": "object", + "properties": { + "coding_url": { + "type": "string" + }, + "is_coding_enabled": { + "type": "boolean" + }, + "token": { + "type": "string" + } + } + }, + "v1.UpdateCompanyNoticeReq": { + "type": "object", + "properties": { + "notice_str": { + "type": "string" + } + } }, - "execution_success_count": { - "type": "integer" + "v1.UpdateCustomRuleReqV1": { + "type": "object", + "properties": { + "annotation": { + "type": "string", + "example": "this is test rule" + }, + "desc": { + "type": "string", + "example": "this is test rule" + }, + "level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ], + "example": "notice" + }, + "rule_script": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "example": "DDL规则" + } + } + }, + "v1.UpdateDingTalkConfigurationReqV1": { + "type": "object", + "required": [ + "app_key", + "app_secret", + "is_enable_ding_talk_notify" + ], + "properties": { + "app_key": { + "type": "string" + }, + "app_secret": { + "type": "string" + }, + "is_enable_ding_talk_notify": { + "type": "boolean" + } + } + }, + "v1.UpdateFeishuConfigurationReqV1": { + "type": "object", + "required": [ + "app_id", + "app_secret", + "is_feishu_notification_enabled" + ], + "properties": { + "app_id": { + "type": "string" + }, + "app_secret": { + "type": "string" + }, + "is_feishu_notification_enabled": { + "type": "boolean" + } + } + }, + "v1.UpdateInstanceAuditPlanReqV1": { + "type": "object", + "properties": { + "audit_plans": { + "description": "扫描类型", + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlan" + } + } + } }, - "rejected_count": { - "type": "integer" + "v1.UpdateInstanceAuditPlanStatusReqV1": { + "type": "object", + "properties": { + "active": { + "description": "任务状态", + "type": "string", + "enum": [ + "normal", + "disabled" + ] + } + } + }, + "v1.UpdatePipelineReqV1": { + "type": "object", + "properties": { + "address": { + "description": "关联流水线地址", + "type": "string" + }, + "description": { + "description": "流水线描述", + "type": "string" + }, + "name": { + "description": "流水线名称", + "type": "string" + }, + "nodes": { + "description": "节点信息", + "type": "array", + "items": { + "$ref": "#/definitions/v1.updatePipelineNode" + } + } + } + }, + "v1.UpdateProjectRuleTemplateReqV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "rule_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RuleReqV1" + } + } + } + }, + "v1.UpdateReportPushConfigReqV1": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "push_frequency_cron": { + "type": "string" + }, + "push_user_Type": { + "type": "string", + "enum": [ + "fixed", + "permission_match" + ] + }, + "push_user_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "trigger_type": { + "type": "string", + "enum": [ + "immediately", + "timing" + ] + } + } + }, + "v1.UpdateRuleKnowledgeReq": { + "type": "object", + "properties": { + "knowledge_content": { + "type": "string" + } + } }, - "waiting_for_audit_count": { - "type": "integer" + "v1.UpdateRuleTemplateReqV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "rule_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.RuleReqV1" + } + } + } + }, + "v1.UpdateSQLAuditRecordReqV1": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } }, - "waiting_for_execution_count": { - "type": "integer" - } - } - }, - "WorkflowStepResV1": { - "type": "object", - "properties": { - "assignee_user_name_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "desc": { - "type": "string" - }, - "number": { - "type": "integer" - }, - "operation_time": { - "type": "string" - }, - "operation_user_name": { - "type": "string" - }, - "reason": { - "type": "string" - }, - "state": { - "type": "string", - "enum": [ - "initialized", - "approved", - "rejected" - ] - }, - "type": { - "type": "string", - "enum": [ - "create_workflow", - "update_workflow", - "sql_review", - "sql_execute" - ] - }, - "workflow_step_id": { - "type": "integer" - } - } - }, - "WorkflowTaskItem": { - "type": "object", - "properties": { - "task_id": { - "type": "integer" - } - } - }, - "WorkflowTemplateDetailResV1": { - "type": "object", - "properties": { - "allow_submit_when_less_audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error" - ] - }, - "desc": { - "type": "string" - }, - "is_default": { - "type": "boolean" - }, - "update_time": { - "type": "string" - }, - "workflow_step_template_list": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkFlowStepTemplateResV1" - } - }, - "workflow_template_id": { - "type": "integer" - }, - "workflow_template_name": { - "type": "string" - }, - "workflow_type": { - "type": "string", - "enum": [ - "workflow", - "data_export" - ] - } - } - }, - "createPipelineResData": { - "type": "object", - "properties": { - "pipeline_id": { - "description": "流水线的唯一标识符", - "type": "integer" - } - } - }, - "pipelineDetail": { - "type": "object", - "properties": { - "address": { - "description": "关联流水线地址", - "type": "string" - }, - "data_sources": { - "description": "数据源", - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "description": "流水线描述", - "type": "string" - }, - "id": { - "description": "流水线的唯一标识符", - "type": "integer" - }, - "name": { - "description": "流水线名称", - "type": "string" - }, - "node_count": { - "description": "节点个数", - "type": "integer" - } - } - }, - "pipelineDetailData": { - "type": "object", - "properties": { - "address": { - "description": "关联流水线地址", - "type": "string" - }, - "data_sources": { - "description": "数据源", - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "description": "流水线描述", - "type": "string" - }, - "id": { - "description": "流水线的唯一标识符", - "type": "integer" - }, - "name": { - "description": "流水线名称", - "type": "string" - }, - "node_count": { - "description": "节点个数", - "type": "integer" - }, - "nodes": { - "description": "流水线节点信息", - "type": "array", - "items": { - "$ref": "#/definitions/pipelineNodeDetail" - } - } - } - }, - "pipelineNodeBase": { - "type": "object", - "properties": { - "audit_method": { - "description": "审核方式,必选,可选项为离线审核、在线审核", - "type": "string", - "enum": [ - "offline", - "online" - ] - }, - "instance_name": { - "description": "数据源名称,在线审核时必填", - "type": "string" - }, - "instance_type": { - "description": "数据源类型,离线审核时必填", - "type": "string" - }, - "name": { - "description": "节点名称,必填,支持中文、英文+数字+特殊字符", - "type": "string" - }, - "object_path": { - "description": "审核脚本路径,必填,用户填写文件路径", - "type": "string" - }, - "object_type": { - "description": "审核对象类型,必填,可选项为SQL文件、MyBatis文件", - "type": "string", - "enum": [ - "sql", - "mybatis" - ] - }, - "rule_template_name": { - "description": "审核规则模板,必填", - "type": "string" - }, - "type": { - "description": "节点类型,必填,选项为“审核”或“上线”", - "type": "string", - "enum": [ - "audit", - "release" - ] - } - } - }, - "pipelineNodeDetail": { - "type": "object", - "properties": { - "audit_method": { - "description": "审核方式,必选,可选项为离线审核、在线审核", - "type": "string", - "enum": [ - "offline", - "online" - ] - }, - "id": { - "description": "节点的唯一标识符", - "type": "integer" - }, - "instance_name": { - "description": "数据源名称,在线审核时必填", - "type": "string" - }, - "instance_type": { - "description": "数据源类型,离线审核时必填", - "type": "string" - }, - "integration_info": { - "description": "对接说明", - "type": "string" - }, - "name": { - "description": "节点名称,必填,支持中文、英文+数字+特殊字符", - "type": "string" - }, - "object_path": { - "description": "审核脚本路径,必填,用户填写文件路径", - "type": "string" - }, - "object_type": { - "description": "审核对象类型,必填,可选项为SQL文件、MyBatis文件", - "type": "string", - "enum": [ - "sql", - "mybatis" - ] - }, - "rule_template_name": { - "description": "审核规则模板,必填", - "type": "string" - }, - "type": { - "description": "节点类型,必填,选项为“审核”或“上线”", - "type": "string", - "enum": [ - "audit", - "release" - ] - } - } - }, - "updatePipelineNode": { - "type": "object", - "properties": { - "audit_method": { - "description": "审核方式,必选,可选项为离线审核、在线审核", - "type": "string", - "enum": [ - "offline", - "online" - ] - }, - "id": { - "type": "integer" - }, - "instance_name": { - "description": "数据源名称,在线审核时必填", - "type": "string" - }, - "instance_type": { - "description": "数据源类型,离线审核时必填", - "type": "string" - }, - "name": { - "description": "节点名称,必填,支持中文、英文+数字+特殊字符", - "type": "string" - }, - "object_path": { - "description": "审核脚本路径,必填,用户填写文件路径", - "type": "string" - }, - "object_type": { - "description": "审核对象类型,必填,可选项为SQL文件、MyBatis文件", - "type": "string", - "enum": [ - "sql", - "mybatis" - ] - }, - "rule_template_name": { - "description": "审核规则模板,必填", - "type": "string" - }, - "type": { - "description": "节点类型,必填,选项为“审核”或“上线”", - "type": "string", - "enum": [ - "audit", - "release" - ] - } - } - }, - "ApproveWorkflowReqV2": { - "type": "object", - "properties": { - "reason": { - "type": "string" - } - } - }, - "AssociatedRollbackWorkflow": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "canceled", - "exec_failed", - "executing", - "finished" - ] - }, - "workflow_id": { - "type": "string" - }, - "workflow_name": { - "type": "string" - } - } - }, - "AssociatedStageWorkflows": { - "type": "object", - "properties": { - "sql_version_stage_id": { - "type": "integer" - }, - "stage_sequence": { - "type": "integer" - }, - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "canceled", - "exec_failed", - "executing", - "finished" - ] - }, - "workflow_id": { - "type": "string" - }, - "workflow_name": { - "type": "string" - } - } - }, - "AuditFileExecStatistic": { - "type": "object", - "properties": { - "exec_result_count": { - "type": "object", - "$ref": "#/definitions/ExecResultCount" - }, - "file_id": { - "type": "string" - }, - "file_name": { - "type": "string" - } - } - }, - "AuditFileStatistic": { - "type": "object", - "properties": { - "audit_result_count": { - "type": "object", - "$ref": "#/definitions/AuditResultCount" + "v1.UpdateSqlBackupStrategyReq": { + "type": "object", + "properties": { + "strategy": { + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "original_row" + ] + } + } + }, + "v1.UpdateSqlFileOrderV1Req": { + "type": "object", + "properties": { + "files_to_sort": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.FileToSort" + } + } + } }, - "exec_order": { - "type": "integer" + "v1.UpdateSqlVersionReqV1": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "update_sql_version_stage": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.UpdateSqlVersionStage" + } + }, + "version": { + "type": "string", + "example": "2.23" + } + } + }, + "v1.UpdateSqlVersionStage": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "生产" + }, + "stage_sequence": { + "type": "integer" + }, + "update_stages_instance_dep": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.UpdateStagesInstanceDep" + } + } + } + }, + "v1.UpdateStagesInstanceDep": { + "type": "object", + "properties": { + "next_stage_instance_id": { + "type": "string" + }, + "stage_instance_id": { + "type": "string" + } + } }, - "exec_status": { - "type": "string" + "v1.UpdateTaskBackupStrategyReq": { + "type": "object", + "properties": { + "strategy": { + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "original_row" + ] + } + } + }, + "v1.UpdateWechatConfigurationReqV1": { + "type": "object", + "required": [ + "is_wechat_notification_enabled" + ], + "properties": { + "corp_id": { + "type": "string" + }, + "corp_secret": { + "type": "string" + }, + "is_wechat_notification_enabled": { + "type": "boolean" + } + } + }, + "v1.UpdateWorkflowReqV1": { + "type": "object", + "properties": { + "task_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } }, - "file_id": { - "type": "string" + "v1.UpdateWorkflowScheduleReqV1": { + "type": "object", + "properties": { + "schedule_time": { + "type": "string" + } + } }, - "file_name": { - "type": "string" - } - } - }, - "AuditPlanReportSQLResV2": { - "type": "object", - "properties": { - "audit_plan_report_sql": { - "type": "string", - "example": "select * from t1 where id = 1" - }, - "audit_plan_report_sql_audit_result": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditResult" - } - }, - "number": { - "type": "integer", - "example": 1 - } - } - }, - "AuditPlanResV2": { - "type": "object", - "properties": { - "audit_plan_cron": { - "type": "string", - "example": "0 */2 * * *" - }, - "audit_plan_db_type": { - "type": "string", - "example": "mysql" - }, - "audit_plan_instance_database": { - "type": "string", - "example": "app1" - }, - "audit_plan_instance_name": { - "type": "string", - "example": "test_mysql" - }, - "audit_plan_meta": { - "type": "object", - "$ref": "#/definitions/AuditPlanMetaV1" - }, - "audit_plan_name": { - "type": "string", - "example": "audit_for_java_app1" - }, - "audit_plan_token": { - "type": "string", - "example": "it's a JWT Token for scanner" - }, - "create_user_id": { - "type": "string" - }, - "rule_template": { - "type": "object", - "$ref": "#/definitions/RuleTemplateV2" - } - } - }, - "AuditPlanSQLReqV2": { - "type": "object", - "properties": { - "audit_plan_sql_counter": { - "type": "string", - "example": "6" - }, - "audit_plan_sql_fingerprint": { - "type": "string", - "example": "select * from t1 where id = ?" - }, - "audit_plan_sql_last_receive_text": { - "type": "string", - "example": "select * from t1 where id = 1" - }, - "audit_plan_sql_last_receive_timestamp": { - "type": "string", - "example": "RFC3339" - }, - "audit_plan_sql_schema": { - "type": "string", - "example": "db1" - }, - "db_user": { - "type": "string", - "example": "database_user001" - }, - "endpoints": { - "type": "array", - "items": { - "type": "string" - } - }, - "first_query_at": { - "type": "string", - "example": "2023-09-12T02:48:01.317880Z" - }, - "query_time_avg": { - "type": "number", - "example": 3.22 - }, - "query_time_max": { - "type": "number", - "example": 5.22 - }, - "row_examined_avg": { - "type": "number", - "example": 100.22 - } - } - }, - "AuditResDataV2": { - "type": "object", - "properties": { - "audit_level": { - "type": "string", - "enum": [ - "normal", - "notice", - "warn", - "error", - "" - ] - }, - "pass_rate": { - "type": "number" - }, - "score": { - "type": "integer" - }, - "sql_results": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditSQLResV2" - } - } - } - }, - "AuditResultCount": { - "type": "object", - "properties": { - "error_sql_count": { - "type": "integer" + "v1.UpdateWorkflowTemplateByIdReqV1": { + "type": "object", + "properties": { + "allow_submit_when_less_audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ] + }, + "desc": { + "type": "string" + }, + "is_default": { + "type": "boolean" + }, + "workflow_step_template_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.WorkFlowStepTemplateReqV1" + } + }, + "workflow_template_name": { + "type": "string" + } + } + }, + "v1.UpdateWorkflowTemplateReqV1": { + "type": "object", + "properties": { + "allow_submit_when_less_audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ] + }, + "desc": { + "type": "string" + }, + "workflow_step_template_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.WorkFlowStepTemplateReqV1" + } + } + } + }, + "v1.UserTipResV1": { + "type": "object", + "properties": { + "user_id": { + "type": "string" + }, + "user_name": { + "type": "string" + } + } }, - "normal_sql_count": { - "type": "integer" + "v1.VersionStageInstance": { + "type": "object", + "properties": { + "instance_schema": { + "type": "string" + }, + "instances_id": { + "type": "string" + }, + "instances_name": { + "type": "string" + } + } + }, + "v1.WechatConfigurationV1": { + "type": "object", + "properties": { + "corp_id": { + "type": "string" + }, + "is_wechat_notification_enabled": { + "type": "boolean" + } + } }, - "notice_sql_count": { - "type": "integer" + "v1.WorkFlowStepTemplateReqV1": { + "type": "object", + "properties": { + "approved_by_authorized": { + "type": "boolean" + }, + "assignee_user_id_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "desc": { + "type": "string" + }, + "execute_by_authorized": { + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "sql_review", + "sql_execute", + "export_review", + "export_execute" + ] + } + } + }, + "v1.WorkFlowStepTemplateResV1": { + "type": "object", + "properties": { + "approved_by_authorized": { + "type": "boolean" + }, + "assignee_user_id_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "desc": { + "type": "string" + }, + "execute_by_authorized": { + "type": "boolean" + }, + "number": { + "type": "integer" + }, + "type": { + "type": "string" + } + } + }, + "v1.WorkflowAuditPassPercentV1": { + "type": "object", + "properties": { + "audit_pass_percent": { + "type": "number" + } + } }, - "warning_sql_count": { - "type": "integer" - } - } - }, - "AuditSQLResV2": { - "type": "object", - "properties": { - "audit_level": { - "type": "string" - }, - "audit_result": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditResult" - } - }, - "exec_sql": { - "type": "string" - }, - "number": { - "type": "integer" - }, - "sql_type": { - "type": "string" - } - } - }, - "AuditTaskSQLResV2": { - "type": "object", - "properties": { - "associated_rollback_workflows": { - "type": "array", - "items": { - "$ref": "#/definitions/AssociatedRollbackWorkflow" - } - }, - "audit_level": { - "type": "string" - }, - "audit_result": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditResult" - } - }, - "audit_status": { - "type": "string" - }, - "backup_result": { - "type": "string" - }, - "backup_status": { - "type": "string", - "enum": [ - "waiting_for_execution", - "executing", - "failed", - "succeed" - ] - }, - "backup_strategy": { - "type": "string", - "enum": [ - "none", - "manual", - "reverse_sql", - "original_row" - ] - }, - "backup_strategy_tip": { - "type": "string" - }, - "description": { - "type": "string" - }, - "exec_result": { - "type": "string" - }, - "exec_sql": { - "type": "string" - }, - "exec_sql_id": { - "type": "integer" - }, - "exec_status": { - "type": "string" - }, - "fail_reason": { - "type": "string" - }, - "fail_stage": { - "type": "string" - }, - "number": { - "type": "integer" - }, - "rollback_sqls": { - "type": "array", - "items": { - "type": "string" - } - }, - "sql_source_file": { - "type": "string" - }, - "sql_start_line": { - "type": "integer" - }, - "sql_type": { - "type": "string" - } - } - }, - "BatchCancelWorkflowsReqV2": { - "type": "object", - "properties": { - "workflow_id_list": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "BatchCompleteWorkflowsReqV2": { - "type": "object", - "properties": { - "workflow_id_list": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "CreateWorkflowReqV2": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "ops_type_uid": { - "description": "OpsTypeUID 运维类型字典项标识;可选;空表示未设置;创建后不可改", - "type": "string" - }, - "sql_version_id": { - "type": "integer" - }, - "task_ids": { - "type": "array", - "items": { - "type": "integer" - } - }, - "workflow_subject": { - "type": "string" - }, - "workflow_template_id": { - "type": "integer" - } - } - }, - "CreateWorkflowResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/CreateWorkflowResV2Data" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "CreateWorkflowResV2Data": { - "type": "object", - "properties": { - "workflow_id": { - "type": "string" - } - } - }, - "DirectAuditFileReqV2": { - "type": "object", - "properties": { - "file_contents": { - "description": "调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现\n每个数组元素是一个文件内容", - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "select * from t1; select * from t2;" - ] - }, - "instance_name": { - "type": "string", - "example": "instance1" - }, - "instance_type": { - "type": "string", - "example": "MySQL" - }, - "project_name": { - "type": "string", - "example": "project1" - }, - "schema_name": { - "type": "string", - "example": "schema1" - }, - "sql_type": { - "type": "string", - "enum": [ - "sql", - "mybatis", - "" - ], - "example": "sql" - } - } - }, - "DirectAuditReqV2": { - "type": "object", - "properties": { - "instance_name": { - "type": "string", - "example": "instance1" - }, - "instance_type": { - "type": "string", - "example": "MySQL" - }, - "project_id": { - "type": "string", - "example": "700300" - }, - "rule_template_name": { - "type": "string", - "example": "default" - }, - "schema_name": { - "type": "string", - "example": "schema1" - }, - "sql_content": { - "description": "调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现", - "type": "string", - "example": "select * from t1; select * from t2;" - }, - "sql_type": { - "type": "string", - "enum": [ - "sql", - "mybatis", - "" - ], - "example": "sql" - } - } - }, - "DirectAuditResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AuditResDataV2" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "DriverMeta": { - "type": "object", - "properties": { - "default_port": { - "type": "integer" + "v1.WorkflowCountsV1": { + "type": "object", + "properties": { + "today_count": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } }, - "driver_name": { - "type": "string" + "v1.WorkflowCreatedCountsEachDayItem": { + "type": "object", + "properties": { + "date": { + "type": "string", + "example": "2022-08-24" + }, + "value": { + "type": "integer" + } + } }, - "logo_url": { - "type": "string" - } - } - }, - "ExecResultCount": { - "type": "object", - "properties": { - "doing_count": { - "type": "integer" + "v1.WorkflowCreatedCountsEachDayV1": { + "type": "object", + "properties": { + "samples": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.WorkflowCreatedCountsEachDayItem" + } + } + } }, - "failed_count": { - "type": "integer" + "v1.WorkflowDetailResV1": { + "type": "object", + "properties": { + "create_time": { + "type": "string" + }, + "create_user_name": { + "type": "string" + }, + "current_step_assignee_user_name_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "current_step_type": { + "type": "string", + "enum": [ + "sql_review", + "sql_execute" + ] + }, + "desc": { + "type": "string" + }, + "instance_info": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.InstanceInfo" + } + }, + "ops_type": { + "description": "OpsType 运维类型(项目字典批量解析);未设置或字典项已删时省略", + "type": "object", + "$ref": "#/definitions/dms.OpsType" + }, + "project_name": { + "type": "string" + }, + "project_priority": { + "type": "string" + }, + "project_uid": { + "type": "string" + }, + "sql_version_name": { + "type": "array", + "items": { + "type": "string" + } + }, + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_approve", + "wait_for_execution", + "wait_for_export", + "rejected", + "canceled", + "cancel", + "exec_failed", + "failed", + "executing", + "exporting", + "finished", + "finish" + ] + }, + "workflow_id": { + "type": "string" + }, + "workflow_name": { + "type": "string" + }, + "workflow_template_id": { + "type": "integer" + }, + "workflow_template_name": { + "type": "string" + } + } + }, + "v1.WorkflowDetailWithInstance": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "canceled", + "exec_failed", + "executing", + "finished" + ] + }, + "workflow_exec_time": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "workflow_instances": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.VersionStageInstance" + } + }, + "workflow_name": { + "type": "string" + }, + "workflow_release_status": { + "type": "string", + "enum": [ + "wait_for_release", + "released", + "not_need_release" + ] + }, + "workflow_sequence": { + "type": "integer" + } + } + }, + "v1.WorkflowPassPercentV1": { + "type": "object", + "properties": { + "audit_pass_percent": { + "type": "number" + }, + "execution_success_percent": { + "type": "number" + } + } }, - "initialized_count": { - "type": "integer" + "v1.WorkflowPercentCountedByInstanceType": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "instance_type": { + "type": "string" + }, + "percent": { + "type": "number" + } + } + }, + "v1.WorkflowPercentCountedByInstanceTypeV1": { + "type": "object", + "properties": { + "workflow_percents": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.WorkflowPercentCountedByInstanceType" + } + }, + "workflow_total_num": { + "type": "integer" + } + } + }, + "v1.WorkflowRecordResV1": { + "type": "object", + "properties": { + "current_step_number": { + "type": "integer" + }, + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "canceled", + "exec_failed", + "executing", + "finished" + ] + }, + "tasks": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.WorkflowTaskItem" + } + }, + "workflow_step_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.WorkflowStepResV1" + } + } + } + }, + "v1.WorkflowRejectedPercentGroupByCreator": { + "type": "object", + "properties": { + "creator": { + "type": "string" + }, + "rejected_percent": { + "type": "number" + }, + "workflow_total_num": { + "type": "integer" + } + } + }, + "v1.WorkflowRejectedPercentGroupByInstance": { + "type": "object", + "properties": { + "instance_name": { + "type": "string" + }, + "rejected_percent": { + "type": "number" + }, + "workflow_total_num": { + "type": "integer" + } + } + }, + "v1.WorkflowResV1": { + "type": "object", + "properties": { + "create_time": { + "type": "string" + }, + "create_user_name": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "mode": { + "type": "string", + "enum": [ + "same_sqls", + "different_sqls" + ] + }, + "record": { + "type": "object", + "$ref": "#/definitions/v1.WorkflowRecordResV1" + }, + "record_history_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.WorkflowRecordResV1" + } + }, + "workflow_name": { + "type": "string" + } + } + }, + "v1.WorkflowStageDuration": { + "type": "object", + "properties": { + "minutes": { + "type": "integer" + } + } }, - "manually_executed_count": { - "type": "integer" + "v1.WorkflowStatisticOfInstance": { + "type": "object", + "properties": { + "instance_id": { + "type": "integer" + }, + "unfinished_count": { + "type": "integer" + } + } }, - "succeeded_count": { - "type": "integer" + "v1.WorkflowStatisticsResV1": { + "type": "object", + "properties": { + "my_need_execute_workflow_number": { + "type": "integer" + }, + "my_need_review_workflow_number": { + "type": "integer" + }, + "my_on_process_workflow_number": { + "type": "integer" + }, + "my_rejected_workflow_number": { + "type": "integer" + }, + "need_me_to_execute_workflow_number": { + "type": "integer" + }, + "need_me_to_review_workflow_number": { + "type": "integer" + } + } + }, + "v1.WorkflowStatusCountV1": { + "type": "object", + "properties": { + "closed_count": { + "type": "integer" + }, + "executing_count": { + "type": "integer" + }, + "executing_failed_count": { + "type": "integer" + }, + "execution_success_count": { + "type": "integer" + }, + "rejected_count": { + "type": "integer" + }, + "waiting_for_audit_count": { + "type": "integer" + }, + "waiting_for_execution_count": { + "type": "integer" + } + } + }, + "v1.WorkflowStepResV1": { + "type": "object", + "properties": { + "assignee_user_name_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "desc": { + "type": "string" + }, + "number": { + "type": "integer" + }, + "operation_time": { + "type": "string" + }, + "operation_user_name": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "state": { + "type": "string", + "enum": [ + "initialized", + "approved", + "rejected" + ] + }, + "type": { + "type": "string", + "enum": [ + "create_workflow", + "update_workflow", + "sql_review", + "sql_execute" + ] + }, + "workflow_step_id": { + "type": "integer" + } + } + }, + "v1.WorkflowTaskItem": { + "type": "object", + "properties": { + "task_id": { + "type": "integer" + } + } }, - "terminate_failed_count": { - "type": "integer" + "v1.WorkflowTemplateDetailResV1": { + "type": "object", + "properties": { + "allow_submit_when_less_audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error" + ] + }, + "desc": { + "type": "string" + }, + "is_default": { + "type": "boolean" + }, + "update_time": { + "type": "string" + }, + "workflow_step_template_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.WorkFlowStepTemplateResV1" + } + }, + "workflow_template_id": { + "type": "integer" + }, + "workflow_template_name": { + "type": "string" + }, + "workflow_type": { + "type": "string", + "enum": [ + "workflow", + "data_export" + ] + } + } + }, + "v1.createPipelineResData": { + "type": "object", + "properties": { + "pipeline_id": { + "description": "流水线的唯一标识符", + "type": "integer" + } + } }, - "terminate_succeeded_count": { - "type": "integer" - } - } - }, - "FullSyncAuditPlanSQLsReqV2": { - "type": "object", - "properties": { - "audit_plan_sql_list": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanSQLReqV2" - } - }, - "error_message": { - "type": "string" - } - } - }, - "GetAuditFileExecStatisticRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/AuditFileExecStatistic" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetAuditFileListRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditFileStatistic" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetAuditPlanAnalysisDataResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/TaskAnalysisDataV2" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetAuditPlanReportSQLsResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanReportSQLResV2" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetAuditPlansResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanResV2" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetAuditTaskSQLsResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditTaskSQLResV2" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetDriversRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/DriverMeta" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetInstanceAuditPlanDetailRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/InstanceAuditPlanDetailRes" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetInstanceAuditPlansRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/InstanceAuditPlanResV1" - } - }, - "message": { - "type": "string", - "example": "ok" - }, - "total_nums": { - "type": "integer" - } - } - }, - "GetInstanceResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/InstanceResV2" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetInstanceTipsResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/InstanceTipResV2" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetOptimizationDetailRes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/OptimizationSQLDetail" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetTaskAnalysisDataResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/TaskAnalysisDataV2" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "object", - "$ref": "#/definitions/WorkflowResV2" - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "GetWorkflowTasksItemV2": { - "type": "object", - "properties": { - "current_step_assignee_user_name_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "exec_end_time": { - "type": "string" - }, - "exec_start_time": { - "type": "string" - }, - "execution_user_name": { - "type": "string" - }, - "instance_maintenance_times": { - "type": "array", - "items": { - "$ref": "#/definitions/MaintenanceTimeResV1" - } - }, - "instance_name": { - "type": "string" - }, - "schedule_time": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_execution", - "exec_scheduled", - "exec_failed", - "exec_succeeded", - "executing", - "manually_executed", - "terminating", - "terminate_succeeded", - "terminate_failed" - ] - }, - "task_id": { - "type": "integer" - }, - "task_pass_rate": { - "type": "number" - }, - "task_score": { - "type": "integer" - } - } - }, - "GetWorkflowTasksResV2": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 0 - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/GetWorkflowTasksItemV2" - } - }, - "message": { - "type": "string", - "example": "ok" - } - } - }, - "InstanceAuditPlanDetailRes": { - "type": "object", - "properties": { - "audit_plans": { - "description": "扫描类型", - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanRes" - } - }, - "environment": { - "type": "string", - "example": "prod" - }, - "instance_id": { - "type": "string", - "example": "instance_id" - }, - "instance_name": { - "type": "string", - "example": "test_mysql" - }, - "instance_type": { - "type": "string", - "example": "mysql" - } - } - }, - "InstanceResV2": { - "type": "object", - "properties": { - "additional_params": { - "type": "array", - "items": { - "$ref": "#/definitions/InstanceAdditionalParamResV1" - } - }, - "db_host": { - "type": "string", - "example": "10.10.10.10" - }, - "db_port": { - "type": "string", - "example": "3306" - }, - "db_type": { - "type": "string", - "example": "mysql" - }, - "db_user": { - "type": "string", - "example": "root" - }, - "desc": { - "type": "string", - "example": "this is a instance" - }, - "environment_tag_color": { - "type": "string" - }, - "environment_tag_name": { - "type": "string" - }, - "environment_tag_uid": { - "type": "string" - }, - "instance_name": { - "type": "string" - }, - "maintenance_times": { - "type": "array", - "items": { - "$ref": "#/definitions/MaintenanceTimeResV1" - } - }, - "rule_template": { - "type": "object", - "$ref": "#/definitions/RuleTemplateV2" - }, - "source": { - "type": "string", - "example": "SQLE" - }, - "sql_query_config": { - "type": "object", - "$ref": "#/definitions/SQLQueryConfigResV1" - } - } - }, - "InstanceTipResV2": { - "type": "object", - "properties": { - "backup_max_rows": { - "type": "integer" + "v1.pipelineDetail": { + "type": "object", + "properties": { + "address": { + "description": "关联流水线地址", + "type": "string" + }, + "data_sources": { + "description": "数据源", + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "description": "流水线描述", + "type": "string" + }, + "id": { + "description": "流水线的唯一标识符", + "type": "integer" + }, + "name": { + "description": "流水线名称", + "type": "string" + }, + "node_count": { + "description": "节点个数", + "type": "integer" + } + } + }, + "v1.pipelineDetailData": { + "type": "object", + "properties": { + "address": { + "description": "关联流水线地址", + "type": "string" + }, + "data_sources": { + "description": "数据源", + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "description": "流水线描述", + "type": "string" + }, + "id": { + "description": "流水线的唯一标识符", + "type": "integer" + }, + "name": { + "description": "流水线名称", + "type": "string" + }, + "node_count": { + "description": "节点个数", + "type": "integer" + }, + "nodes": { + "description": "流水线节点信息", + "type": "array", + "items": { + "$ref": "#/definitions/v1.pipelineNodeDetail" + } + } + } + }, + "v1.pipelineNodeBase": { + "type": "object", + "properties": { + "audit_method": { + "description": "审核方式,必选,可选项为离线审核、在线审核", + "type": "string", + "enum": [ + "offline", + "online" + ] + }, + "instance_name": { + "description": "数据源名称,在线审核时必填", + "type": "string" + }, + "instance_type": { + "description": "数据源类型,离线审核时必填", + "type": "string" + }, + "name": { + "description": "节点名称,必填,支持中文、英文+数字+特殊字符", + "type": "string" + }, + "object_path": { + "description": "审核脚本路径,必填,用户填写文件路径", + "type": "string" + }, + "object_type": { + "description": "审核对象类型,必填,可选项为SQL文件、MyBatis文件", + "type": "string", + "enum": [ + "sql", + "mybatis" + ] + }, + "rule_template_name": { + "description": "审核规则模板,必填", + "type": "string" + }, + "type": { + "description": "节点类型,必填,选项为“审核”或“上线”", + "type": "string", + "enum": [ + "audit", + "release" + ] + } + } + }, + "v1.pipelineNodeDetail": { + "type": "object", + "properties": { + "audit_method": { + "description": "审核方式,必选,可选项为离线审核、在线审核", + "type": "string", + "enum": [ + "offline", + "online" + ] + }, + "id": { + "description": "节点的唯一标识符", + "type": "integer" + }, + "instance_name": { + "description": "数据源名称,在线审核时必填", + "type": "string" + }, + "instance_type": { + "description": "数据源类型,离线审核时必填", + "type": "string" + }, + "integration_info": { + "description": "对接说明", + "type": "string" + }, + "name": { + "description": "节点名称,必填,支持中文、英文+数字+特殊字符", + "type": "string" + }, + "object_path": { + "description": "审核脚本路径,必填,用户填写文件路径", + "type": "string" + }, + "object_type": { + "description": "审核对象类型,必填,可选项为SQL文件、MyBatis文件", + "type": "string", + "enum": [ + "sql", + "mybatis" + ] + }, + "rule_template_name": { + "description": "审核规则模板,必填", + "type": "string" + }, + "type": { + "description": "节点类型,必填,选项为“审核”或“上线”", + "type": "string", + "enum": [ + "audit", + "release" + ] + } + } + }, + "v1.updatePipelineNode": { + "type": "object", + "properties": { + "audit_method": { + "description": "审核方式,必选,可选项为离线审核、在线审核", + "type": "string", + "enum": [ + "offline", + "online" + ] + }, + "id": { + "type": "integer" + }, + "instance_name": { + "description": "数据源名称,在线审核时必填", + "type": "string" + }, + "instance_type": { + "description": "数据源类型,离线审核时必填", + "type": "string" + }, + "name": { + "description": "节点名称,必填,支持中文、英文+数字+特殊字符", + "type": "string" + }, + "object_path": { + "description": "审核脚本路径,必填,用户填写文件路径", + "type": "string" + }, + "object_type": { + "description": "审核对象类型,必填,可选项为SQL文件、MyBatis文件", + "type": "string", + "enum": [ + "sql", + "mybatis" + ] + }, + "rule_template_name": { + "description": "审核规则模板,必填", + "type": "string" + }, + "type": { + "description": "节点类型,必填,选项为“审核”或“上线”", + "type": "string", + "enum": [ + "audit", + "release" + ] + } + } + }, + "v2.AffectRows": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "err_message": { + "type": "string" + } + } + }, + "v2.ApproveWorkflowReqV2": { + "type": "object", + "properties": { + "reason": { + "type": "string" + } + } + }, + "v2.AssociatedRollbackWorkflow": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "canceled", + "exec_failed", + "executing", + "finished" + ] + }, + "workflow_id": { + "type": "string" + }, + "workflow_name": { + "type": "string" + } + } + }, + "v2.AssociatedStageWorkflows": { + "type": "object", + "properties": { + "sql_version_stage_id": { + "type": "integer" + }, + "stage_sequence": { + "type": "integer" + }, + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "canceled", + "exec_failed", + "executing", + "finished" + ] + }, + "workflow_id": { + "type": "string" + }, + "workflow_name": { + "type": "string" + } + } + }, + "v2.AuditFileExecStatistic": { + "type": "object", + "properties": { + "exec_result_count": { + "type": "object", + "$ref": "#/definitions/v2.ExecResultCount" + }, + "file_id": { + "type": "string" + }, + "file_name": { + "type": "string" + } + } + }, + "v2.AuditFileStatistic": { + "type": "object", + "properties": { + "audit_result_count": { + "type": "object", + "$ref": "#/definitions/v2.AuditResultCount" + }, + "exec_order": { + "type": "integer" + }, + "exec_status": { + "type": "string" + }, + "file_id": { + "type": "string" + }, + "file_name": { + "type": "string" + } + } + }, + "v2.AuditPlanReportSQLResV2": { + "type": "object", + "properties": { + "audit_plan_report_sql": { + "type": "string", + "example": "select * from t1 where id = 1" + }, + "audit_plan_report_sql_audit_result": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.AuditResult" + } + }, + "number": { + "type": "integer", + "example": 1 + } + } + }, + "v2.AuditPlanRes": { + "type": "object", + "properties": { + "audit_plan_params": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditPlanParamResV1" + } + }, + "audit_plan_type": { + "type": "object", + "$ref": "#/definitions/v2.AuditPlanTypeResBase" + }, + "high_priority_conditions": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.HighPriorityConditionResV1" + } + }, + "need_mark_high_priority_sql": { + "type": "boolean" + }, + "rule_template_name": { + "type": "string", + "example": "default_MySQL" + } + } + }, + "v2.AuditPlanResV2": { + "type": "object", + "properties": { + "audit_plan_cron": { + "type": "string", + "example": "0 */2 * * *" + }, + "audit_plan_db_type": { + "type": "string", + "example": "mysql" + }, + "audit_plan_instance_database": { + "type": "string", + "example": "app1" + }, + "audit_plan_instance_name": { + "type": "string", + "example": "test_mysql" + }, + "audit_plan_meta": { + "type": "object", + "$ref": "#/definitions/v1.AuditPlanMetaV1" + }, + "audit_plan_name": { + "type": "string", + "example": "audit_for_java_app1" + }, + "audit_plan_token": { + "type": "string", + "example": "it's a JWT Token for scanner" + }, + "create_user_id": { + "type": "string" + }, + "rule_template": { + "type": "object", + "$ref": "#/definitions/v2.RuleTemplateV2" + } + } + }, + "v2.AuditPlanSQLReqV2": { + "type": "object", + "properties": { + "audit_plan_sql_counter": { + "type": "string", + "example": "6" + }, + "audit_plan_sql_fingerprint": { + "type": "string", + "example": "select * from t1 where id = ?" + }, + "audit_plan_sql_last_receive_text": { + "type": "string", + "example": "select * from t1 where id = 1" + }, + "audit_plan_sql_last_receive_timestamp": { + "type": "string", + "example": "RFC3339" + }, + "audit_plan_sql_schema": { + "type": "string", + "example": "db1" + }, + "db_user": { + "type": "string", + "example": "database_user001" + }, + "endpoints": { + "type": "array", + "items": { + "type": "string" + } + }, + "first_query_at": { + "type": "string", + "example": "2023-09-12T02:48:01.317880Z" + }, + "query_time_avg": { + "type": "number", + "example": 3.22 + }, + "query_time_max": { + "type": "number", + "example": 5.22 + }, + "row_examined_avg": { + "type": "number", + "example": 100.22 + } + } + }, + "v2.AuditPlanTypeResBase": { + "type": "object", + "properties": { + "active_status": { + "type": "string", + "enum": [ + "normal", + "disabled" + ] + }, + "audit_plan_id": { + "type": "integer" + }, + "desc": { + "type": "string" + }, + "last_collection_status": { + "type": "string", + "enum": [ + "normal", + "abnormal" + ] + }, + "token": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "v2.AuditResDataV2": { + "type": "object", + "properties": { + "audit_level": { + "type": "string", + "enum": [ + "normal", + "notice", + "warn", + "error", + "" + ] + }, + "pass_rate": { + "type": "number" + }, + "score": { + "type": "integer" + }, + "sql_results": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.AuditSQLResV2" + } + } + } + }, + "v2.AuditResult": { + "type": "object", + "properties": { + "db_type": { + "type": "string" + }, + "error_info": { + "type": "string" + }, + "execution_failed": { + "type": "boolean", + "example": false + }, + "i18n_audit_result_info": { + "type": "object", + "$ref": "#/definitions/model.I18nAuditResultInfo" + }, + "level": { + "type": "string", + "example": "warn" + }, + "message": { + "type": "string", + "example": "避免使用不必要的内置函数md5()" + }, + "rule_name": { + "type": "string" + } + } + }, + "v2.AuditResultCount": { + "type": "object", + "properties": { + "error_sql_count": { + "type": "integer" + }, + "normal_sql_count": { + "type": "integer" + }, + "notice_sql_count": { + "type": "integer" + }, + "warning_sql_count": { + "type": "integer" + } + } + }, + "v2.AuditSQLResV2": { + "type": "object", + "properties": { + "audit_level": { + "type": "string" + }, + "audit_result": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.AuditResult" + } + }, + "exec_sql": { + "type": "string" + }, + "number": { + "type": "integer" + }, + "sql_type": { + "type": "string" + } + } + }, + "v2.AuditTaskSQLResV2": { + "type": "object", + "properties": { + "associated_rollback_workflows": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.AssociatedRollbackWorkflow" + } + }, + "audit_level": { + "type": "string" + }, + "audit_result": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.AuditResult" + } + }, + "audit_status": { + "type": "string" + }, + "backup_result": { + "type": "string" + }, + "backup_status": { + "type": "string", + "enum": [ + "waiting_for_execution", + "executing", + "failed", + "succeed" + ] + }, + "backup_strategy": { + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "original_row" + ] + }, + "backup_strategy_tip": { + "type": "string" + }, + "description": { + "type": "string" + }, + "exec_result": { + "type": "string" + }, + "exec_sql": { + "type": "string" + }, + "exec_sql_id": { + "type": "integer" + }, + "exec_status": { + "type": "string" + }, + "fail_reason": { + "type": "string" + }, + "fail_stage": { + "type": "string" + }, + "number": { + "type": "integer" + }, + "rollback_sqls": { + "type": "array", + "items": { + "type": "string" + } + }, + "sql_source_file": { + "type": "string" + }, + "sql_start_line": { + "type": "integer" + }, + "sql_type": { + "type": "string" + } + } + }, + "v2.BatchCancelWorkflowsReqV2": { + "type": "object", + "properties": { + "workflow_id_list": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "v2.BatchCompleteWorkflowsReqV2": { + "type": "object", + "properties": { + "workflow_id_list": { + "type": "array", + "items": { + "type": "string" + } + } + } }, - "enable_backup": { - "type": "boolean" + "v2.CreateWorkflowReqV2": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "ops_type_uid": { + "description": "OpsTypeUID 运维类型字典项标识;可选;空表示未设置;创建后不可改", + "type": "string" + }, + "sql_version_id": { + "type": "integer" + }, + "task_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "workflow_subject": { + "type": "string" + }, + "workflow_template_id": { + "type": "integer" + } + } + }, + "v2.CreateWorkflowResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v2.CreateWorkflowResV2Data" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v2.CreateWorkflowResV2Data": { + "type": "object", + "properties": { + "workflow_id": { + "type": "string" + } + } }, - "environment_tag_color": { - "type": "string" + "v2.DirectAuditFileReqV2": { + "type": "object", + "properties": { + "file_contents": { + "description": "调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现\n每个数组元素是一个文件内容", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "select * from t1; select * from t2;" + ] + }, + "instance_name": { + "type": "string", + "example": "instance1" + }, + "instance_type": { + "type": "string", + "example": "MySQL" + }, + "project_name": { + "type": "string", + "example": "project1" + }, + "schema_name": { + "type": "string", + "example": "schema1" + }, + "sql_type": { + "type": "string", + "enum": [ + "sql", + "mybatis", + "" + ], + "example": "sql" + } + } + }, + "v2.DirectAuditReqV2": { + "type": "object", + "properties": { + "instance_name": { + "type": "string", + "example": "instance1" + }, + "instance_type": { + "type": "string", + "example": "MySQL" + }, + "project_id": { + "type": "string", + "example": "700300" + }, + "rule_template_name": { + "type": "string", + "example": "default" + }, + "schema_name": { + "type": "string", + "example": "schema1" + }, + "sql_content": { + "description": "调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现", + "type": "string", + "example": "select * from t1; select * from t2;" + }, + "sql_type": { + "type": "string", + "enum": [ + "sql", + "mybatis", + "" + ], + "example": "sql" + } + } + }, + "v2.DirectAuditResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v2.AuditResDataV2" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v2.DriverMeta": { + "type": "object", + "properties": { + "default_port": { + "type": "integer" + }, + "driver_name": { + "type": "string" + }, + "logo_url": { + "type": "string" + } + } + }, + "v2.ExecResultCount": { + "type": "object", + "properties": { + "doing_count": { + "type": "integer" + }, + "failed_count": { + "type": "integer" + }, + "initialized_count": { + "type": "integer" + }, + "manually_executed_count": { + "type": "integer" + }, + "succeeded_count": { + "type": "integer" + }, + "terminate_failed_count": { + "type": "integer" + }, + "terminate_succeeded_count": { + "type": "integer" + } + } + }, + "v2.FullSyncAuditPlanSQLsReqV2": { + "type": "object", + "properties": { + "audit_plan_sql_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.AuditPlanSQLReqV2" + } + }, + "error_message": { + "type": "string" + } + } + }, + "v2.GetAuditFileExecStatisticRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v2.AuditFileExecStatistic" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v2.GetAuditFileListRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.AuditFileStatistic" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v2.GetAuditPlanAnalysisDataResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v2.TaskAnalysisDataV2" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v2.GetAuditPlanReportSQLsResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.AuditPlanReportSQLResV2" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v2.GetAuditPlansResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.AuditPlanResV2" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v2.GetAuditTaskSQLsResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.AuditTaskSQLResV2" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v2.GetDriversRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.DriverMeta" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v2.GetInstanceAuditPlanDetailRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v2.InstanceAuditPlanDetailRes" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v2.GetInstanceAuditPlansRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.InstanceAuditPlanResV1" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v2.GetInstanceResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v2.InstanceResV2" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v2.GetInstanceTipsResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.InstanceTipResV2" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v2.GetOptimizationDetailRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v2.OptimizationSQLDetail" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v2.GetOptimizationRecordsRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.OptimizationRecord" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, + "v2.GetSqlManageListResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.SqlManage" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "sql_manage_bad_num": { + "type": "integer" + }, + "sql_manage_optimized_num": { + "type": "integer" + }, + "sql_manage_total_num": { + "type": "integer" + } + } + }, + "v2.GetTaskAnalysisDataResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v2.TaskAnalysisDataV2" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v2.GetWorkflowResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v2.WorkflowResV2" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v2.GetWorkflowTasksItemV2": { + "type": "object", + "properties": { + "current_step_assignee_user_name_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "exec_end_time": { + "type": "string" + }, + "exec_start_time": { + "type": "string" + }, + "execution_user_name": { + "type": "string" + }, + "instance_maintenance_times": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.MaintenanceTimeResV1" + } + }, + "instance_name": { + "type": "string" + }, + "schedule_time": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "exec_scheduled", + "exec_failed", + "exec_succeeded", + "executing", + "manually_executed", + "terminating", + "terminate_succeeded", + "terminate_failed" + ] + }, + "task_id": { + "type": "integer" + }, + "task_pass_rate": { + "type": "number" + }, + "task_score": { + "type": "integer" + } + } + }, + "v2.GetWorkflowTasksResV2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.GetWorkflowTasksItemV2" + } + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v2.InstanceAuditPlanDetailRes": { + "type": "object", + "properties": { + "audit_plans": { + "description": "扫描类型", + "type": "array", + "items": { + "$ref": "#/definitions/v2.AuditPlanRes" + } + }, + "environment": { + "type": "string", + "example": "prod" + }, + "instance_id": { + "type": "string", + "example": "instance_id" + }, + "instance_name": { + "type": "string", + "example": "test_mysql" + }, + "instance_type": { + "type": "string", + "example": "mysql" + } + } + }, + "v2.InstanceAuditPlanResV1": { + "type": "object", + "properties": { + "active_status": { + "type": "string", + "enum": [ + "normal", + "disabled" + ] + }, + "audit_plan_types": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.AuditPlanTypeResBase" + } + }, + "create_time": { + "description": "TODO 采集状态", + "type": "string" + }, + "creator": { + "type": "string" + }, + "environment": { + "type": "string" + }, + "instance_audit_plan_id": { + "type": "integer" + }, + "instance_id": { + "type": "string" + }, + "instance_name": { + "type": "string" + }, + "instance_type": { + "type": "string" + } + } + }, + "v2.InstanceResV2": { + "type": "object", + "properties": { + "additional_params": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.InstanceAdditionalParamResV1" + } + }, + "db_host": { + "type": "string", + "example": "10.10.10.10" + }, + "db_port": { + "type": "string", + "example": "3306" + }, + "db_type": { + "type": "string", + "example": "mysql" + }, + "db_user": { + "type": "string", + "example": "root" + }, + "desc": { + "type": "string", + "example": "this is a instance" + }, + "environment_tag_color": { + "type": "string" + }, + "environment_tag_name": { + "type": "string" + }, + "environment_tag_uid": { + "type": "string" + }, + "instance_name": { + "type": "string" + }, + "maintenance_times": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.MaintenanceTimeResV1" + } + }, + "rule_template": { + "type": "object", + "$ref": "#/definitions/v2.RuleTemplateV2" + }, + "source": { + "type": "string", + "example": "SQLE" + }, + "sql_query_config": { + "type": "object", + "$ref": "#/definitions/v1.SQLQueryConfigResV1" + } + } + }, + "v2.InstanceTipResV2": { + "type": "object", + "properties": { + "backup_max_rows": { + "type": "integer" + }, + "enable_backup": { + "type": "boolean" + }, + "environment_tag_color": { + "type": "string" + }, + "environment_tag_name": { + "type": "string" + }, + "environment_tag_uid": { + "type": "string" + }, + "host": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "instance_name": { + "type": "string" + }, + "instance_type": { + "type": "string" + }, + "port": { + "type": "string" + }, + "supported_backup_strategy": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "none", + "manual", + "reverse_sql", + "original_row" + ] + } + }, + "workflow_template_id": { + "type": "integer" + } + } + }, + "v2.OptimizationRecord": { + "type": "object", + "properties": { + "adoption_rate": { + "description": "优化采纳率", + "type": "number" + }, + "created_time": { + "description": "创建时间", + "type": "string" + }, + "created_user": { + "description": "创建人", + "type": "string" + }, + "db_type": { + "description": "数据库类型", + "type": "string" + }, + "instance_name": { + "description": "数据源", + "type": "string" + }, + "number_of_index": { + "description": "优化索引数量", + "type": "integer" + }, + "number_of_rule": { + "description": "优化规则数量", + "type": "integer" + }, + "optimization_id": { + "description": "优化ID", + "type": "string" + }, + "optimization_name": { + "type": "string" + }, + "performance_improve": { + "description": "优化提升性能", + "type": "number" + }, + "status": { + "description": "优化状态", + "type": "string", + "enum": [ + "optimizing", + "failed", + "finish" + ] + }, + "status_detail": { + "description": "优化状态详情", + "type": "string" + } + } + }, + "v2.OptimizationSQLDetail": { + "type": "object", + "properties": { + "advised_index": { + "description": "索引建议详情", + "type": "object", + "$ref": "#/definitions/sql_flash.AdvisedIndex" + }, + "id": { + "type": "integer" + }, + "metadata": { + "description": "数据库元数据信息", + "type": "string" + }, + "optimization_id": { + "type": "string" + }, + "optimize": { + "description": "优化详情", + "type": "object", + "$ref": "#/definitions/sql_flash.OptimizeDetail" + }, + "optimize_status": { + "description": "优化状态", + "type": "string", + "enum": [ + "optimizing", + "failed", + "finish" + ] + }, + "optimized_sql_feedbacks": { + "description": "优化后的SQL反馈", + "type": "array", + "items": { + "$ref": "#/definitions/v2.OptimizedSQLFeedback" + } + }, + "origin_query_plan": { + "description": "原始SQL查询计划", + "type": "object", + "$ref": "#/definitions/sql_flash.QueryPlan" + }, + "origin_sql": { + "description": "SQL Flash相关字段", + "type": "string" + }, + "status": { + "description": "SQLe 维护的状态", + "type": "string", + "enum": [ + "rewriting", + "rewrite_done", + "advise_indexing", + "advise_index_done", + "finish", + "failed" + ] + }, + "status_detail": { + "description": "SQLe 维护的状态详情", + "type": "string" + }, + "total_analysis": { + "description": "总体分析", + "type": "object", + "$ref": "#/definitions/sql_flash.TotalAnalysis" + }, + "total_state": { + "description": "总状态", + "type": "string" + } + } + }, + "v2.OptimizeSQLReq": { + "type": "object", + "properties": { + "db_type": { + "type": "string", + "example": "MySQL" + }, + "enable_high_analysis": { + "description": "是否启用高级分析", + "type": "boolean" + }, + "explain_info": { + "type": "string" + }, + "instance_name": { + "type": "string", + "example": "instance1" + }, + "metadata": { + "type": "string" + }, + "optimization_name": { + "type": "string", + "example": "optmz_2024031412091244" + }, + "schema_name": { + "type": "string", + "example": "schema1" + }, + "sql_content": { + "type": "string", + "example": "select * from t1; select * from t2;" + } + } + }, + "v2.OptimizeSQLRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v2.OptimizeSQLResData" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, + "v2.OptimizeSQLResData": { + "type": "object", + "properties": { + "sql_optimization_record_id": { + "type": "string" + } + } }, - "environment_tag_name": { - "type": "string" + "v2.OptimizedSQLFeedback": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "creator": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "reason": { + "type": "string" + }, + "vote": { + "type": "string", + "enum": [ + "agree", + "disagree" + ] + } + } + }, + "v2.OptimizedSQLFeedbackReq": { + "type": "object", + "properties": { + "reason": { + "type": "string", + "example": "the sql is not optimized" + }, + "vote": { + "type": "string", + "enum": [ + "agree", + "disagree" + ], + "example": "agree" + } + } + }, + "v2.PartialSyncAuditPlanSQLsReqV2": { + "type": "object", + "properties": { + "audit_plan_sql_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.AuditPlanSQLReqV2" + } + } + } }, - "environment_tag_uid": { - "type": "string" + "v2.PerformanceStatistics": { + "type": "object", + "properties": { + "affect_rows": { + "type": "object", + "$ref": "#/definitions/v2.AffectRows" + } + } }, - "host": { - "type": "string" + "v2.RejectWorkflowReqV2": { + "type": "object", + "properties": { + "reason": { + "type": "string" + } + } }, - "instance_id": { - "type": "string" + "v2.RuleTemplateV2": { + "type": "object", + "properties": { + "is_global_rule_template": { + "type": "boolean" + }, + "name": { + "type": "string" + } + } }, - "instance_name": { - "type": "string" + "v2.SQLExplain": { + "type": "object", + "properties": { + "classic_result": { + "type": "object", + "$ref": "#/definitions/v1.ExplainClassicResult" + }, + "cost": { + "type": "number" + }, + "err_message": { + "type": "string" + }, + "sql": { + "type": "string" + } + } + }, + "v2.SqlManage": { + "type": "object", + "properties": { + "assignees": { + "type": "array", + "items": { + "type": "string" + } + }, + "audit_result": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditResult" + } + }, + "audit_status": { + "type": "string", + "enum": [ + "being_audited" + ] + }, + "endpoints": { + "type": "array", + "items": { + "type": "string" + } + }, + "first_appear_timestamp": { + "type": "string" + }, + "fp_count": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "instance_name": { + "type": "string" + }, + "last_receive_timestamp": { + "type": "string" + }, + "priority": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "schema_name": { + "type": "string" + }, + "source": { + "type": "object", + "$ref": "#/definitions/v1.Source" + }, + "sql": { + "type": "string" + }, + "sql_fingerprint": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited", + "sent" + ] + } + } + }, + "v2.SqlVersion": { + "type": "object", + "properties": { + "sql_version_id": { + "type": "integer" + }, + "sql_version_name": { + "type": "string" + } + } }, - "instance_type": { - "type": "string" + "v2.TableMetas": { + "type": "object", + "properties": { + "err_message": { + "type": "string" + }, + "table_meta_items": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.TableMeta" + } + } + } + }, + "v2.TaskAnalysisDataV2": { + "type": "object", + "properties": { + "performance_statistics": { + "type": "object", + "$ref": "#/definitions/v2.PerformanceStatistics" + }, + "sql_explain": { + "type": "object", + "$ref": "#/definitions/v2.SQLExplain" + }, + "table_metas": { + "type": "object", + "$ref": "#/definitions/v2.TableMetas" + } + } + }, + "v2.UpdateOptimizedSQLFeedbackReq": { + "type": "object", + "properties": { + "reason": { + "type": "string", + "example": "the sql is not optimized" + }, + "vote": { + "type": "string", + "enum": [ + "agree", + "disagree" + ], + "example": "agree" + } + } + }, + "v2.UpdateWorkflowReqV2": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "task_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "v2.UpdateWorkflowScheduleReqV2": { + "type": "object", + "properties": { + "is_notify": { + "type": "boolean" + }, + "notify_type": { + "type": "string", + "enum": [ + "wechat", + "feishu" + ] + }, + "schedule_time": { + "type": "string" + } + } + }, + "v2.UploadInstanceAuditPlanSQLsReqV2": { + "type": "object", + "properties": { + "audit_plan_sql_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.AuditPlanSQLReqV2" + } + }, + "error_message": { + "type": "string" + } + } + }, + "v2.WorkflowRecordResV2": { + "type": "object", + "properties": { + "assignee_user_name_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "current_step_number": { + "type": "integer" + }, + "executable": { + "type": "boolean" + }, + "executable_reason": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "canceled", + "exec_failed", + "executing", + "finished" + ] + }, + "tasks": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.WorkflowTaskItem" + } + }, + "workflow_step_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.WorkflowStepResV2" + } + } + } + }, + "v2.WorkflowResV2": { + "type": "object", + "properties": { + "associated_rollback_workflows": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.AssociatedRollbackWorkflow" + } + }, + "associated_stage_workflows": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.AssociatedStageWorkflows" + } + }, + "create_time": { + "type": "string" + }, + "create_user_name": { + "type": "string" + }, + "desc": { + "type": "string" + }, + "exec_mode": { + "type": "string", + "enum": [ + "sql_file", + "sqls" + ] + }, + "mode": { + "type": "string", + "enum": [ + "same_sqls", + "different_sqls" + ] + }, + "ops_type": { + "description": "OpsType 运维类型(项目字典解析);未设置或字典项已删时省略,供前端「-」约定", + "type": "object", + "$ref": "#/definitions/dms.OpsType" + }, + "record": { + "type": "object", + "$ref": "#/definitions/v2.WorkflowRecordResV2" + }, + "record_history_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.WorkflowRecordResV2" + } + }, + "sql_version": { + "type": "object", + "$ref": "#/definitions/v2.SqlVersion" + }, + "workflow_id": { + "type": "string" + }, + "workflow_name": { + "type": "string" + }, + "workflow_template_id": { + "type": "integer" + }, + "workflow_template_name": { + "type": "string" + } + } + }, + "v2.WorkflowStepResV2": { + "type": "object", + "properties": { + "assignee_user_name_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "desc": { + "type": "string" + }, + "number": { + "type": "integer" + }, + "operation_time": { + "type": "string" + }, + "operation_user_name": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "state": { + "type": "string", + "enum": [ + "initialized", + "approved", + "rejected" + ] + }, + "type": { + "type": "string", + "enum": [ + "create_workflow", + "update_workflow", + "sql_review", + "sql_execute" + ] + }, + "workflow_step_id": { + "type": "integer" + } + } + }, + "v2.WorkflowTaskItem": { + "type": "object", + "properties": { + "task_id": { + "type": "integer" + } + } }, - "port": { - "type": "string" + "v3.BatchCompleteWorkflowsReqV3": { + "type": "object", + "properties": { + "workflow_list": { + "type": "array", + "items": { + "$ref": "#/definitions/v3.CompleteWorkflowReq" + } + } + } }, - "supported_backup_strategy": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "none", - "manual", - "reverse_sql", - "original_row" - ] - } + "v3.CompleteWorkflowReq": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "workflow_id": { + "type": "string" + } + } }, - "workflow_template_id": { - "type": "integer" - } - } - }, - "OptimizedSQLFeedback": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "creator": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "reason": { - "type": "string" - }, - "vote": { - "type": "string", - "enum": [ - "agree", - "disagree" - ] - } - } - }, - "OptimizedSQLFeedbackReq": { - "type": "object", - "properties": { - "reason": { - "type": "string", - "example": "the sql is not optimized" - }, - "vote": { - "type": "string", - "enum": [ - "agree", - "disagree" - ], - "example": "agree" - } - } - }, - "PartialSyncAuditPlanSQLsReqV2": { - "type": "object", - "properties": { - "audit_plan_sql_list": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanSQLReqV2" - } - } - } - }, - "RejectWorkflowReqV2": { - "type": "object", - "properties": { - "reason": { - "type": "string" - } - } - }, - "RuleTemplateV2": { - "type": "object", - "properties": { - "is_global_rule_template": { - "type": "boolean" - }, - "name": { - "type": "string" - } - } - }, - "SqlVersion": { - "type": "object", - "properties": { - "sql_version_id": { - "type": "integer" - }, - "sql_version_name": { - "type": "string" - } - } - }, - "TaskAnalysisDataV2": { - "type": "object", - "properties": { - "performance_statistics": { - "type": "object", - "$ref": "#/definitions/PerformanceStatistics" - }, - "sql_explain": { - "type": "object", - "$ref": "#/definitions/SQLExplain" - }, - "table_metas": { - "type": "object", - "$ref": "#/definitions/TableMetas" - } - } - }, - "UpdateOptimizedSQLFeedbackReq": { - "type": "object", - "properties": { - "reason": { - "type": "string", - "example": "the sql is not optimized" - }, - "vote": { - "type": "string", - "enum": [ - "agree", - "disagree" - ], - "example": "agree" - } - } - }, - "UpdateWorkflowReqV2": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "task_ids": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "UpdateWorkflowScheduleReqV2": { - "type": "object", - "properties": { - "is_notify": { - "type": "boolean" - }, - "notify_type": { - "type": "string", - "enum": [ - "wechat", - "feishu" - ] - }, - "schedule_time": { - "type": "string" - } - } - }, - "UploadInstanceAuditPlanSQLsReqV2": { - "type": "object", - "properties": { - "audit_plan_sql_list": { - "type": "array", - "items": { - "$ref": "#/definitions/AuditPlanSQLReqV2" - } - }, - "error_message": { - "type": "string" - } - } - }, - "WorkflowRecordResV2": { - "type": "object", - "properties": { - "assignee_user_name_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "current_step_number": { - "type": "integer" - }, - "executable": { - "type": "boolean" - }, - "executable_reason": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "wait_for_audit", - "wait_for_execution", - "rejected", - "canceled", - "exec_failed", - "executing", - "finished" - ] - }, - "tasks": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkflowTaskItem" - } - }, - "workflow_step_list": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkflowStepResV2" - } - } - } - }, - "WorkflowResV2": { - "type": "object", - "properties": { - "associated_rollback_workflows": { - "type": "array", - "items": { - "$ref": "#/definitions/AssociatedRollbackWorkflow" - } - }, - "associated_stage_workflows": { - "type": "array", - "items": { - "$ref": "#/definitions/AssociatedStageWorkflows" - } - }, - "create_time": { - "type": "string" - }, - "create_user_name": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "exec_mode": { - "type": "string", - "enum": [ - "sql_file", - "sqls" - ] - }, - "mode": { - "type": "string", - "enum": [ - "same_sqls", - "different_sqls" - ] - }, - "ops_type": { - "description": "OpsType 运维类型(项目字典解析);未设置或字典项已删时省略,供前端「-」约定", - "type": "object", - "$ref": "#/definitions/OpsType" - }, - "record": { - "type": "object", - "$ref": "#/definitions/WorkflowRecordResV2" - }, - "record_history_list": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkflowRecordResV2" - } - }, - "sql_version": { - "type": "object", - "$ref": "#/definitions/SqlVersion" - }, - "workflow_id": { - "type": "string" - }, - "workflow_name": { - "type": "string" - }, - "workflow_template_id": { - "type": "integer" - }, - "workflow_template_name": { - "type": "string" - } - } - }, - "WorkflowStepResV2": { - "type": "object", - "properties": { - "assignee_user_name_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "desc": { - "type": "string" - }, - "number": { - "type": "integer" - }, - "operation_time": { - "type": "string" - }, - "operation_user_name": { - "type": "string" - }, - "reason": { - "type": "string" - }, - "state": { - "type": "string", - "enum": [ - "initialized", - "approved", - "rejected" - ] - }, - "type": { - "type": "string", - "enum": [ - "create_workflow", - "update_workflow", - "sql_review", - "sql_execute" - ] - }, - "workflow_step_id": { - "type": "integer" - } - } - }, - "BatchCompleteWorkflowsReqV3": { - "type": "object", - "properties": { - "workflow_list": { - "type": "array", - "items": { - "$ref": "#/definitions/CompleteWorkflowReq" - } - } - } - }, - "CompleteWorkflowReq": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "workflow_id": { - "type": "string" + "v3.GetSqlManageListResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v3.SqlManage" + } + }, + "message": { + "type": "string", + "example": "ok" + }, + "sql_manage_bad_num": { + "type": "integer" + }, + "sql_manage_optimized_num": { + "type": "integer" + }, + "sql_manage_total_num": { + "type": "integer" + } + } + }, + "v3.SqlManage": { + "type": "object", + "properties": { + "assignees": { + "type": "array", + "items": { + "type": "string" + } + }, + "audit_result": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.AuditResult" + } + }, + "audit_status": { + "type": "string", + "enum": [ + "being_audited" + ] + }, + "endpoints": { + "type": "array", + "items": { + "type": "string" + } + }, + "first_appear_timestamp": { + "type": "string" + }, + "fp_count": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "instance_name": { + "type": "string" + }, + "last_receive_timestamp": { + "type": "string" + }, + "priority": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "schema_name": { + "type": "string" + }, + "source": { + "type": "object", + "$ref": "#/definitions/v1.Source" + }, + "sql": { + "type": "string" + }, + "sql_fingerprint": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "unhandled", + "solved", + "ignored", + "manual_audited", + "sent" + ] + } + } + } + }, + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "name": "Authorization", + "in": "header" } - } - } - }, - "securityDefinitions": { - "ApiKeyAuth": { - "type": "apiKey", - "name": "Authorization", - "in": "header" } - } } \ No newline at end of file diff --git a/sqle/docs/swagger.yaml b/sqle/docs/swagger.yaml index 61a9291ae..25e891842 100644 --- a/sqle/docs/swagger.yaml +++ b/sqle/docs/swagger.yaml @@ -184,9 +184,6 @@ definitions: type: object dashboard.GlobalWorkflowListItem: properties: - assignee: - description: 当前处理人姓名 - type: string create_user_name: type: string created_at: @@ -1860,8 +1857,6 @@ definitions: properties: db_type: type: string - default_port: - type: integer params: items: $ref: '#/definitions/v1.InstanceAdditionalParamResV1'