diff --git a/api/swagger.json b/api/dms/swagger.json
similarity index 61%
rename from api/swagger.json
rename to api/dms/swagger.json
index c2f87db5..da454fd7 100644
--- a/api/swagger.json
+++ b/api/dms/swagger.json
@@ -2942,197 +2942,6 @@
}
},
"definitions": {
- "AddDBServicePreCheckReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
- "AddDBServiceReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "Add db service reply",
- "type": "object",
- "properties": {
- "uid": {
- "description": "db service UID",
- "type": "string",
- "x-go-name": "Uid"
- }
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "AddDatabaseSourceServiceReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "add database source service reply",
- "type": "object",
- "properties": {
- "uid": {
- "description": "db service UID",
- "type": "string",
- "x-go-name": "Uid"
- }
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "AddMemberGroupReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "Add member group reply",
- "type": "object",
- "properties": {
- "id": {
- "description": "member group ID",
- "type": "string",
- "x-go-name": "Id"
- }
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "AddMemberReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "Add member reply",
- "type": "object",
- "properties": {
- "uid": {
- "description": "member UID",
- "type": "string",
- "x-go-name": "Uid"
- }
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "AddProjectReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "Add Project reply",
- "type": "object",
- "properties": {
- "uid": {
- "description": "Project UID",
- "type": "string",
- "x-go-name": "Uid"
- }
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "AddRoleReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "Add role reply",
- "type": "object",
- "properties": {
- "uid": {
- "description": "role UID",
- "type": "string",
- "x-go-name": "Uid"
- }
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
"AddSession": {
"description": "Use this struct to add a new session",
"type": "object",
@@ -3154,93 +2963,6 @@
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
- "AddSessionReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "Add user reply",
- "type": "object",
- "properties": {
- "token": {
- "description": "Session token",
- "type": "string",
- "x-go-name": "Token"
- }
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "AddUserGroupReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "Add user group reply",
- "type": "object",
- "properties": {
- "uid": {
- "description": "user group UID",
- "type": "string",
- "x-go-name": "Uid"
- }
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "AddUserReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "Add user reply",
- "type": "object",
- "properties": {
- "uid": {
- "description": "user UID",
- "type": "string",
- "x-go-name": "Uid"
- }
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
"AdditionalParam": {
"type": "object",
"properties": {
@@ -3263,99 +2985,6 @@
},
"x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
},
- "BasicInfo": {
- "type": "object",
- "properties": {
- "components": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/ComponentNameWithVersion"
- },
- "x-go-name": "Components"
- },
- "logo_url": {
- "type": "string",
- "x-go-name": "LogoUrl"
- },
- "title": {
- "type": "string",
- "x-go-name": "Title"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "BindOauth2UserReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/BindOauth2UserResData"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "BindOauth2UserResData": {
- "type": "object",
- "properties": {
- "token": {
- "type": "string",
- "x-go-name": "Token"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "CheckDBServiceIsConnectableReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/CheckDBServiceIsConnectableReplyItem"
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "CheckDBServiceIsConnectableReplyItem": {
- "type": "object",
- "properties": {
- "component": {
- "type": "string",
- "x-go-name": "Component"
- },
- "connect_error_message": {
- "type": "string",
- "x-go-name": "ConnectErrorMessage"
- },
- "is_connectable": {
- "type": "boolean",
- "x-go-name": "IsConnectable"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
"CheckDbConnectable": {
"type": "object",
"required": [
@@ -3407,37 +3036,6 @@
},
"x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
},
- "CompanyNotice": {
- "description": "A companynotice",
- "type": "object",
- "properties": {
- "notice_str": {
- "description": "companynotice info",
- "type": "string",
- "x-go-name": "NoticeStr"
- },
- "read_by_current_user": {
- "description": "current user has been read",
- "type": "boolean",
- "x-go-name": "ReadByCurrentUser"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "ComponentNameWithVersion": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "x-go-name": "Name"
- },
- "version": {
- "type": "string",
- "x-go-name": "Version"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
"DBService": {
"description": "A db service",
"type": "object",
@@ -3550,1761 +3148,130 @@
},
"x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
},
- "DatabaseDriverAdditionalParam": {
+ "DatabaseSourceService": {
"type": "object",
+ "required": [
+ "name",
+ "source",
+ "version",
+ "url",
+ "db_type",
+ "cron_express"
+ ],
"properties": {
- "description": {
- "type": "string",
- "x-go-name": "Description"
- },
- "name": {
- "type": "string",
- "x-go-name": "Name"
- },
- "type": {
- "type": "string",
- "x-go-name": "Type"
- },
- "value": {
- "type": "string",
- "x-go-name": "Value"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "DatabaseDriverOption": {
- "type": "object",
- "properties": {
- "db_type": {
- "type": "string",
- "x-go-name": "DBType"
- },
- "logo_path": {
- "type": "string",
- "x-go-name": "LogoPath"
- },
- "params": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/DatabaseDriverAdditionalParam"
- },
- "x-go-name": "Params"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "DatabaseSource": {
- "type": "object",
- "properties": {
- "db_types": {
- "description": "database type",
- "type": "array",
- "items": {
- "type": "string"
- },
- "x-go-name": "DbTypes",
- "example": "MySQL"
- },
- "source": {
- "description": "database source",
- "type": "string",
- "x-go-name": "Source",
- "example": "actiontech-dmp"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "DatabaseSourceService": {
- "type": "object",
- "required": [
- "name",
- "source",
- "version",
- "url",
- "db_type",
- "cron_express"
- ],
- "properties": {
- "cron_express": {
- "description": "cron expression",
- "type": "string",
- "x-go-name": "CronExpress",
- "example": "0 0 * * *"
- },
- "db_type": {
- "description": "database type",
- "type": "string",
- "x-go-name": "DbType",
- "example": "MySQL"
- },
- "name": {
- "description": "name",
- "type": "string",
- "x-go-name": "Name",
- "example": "dmp"
- },
- "source": {
- "description": "source",
- "type": "string",
- "x-go-name": "Source",
- "example": "actiontech-dmp"
- },
- "sqle_config": {
- "$ref": "#/definitions/SQLEConfig"
- },
- "url": {
- "description": "addr",
- "type": "string",
- "x-go-name": "URL",
- "example": "http://10.186.62.56:10000"
- },
- "version": {
- "description": "version",
- "type": "string",
- "x-go-name": "Version",
- "example": "5.23.01.0"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "DelDBServicePreCheckReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
- "DelUserGroupPreCheckReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
- "DelUserPreCheckReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
- "FeishuConfigurationResData": {
- "type": "object",
- "properties": {
- "app_id": {
- "type": "string",
- "x-go-name": "AppID"
- },
- "is_feishu_notification_enabled": {
- "type": "boolean",
- "x-go-name": "IsFeishuNotificationEnabled"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GenericResp": {
- "description": "GenericResp defines the return code and msg",
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/base/v1"
- },
- "GetBasicInfoReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/BasicInfo"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetCompanyNoticeReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/CompanyNotice"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetDatabaseSourceService": {
- "type": "object",
- "required": [
- "name",
- "source",
- "version",
- "url",
- "db_type",
- "cron_express"
- ],
- "properties": {
- "cron_express": {
- "description": "cron expression",
- "type": "string",
- "x-go-name": "CronExpress",
- "example": "0 0 * * *"
- },
- "db_type": {
- "description": "database type",
- "type": "string",
- "x-go-name": "DbType",
- "example": "MySQL"
- },
- "name": {
- "description": "name",
- "type": "string",
- "x-go-name": "Name",
- "example": "dmp"
- },
- "project_uid": {
- "type": "string",
- "x-go-name": "ProjectUid"
- },
- "source": {
- "description": "source",
- "type": "string",
- "x-go-name": "Source",
- "example": "actiontech-dmp"
- },
- "sqle_config": {
- "$ref": "#/definitions/SQLEConfig"
- },
- "uid": {
- "type": "string",
- "x-go-name": "UID"
- },
- "url": {
- "description": "addr",
- "type": "string",
- "x-go-name": "URL",
- "example": "http://10.186.62.56:10000"
- },
- "version": {
- "description": "version",
- "type": "string",
- "x-go-name": "Version",
- "example": "5.23.01.0"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetDatabaseSourceServiceReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/GetDatabaseSourceService"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetFeishuConfigurationReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/FeishuConfigurationResData"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetLDAPConfigurationResDataReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/LDAPConfigurationResData"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-name": "GetLDAPConfigurationReply",
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetMemberGroup": {
- "type": "object",
- "properties": {
- "is_project_admin": {
- "description": "Whether the member has project admin permission",
- "type": "boolean",
- "x-go-name": "IsProjectAdmin"
- },
- "name": {
- "type": "string",
- "x-go-name": "Name"
- },
- "role_with_op_ranges": {
- "description": "member op permission",
- "type": "array",
- "items": {
- "$ref": "#/definitions/ListMemberRoleWithOpRange"
- },
- "x-go-name": "RoleWithOpRanges"
- },
- "uid": {
- "description": "member group uid",
- "type": "string",
- "x-go-name": "Uid"
- },
- "users": {
- "description": "member user",
- "type": "array",
- "items": {
- "$ref": "#/definitions/UidWithName"
- },
- "x-go-name": "Users"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetMemberGroupReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/GetMemberGroup"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetOauth2ConfigurationResData": {
- "type": "object",
- "properties": {
- "access_token_tag": {
- "type": "string",
- "x-go-name": "AccessTokenTag"
- },
- "client_host": {
- "type": "string",
- "x-go-name": "ClientHost"
- },
- "client_id": {
- "type": "string",
- "x-go-name": "ClientID"
- },
- "enable_oauth2": {
- "type": "boolean",
- "x-go-name": "EnableOauth2"
- },
- "login_tip": {
- "type": "string",
- "x-go-name": "LoginTip"
- },
- "scopes": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "x-go-name": "Scopes"
- },
- "server_auth_url": {
- "type": "string",
- "x-go-name": "ServerAuthUrl"
- },
- "server_token_url": {
- "type": "string",
- "x-go-name": "ServerTokenUrl"
- },
- "server_user_id_url": {
- "type": "string",
- "x-go-name": "ServerUserIdUrl"
- },
- "user_id_tag": {
- "type": "string",
- "x-go-name": "UserIdTag"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetOauth2ConfigurationResDataReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/GetOauth2ConfigurationResData"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-name": "GetOauth2ConfigurationReply",
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetOauth2TipsReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/GetOauth2TipsResData"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetOauth2TipsResData": {
- "type": "object",
- "properties": {
- "enable_oauth2": {
- "type": "boolean",
- "x-go-name": "EnableOauth2"
- },
- "login_tip": {
- "type": "string",
- "x-go-name": "LoginTip"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetSMTPConfigurationReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/SMTPConfigurationResData"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetSQLQueryConfigurationReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "type": "object",
- "properties": {
- "enable_sql_query": {
- "type": "boolean",
- "x-go-name": "EnableSQLQuery"
- },
- "sql_query_root_uri": {
- "type": "string",
- "x-go-name": "SQLQueryRootURI"
- }
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetUser": {
- "description": "A dms user",
- "type": "object",
- "properties": {
- "authentication_type": {
- "description": "user authentication type\nldap UserAuthenticationTypeLDAP\ndms UserAuthenticationTypeDMS\noauth2 UserAuthenticationTypeOAUTH2\nunknown UserAuthenticationTypeUnknown",
- "type": "string",
- "enum": [
- "ldap",
- "dms",
- "oauth2",
- "unknown"
- ],
- "x-go-enum-desc": "ldap UserAuthenticationTypeLDAP\ndms UserAuthenticationTypeDMS\noauth2 UserAuthenticationTypeOAUTH2\nunknown UserAuthenticationTypeUnknown",
- "x-go-name": "AuthenticationType"
- },
- "email": {
- "description": "user email",
- "type": "string",
- "x-go-name": "Email"
- },
- "is_admin": {
- "description": "is admin",
- "type": "boolean",
- "x-go-name": "IsAdmin"
- },
- "name": {
- "description": "user name",
- "type": "string",
- "x-go-name": "Name"
- },
- "op_permissions": {
- "description": "user operation permissions",
- "type": "array",
- "items": {
- "$ref": "#/definitions/UidWithName"
- },
- "x-go-name": "OpPermissions"
- },
- "phone": {
- "description": "user phone",
- "type": "string",
- "x-go-name": "Phone"
- },
- "stat": {
- "description": "user stat\n正常 StatOK\n被禁用 StatDisable\n未知 StatUnknown",
- "type": "string",
- "enum": [
- "正常",
- "被禁用",
- "未知"
- ],
- "x-go-enum-desc": "正常 StatOK\n被禁用 StatDisable\n未知 StatUnknown",
- "x-go-name": "Stat"
- },
- "uid": {
- "description": "user uid",
- "type": "string",
- "x-go-name": "UserUid"
- },
- "user_bind_projects": {
- "description": "user bind name space",
- "type": "array",
- "items": {
- "$ref": "#/definitions/UserBindProject"
- },
- "x-go-name": "UserBindProjects"
- },
- "user_groups": {
- "description": "user groups",
- "type": "array",
- "items": {
- "$ref": "#/definitions/UidWithName"
- },
- "x-go-name": "UserGroups"
- },
- "wxid": {
- "description": "user wxid",
- "type": "string",
- "x-go-name": "WxID"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
- "GetUserBySessionReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "Get user reply",
- "type": "object",
- "properties": {
- "name": {
- "description": "User name",
- "type": "string",
- "x-go-name": "Name"
- },
- "user_uid": {
- "description": "User UID",
- "type": "string",
- "x-go-name": "UserUid"
- }
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetUserOpPermissionReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "user op permission reply\nis user admin, admin has all permissions",
- "type": "object",
- "properties": {
- "is_admin": {
- "type": "boolean",
- "x-go-name": "IsAdmin"
- },
- "op_permission_list": {
- "description": "user op permissions",
- "type": "array",
- "items": {
- "$ref": "#/definitions/OpPermissionItem"
- },
- "x-go-name": "OpPermissionList"
- }
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
- "GetUserReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/GetUser"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
- "GetWeChatConfigurationReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/WeChatConfigurationResData"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetWebHookConfigurationReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/GetWebHookConfigurationReplyItem"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "GetWebHookConfigurationReplyItem": {
- "type": "object",
- "properties": {
- "enable": {
- "type": "boolean",
- "x-go-name": "Enable"
- },
- "max_retry_times": {
- "description": "minlength(3) maxlength(100)",
- "type": "integer",
- "format": "int64",
- "x-go-name": "MaxRetryTimes"
- },
- "retry_interval_seconds": {
- "type": "integer",
- "format": "int64",
- "x-go-name": "RetryIntervalSeconds"
- },
- "token": {
- "type": "string",
- "x-go-name": "Token"
- },
- "url": {
- "type": "string",
- "x-go-name": "URL"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "IPluginDBService": {
- "type": "object",
- "properties": {
- "Business": {
- "type": "string"
- },
- "DBType": {
- "type": "string"
- },
- "Host": {
- "type": "string"
- },
- "Name": {
- "type": "string"
- },
- "Port": {
- "type": "string"
- },
- "SQLERuleTemplateId": {
- "type": "string"
- },
- "SQLERuleTemplateName": {
- "type": "string"
- },
- "User": {
- "type": "string"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
- "LDAPConfiguration": {
- "type": "object",
- "properties": {
- "enable_ldap": {
- "type": "boolean",
- "x-go-name": "EnableLdap"
- },
- "enable_ssl": {
- "type": "boolean",
- "x-go-name": "EnableSSL"
- },
- "ldap_connect_dn": {
- "type": "string",
- "x-go-name": "LdapConnectDn"
- },
- "ldap_connect_pwd": {
- "type": "string",
- "x-go-name": "LdapConnectPwd"
- },
- "ldap_search_base_dn": {
- "type": "string",
- "x-go-name": "LdapSearchBaseDn"
- },
- "ldap_server_host": {
- "type": "string",
- "x-go-name": "LdapServerHost"
- },
- "ldap_server_port": {
- "type": "string",
- "x-go-name": "LdapServerPort"
- },
- "ldap_user_email_rdn_key": {
- "type": "string",
- "x-go-name": "LdapUserEmailRdnKey"
- },
- "ldap_user_name_rdn_key": {
- "type": "string",
- "x-go-name": "LdapUserNameRdnKey"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "LDAPConfigurationResData": {
- "type": "object",
- "properties": {
- "enable_ldap": {
- "type": "boolean",
- "x-go-name": "EnableLdap"
- },
- "enable_ssl": {
- "type": "boolean",
- "x-go-name": "EnableSSL"
- },
- "ldap_connect_dn": {
- "type": "string",
- "x-go-name": "LdapConnectDn"
- },
- "ldap_search_base_dn": {
- "type": "string",
- "x-go-name": "LdapSearchBaseDn"
- },
- "ldap_server_host": {
- "type": "string",
- "x-go-name": "LdapServerHost"
- },
- "ldap_server_port": {
- "type": "string",
- "x-go-name": "LdapServerPort"
- },
- "ldap_user_email_rdn_key": {
- "type": "string",
- "x-go-name": "LdapUserEmailRdnKey"
- },
- "ldap_user_name_rdn_key": {
- "type": "string",
- "x-go-name": "LdapUserNameRdnKey"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "ListDBService": {
- "description": "A dms db Service",
- "type": "object",
- "properties": {
- "additional_params": {
- "description": "DB Service Custom connection parameters",
- "type": "array",
- "items": {
- "$ref": "#/definitions/AdditionalParam"
- },
- "x-go-name": "AdditionalParams"
- },
- "business": {
- "description": "the db service business name",
- "type": "string",
- "x-go-name": "Business"
- },
- "db_type": {
- "description": "db service DB type",
- "type": "string",
- "x-go-name": "DBType"
- },
- "desc": {
- "description": "DB desc",
- "type": "string",
- "x-go-name": "Desc"
- },
- "host": {
- "description": "db service host",
- "type": "string",
- "x-go-name": "Host"
- },
- "maintenance_times": {
- "description": "DB Service maintenance time",
- "type": "array",
- "items": {
- "$ref": "#/definitions/MaintenanceTime"
- },
- "x-go-name": "MaintenanceTimes"
- },
- "name": {
- "description": "db service name",
- "type": "string",
- "x-go-name": "Name"
- },
- "password": {
- "description": "db service admin encrypted password",
- "type": "string",
- "x-go-name": "Password"
- },
- "port": {
- "description": "db service port",
- "type": "string",
- "x-go-name": "Port"
- },
- "project_uid": {
- "description": "DB project uid",
- "type": "string",
- "x-go-name": "ProjectUID"
- },
- "source": {
- "description": "DB source",
- "type": "string",
- "x-go-name": "Source"
- },
- "sqle_config": {
- "$ref": "#/definitions/SQLEConfig"
- },
- "uid": {
- "description": "db service uid",
- "type": "string",
- "x-go-name": "DBServiceUid"
- },
- "user": {
- "description": "db service admin user",
- "type": "string",
- "x-go-name": "User"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
- "ListDBServiceDriverOptionReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "List db service reply",
- "type": "array",
- "items": {
- "$ref": "#/definitions/DatabaseDriverOption"
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "ListDBServiceReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "List db service reply",
- "type": "array",
- "items": {
- "$ref": "#/definitions/ListDBService"
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- },
- "total_nums": {
- "type": "integer",
- "format": "int64",
- "x-go-name": "Total"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
- "ListDatabaseSourceService": {
- "type": "object",
- "required": [
- "name",
- "source",
- "version",
- "url",
- "db_type",
- "cron_express"
- ],
- "properties": {
- "cron_express": {
- "description": "cron expression",
- "type": "string",
- "x-go-name": "CronExpress",
- "example": "0 0 * * *"
- },
- "db_type": {
- "description": "database type",
- "type": "string",
- "x-go-name": "DbType",
- "example": "MySQL"
- },
- "last_sync_err": {
- "description": "last sync error message",
- "type": "string",
- "x-go-name": "LastSyncErr"
- },
- "last_sync_success_time": {
- "type": "string",
- "format": "date-time",
- "x-go-name": "LastSyncSuccessTime"
- },
- "name": {
- "description": "name",
- "type": "string",
- "x-go-name": "Name",
- "example": "dmp"
- },
- "project_uid": {
- "type": "string",
- "x-go-name": "ProjectUid"
- },
- "source": {
- "description": "source",
- "type": "string",
- "x-go-name": "Source",
- "example": "actiontech-dmp"
- },
- "sqle_config": {
- "$ref": "#/definitions/SQLEConfig"
- },
- "uid": {
- "type": "string",
- "x-go-name": "UID"
- },
- "url": {
- "description": "addr",
- "type": "string",
- "x-go-name": "URL",
- "example": "http://10.186.62.56:10000"
- },
- "version": {
- "description": "version",
- "type": "string",
- "x-go-name": "Version",
- "example": "5.23.01.0"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "ListDatabaseSourceServiceTipsReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/DatabaseSource"
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "ListDatabaseSourceServicesReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/ListDatabaseSourceService"
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "ListMember": {
- "description": "A dms member",
- "type": "object",
- "properties": {
- "is_project_admin": {
- "description": "Whether the member has project admin permission",
- "type": "boolean",
- "x-go-name": "IsProjectAdmin"
- },
- "role_with_op_ranges": {
- "description": "member op permission",
- "type": "array",
- "items": {
- "$ref": "#/definitions/ListMemberRoleWithOpRange"
- },
- "x-go-name": "RoleWithOpRanges"
- },
- "uid": {
- "description": "member uid",
- "type": "string",
- "x-go-name": "MemberUid"
- },
- "user": {
- "$ref": "#/definitions/UidWithName"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "ListMemberGroup": {
- "type": "object",
- "properties": {
- "is_project_admin": {
- "description": "Whether the member has project admin permission",
- "type": "boolean",
- "x-go-name": "IsProjectAdmin"
- },
- "name": {
- "type": "string",
- "x-go-name": "Name"
- },
- "role_with_op_ranges": {
- "description": "member op permission",
- "type": "array",
- "items": {
- "$ref": "#/definitions/ListMemberRoleWithOpRange"
- },
- "x-go-name": "RoleWithOpRanges"
- },
- "uid": {
- "description": "member uid",
- "type": "string",
- "x-go-name": "Uid"
- },
- "users": {
- "description": "member user",
- "type": "array",
- "items": {
- "$ref": "#/definitions/UidWithName"
- },
- "x-go-name": "Users"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "ListMemberGroupsReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "List member reply",
- "type": "array",
- "items": {
- "$ref": "#/definitions/ListMemberGroup"
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- },
- "total_nums": {
- "type": "integer",
- "format": "int64",
- "x-go-name": "Total"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "ListMemberReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "List member reply",
- "type": "array",
- "items": {
- "$ref": "#/definitions/ListMember"
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- },
- "total_nums": {
- "type": "integer",
- "format": "int64",
- "x-go-name": "Total"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "ListMemberRoleWithOpRange": {
- "type": "object",
- "properties": {
- "op_range_type": {
- "description": "op permission range type, only support db service now\nunknown OpRangeTypeUnknown\nglobal OpRangeTypeGlobal 全局权限: 该权限只能被用户使用\nproject OpRangeTypeProject 项目权限: 该权限只能被成员使用\ndb_service OpRangeTypeDBService 项目内的数据源权限: 该权限只能被成员使用",
- "type": "string",
- "enum": [
- "unknown",
- "global",
- "project",
- "db_service"
- ],
- "x-go-enum-desc": "unknown OpRangeTypeUnknown\nglobal OpRangeTypeGlobal 全局权限: 该权限只能被用户使用\nproject OpRangeTypeProject 项目权限: 该权限只能被成员使用\ndb_service OpRangeTypeDBService 项目内的数据源权限: 该权限只能被成员使用",
- "x-go-name": "OpRangeType"
- },
- "range_uids": {
- "description": "op range uids",
- "type": "array",
- "items": {
- "$ref": "#/definitions/UidWithName"
- },
- "x-go-name": "RangeUIDs"
- },
- "role_uid": {
- "$ref": "#/definitions/UidWithName"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "ListMembersForInternalItem": {
- "description": "A dms member for internal",
- "type": "object",
- "properties": {
- "is_admin": {
- "description": "is member project admin, admin has all permissions",
- "type": "boolean",
- "x-go-name": "IsAdmin"
- },
- "member_op_permission_list": {
- "description": "member op permissions",
- "type": "array",
- "items": {
- "$ref": "#/definitions/OpPermissionItem"
- },
- "x-go-name": "MemberOpPermissionList"
- },
- "user": {
- "$ref": "#/definitions/UidWithName"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
- "ListMembersForInternalReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "List member reply",
- "type": "array",
- "items": {
- "$ref": "#/definitions/ListMembersForInternalItem"
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- },
- "total_nums": {
- "type": "integer",
- "format": "int64",
- "x-go-name": "Total"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
- "ListOpPermission": {
- "description": "A dms op permission",
- "type": "object",
- "properties": {
- "description": {
- "type": "string",
- "x-go-name": "Description"
- },
- "op_permission": {
- "$ref": "#/definitions/UidWithName"
- },
- "range_type": {
- "type": "string",
- "enum": [
- "unknown",
- "global",
- "project",
- "db_service"
- ],
- "x-go-enum-desc": "unknown OpRangeTypeUnknown\nglobal OpRangeTypeGlobal 全局权限: 该权限只能被用户使用\nproject OpRangeTypeProject 项目权限: 该权限只能被成员使用\ndb_service OpRangeTypeDBService 项目内的数据源权限: 该权限只能被成员使用",
- "x-go-name": "RangeType"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "ListOpPermissionReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "List op_permission reply",
- "type": "array",
- "items": {
- "$ref": "#/definitions/ListOpPermission"
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- },
- "total_nums": {
- "type": "integer",
- "format": "int64",
- "x-go-name": "Total"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "ListProject": {
- "description": "A dms Project",
- "type": "object",
- "properties": {
- "archived": {
- "description": "Project is archived",
- "type": "boolean",
- "x-go-name": "Archived"
- },
- "create_time": {
- "description": "create time",
- "type": "string",
- "format": "date-time",
- "x-go-name": "CreateTime"
- },
- "create_user": {
- "$ref": "#/definitions/UidWithName"
- },
- "desc": {
- "description": "Project desc",
- "type": "string",
- "x-go-name": "Desc"
- },
- "name": {
- "description": "Project name",
- "type": "string",
- "x-go-name": "Name"
- },
- "uid": {
- "description": "Project uid",
- "type": "string",
- "x-go-name": "ProjectUid"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
- "ListProjectReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "List project reply",
- "type": "array",
- "items": {
- "$ref": "#/definitions/ListProject"
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
+ "cron_express": {
+ "description": "cron expression",
"type": "string",
- "x-go-name": "Message"
+ "x-go-name": "CronExpress",
+ "example": "0 0 * * *"
},
- "total_nums": {
- "type": "integer",
- "format": "int64",
- "x-go-name": "Total"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
- "ListRole": {
- "description": "A dms role",
- "type": "object",
- "properties": {
- "desc": {
- "description": "role desc",
+ "db_type": {
+ "description": "database type",
"type": "string",
- "x-go-name": "Desc"
+ "x-go-name": "DbType",
+ "example": "MySQL"
},
"name": {
- "description": "role name",
- "type": "string",
- "x-go-name": "Name"
- },
- "op_permissions": {
- "description": "op permissions",
- "type": "array",
- "items": {
- "$ref": "#/definitions/UidWithName"
- },
- "x-go-name": "OpPermissions"
- },
- "stat": {
- "description": "role stat\n正常 StatOK\n被禁用 StatDisable\n未知 StatUnknown",
+ "description": "name",
"type": "string",
- "enum": [
- "正常",
- "被禁用",
- "未知"
- ],
- "x-go-enum-desc": "正常 StatOK\n被禁用 StatDisable\n未知 StatUnknown",
- "x-go-name": "Stat"
+ "x-go-name": "Name",
+ "example": "dmp"
},
- "uid": {
- "description": "role uid",
+ "source": {
+ "description": "source",
"type": "string",
- "x-go-name": "RoleUid"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "ListRoleReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
+ "x-go-name": "Source",
+ "example": "actiontech-dmp"
},
- "data": {
- "description": "List role reply",
- "type": "array",
- "items": {
- "$ref": "#/definitions/ListRole"
- },
- "x-go-name": "Data"
+ "sqle_config": {
+ "$ref": "#/definitions/SQLEConfig"
},
- "message": {
- "description": "message",
+ "url": {
+ "description": "addr",
"type": "string",
- "x-go-name": "Message"
+ "x-go-name": "URL",
+ "example": "http://10.186.62.56:10000"
},
- "total_nums": {
- "type": "integer",
- "format": "int64",
- "x-go-name": "Total"
+ "version": {
+ "description": "version",
+ "type": "string",
+ "x-go-name": "Version",
+ "example": "5.23.01.0"
}
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
- "ListUser": {
- "description": "A dms user",
+ "IPluginDBService": {
"type": "object",
"properties": {
- "authentication_type": {
- "description": "user authentication type\nldap UserAuthenticationTypeLDAP\ndms UserAuthenticationTypeDMS\noauth2 UserAuthenticationTypeOAUTH2\nunknown UserAuthenticationTypeUnknown",
- "type": "string",
- "enum": [
- "ldap",
- "dms",
- "oauth2",
- "unknown"
- ],
- "x-go-enum-desc": "ldap UserAuthenticationTypeLDAP\ndms UserAuthenticationTypeDMS\noauth2 UserAuthenticationTypeOAUTH2\nunknown UserAuthenticationTypeUnknown",
- "x-go-name": "AuthenticationType"
- },
- "email": {
- "description": "user email",
- "type": "string",
- "x-go-name": "Email"
- },
- "is_deleted": {
- "description": "user is deleted",
- "type": "boolean",
- "x-go-name": "IsDeleted"
+ "Business": {
+ "type": "string"
},
- "name": {
- "description": "user name",
- "type": "string",
- "x-go-name": "Name"
+ "DBType": {
+ "type": "string"
},
- "op_permissions": {
- "description": "user operation permissions",
- "type": "array",
- "items": {
- "$ref": "#/definitions/UidWithName"
- },
- "x-go-name": "OpPermissions"
+ "Host": {
+ "type": "string"
},
- "phone": {
- "description": "user phone",
- "type": "string",
- "x-go-name": "Phone"
+ "Name": {
+ "type": "string"
},
- "stat": {
- "description": "user stat\n正常 StatOK\n被禁用 StatDisable\n未知 StatUnknown",
- "type": "string",
- "enum": [
- "正常",
- "被禁用",
- "未知"
- ],
- "x-go-enum-desc": "正常 StatOK\n被禁用 StatDisable\n未知 StatUnknown",
- "x-go-name": "Stat"
+ "Port": {
+ "type": "string"
},
- "uid": {
- "description": "user uid",
- "type": "string",
- "x-go-name": "UserUid"
+ "SQLERuleTemplateId": {
+ "type": "string"
},
- "user_groups": {
- "description": "user groups",
- "type": "array",
- "items": {
- "$ref": "#/definitions/UidWithName"
- },
- "x-go-name": "UserGroups"
+ "SQLERuleTemplateName": {
+ "type": "string"
},
- "wxid": {
- "description": "user wxid",
- "type": "string",
- "x-go-name": "WxID"
+ "User": {
+ "type": "string"
}
},
"x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
},
- "ListUserGroup": {
- "description": "A dms user group",
+ "LDAPConfiguration": {
"type": "object",
"properties": {
- "desc": {
- "description": "user group description",
- "type": "string",
- "x-go-name": "Desc"
+ "enable_ldap": {
+ "type": "boolean",
+ "x-go-name": "EnableLdap"
},
- "name": {
- "description": "user group name",
- "type": "string",
- "x-go-name": "Name"
+ "enable_ssl": {
+ "type": "boolean",
+ "x-go-name": "EnableSSL"
},
- "stat": {
- "description": "user group stat\n正常 StatOK\n被禁用 StatDisable\n未知 StatUnknown",
+ "ldap_connect_dn": {
"type": "string",
- "enum": [
- "正常",
- "被禁用",
- "未知"
- ],
- "x-go-enum-desc": "正常 StatOK\n被禁用 StatDisable\n未知 StatUnknown",
- "x-go-name": "Stat"
+ "x-go-name": "LdapConnectDn"
},
- "uid": {
- "description": "user group uid",
+ "ldap_connect_pwd": {
"type": "string",
- "x-go-name": "UserGroupUid"
- },
- "users": {
- "description": "users",
- "type": "array",
- "items": {
- "$ref": "#/definitions/UidWithName"
- },
- "x-go-name": "Users"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "ListUserGroupReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "List user reply",
- "type": "array",
- "items": {
- "$ref": "#/definitions/ListUserGroup"
- },
- "x-go-name": "Data"
+ "x-go-name": "LdapConnectPwd"
},
- "message": {
- "description": "message",
+ "ldap_search_base_dn": {
"type": "string",
- "x-go-name": "Message"
+ "x-go-name": "LdapSearchBaseDn"
},
- "total_nums": {
- "type": "integer",
- "format": "int64",
- "x-go-name": "Total"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "ListUserReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
+ "ldap_server_host": {
+ "type": "string",
+ "x-go-name": "LdapServerHost"
},
- "data": {
- "description": "List user reply",
- "type": "array",
- "items": {
- "$ref": "#/definitions/ListUser"
- },
- "x-go-name": "Data"
+ "ldap_server_port": {
+ "type": "string",
+ "x-go-name": "LdapServerPort"
},
- "message": {
- "description": "message",
+ "ldap_user_email_rdn_key": {
"type": "string",
- "x-go-name": "Message"
+ "x-go-name": "LdapUserEmailRdnKey"
},
- "total_nums": {
- "type": "integer",
- "format": "int64",
- "x-go-name": "Total"
+ "ldap_user_name_rdn_key": {
+ "type": "string",
+ "x-go-name": "LdapUserNameRdnKey"
}
},
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
+ "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"MaintenanceTime": {
"type": "object",
@@ -5434,23 +3401,6 @@
},
"x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
},
- "NotificationReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
"Oauth2Configuration": {
"type": "object",
"properties": {
@@ -5472,100 +3422,38 @@
},
"enable_oauth2": {
"type": "boolean",
- "x-go-name": "EnableOauth2"
- },
- "login_tip": {
- "type": "string",
- "maximum": 28,
- "x-go-name": "LoginTip"
- },
- "scopes": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "x-go-name": "Scopes"
- },
- "server_auth_url": {
- "type": "string",
- "x-go-name": "ServerAuthUrl"
- },
- "server_token_url": {
- "type": "string",
- "x-go-name": "ServerTokenUrl"
- },
- "server_user_id_url": {
- "type": "string",
- "x-go-name": "ServerUserIdUrl"
- },
- "user_id_tag": {
- "type": "string",
- "x-go-name": "UserIdTag"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "OpPermissionItem": {
- "type": "object",
- "properties": {
- "op_permission_type": {
- "description": "op permission type\nunknown OpPermissionTypeUnknown\ncreate_project OpPermissionTypeCreateProject 创建项目;创建项目的用户自动拥有该项目管理权限\nproject_admin OpPermissionTypeProjectAdmin 项目管理;拥有该权限的用户可以管理项目下的所有资源\ncreate_workflow OpPermissionTypeCreateWorkflow 创建/编辑工单;拥有该权限的用户可以创建/编辑工单\naudit_workflow OpPermissionTypeAuditWorkflow 审核/驳回工单;拥有该权限的用户可以审核/驳回工单\nauth_db_service_data OpPermissionTypeAuthDBServiceData 授权数据源数据权限;拥有该权限的用户可以授权数据源数据权限\nview_others_workflow OpPermissionTypeViewOthersWorkflow 查看其他工单权限\nexecute_workflow OpPermissionTypeExecuteWorkflow 上线工单;拥有该权限的用户可以上线工单\nview_other_audit_plan OpPermissionTypeViewOtherAuditPlan 查看其他扫描任务权限\nsave_audit_plan OpPermissionTypeSaveAuditPlan 创建扫描任务权限;拥有该权限的用户可以创建/更新扫描任务\nsql_query OpPermissionTypeSQLQuery SQL查询;SQL查询权限",
- "type": "string",
- "enum": [
- "unknown",
- "create_project",
- "project_admin",
- "create_workflow",
- "audit_workflow",
- "auth_db_service_data",
- "view_others_workflow",
- "execute_workflow",
- "view_other_audit_plan",
- "save_audit_plan",
- "sql_query"
- ],
- "x-go-enum-desc": "unknown OpPermissionTypeUnknown\ncreate_project OpPermissionTypeCreateProject 创建项目;创建项目的用户自动拥有该项目管理权限\nproject_admin OpPermissionTypeProjectAdmin 项目管理;拥有该权限的用户可以管理项目下的所有资源\ncreate_workflow OpPermissionTypeCreateWorkflow 创建/编辑工单;拥有该权限的用户可以创建/编辑工单\naudit_workflow OpPermissionTypeAuditWorkflow 审核/驳回工单;拥有该权限的用户可以审核/驳回工单\nauth_db_service_data OpPermissionTypeAuthDBServiceData 授权数据源数据权限;拥有该权限的用户可以授权数据源数据权限\nview_others_workflow OpPermissionTypeViewOthersWorkflow 查看其他工单权限\nexecute_workflow OpPermissionTypeExecuteWorkflow 上线工单;拥有该权限的用户可以上线工单\nview_other_audit_plan OpPermissionTypeViewOtherAuditPlan 查看其他扫描任务权限\nsave_audit_plan OpPermissionTypeSaveAuditPlan 创建扫描任务权限;拥有该权限的用户可以创建/更新扫描任务\nsql_query OpPermissionTypeSQLQuery SQL查询;SQL查询权限",
- "x-go-name": "OpPermissionType"
- },
- "range_type": {
- "description": "object type of RangeUids\nunknown OpRangeTypeUnknown\nglobal OpRangeTypeGlobal 全局权限: 该权限只能被用户使用\nproject OpRangeTypeProject 项目权限: 该权限只能被成员使用\ndb_service OpRangeTypeDBService 项目内的数据源权限: 该权限只能被成员使用",
- "type": "string",
- "enum": [
- "unknown",
- "global",
- "project",
- "db_service"
- ],
- "x-go-enum-desc": "unknown OpRangeTypeUnknown\nglobal OpRangeTypeGlobal 全局权限: 该权限只能被用户使用\nproject OpRangeTypeProject 项目权限: 该权限只能被成员使用\ndb_service OpRangeTypeDBService 项目内的数据源权限: 该权限只能被成员使用",
- "x-go-name": "RangeType"
+ "x-go-name": "EnableOauth2"
},
- "range_uids": {
- "description": "object uids, object type is defined by RangeType",
+ "login_tip": {
+ "type": "string",
+ "maximum": 28,
+ "x-go-name": "LoginTip"
+ },
+ "scopes": {
"type": "array",
"items": {
"type": "string"
},
- "x-go-name": "RangeUids"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
- "OperateDataResourceHandleReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
+ "x-go-name": "Scopes"
},
- "message": {
- "description": "message",
+ "server_auth_url": {
"type": "string",
- "x-go-name": "Message"
+ "x-go-name": "ServerAuthUrl"
+ },
+ "server_token_url": {
+ "type": "string",
+ "x-go-name": "ServerTokenUrl"
+ },
+ "server_user_id_url": {
+ "type": "string",
+ "x-go-name": "ServerUserIdUrl"
+ },
+ "user_id_tag": {
+ "type": "string",
+ "x-go-name": "UserIdTag"
}
},
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
+ "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"Plugin": {
"type": "object",
@@ -5620,40 +3508,6 @@
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
- "RegisterDMSPluginReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
- "RegisterDMSProxyTargetReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
"Role": {
"description": "A role",
"type": "object",
@@ -5682,32 +3536,6 @@
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
- "SMTPConfigurationResData": {
- "type": "object",
- "properties": {
- "enable_smtp_notify": {
- "type": "boolean",
- "x-go-name": "EnableSMTPNotify"
- },
- "is_skip_verify": {
- "type": "boolean",
- "x-go-name": "IsSkipVerify"
- },
- "smtp_host": {
- "type": "string",
- "x-go-name": "Host"
- },
- "smtp_port": {
- "type": "string",
- "x-go-name": "Port"
- },
- "smtp_username": {
- "type": "string",
- "x-go-name": "Username"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
"SQLEConfig": {
"type": "object",
"properties": {
@@ -5777,40 +3605,6 @@
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
- "TestFeishuConfigurationReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/TestFeishuConfigurationResData"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "TestFeishuConfigurationResData": {
- "type": "object",
- "properties": {
- "error_message": {
- "type": "string",
- "x-go-name": "ErrorMessage"
- },
- "is_message_sent_normally": {
- "type": "boolean",
- "x-go-name": "IsMessageSentNormally"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
"TestSMTPConfiguration": {
"type": "object",
"properties": {
@@ -5821,40 +3615,6 @@
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
- "TestSMTPConfigurationReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/TestSMTPConfigurationResData"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "TestSMTPConfigurationResData": {
- "type": "object",
- "properties": {
- "is_smtp_send_normal": {
- "type": "boolean",
- "x-go-name": "IsSMTPSendNormal"
- },
- "send_error_message": {
- "type": "string",
- "x-go-name": "SendErrorMessage"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
"TestWeChatConfiguration": {
"type": "object",
"properties": {
@@ -5865,74 +3625,6 @@
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
- "TestWeChatConfigurationReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/TestWeChatConfigurationResData"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "TestWeChatConfigurationResData": {
- "type": "object",
- "properties": {
- "is_wechat_send_normal": {
- "type": "boolean",
- "x-go-name": "IsWeChatSendNormal"
- },
- "send_error_message": {
- "type": "string",
- "x-go-name": "SendErrorMessage"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "TestWebHookConfigurationReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "$ref": "#/definitions/TestWebHookConfigurationResData"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
- "TestWebHookConfigurationResData": {
- "type": "object",
- "properties": {
- "is_message_sent_normally": {
- "type": "boolean",
- "x-go-name": "IsMessageSentNormally"
- },
- "send_error_message": {
- "type": "string",
- "x-go-name": "SendErrorMessage"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
"Time": {
"type": "object",
"properties": {
@@ -5953,20 +3645,6 @@
"type": "string",
"x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
},
- "UidWithName": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "x-go-name": "Name"
- },
- "uid": {
- "type": "string",
- "x-go-name": "Uid"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
"UpdateCompanyNotice": {
"description": "A companynotice",
"type": "object",
@@ -6079,35 +3757,6 @@
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
- "UpdateDBServiceReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "data": {
- "description": "update db service reply",
- "type": "object",
- "properties": {
- "uid": {
- "description": "db service UID",
- "type": "string",
- "x-go-name": "Uid"
- }
- },
- "x-go-name": "Data"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
"UpdateFeishuConfiguration": {
"type": "object",
"properties": {
@@ -6398,24 +4047,6 @@
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
- "UserBindProject": {
- "type": "object",
- "properties": {
- "is_manager": {
- "type": "boolean",
- "x-go-name": "IsManager"
- },
- "project_id": {
- "type": "string",
- "x-go-name": "ProjectID"
- },
- "project_name": {
- "type": "string",
- "x-go-name": "ProjectName"
- }
- },
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
"UserGroup": {
"description": "A user group",
"type": "object",
@@ -6455,33 +4086,6 @@
},
"x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
},
- "WeChatConfigurationResData": {
- "type": "object",
- "properties": {
- "agent_id": {
- "type": "integer",
- "format": "int64",
- "x-go-name": "AgentID"
- },
- "corp_id": {
- "type": "string",
- "x-go-name": "CorpID"
- },
- "enable_wechat_notify": {
- "type": "boolean",
- "x-go-name": "EnableWeChatNotify"
- },
- "proxy_ip": {
- "type": "string",
- "x-go-name": "ProxyIP"
- },
- "safe_enabled": {
- "type": "boolean",
- "x-go-name": "SafeEnabled"
- }
- },
- "x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
- },
"WebHookConfigurationData": {
"type": "object",
"properties": {
@@ -6511,24 +4115,6 @@
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
- "WebHookSendMessageReply": {
- "type": "object",
- "properties": {
- "code": {
- "description": "code",
- "type": "integer",
- "format": "int64",
- "x-go-name": "Code"
- },
- "message": {
- "description": "message",
- "type": "string",
- "x-go-name": "Message"
- }
- },
- "x-go-name": "WebHooksSendMessageReply",
- "x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
- },
"WebHooksMessage": {
"type": "object",
"properties": {
diff --git a/api/swagger.yaml b/api/dms/swagger.yaml
similarity index 99%
rename from api/swagger.yaml
rename to api/dms/swagger.yaml
index c444d13a..7c277f03 100644
--- a/api/swagger.yaml
+++ b/api/dms/swagger.yaml
@@ -2410,7 +2410,7 @@ definitions:
type: string
x-go-name: Uid
type: object
- x-go-package: github.com/actiontech/dms/api/dms/service/v1
+ x-go-package: github.com/actiontech/dms/pkg/dms-common/api/dms/v1
UpdateCompanyNotice:
description: A companynotice
properties:
diff --git a/api/doc.go b/api/doc.go
index 904665c0..9ab885b1 100644
--- a/api/doc.go
+++ b/api/doc.go
@@ -12,7 +12,7 @@ import (
"github.com/swaggo/swag"
)
-//go:embed docs/*
+//go:embed docs
var multi embed.FS
type SwaggerDoc struct {
@@ -69,265 +69,3 @@ var ConfigFunc []func(*echoSwagger.Config) = []func(*echoSwagger.Config){
Config = config
},
}
-
-// // EchoWrapHandler wraps `http.Handler` into `echo.HandlerFunc`.
-// func RewriteEchoWrapHandler(options ...func(*echoSwagger.Config)) echo.HandlerFunc {
-
-// var re = regexp.MustCompile(`^(.*/)([^?].*)?[?|.]*$`)
-
-// return func(c echo.Context) error {
-// if c.Request().Method != http.MethodGet {
-// return echo.NewHTTPError(http.StatusMethodNotAllowed, http.StatusText(http.StatusMethodNotAllowed))
-// }
-
-// matches := re.FindStringSubmatch(c.Request().RequestURI)
-// path := matches[2]
-
-// switch filepath.Ext(path) {
-// case ".html":
-// c.Response().Header().Set("Content-Type", "text/html; charset=utf-8")
-// case ".css":
-// c.Response().Header().Set("Content-Type", "text/css; charset=utf-8")
-// case ".js":
-// c.Response().Header().Set("Content-Type", "application/javascript")
-// case ".json":
-// c.Response().Header().Set("Content-Type", "application/json; charset=utf-8")
-// case ".yaml":
-// c.Response().Header().Set("Content-Type", "text/plain; charset=utf-8")
-// case ".png":
-// c.Response().Header().Set("Content-Type", "image/png")
-// }
-
-// response := c.Response()
-// // This check fixes an error introduced here: https://github.com/labstack/echo/blob/8da8e161380fd926d4341721f0328f1e94d6d0a2/response.go#L86-L88
-// if _, ok := response.Writer.(http.Flusher); ok {
-// defer response.Flush()
-// }
-
-// jsonString, err := swag.ReadDoc(path)
-// if err != nil {
-// c.Error(err)
-
-// return nil
-// }
-// doc, err := yaml.JSONToYAML([]byte(jsonString))
-// if err != nil {
-// c.Error(err)
-
-// return nil
-// }
-// _, _ = c.Response().Writer.Write(doc)
-
-// return nil
-// }
-// }
-
-// func newConfig(configFns ...func(*echoSwagger.Config)) *echoSwagger.Config {
-// config := echoSwagger.Config{
-// URLs: []string{"dms.yaml", "sqle.yaml"},
-// DocExpansion: "list",
-// DomID: "swagger-ui",
-// InstanceName: "swagger",
-// DeepLinking: true,
-// PersistAuthorization: false,
-// SyntaxHighlight: true,
-// }
-
-// for _, fn := range configFns {
-// fn(&config)
-// }
-
-// if config.InstanceName == "" {
-// config.InstanceName = swag.Name
-// }
-
-// return &config
-// }
-
-// // EchoWrapHandler wraps `http.Handler` into `echo.HandlerFunc`.
-// func EchoWrapHandler(options ...func(*echoSwagger.Config)) echo.HandlerFunc {
-// config := newConfig(options...)
-
-// // create a template with name
-// index, _ := template.New("swagger_index.html").Parse(indexTemplate)
-
-// var re = regexp.MustCompile(`^(.*/)([^?].*)?[?|.]*$`)
-
-// return func(c echo.Context) error {
-// if c.Request().Method != http.MethodGet {
-// return echo.NewHTTPError(http.StatusMethodNotAllowed, http.StatusText(http.StatusMethodNotAllowed))
-// }
-
-// matches := re.FindStringSubmatch(c.Request().RequestURI)
-// path := matches[2]
-
-// switch filepath.Ext(path) {
-// case ".html":
-// c.Response().Header().Set("Content-Type", "text/html; charset=utf-8")
-// case ".css":
-// c.Response().Header().Set("Content-Type", "text/css; charset=utf-8")
-// case ".js":
-// c.Response().Header().Set("Content-Type", "application/javascript")
-// case ".json":
-// c.Response().Header().Set("Content-Type", "application/json; charset=utf-8")
-// case ".yaml":
-// c.Response().Header().Set("Content-Type", "text/plain; charset=utf-8")
-// case ".png":
-// c.Response().Header().Set("Content-Type", "image/png")
-// }
-
-// response := c.Response()
-// // This check fixes an error introduced here: https://github.com/labstack/echo/blob/8da8e161380fd926d4341721f0328f1e94d6d0a2/response.go#L86-L88
-// if _, ok := response.Writer.(http.Flusher); ok {
-// defer response.Flush()
-// }
-
-// switch path {
-// case "":
-// _ = c.Redirect(http.StatusMovedPermanently, matches[1]+"/"+"index.html")
-// case "index.html":
-// _ = index.Execute(c.Response().Writer, config)
-// case "doc.json":
-// doc, err := swag.ReadDoc(config.InstanceName)
-// if err != nil {
-// c.Error(err)
-
-// return nil
-// }
-
-// _, _ = c.Response().Writer.Write([]byte(doc))
-// case "doc.yaml", "dms.yaml", "sqle.yaml":
-// jsonString, err := swag.ReadDoc(path)
-// if err != nil {
-// c.Error(err)
-
-// return nil
-// }
-// doc, err := yaml.JSONToYAML([]byte(jsonString))
-// if err != nil {
-// c.Error(err)
-
-// return nil
-// }
-// _, _ = c.Response().Writer.Write(doc)
-// default:
-// c.Request().URL.Path = matches[2]
-// http.FileServer(http.FS(swaggerFiles.FS)).ServeHTTP(c.Response(), c.Request())
-// }
-
-// return nil
-// }
-// }
-
-// const indexTemplate = `
-//
-//
-//
-//
-// Swagger UI
-//
-//
-//
-//
-//
-
-//
-
-//
-
-//
-
-//
-//
-//
-//
-
-//
-// `
diff --git a/api/docs/sqle/swagger.json b/api/docs/sqle/swagger.json
new file mode 100644
index 00000000..8faa815a
--- /dev/null
+++ b/api/docs/sqle/swagger.json
@@ -0,0 +1,12860 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "description": "This is a sample server for dev.",
+ "title": "Sqle API Docs",
+ "contact": {},
+ "license": {},
+ "version": "1.0"
+ },
+ "basePath": "/",
+ "paths": {
+ "/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"
+ }
+ ],
+ "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/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/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/system_variables": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "get system variables",
+ "tags": [
+ "configuration"
+ ],
+ "summary": "获取系统变量",
+ "operationId": "getSystemVariablesV1",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/v1.GetSystemVariablesResV1"
+ }
+ }
+ }
+ },
+ "patch": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "update system variables",
+ "consumes": [
+ "application/json"
+ ],
+ "tags": [
+ "configuration"
+ ],
+ "summary": "修改系统变量",
+ "operationId": "updateSystemVariablesV1",
+ "parameters": [
+ {
+ "description": "update system variables request",
+ "name": "instance",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.UpdateSystemVariablesReqV1"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/controller.BaseRes"
+ }
+ }
+ }
+ }
+ },
+ "/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": "query",
+ "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/operation_records": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Get operation record list",
+ "tags": [
+ "OperationRecord"
+ ],
+ "summary": "获取操作记录列表",
+ "operationId": "getOperationRecordListV1",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "filter_operate_time_from",
+ "name": "filter_operate_time_from",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "filter_operate_time_to",
+ "name": "filter_operate_time_to",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "filter_operate_project_name",
+ "name": "filter_operate_project_name",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "fuzzy_search_operate_user_name",
+ "name": "fuzzy_search_operate_user_name",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "filter_operate_type_name",
+ "name": "filter_operate_type_name",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "filter_operate_action",
+ "name": "filter_operate_action",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page_index",
+ "name": "page_index",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "page_size",
+ "name": "page_size",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/v1.GetOperationRecordListResV1"
+ }
+ }
+ }
+ }
+ },
+ "/v1/operation_records/exports": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Export operation record list",
+ "tags": [
+ "OperationRecord"
+ ],
+ "summary": "导出操作记录列表",
+ "operationId": "getExportOperationRecordListV1",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "filter_operate_time_from",
+ "name": "filter_operate_time_from",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "filter_operate_time_to",
+ "name": "filter_operate_time_to",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "filter_operate_project_name",
+ "name": "filter_operate_project_name",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "fuzzy_search_operate_user_name",
+ "name": "fuzzy_search_operate_user_name",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "filter_operate_type_name",
+ "name": "filter_operate_type_name",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "filter_operate_action",
+ "name": "filter_operate_action",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "get export operation record list",
+ "schema": {
+ "type": "file"
+ }
+ }
+ }
+ }
+ },
+ "/v1/operation_records/operation_actions": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Get operation action list",
+ "tags": [
+ "OperationRecord"
+ ],
+ "summary": "获取操作内容列表",
+ "operationId": "getOperationActionList",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/v1.GetOperationActionListResV1"
+ }
+ }
+ }
+ }
+ },
+ "/v1/operation_records/operation_type_names": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Get operation type name list",
+ "tags": [
+ "OperationRecord"
+ ],
+ "summary": "获取操作类型名列表",
+ "operationId": "GetOperationTypeNameList",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/v1.GetOperationTypeNamesListResV1"
+ }
+ }
+ }
+ }
+ },
+ "/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",
+ "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": "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}/instance_tips": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "get instance tip list",
+ "tags": [
+ "instance"
+ ],
+ "summary": "获取实例提示列表",
+ "operationId": "getInstanceTipListV1",
+ "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 workflow template id",
+ "name": "filter_workflow_template_id",
+ "in": "query"
+ },
+ {
+ "enum": [
+ "create_audit_plan",
+ "create_workflow",
+ "sql_manage"
+ ],
+ "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}/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"
+ }
+ ],
+ "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
+ }
+ ],
+ "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_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": "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 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_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/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",
+ "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": "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/{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
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/v1.GetSqlManageSqlAnalysisResp"
+ }
+ }
+ }
+ }
+ },
+ "/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/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": "string",
+ "description": "sqls for audit",
+ "name": "sql",
+ "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.GetAuditTaskResV1"
+ }
+ }
+ }
+ }
+ },
+ "/v1/projects/{project_name}/workflow_template": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "get workflow template detail",
+ "tags": [
+ "workflow"
+ ],
+ "summary": "获取审批流程模板详情",
+ "operationId": "getWorkflowTemplateV1",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "project name",
+ "name": "project_name",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/v1.GetWorkflowTemplateResV1"
+ }
+ }
+ }
+ },
+ "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
+ },
+ {
+ "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}/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 name",
+ "name": "filter_task_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
+ },
+ {
+ "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/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",
+ "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 name",
+ "name": "filter_task_instance_name",
+ "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"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "export workflow",
+ "schema": {
+ "type": "file"
+ }
+ }
+ }
+ }
+ },
+ "/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}/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": [
+ {
+ "type": "file",
+ "description": "SQLE rule template file",
+ "name": "rule_template_file",
+ "in": "formData",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/v1.ParseProjectRuleTemplateFileResV1"
+ }
+ }
+ }
+ }
+ },
+ "/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"
+ }
+ ],
+ "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": [
+ {
+ "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"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/v1.GetRulesResV1"
+ }
+ }
+ }
+ }
+ },
+ "/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/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/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": "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}/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"
+ ],
+ "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/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": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "get global workflow list",
+ "tags": [
+ "workflow"
+ ],
+ "summary": "获取全局工单列表",
+ "operationId": "getGlobalWorkflowsV1",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "filter subject",
+ "name": "filter_subject",
+ "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_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.GetWorkflowsResV1"
+ }
+ }
+ }
+ }
+ },
+ "/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/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_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}/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",
+ "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/v2.GetSqlManageListResp"
+ }
+ }
+ }
+ }
+ },
+ "/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",
+ "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
+ }
+ ],
+ "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",
+ "deprecated": true,
+ "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}/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"
+ ],
+ "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/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
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/v2.GetTaskAnalysisDataResV2"
+ }
+ }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "controller.BaseRes": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "example": 0
+ },
+ "message": {
+ "type": "string",
+ "example": "ok"
+ }
+ }
+ },
+ "v1.AffectRows": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer"
+ },
+ "err_message": {
+ "type": "string"
+ }
+ }
+ },
+ "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"
+ },
+ "instance_type": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.AuditPlanParamReqV1": {
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.AuditPlanParamResV1": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "string",
+ "int",
+ "bool"
+ ]
+ },
+ "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.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.AuditPlanSQLHeadV1": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "sql"
+ ]
+ }
+ }
+ },
+ "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.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": {
+ "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_level": {
+ "type": "string",
+ "enum": [
+ "normal",
+ "notice",
+ "warn",
+ "error",
+ ""
+ ]
+ },
+ "exec_end_time": {
+ "type": "string"
+ },
+ "exec_start_time": {
+ "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"
+ ]
+ },
+ "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"
+ }
+ }
+ },
+ "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_sql": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.AuditTasksGroupResV1": {
+ "type": "object",
+ "properties": {
+ "task_group_id": {
+ "type": "integer"
+ }
+ }
+ },
+ "v1.AuditWhitelistResV1": {
+ "type": "object",
+ "properties": {
+ "audit_whitelist_id": {
+ "type": "integer"
+ },
+ "desc": {
+ "type": "string"
+ },
+ "match_type": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.AuditedSQLCount": {
+ "type": "object",
+ "properties": {
+ "risk_sql_count": {
+ "type": "integer"
+ },
+ "total_sql_count": {
+ "type": "integer"
+ }
+ }
+ },
+ "v1.BatchCancelWorkflowsReqV1": {
+ "type": "object",
+ "properties": {
+ "workflow_names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "v1.BatchCheckInstanceConnectionsReqV1": {
+ "type": "object",
+ "properties": {
+ "instances": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.InstanceForCheckConnection"
+ }
+ }
+ }
+ },
+ "v1.BatchCompleteWorkflowsReqV1": {
+ "type": "object",
+ "properties": {
+ "workflow_names": {
+ "type": "array",
+ "items": {
+ "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.BatchUpdateSqlManageReq": {
+ "type": "object",
+ "properties": {
+ "assignees": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "remark": {
+ "type": "string"
+ },
+ "sql_manage_id_list": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "solved",
+ "ignored",
+ "manual_audited"
+ ]
+ }
+ }
+ },
+ "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"
+ }
+ }
+ },
+ "v1.CloneRuleTemplateReqV1": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "new_rule_template_name": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.CompanyNotice": {
+ "type": "object",
+ "properties": {
+ "notice_str": {
+ "type": "string"
+ }
+ }
+ },
+ "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.CreateAuditTasksGroupReqV1": {
+ "type": "object",
+ "properties": {
+ "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.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"
+ },
+ "type": {
+ "type": "string",
+ "example": "DDL规则"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ },
+ "v1.CreateSQLAuditRecordResV1": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "example": 0
+ },
+ "data": {
+ "type": "object",
+ "$ref": "#/definitions/v1.SQLAuditRecordResData"
+ },
+ "message": {
+ "type": "string",
+ "example": "ok"
+ }
+ }
+ },
+ "v1.CreateWorkflowReqV1": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "task_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "workflow_subject": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.CustomRuleResV1": {
+ "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_id": {
+ "type": "string"
+ },
+ "rule_script": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "example": "DDL规则"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ },
+ "v1.DingTalkConfigurationV1": {
+ "type": "object",
+ "properties": {
+ "app_key": {
+ "type": "string"
+ },
+ "is_enable_ding_talk_notify": {
+ "type": "boolean"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "v1.ExplainClassicResult": {
+ "type": "object",
+ "properties": {
+ "head": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.TableMetaItemHeadResV1"
+ }
+ },
+ "rows": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "v1.FeishuConfigurationV1": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "is_feishu_notification_enabled": {
+ "type": "boolean"
+ }
+ }
+ },
+ "v1.FullSyncAuditPlanSQLsReqV1": {
+ "type": "object",
+ "properties": {
+ "audit_plan_sql_list": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.AuditPlanSQLReqV1"
+ }
+ }
+ }
+ },
+ "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.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.GetCompanyNoticeResp": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "example": 0
+ },
+ "data": {
+ "type": "object",
+ "$ref": "#/definitions/v1.CompanyNotice"
+ },
+ "message": {
+ "type": "string",
+ "example": "ok"
+ }
+ }
+ },
+ "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.GetDashboardResV1": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "example": 0
+ },
+ "data": {
+ "type": "object",
+ "$ref": "#/definitions/v1.DashboardResV1"
+ },
+ "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.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.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.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.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.GetOperationActionListResV1": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "example": 0
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.OperationActionList"
+ }
+ },
+ "message": {
+ "type": "string",
+ "example": "ok"
+ }
+ }
+ },
+ "v1.GetOperationRecordListResV1": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "example": 0
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.OperationRecordList"
+ }
+ },
+ "message": {
+ "type": "string",
+ "example": "ok"
+ },
+ "total_nums": {
+ "type": "integer"
+ }
+ }
+ },
+ "v1.GetOperationTypeNamesListResV1": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "example": 0
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.OperationTypeNameList"
+ }
+ },
+ "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.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.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.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.GetSqlExecutionFailPercentResV1": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "example": 0
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.SqlExecutionFailPercent"
+ }
+ },
+ "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.GetSystemVariablesResV1": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "example": 0
+ },
+ "data": {
+ "type": "object",
+ "$ref": "#/definitions/v1.SystemVariablesResV1"
+ },
+ "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.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.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.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.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.InstanceConnectableResV1": {
+ "type": "object",
+ "properties": {
+ "connect_error_message": {
+ "type": "string"
+ },
+ "is_instance_connectable": {
+ "type": "boolean"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ },
+ "v1.InstanceForCreatingTask": {
+ "type": "object",
+ "properties": {
+ "instance_name": {
+ "type": "string"
+ },
+ "instance_schema": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.InstanceSchemaResV1": {
+ "type": "object",
+ "properties": {
+ "schema_name_list": {
+ "type": "array",
+ "items": {
+ "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": {
+ "host": {
+ "type": "string"
+ },
+ "instance_id": {
+ "type": "string"
+ },
+ "instance_name": {
+ "type": "string"
+ },
+ "instance_type": {
+ "type": "string"
+ },
+ "port": {
+ "type": "string"
+ },
+ "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.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.ListTableBySchemaResV1": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "example": 0
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.Table"
+ }
+ },
+ "message": {
+ "type": "string",
+ "example": "ok"
+ }
+ }
+ },
+ "v1.MaintenanceTimeResV1": {
+ "type": "object",
+ "properties": {
+ "maintenance_start_time": {
+ "type": "object",
+ "$ref": "#/definitions/v1.TimeResV1"
+ },
+ "maintenance_stop_time": {
+ "type": "object",
+ "$ref": "#/definitions/v1.TimeResV1"
+ }
+ }
+ },
+ "v1.OperationActionList": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "operation_action": {
+ "type": "string"
+ },
+ "operation_type": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.OperationRecordList": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "operation_action": {
+ "type": "string"
+ },
+ "operation_content": {
+ "type": "string"
+ },
+ "operation_time": {
+ "type": "string"
+ },
+ "operation_type_name": {
+ "type": "string"
+ },
+ "operation_user": {
+ "type": "object",
+ "$ref": "#/definitions/v1.OperationUser"
+ },
+ "project_name": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "succeeded",
+ "failed"
+ ]
+ }
+ }
+ },
+ "v1.OperationResV1": {
+ "type": "object",
+ "properties": {
+ "op_code": {
+ "type": "integer"
+ },
+ "op_desc": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.OperationTypeNameList": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "operation_type_name": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.OperationUser": {
+ "type": "object",
+ "properties": {
+ "ip": {
+ "type": "string"
+ },
+ "user_name": {
+ "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"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "v1.PerformanceStatistics": {
+ "type": "object",
+ "properties": {
+ "affect_rows": {
+ "type": "object",
+ "$ref": "#/definitions/v1.AffectRows"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ },
+ "v1.RejectWorkflowReqV1": {
+ "type": "object",
+ "properties": {
+ "reason": {
+ "type": "string"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ },
+ "v1.RuleParamReqV1": {
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "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"
+ }
+ }
+ },
+ "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 带来的消耗、以及对线上业务的影响"
+ },
+ "db_type": {
+ "type": "string",
+ "example": "mysql"
+ },
+ "desc": {
+ "type": "string"
+ },
+ "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": "全局配置"
+ }
+ }
+ },
+ "v1.RuleRespV1": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "rule_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"
+ }
+ }
+ },
+ "v1.RuleTemplateResV1": {
+ "type": "object",
+ "properties": {
+ "db_type": {
+ "type": "string"
+ },
+ "desc": {
+ "type": "string"
+ },
+ "rule_template_name": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.RuleTemplateTipResV1": {
+ "type": "object",
+ "properties": {
+ "db_type": {
+ "type": "string"
+ },
+ "rule_template_id": {
+ "type": "string"
+ },
+ "rule_template_name": {
+ "type": "string"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ },
+ "v1.SQLExplain": {
+ "type": "object",
+ "properties": {
+ "classic_result": {
+ "description": "explain result in table format",
+ "type": "object",
+ "$ref": "#/definitions/v1.ExplainClassicResult"
+ },
+ "message": {
+ "type": "string"
+ },
+ "sql": {
+ "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.Source": {
+ "type": "object",
+ "properties": {
+ "audit_plan_name": {
+ "type": "string"
+ },
+ "sql_audit_record_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "audit_plan",
+ "sql_audit_record"
+ ]
+ }
+ }
+ },
+ "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.SqlAnalysisResDataV1": {
+ "type": "object",
+ "properties": {
+ "sql_explain": {
+ "type": "object",
+ "$ref": "#/definitions/v1.SQLExplain"
+ },
+ "table_metas": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.TableMeta"
+ }
+ }
+ }
+ },
+ "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.SqlExecutionFailPercent": {
+ "type": "object",
+ "properties": {
+ "instance_name": {
+ "type": "string"
+ },
+ "percent": {
+ "type": "number"
+ }
+ }
+ },
+ "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"
+ ]
+ }
+ }
+ },
+ "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.SystemVariablesResV1": {
+ "type": "object",
+ "properties": {
+ "operation_record_expired_hours": {
+ "type": "integer"
+ },
+ "url": {
+ "type": "string"
+ },
+ "workflow_expired_hours": {
+ "type": "integer"
+ }
+ }
+ },
+ "v1.Table": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ },
+ "v1.TableMetas": {
+ "type": "object",
+ "properties": {
+ "err_message": {
+ "type": "string"
+ },
+ "table_meta_items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.TableMeta"
+ }
+ }
+ }
+ },
+ "v1.TestAuditPlanNotifyConfigResDataV1": {
+ "type": "object",
+ "properties": {
+ "is_notify_send_normal": {
+ "type": "boolean"
+ },
+ "send_error_message": {
+ "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.TestDingTalkConfigResDataV1": {
+ "type": "object",
+ "properties": {
+ "is_ding_talk_send_normal": {
+ "type": "boolean"
+ },
+ "send_error_message": {
+ "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"
+ }
+ }
+ },
+ "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.TimeResV1": {
+ "type": "object",
+ "properties": {
+ "hour": {
+ "type": "integer"
+ },
+ "minute": {
+ "type": "integer"
+ }
+ }
+ },
+ "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.UpdateAuditTaskSQLsReqV1": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ }
+ }
+ },
+ "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.UpdateCompanyNoticeReq": {
+ "type": "object",
+ "properties": {
+ "notice_str": {
+ "type": "string"
+ }
+ }
+ },
+ "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"
+ },
+ "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.UpdateProjectRuleTemplateReqV1": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "rule_list": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.RuleReqV1"
+ }
+ }
+ }
+ },
+ "v1.UpdateRuleKnowledgeReq": {
+ "type": "object",
+ "properties": {
+ "knowledge_content": {
+ "type": "string"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "v1.UpdateSystemVariablesReqV1": {
+ "type": "object",
+ "properties": {
+ "operation_record_expired_hours": {
+ "type": "integer",
+ "example": 2160
+ },
+ "url": {
+ "type": "string",
+ "example": "http://10.186.61.32:8080"
+ },
+ "workflow_expired_hours": {
+ "type": "integer",
+ "example": 720
+ }
+ }
+ },
+ "v1.UpdateWorkflowReqV1": {
+ "type": "object",
+ "properties": {
+ "task_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "v1.UpdateWorkflowScheduleReqV1": {
+ "type": "object",
+ "properties": {
+ "schedule_time": {
+ "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"
+ }
+ }
+ },
+ "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"
+ ]
+ }
+ }
+ },
+ "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"
+ }
+ }
+ },
+ "v1.WorkflowCountsV1": {
+ "type": "object",
+ "properties": {
+ "today_count": {
+ "type": "integer"
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "v1.WorkflowCreatedCountsEachDayItem": {
+ "type": "object",
+ "properties": {
+ "date": {
+ "type": "string",
+ "example": "2022-08-24"
+ },
+ "value": {
+ "type": "integer"
+ }
+ }
+ },
+ "v1.WorkflowCreatedCountsEachDayV1": {
+ "type": "object",
+ "properties": {
+ "samples": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.WorkflowCreatedCountsEachDayItem"
+ }
+ }
+ }
+ },
+ "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"
+ },
+ "project_name": {
+ "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.WorkflowPassPercentV1": {
+ "type": "object",
+ "properties": {
+ "audit_pass_percent": {
+ "type": "number"
+ },
+ "execution_success_percent": {
+ "type": "number"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ },
+ "v1.WorkflowTemplateDetailResV1": {
+ "type": "object",
+ "properties": {
+ "allow_submit_when_less_audit_level": {
+ "type": "string",
+ "enum": [
+ "normal",
+ "notice",
+ "warn",
+ "error"
+ ]
+ },
+ "desc": {
+ "type": "string"
+ },
+ "update_time": {
+ "type": "string"
+ },
+ "workflow_step_template_list": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.WorkFlowStepTemplateResV1"
+ }
+ },
+ "workflow_template_name": {
+ "type": "string"
+ }
+ }
+ },
+ "v2.AffectRows": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer"
+ },
+ "err_message": {
+ "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.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"
+ },
+ "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
+ }
+ }
+ },
+ "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"
+ },
+ "level": {
+ "type": "string",
+ "example": "warn"
+ },
+ "message": {
+ "type": "string",
+ "example": "避免使用不必要的内置函数md5()"
+ },
+ "rule_name": {
+ "type": "string"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ },
+ "v2.AuditTaskSQLResV2": {
+ "type": "object",
+ "properties": {
+ "audit_level": {
+ "type": "string"
+ },
+ "audit_result": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v2.AuditResult"
+ }
+ },
+ "audit_status": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "exec_result": {
+ "type": "string"
+ },
+ "exec_sql": {
+ "type": "string"
+ },
+ "exec_status": {
+ "type": "string"
+ },
+ "number": {
+ "type": "integer"
+ },
+ "rollback_sql": {
+ "type": "string"
+ },
+ "sql_source_file": {
+ "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"
+ }
+ }
+ }
+ },
+ "v2.CreateWorkflowReqV2": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "task_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "workflow_subject": {
+ "type": "string"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ },
+ "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_type": {
+ "type": "string",
+ "example": "MySQL"
+ },
+ "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.FullSyncAuditPlanSQLsReqV2": {
+ "type": "object",
+ "properties": {
+ "audit_plan_sql_list": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v2.AuditPlanSQLReqV2"
+ }
+ }
+ }
+ },
+ "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.GetInstanceResV2": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "example": 0
+ },
+ "data": {
+ "type": "object",
+ "$ref": "#/definitions/v2.InstanceResV2"
+ },
+ "message": {
+ "type": "string",
+ "example": "ok"
+ }
+ }
+ },
+ "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.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"
+ },
+ "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.PartialSyncAuditPlanSQLsReqV2": {
+ "type": "object",
+ "properties": {
+ "audit_plan_sql_list": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v2.AuditPlanSQLReqV2"
+ }
+ }
+ }
+ },
+ "v2.PerformanceStatistics": {
+ "type": "object",
+ "properties": {
+ "affect_rows": {
+ "type": "object",
+ "$ref": "#/definitions/v2.AffectRows"
+ }
+ }
+ },
+ "v2.RejectWorkflowReqV2": {
+ "type": "object",
+ "properties": {
+ "reason": {
+ "type": "string"
+ }
+ }
+ },
+ "v2.RuleTemplateV2": {
+ "type": "object",
+ "properties": {
+ "is_global_rule_template": {
+ "type": "boolean"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "v2.SQLExplain": {
+ "type": "object",
+ "properties": {
+ "classic_result": {
+ "type": "object",
+ "$ref": "#/definitions/v1.ExplainClassicResult"
+ },
+ "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"
+ }
+ },
+ "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"
+ },
+ "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"
+ ]
+ }
+ }
+ },
+ "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.UpdateWorkflowReqV2": {
+ "type": "object",
+ "properties": {
+ "task_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "v2.UpdateWorkflowScheduleReqV2": {
+ "type": "object",
+ "properties": {
+ "schedule_time": {
+ "type": "string"
+ }
+ }
+ },
+ "v2.WorkflowRecordResV2": {
+ "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/v2.WorkflowTaskItem"
+ }
+ },
+ "workflow_step_list": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v2.WorkflowStepResV2"
+ }
+ }
+ }
+ },
+ "v2.WorkflowResV2": {
+ "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/v2.WorkflowRecordResV2"
+ },
+ "record_history_list": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v2.WorkflowRecordResV2"
+ }
+ },
+ "workflow_id": {
+ "type": "string"
+ },
+ "workflow_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"
+ }
+ }
+ }
+ },
+ "securityDefinitions": {
+ "ApiKeyAuth": {
+ "type": "apiKey",
+ "name": "Authorization",
+ "in": "header"
+ }
+ }
+}
\ No newline at end of file
diff --git a/api/docs/sqle/swagger.yaml b/api/docs/sqle/swagger.yaml
new file mode 100644
index 00000000..8cee8017
--- /dev/null
+++ b/api/docs/sqle/swagger.yaml
@@ -0,0 +1,8534 @@
+basePath: /
+definitions:
+ controller.BaseRes:
+ properties:
+ code:
+ example: 0
+ type: integer
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.AffectRows:
+ properties:
+ count:
+ type: integer
+ err_message:
+ type: string
+ type: object
+ v1.AuditPlanCount:
+ properties:
+ audit_plan_count:
+ type: integer
+ audit_plan_desc:
+ type: string
+ audit_plan_type:
+ type: string
+ type: object
+ v1.AuditPlanMetaV1:
+ properties:
+ audit_plan_params:
+ items:
+ $ref: '#/definitions/v1.AuditPlanParamResV1'
+ type: array
+ audit_plan_type:
+ type: string
+ audit_plan_type_desc:
+ type: string
+ instance_type:
+ type: string
+ type: object
+ v1.AuditPlanParamReqV1:
+ properties:
+ key:
+ type: string
+ value:
+ type: string
+ type: object
+ v1.AuditPlanParamResV1:
+ properties:
+ desc:
+ type: string
+ key:
+ type: string
+ type:
+ enum:
+ - string
+ - int
+ - bool
+ type: string
+ value:
+ type: string
+ type: object
+ v1.AuditPlanReportResV1:
+ properties:
+ audit_level:
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ - ""
+ type: string
+ audit_plan_report_id:
+ example: "1"
+ type: string
+ audit_plan_report_timestamp:
+ example: RFC3339
+ type: string
+ pass_rate:
+ type: number
+ score:
+ type: integer
+ type: object
+ v1.AuditPlanReportSQLResV1:
+ properties:
+ audit_plan_report_sql:
+ example: select * from t1 where id = 1
+ type: string
+ audit_plan_report_sql_audit_result:
+ example: same format as task audit result
+ type: string
+ number:
+ example: 1
+ type: integer
+ type: object
+ v1.AuditPlanResV1:
+ properties:
+ audit_plan_cron:
+ example: 0 */2 * * *
+ type: string
+ audit_plan_db_type:
+ example: mysql
+ type: string
+ audit_plan_instance_database:
+ example: app1
+ type: string
+ audit_plan_instance_name:
+ example: test_mysql
+ type: string
+ audit_plan_meta:
+ $ref: '#/definitions/v1.AuditPlanMetaV1'
+ type: object
+ audit_plan_name:
+ example: audit_for_java_app1
+ type: string
+ audit_plan_token:
+ example: it's a JWT Token for scanner
+ type: string
+ rule_template_name:
+ example: default_MySQL
+ type: string
+ type: object
+ v1.AuditPlanSQLHeadV1:
+ properties:
+ desc:
+ type: string
+ name:
+ type: string
+ type:
+ enum:
+ - sql
+ type: string
+ type: object
+ v1.AuditPlanSQLReqV1:
+ properties:
+ audit_plan_sql_counter:
+ example: "6"
+ type: string
+ audit_plan_sql_fingerprint:
+ example: select * from t1 where id = ?
+ type: string
+ audit_plan_sql_last_receive_text:
+ example: select * from t1 where id = 1
+ type: string
+ audit_plan_sql_last_receive_timestamp:
+ example: RFC3339
+ type: string
+ audit_plan_sql_schema:
+ example: db1
+ type: string
+ db_user:
+ example: database_user001
+ type: string
+ endpoint:
+ example: 10.186.1.2
+ type: string
+ first_query_at:
+ example: "2023-09-12T02:48:01.317880Z"
+ type: string
+ query_time_avg:
+ example: 3.22
+ type: number
+ query_time_max:
+ example: 5.22
+ type: number
+ type: object
+ v1.AuditPlanSQLResV1:
+ properties:
+ head:
+ items:
+ $ref: '#/definitions/v1.AuditPlanSQLHeadV1'
+ type: array
+ rows:
+ items:
+ additionalProperties:
+ type: string
+ type: object
+ type: array
+ type: object
+ v1.AuditPlanTypesV1:
+ properties:
+ desc:
+ type: string
+ instance_type:
+ enum:
+ - MySQL
+ - Oracle
+ - TiDB
+ - OceanBase For MySQL
+ - ""
+ type: string
+ type:
+ type: string
+ type: object
+ v1.AuditResDataV1:
+ properties:
+ audit_level:
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ - ""
+ type: string
+ pass_rate:
+ type: number
+ score:
+ type: integer
+ sql_results:
+ items:
+ $ref: '#/definitions/v1.AuditSQLResV1'
+ type: array
+ type: object
+ v1.AuditResult:
+ properties:
+ level:
+ example: warn
+ type: string
+ message:
+ example: 避免使用不必要的内置函数md5()
+ type: string
+ rule_name:
+ type: string
+ type: object
+ v1.AuditSQLResV1:
+ properties:
+ audit_level:
+ type: string
+ audit_result:
+ type: string
+ exec_sql:
+ type: string
+ number:
+ type: integer
+ type: object
+ v1.AuditTaskGroupRes:
+ properties:
+ task_group_id:
+ type: integer
+ tasks:
+ items:
+ $ref: '#/definitions/v1.AuditTaskResV1'
+ type: array
+ type: object
+ v1.AuditTaskGroupResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.AuditTaskGroupRes'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.AuditTaskResV1:
+ properties:
+ audit_level:
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ - ""
+ type: string
+ exec_end_time:
+ type: string
+ exec_start_time:
+ type: string
+ instance_db_type:
+ type: string
+ instance_name:
+ type: string
+ instance_schema:
+ example: db1
+ type: string
+ pass_rate:
+ type: number
+ score:
+ type: integer
+ sql_source:
+ enum:
+ - form_data
+ - sql_file
+ - mybatis_xml_file
+ - audit_plan
+ type: string
+ status:
+ enum:
+ - initialized
+ - audited
+ - executing
+ - exec_success
+ - exec_failed
+ - manually_executed
+ type: string
+ task_id:
+ type: integer
+ type: object
+ v1.AuditTaskSQLContentResV1:
+ properties:
+ sql:
+ example: alter table tb1 drop columns c1
+ type: string
+ type: object
+ v1.AuditTaskSQLResV1:
+ 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_sql:
+ type: string
+ type: object
+ v1.AuditTasksGroupResV1:
+ properties:
+ task_group_id:
+ type: integer
+ type: object
+ v1.AuditWhitelistResV1:
+ properties:
+ audit_whitelist_id:
+ type: integer
+ desc:
+ type: string
+ match_type:
+ type: string
+ value:
+ type: string
+ type: object
+ v1.AuditedSQLCount:
+ properties:
+ risk_sql_count:
+ type: integer
+ total_sql_count:
+ type: integer
+ type: object
+ v1.BatchCancelWorkflowsReqV1:
+ properties:
+ workflow_names:
+ items:
+ type: string
+ type: array
+ type: object
+ v1.BatchCheckInstanceConnectionsReqV1:
+ properties:
+ instances:
+ items:
+ $ref: '#/definitions/v1.InstanceForCheckConnection'
+ type: array
+ type: object
+ v1.BatchCompleteWorkflowsReqV1:
+ properties:
+ workflow_names:
+ items:
+ type: string
+ type: array
+ type: object
+ v1.BatchGetInstanceConnectionsResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.InstanceConnectionResV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.BatchUpdateSqlManageReq:
+ properties:
+ assignees:
+ items:
+ type: string
+ type: array
+ remark:
+ type: string
+ sql_manage_id_list:
+ items:
+ type: integer
+ type: array
+ status:
+ enum:
+ - solved
+ - ignored
+ - manual_audited
+ type: string
+ type: object
+ v1.CheckLicenseResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ content:
+ type: string
+ license:
+ items:
+ $ref: '#/definitions/v1.LicenseItem'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.CloneProjectRuleTemplateReqV1:
+ properties:
+ desc:
+ type: string
+ new_rule_template_name:
+ type: string
+ type: object
+ v1.CloneRuleTemplateReqV1:
+ properties:
+ desc:
+ type: string
+ new_rule_template_name:
+ type: string
+ type: object
+ v1.CompanyNotice:
+ properties:
+ notice_str:
+ type: string
+ type: object
+ v1.CreateAuditPlanReqV1:
+ properties:
+ audit_plan_cron:
+ example: 0 */2 * * *
+ type: string
+ audit_plan_instance_database:
+ example: app1
+ type: string
+ audit_plan_instance_name:
+ example: test_mysql
+ type: string
+ audit_plan_instance_type:
+ example: mysql
+ type: string
+ audit_plan_name:
+ example: audit_plan_for_java_repo_1
+ type: string
+ audit_plan_params:
+ items:
+ $ref: '#/definitions/v1.AuditPlanParamReqV1'
+ type: array
+ audit_plan_type:
+ example: slow log
+ type: string
+ rule_template_name:
+ example: default_MySQL
+ type: string
+ type: object
+ v1.CreateAuditTasksGroupReqV1:
+ properties:
+ instances:
+ items:
+ $ref: '#/definitions/v1.InstanceForCreatingTask'
+ type: array
+ type: object
+ v1.CreateAuditTasksGroupResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.AuditTasksGroupResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.CreateAuditWhitelistReqV1:
+ properties:
+ desc:
+ example: used for rapid release
+ type: string
+ match_type:
+ enum:
+ - exact_match
+ - fp_match
+ example: exact_match
+ type: string
+ value:
+ example: create table
+ type: string
+ type: object
+ v1.CreateCustomRuleReqV1:
+ properties:
+ annotation:
+ example: this is test rule
+ type: string
+ db_type:
+ example: MySQL
+ type: string
+ desc:
+ example: this is test rule
+ type: string
+ level:
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ example: notice
+ type: string
+ rule_script:
+ type: string
+ type:
+ example: DDL规则
+ type: string
+ type: object
+ v1.CreateProjectRuleTemplateReqV1:
+ properties:
+ db_type:
+ type: string
+ desc:
+ type: string
+ rule_list:
+ items:
+ $ref: '#/definitions/v1.RuleReqV1'
+ type: array
+ rule_template_name:
+ type: string
+ type: object
+ v1.CreateRuleTemplateReqV1:
+ properties:
+ db_type:
+ type: string
+ desc:
+ type: string
+ rule_list:
+ items:
+ $ref: '#/definitions/v1.RuleReqV1'
+ type: array
+ rule_template_name:
+ type: string
+ type: object
+ v1.CreateSQLAuditRecordResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.SQLAuditRecordResData'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.CreateWorkflowReqV1:
+ properties:
+ desc:
+ type: string
+ task_ids:
+ items:
+ type: integer
+ type: array
+ workflow_subject:
+ type: string
+ type: object
+ v1.CustomRuleResV1:
+ properties:
+ annotation:
+ example: this is test rule
+ type: string
+ db_type:
+ example: MySQL
+ type: string
+ desc:
+ example: this is test rule
+ type: string
+ level:
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ example: notice
+ type: string
+ rule_id:
+ type: string
+ rule_script:
+ type: string
+ type:
+ example: DDL规则
+ type: string
+ type: object
+ v1.DBTypeAuditPlan:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/v1.AuditPlanCount'
+ type: array
+ db_type:
+ type: string
+ type: object
+ v1.DBTypeHealth:
+ properties:
+ db_type:
+ type: string
+ health_instance_names:
+ items:
+ type: string
+ type: array
+ unhealth_instance_names:
+ items:
+ type: string
+ type: array
+ type: object
+ v1.DashboardResV1:
+ properties:
+ workflow_statistics:
+ $ref: '#/definitions/v1.WorkflowStatisticsResV1'
+ type: object
+ type: object
+ v1.DingTalkConfigurationV1:
+ properties:
+ app_key:
+ type: string
+ is_enable_ding_talk_notify:
+ type: boolean
+ type: object
+ v1.DirectAuditFileReqV1:
+ properties:
+ file_contents:
+ description: |-
+ 调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现
+ 每个数组元素是一个文件内容
+ example:
+ - select * from t1; select * from t2;
+ items:
+ type: string
+ type: array
+ instance_name:
+ example: instance1
+ type: string
+ instance_type:
+ example: MySQL
+ type: string
+ project_name:
+ example: project1
+ type: string
+ schema_name:
+ example: schema1
+ type: string
+ sql_type:
+ enum:
+ - sql
+ - mybatis
+ - ""
+ example: sql
+ type: string
+ type: object
+ v1.DirectAuditReqV1:
+ properties:
+ instance_name:
+ example: instance1
+ type: string
+ instance_type:
+ example: MySQL
+ type: string
+ project_name:
+ example: project1
+ type: string
+ schema_name:
+ example: schema1
+ type: string
+ sql_content:
+ description: 调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现
+ example: select * from t1; select * from t2;
+ type: string
+ sql_type:
+ enum:
+ - sql
+ - mybatis
+ - ""
+ example: sql
+ type: string
+ type: object
+ v1.DirectAuditResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.AuditResDataV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.DirectGetSQLAnalysisResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.SqlAnalysisResDataV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.DriversResV1:
+ properties:
+ driver_name_list:
+ items:
+ type: string
+ type: array
+ type: object
+ v1.ExplainClassicResult:
+ properties:
+ head:
+ items:
+ $ref: '#/definitions/v1.TableMetaItemHeadResV1'
+ type: array
+ rows:
+ items:
+ additionalProperties:
+ type: string
+ type: object
+ type: array
+ type: object
+ v1.FeishuConfigurationV1:
+ properties:
+ app_id:
+ type: string
+ is_feishu_notification_enabled:
+ type: boolean
+ type: object
+ v1.FullSyncAuditPlanSQLsReqV1:
+ properties:
+ audit_plan_sql_list:
+ items:
+ $ref: '#/definitions/v1.AuditPlanSQLReqV1'
+ type: array
+ type: object
+ v1.GetAuditPlanAnalysisDataResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.GetSQLAnalysisDataResItemV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetAuditPlanMetasResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.AuditPlanMetaV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetAuditPlanNotifyConfigResDataV1:
+ 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
+ type: object
+ v1.GetAuditPlanNotifyConfigResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.GetAuditPlanNotifyConfigResDataV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetAuditPlanReportResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.AuditPlanReportResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetAuditPlanReportSQLsResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.AuditPlanReportSQLResV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ total_nums:
+ type: integer
+ type: object
+ v1.GetAuditPlanReportsResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.AuditPlanReportResV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ total_nums:
+ type: integer
+ type: object
+ v1.GetAuditPlanResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.AuditPlanResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetAuditPlanSQLsResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.AuditPlanSQLResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ total_nums:
+ type: integer
+ type: object
+ v1.GetAuditPlanTypesResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.AuditPlanTypesV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetAuditPlansResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.AuditPlanResV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ total_nums:
+ type: integer
+ type: object
+ v1.GetAuditTaskResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.AuditTaskResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetAuditTaskSQLContentResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.AuditTaskSQLContentResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetAuditTaskSQLsResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.AuditTaskSQLResV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ total_nums:
+ type: integer
+ type: object
+ v1.GetAuditWhitelistResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.AuditWhitelistResV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ total_nums:
+ type: integer
+ type: object
+ v1.GetCompanyNoticeResp:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.CompanyNotice'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetCustomRuleResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.CustomRuleResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetCustomRulesResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.CustomRuleResV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetDashboardResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.DashboardResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetDingTalkConfigurationResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.DingTalkConfigurationV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetDriversResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.DriversResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetFeishuAuditConfigurationResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.FeishuConfigurationV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetInstanceConnectableResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.InstanceConnectableResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetInstanceHealthResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.DBTypeHealth'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetInstanceSchemaResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.InstanceSchemaResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetInstanceTipsResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.InstanceTipResV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetInstancesTypePercentResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.InstancesTypePercentV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetLicenseResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ content:
+ type: string
+ license:
+ items:
+ $ref: '#/definitions/v1.LicenseItem'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetLicenseUsageResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.LicenseUsageV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetOperationActionListResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.OperationActionList'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetOperationRecordListResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.OperationRecordList'
+ type: array
+ message:
+ example: ok
+ type: string
+ total_nums:
+ type: integer
+ type: object
+ v1.GetOperationTypeNamesListResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.OperationTypeNameList'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetOperationsResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.OperationResV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetProjectRuleTemplateResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.RuleProjectTemplateDetailResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetProjectRuleTemplatesResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.ProjectRuleTemplateResV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ total_nums:
+ type: integer
+ type: object
+ v1.GetProjectScoreResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.ProjectScore'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetProjectStatisticsResDataV1:
+ 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
+ type: object
+ v1.GetProjectStatisticsResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.GetProjectStatisticsResDataV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetRiskAuditPlanResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.RiskAuditPlan'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetRoleUserCountResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.RoleUserCount'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetRuleKnowledgeResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.RuleKnowledgeResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetRuleTemplateResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.RuleTemplateDetailResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetRuleTemplateTipsResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.RuleTemplateTipResV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetRuleTemplatesResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.RuleTemplateResV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ total_nums:
+ type: integer
+ type: object
+ v1.GetRuleTypeByDBTypeResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.RuleTypeV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetRulesResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.RuleResV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetSQLAnalysisDataResItemV1:
+ properties:
+ sql_explain:
+ $ref: '#/definitions/v1.SQLExplain'
+ type: object
+ table_metas:
+ items:
+ $ref: '#/definitions/v1.TableMeta'
+ type: array
+ type: object
+ v1.GetSQLAuditRecordResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.SQLAuditRecord'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetSQLAuditRecordTagTipsResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ type: string
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetSQLAuditRecordsResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.SQLAuditRecord'
+ type: array
+ message:
+ example: ok
+ type: string
+ total_nums:
+ type: integer
+ type: object
+ v1.GetSqlAverageExecutionTimeResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.SqlAverageExecutionTime'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetSqlExecutionFailPercentResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.SqlExecutionFailPercent'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetSqlManageListResp:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.SqlManage'
+ type: array
+ message:
+ example: ok
+ type: string
+ sql_manage_bad_num:
+ type: integer
+ sql_manage_optimized_num:
+ type: integer
+ sql_manage_total_num:
+ type: integer
+ type: object
+ v1.GetSqlManageRuleTipsResp:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.RuleTips'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetSqlManageSqlAnalysisResp:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.SqlAnalysis'
+ description: V1版本不能引用V2版本的结构体,所以只能复制一份
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetSystemVariablesResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.SystemVariablesResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetTableMetadataResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.InstanceTableMeta'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetTaskAnalysisDataResItemV1:
+ properties:
+ sql_explain:
+ $ref: '#/definitions/v1.SQLExplain'
+ type: object
+ table_metas:
+ items:
+ $ref: '#/definitions/v1.TableMeta'
+ type: array
+ type: object
+ v1.GetTaskAnalysisDataResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.GetTaskAnalysisDataResItemV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetUserTipsResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.UserTipResV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetWorkflowAuditPassPercentResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.WorkflowAuditPassPercentV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetWorkflowCountsResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.WorkflowCountsV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetWorkflowCreatedCountsEachDayResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.WorkflowCreatedCountsEachDayV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetWorkflowDurationOfWaitingForAuditResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.WorkflowStageDuration'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetWorkflowDurationOfWaitingForExecutionResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.WorkflowStageDuration'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetWorkflowPassPercentResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.WorkflowPassPercentV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetWorkflowPercentCountedByInstanceTypeResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.WorkflowPercentCountedByInstanceTypeV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetWorkflowRejectedPercentGroupByCreatorResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.WorkflowRejectedPercentGroupByCreator'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetWorkflowRejectedPercentGroupByInstanceResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.WorkflowRejectedPercentGroupByInstance'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetWorkflowResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.WorkflowResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetWorkflowStatusCountResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.WorkflowStatusCountV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetWorkflowTasksItemV1:
+ properties:
+ current_step_assignee_user_name_list:
+ items:
+ type: string
+ type: array
+ exec_end_time:
+ type: string
+ exec_start_time:
+ type: string
+ execution_user_name:
+ type: string
+ instance_maintenance_times:
+ items:
+ $ref: '#/definitions/v1.MaintenanceTimeResV1'
+ type: array
+ instance_name:
+ type: string
+ schedule_time:
+ type: string
+ status:
+ enum:
+ - wait_for_audit
+ - wait_for_execution
+ - exec_scheduled
+ - exec_failed
+ - exec_succeeded
+ - executing
+ - manually_executed
+ type: string
+ task_id:
+ type: integer
+ task_pass_rate:
+ type: number
+ task_score:
+ type: integer
+ type: object
+ v1.GetWorkflowTasksResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.GetWorkflowTasksItemV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetWorkflowTemplateResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.WorkflowTemplateDetailResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.GetWorkflowsResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.WorkflowDetailResV1'
+ type: array
+ message:
+ example: ok
+ type: string
+ total_nums:
+ type: integer
+ type: object
+ v1.InstanceAdditionalParamResV1:
+ properties:
+ description:
+ example: 参数项中文名
+ type: string
+ name:
+ example: param name
+ type: string
+ type:
+ example: int
+ type: string
+ value:
+ example: "0"
+ type: string
+ type: object
+ v1.InstanceConnectableResV1:
+ properties:
+ connect_error_message:
+ type: string
+ is_instance_connectable:
+ type: boolean
+ type: object
+ v1.InstanceConnectionResV1:
+ properties:
+ connect_error_message:
+ type: string
+ instance_name:
+ type: string
+ is_instance_connectable:
+ type: boolean
+ type: object
+ v1.InstanceForCheckConnection:
+ properties:
+ name:
+ type: string
+ type: object
+ v1.InstanceForCreatingTask:
+ properties:
+ instance_name:
+ type: string
+ instance_schema:
+ type: string
+ type: object
+ v1.InstanceSchemaResV1:
+ properties:
+ schema_name_list:
+ items:
+ type: string
+ type: array
+ type: object
+ v1.InstanceTableMeta:
+ properties:
+ columns:
+ $ref: '#/definitions/v1.TableColumns'
+ type: object
+ create_table_sql:
+ type: string
+ indexes:
+ $ref: '#/definitions/v1.TableIndexes'
+ type: object
+ name:
+ type: string
+ schema:
+ type: string
+ type: object
+ v1.InstanceTipResV1:
+ properties:
+ host:
+ type: string
+ instance_id:
+ type: string
+ instance_name:
+ type: string
+ instance_type:
+ type: string
+ port:
+ type: string
+ workflow_template_id:
+ type: integer
+ type: object
+ v1.InstanceTypePercent:
+ properties:
+ count:
+ type: integer
+ percent:
+ type: number
+ type:
+ type: string
+ type: object
+ v1.InstancesTypePercentV1:
+ properties:
+ instance_total_num:
+ type: integer
+ instance_type_percents:
+ items:
+ $ref: '#/definitions/v1.InstanceTypePercent'
+ type: array
+ type: object
+ v1.LicenseItem:
+ properties:
+ description:
+ type: string
+ limit:
+ type: string
+ name:
+ type: string
+ type: object
+ v1.LicenseUsageItem:
+ properties:
+ is_limited:
+ type: boolean
+ limit:
+ type: integer
+ resource_type:
+ type: string
+ resource_type_desc:
+ type: string
+ used:
+ type: integer
+ type: object
+ v1.LicenseUsageV1:
+ properties:
+ instances_usage:
+ items:
+ $ref: '#/definitions/v1.LicenseUsageItem'
+ type: array
+ users_usage:
+ $ref: '#/definitions/v1.LicenseUsageItem'
+ type: object
+ type: object
+ v1.ListTableBySchemaResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.Table'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.MaintenanceTimeResV1:
+ properties:
+ maintenance_start_time:
+ $ref: '#/definitions/v1.TimeResV1'
+ type: object
+ maintenance_stop_time:
+ $ref: '#/definitions/v1.TimeResV1'
+ type: object
+ type: object
+ v1.OperationActionList:
+ properties:
+ desc:
+ type: string
+ operation_action:
+ type: string
+ operation_type:
+ type: string
+ type: object
+ v1.OperationRecordList:
+ properties:
+ id:
+ type: integer
+ operation_action:
+ type: string
+ operation_content:
+ type: string
+ operation_time:
+ type: string
+ operation_type_name:
+ type: string
+ operation_user:
+ $ref: '#/definitions/v1.OperationUser'
+ type: object
+ project_name:
+ type: string
+ status:
+ enum:
+ - succeeded
+ - failed
+ type: string
+ type: object
+ v1.OperationResV1:
+ properties:
+ op_code:
+ type: integer
+ op_desc:
+ type: string
+ type: object
+ v1.OperationTypeNameList:
+ properties:
+ desc:
+ type: string
+ operation_type_name:
+ type: string
+ type: object
+ v1.OperationUser:
+ properties:
+ ip:
+ type: string
+ user_name:
+ type: string
+ type: object
+ v1.ParseProjectRuleTemplateFileResDataV1:
+ properties:
+ db_type:
+ type: string
+ desc:
+ type: string
+ name:
+ type: string
+ rule_list:
+ items:
+ $ref: '#/definitions/v1.RuleResV1'
+ type: array
+ type: object
+ v1.ParseProjectRuleTemplateFileResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.ParseProjectRuleTemplateFileResDataV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.PartialSyncAuditPlanSQLsReqV1:
+ properties:
+ audit_plan_sql_list:
+ items:
+ $ref: '#/definitions/v1.AuditPlanSQLReqV1'
+ type: array
+ type: object
+ v1.PerformanceStatistics:
+ properties:
+ affect_rows:
+ $ref: '#/definitions/v1.AffectRows'
+ type: object
+ type: object
+ v1.ProjectRuleTemplateResV1:
+ properties:
+ db_type:
+ type: string
+ desc:
+ type: string
+ rule_template_name:
+ type: string
+ type: object
+ v1.ProjectScore:
+ properties:
+ score:
+ type: integer
+ type: object
+ v1.RejectWorkflowReqV1:
+ properties:
+ reason:
+ type: string
+ type: object
+ v1.RiskAuditPlan:
+ 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
+ type: object
+ v1.RiskWorkflow:
+ properties:
+ create_user_name:
+ type: string
+ update_time:
+ type: string
+ workflow_id:
+ type: string
+ workflow_name:
+ type: string
+ workflow_status:
+ type: string
+ type: object
+ v1.RoleUserCount:
+ properties:
+ count:
+ type: integer
+ role:
+ type: string
+ type: object
+ v1.RuleInfo:
+ properties:
+ annotation:
+ example: this is test rule
+ type: string
+ desc:
+ example: this is test rule
+ type: string
+ type: object
+ v1.RuleKnowledgeResV1:
+ properties:
+ knowledge_content:
+ type: string
+ rule:
+ $ref: '#/definitions/v1.RuleInfo'
+ type: object
+ type: object
+ v1.RuleParamReqV1:
+ properties:
+ key:
+ type: string
+ value:
+ type: string
+ type: object
+ v1.RuleParamResV1:
+ properties:
+ desc:
+ type: string
+ key:
+ type: string
+ type:
+ enum:
+ - string
+ - int
+ - bool
+ type: string
+ value:
+ type: string
+ type: object
+ v1.RuleProjectTemplateDetailResV1:
+ properties:
+ db_type:
+ type: string
+ desc:
+ type: string
+ rule_list:
+ items:
+ $ref: '#/definitions/v1.RuleResV1'
+ type: array
+ rule_template_name:
+ type: string
+ type: object
+ v1.RuleReqV1:
+ properties:
+ is_custom_rule:
+ type: boolean
+ level:
+ example: error
+ type: string
+ name:
+ example: ddl_check_index_count
+ type: string
+ params:
+ items:
+ $ref: '#/definitions/v1.RuleParamReqV1'
+ type: array
+ type: object
+ v1.RuleResV1:
+ properties:
+ annotation:
+ example: 避免多次 table rebuild 带来的消耗、以及对线上业务的影响
+ type: string
+ db_type:
+ example: mysql
+ type: string
+ desc:
+ type: string
+ is_custom_rule:
+ type: boolean
+ level:
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ example: error
+ type: string
+ params:
+ items:
+ $ref: '#/definitions/v1.RuleParamResV1'
+ type: array
+ rule_name:
+ type: string
+ type:
+ example: 全局配置
+ type: string
+ type: object
+ v1.RuleRespV1:
+ properties:
+ desc:
+ type: string
+ rule_name:
+ type: string
+ type: object
+ v1.RuleTemplateDetailResV1:
+ properties:
+ db_type:
+ type: string
+ desc:
+ type: string
+ rule_list:
+ items:
+ $ref: '#/definitions/v1.RuleResV1'
+ type: array
+ rule_template_name:
+ type: string
+ type: object
+ v1.RuleTemplateResV1:
+ properties:
+ db_type:
+ type: string
+ desc:
+ type: string
+ rule_template_name:
+ type: string
+ type: object
+ v1.RuleTemplateTipResV1:
+ properties:
+ db_type:
+ type: string
+ rule_template_id:
+ type: string
+ rule_template_name:
+ type: string
+ type: object
+ v1.RuleTips:
+ properties:
+ db_type:
+ type: string
+ rule:
+ items:
+ $ref: '#/definitions/v1.RuleRespV1'
+ type: array
+ type: object
+ v1.RuleTypeV1:
+ properties:
+ is_custom_rule_type:
+ type: boolean
+ rule_count:
+ type: integer
+ rule_type:
+ type: string
+ type: object
+ v1.SQLAuditRecord:
+ properties:
+ created_at:
+ type: string
+ creator:
+ type: string
+ instance:
+ $ref: '#/definitions/v1.SQLAuditRecordInstance'
+ type: object
+ sql_audit_record_id:
+ type: string
+ sql_audit_status:
+ type: string
+ tags:
+ items:
+ type: string
+ type: array
+ task:
+ $ref: '#/definitions/v1.AuditTaskResV1'
+ type: object
+ type: object
+ v1.SQLAuditRecordInstance:
+ properties:
+ db_host:
+ example: 10.10.10.10
+ type: string
+ db_port:
+ example: "3306"
+ type: string
+ type: object
+ v1.SQLAuditRecordResData:
+ properties:
+ sql_audit_record_id:
+ type: string
+ task:
+ $ref: '#/definitions/v1.AuditTaskResV1'
+ type: object
+ type: object
+ v1.SQLExplain:
+ properties:
+ classic_result:
+ $ref: '#/definitions/v1.ExplainClassicResult'
+ description: explain result in table format
+ type: object
+ message:
+ type: string
+ sql:
+ type: string
+ type: object
+ v1.SQLQueryConfigResV1:
+ properties:
+ allow_query_when_less_than_audit_level:
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ type: string
+ audit_enabled:
+ type: boolean
+ max_pre_query_rows:
+ type: integer
+ query_timeout_second:
+ type: integer
+ type: object
+ v1.Source:
+ properties:
+ audit_plan_name:
+ type: string
+ sql_audit_record_ids:
+ items:
+ type: string
+ type: array
+ type:
+ enum:
+ - audit_plan
+ - sql_audit_record
+ type: string
+ type: object
+ v1.SqlAnalysis:
+ properties:
+ performance_statistics:
+ $ref: '#/definitions/v1.PerformanceStatistics'
+ type: object
+ sql_explain:
+ $ref: '#/definitions/v1.SQLExplain'
+ type: object
+ table_metas:
+ $ref: '#/definitions/v1.TableMetas'
+ type: object
+ type: object
+ v1.SqlAnalysisResDataV1:
+ properties:
+ sql_explain:
+ $ref: '#/definitions/v1.SQLExplain'
+ type: object
+ table_metas:
+ items:
+ $ref: '#/definitions/v1.TableMeta'
+ type: array
+ type: object
+ v1.SqlAverageExecutionTime:
+ properties:
+ average_execution_seconds:
+ type: integer
+ instance_name:
+ type: string
+ max_execution_seconds:
+ type: integer
+ min_execution_seconds:
+ type: integer
+ type: object
+ v1.SqlExecutionFailPercent:
+ properties:
+ instance_name:
+ type: string
+ percent:
+ type: number
+ type: object
+ v1.SqlManage:
+ properties:
+ appear_num:
+ type: integer
+ assignees:
+ items:
+ type: string
+ type: array
+ audit_result:
+ items:
+ $ref: '#/definitions/v1.AuditResult'
+ type: array
+ 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:
+ $ref: '#/definitions/v1.Source'
+ type: object
+ sql:
+ type: string
+ sql_fingerprint:
+ type: string
+ status:
+ enum:
+ - unhandled
+ - solved
+ - ignored
+ - manual_audited
+ type: string
+ type: object
+ v1.StatisticAuditPlanResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.DBTypeAuditPlan'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.StatisticRiskWorkflowResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v1.RiskWorkflow'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.StatisticsAuditedSQLResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.AuditedSQLCount'
+ type: object
+ message:
+ example: ok
+ type: string
+ risk_rate:
+ type: integer
+ type: object
+ v1.SystemVariablesResV1:
+ properties:
+ operation_record_expired_hours:
+ type: integer
+ url:
+ type: string
+ workflow_expired_hours:
+ type: integer
+ type: object
+ v1.Table:
+ properties:
+ name:
+ type: string
+ type: object
+ v1.TableColumns:
+ properties:
+ head:
+ items:
+ $ref: '#/definitions/v1.TableMetaItemHeadResV1'
+ type: array
+ rows:
+ items:
+ additionalProperties:
+ type: string
+ type: object
+ type: array
+ type: object
+ v1.TableIndexes:
+ properties:
+ head:
+ items:
+ $ref: '#/definitions/v1.TableMetaItemHeadResV1'
+ type: array
+ rows:
+ items:
+ additionalProperties:
+ type: string
+ type: object
+ type: array
+ type: object
+ v1.TableMeta:
+ properties:
+ columns:
+ $ref: '#/definitions/v1.TableColumns'
+ type: object
+ create_table_sql:
+ type: string
+ indexes:
+ $ref: '#/definitions/v1.TableIndexes'
+ type: object
+ message:
+ type: string
+ name:
+ type: string
+ schema:
+ type: string
+ type: object
+ v1.TableMetaItemHeadResV1:
+ properties:
+ desc:
+ type: string
+ field_name:
+ type: string
+ type: object
+ v1.TableMetas:
+ properties:
+ err_message:
+ type: string
+ table_meta_items:
+ items:
+ $ref: '#/definitions/v1.TableMeta'
+ type: array
+ type: object
+ v1.TestAuditPlanNotifyConfigResDataV1:
+ properties:
+ is_notify_send_normal:
+ type: boolean
+ send_error_message:
+ type: string
+ type: object
+ v1.TestAuditPlanNotifyConfigResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.TestAuditPlanNotifyConfigResDataV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.TestDingTalkConfigResDataV1:
+ properties:
+ is_ding_talk_send_normal:
+ type: boolean
+ send_error_message:
+ type: string
+ type: object
+ v1.TestDingTalkConfigResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.TestDingTalkConfigResDataV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.TestFeishuConfigResDataV1:
+ properties:
+ error_message:
+ type: string
+ is_message_sent_normally:
+ type: boolean
+ type: object
+ v1.TestFeishuConfigResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.TestFeishuConfigResDataV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.TestFeishuConfigurationReqV1:
+ properties:
+ account:
+ type: string
+ account_type:
+ enum:
+ - email
+ - phone
+ type: string
+ type: object
+ v1.TimeResV1:
+ properties:
+ hour:
+ type: integer
+ minute:
+ type: integer
+ type: object
+ v1.TriggerAuditPlanResV1:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v1.AuditPlanReportResV1'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v1.UpdateAuditPlanNotifyConfigReqV1:
+ properties:
+ enable_email_notify:
+ type: boolean
+ enable_web_hook_notify:
+ type: boolean
+ notify_interval:
+ default: 10
+ type: integer
+ notify_level:
+ default: warn
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ type: string
+ web_hook_template:
+ type: string
+ web_hook_url:
+ type: string
+ type: object
+ v1.UpdateAuditPlanReqV1:
+ properties:
+ audit_plan_cron:
+ example: 0 */2 * * *
+ type: string
+ audit_plan_instance_database:
+ example: app1
+ type: string
+ audit_plan_instance_name:
+ example: test_mysql
+ type: string
+ audit_plan_params:
+ items:
+ $ref: '#/definitions/v1.AuditPlanParamReqV1'
+ type: array
+ rule_template_name:
+ example: default_MySQL
+ type: string
+ type: object
+ v1.UpdateAuditTaskSQLsReqV1:
+ properties:
+ description:
+ type: string
+ type: object
+ v1.UpdateAuditWhitelistReqV1:
+ properties:
+ desc:
+ example: used for rapid release
+ type: string
+ match_type:
+ enum:
+ - exact_match
+ - fp_match
+ example: exact_match
+ type: string
+ value:
+ example: create table
+ type: string
+ type: object
+ v1.UpdateCompanyNoticeReq:
+ properties:
+ notice_str:
+ type: string
+ type: object
+ v1.UpdateCustomRuleReqV1:
+ properties:
+ annotation:
+ example: this is test rule
+ type: string
+ desc:
+ example: this is test rule
+ type: string
+ level:
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ example: notice
+ type: string
+ rule_script:
+ type: string
+ type:
+ example: DDL规则
+ type: string
+ type: object
+ v1.UpdateDingTalkConfigurationReqV1:
+ properties:
+ app_key:
+ type: string
+ app_secret:
+ type: string
+ is_enable_ding_talk_notify:
+ type: boolean
+ required:
+ - app_key
+ - app_secret
+ - is_enable_ding_talk_notify
+ type: object
+ v1.UpdateFeishuConfigurationReqV1:
+ properties:
+ app_id:
+ type: string
+ app_secret:
+ type: string
+ is_feishu_notification_enabled:
+ type: boolean
+ required:
+ - app_id
+ - app_secret
+ - is_feishu_notification_enabled
+ type: object
+ v1.UpdateProjectRuleTemplateReqV1:
+ properties:
+ desc:
+ type: string
+ rule_list:
+ items:
+ $ref: '#/definitions/v1.RuleReqV1'
+ type: array
+ type: object
+ v1.UpdateRuleKnowledgeReq:
+ properties:
+ knowledge_content:
+ type: string
+ type: object
+ v1.UpdateRuleTemplateReqV1:
+ properties:
+ desc:
+ type: string
+ rule_list:
+ items:
+ $ref: '#/definitions/v1.RuleReqV1'
+ type: array
+ type: object
+ v1.UpdateSQLAuditRecordReqV1:
+ properties:
+ tags:
+ items:
+ type: string
+ type: array
+ type: object
+ v1.UpdateSystemVariablesReqV1:
+ properties:
+ operation_record_expired_hours:
+ example: 2160
+ type: integer
+ url:
+ example: http://10.186.61.32:8080
+ type: string
+ workflow_expired_hours:
+ example: 720
+ type: integer
+ type: object
+ v1.UpdateWorkflowReqV1:
+ properties:
+ task_ids:
+ items:
+ type: integer
+ type: array
+ type: object
+ v1.UpdateWorkflowScheduleReqV1:
+ properties:
+ schedule_time:
+ type: string
+ type: object
+ v1.UpdateWorkflowTemplateReqV1:
+ properties:
+ allow_submit_when_less_audit_level:
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ type: string
+ desc:
+ type: string
+ workflow_step_template_list:
+ items:
+ $ref: '#/definitions/v1.WorkFlowStepTemplateReqV1'
+ type: array
+ type: object
+ v1.UserTipResV1:
+ properties:
+ user_id:
+ type: string
+ user_name:
+ type: string
+ type: object
+ v1.WorkFlowStepTemplateReqV1:
+ properties:
+ approved_by_authorized:
+ type: boolean
+ assignee_user_id_list:
+ items:
+ type: string
+ type: array
+ desc:
+ type: string
+ execute_by_authorized:
+ type: boolean
+ type:
+ enum:
+ - sql_review
+ - sql_execute
+ type: string
+ type: object
+ v1.WorkFlowStepTemplateResV1:
+ properties:
+ approved_by_authorized:
+ type: boolean
+ assignee_user_id_list:
+ items:
+ type: string
+ type: array
+ desc:
+ type: string
+ execute_by_authorized:
+ type: boolean
+ number:
+ type: integer
+ type:
+ type: string
+ type: object
+ v1.WorkflowAuditPassPercentV1:
+ properties:
+ audit_pass_percent:
+ type: number
+ type: object
+ v1.WorkflowCountsV1:
+ properties:
+ today_count:
+ type: integer
+ total:
+ type: integer
+ type: object
+ v1.WorkflowCreatedCountsEachDayItem:
+ properties:
+ date:
+ example: "2022-08-24"
+ type: string
+ value:
+ type: integer
+ type: object
+ v1.WorkflowCreatedCountsEachDayV1:
+ properties:
+ samples:
+ items:
+ $ref: '#/definitions/v1.WorkflowCreatedCountsEachDayItem'
+ type: array
+ type: object
+ v1.WorkflowDetailResV1:
+ properties:
+ create_time:
+ type: string
+ create_user_name:
+ type: string
+ current_step_assignee_user_name_list:
+ items:
+ type: string
+ type: array
+ current_step_type:
+ enum:
+ - sql_review
+ - sql_execute
+ type: string
+ desc:
+ type: string
+ project_name:
+ type: string
+ status:
+ enum:
+ - wait_for_audit
+ - wait_for_execution
+ - rejected
+ - canceled
+ - exec_failed
+ - executing
+ - finished
+ type: string
+ workflow_id:
+ type: string
+ workflow_name:
+ type: string
+ type: object
+ v1.WorkflowPassPercentV1:
+ properties:
+ audit_pass_percent:
+ type: number
+ execution_success_percent:
+ type: number
+ type: object
+ v1.WorkflowPercentCountedByInstanceType:
+ properties:
+ count:
+ type: integer
+ instance_type:
+ type: string
+ percent:
+ type: number
+ type: object
+ v1.WorkflowPercentCountedByInstanceTypeV1:
+ properties:
+ workflow_percents:
+ items:
+ $ref: '#/definitions/v1.WorkflowPercentCountedByInstanceType'
+ type: array
+ workflow_total_num:
+ type: integer
+ type: object
+ v1.WorkflowRecordResV1:
+ properties:
+ current_step_number:
+ type: integer
+ status:
+ enum:
+ - wait_for_audit
+ - wait_for_execution
+ - rejected
+ - canceled
+ - exec_failed
+ - executing
+ - finished
+ type: string
+ tasks:
+ items:
+ $ref: '#/definitions/v1.WorkflowTaskItem'
+ type: array
+ workflow_step_list:
+ items:
+ $ref: '#/definitions/v1.WorkflowStepResV1'
+ type: array
+ type: object
+ v1.WorkflowRejectedPercentGroupByCreator:
+ properties:
+ creator:
+ type: string
+ rejected_percent:
+ type: number
+ workflow_total_num:
+ type: integer
+ type: object
+ v1.WorkflowRejectedPercentGroupByInstance:
+ properties:
+ instance_name:
+ type: string
+ rejected_percent:
+ type: number
+ workflow_total_num:
+ type: integer
+ type: object
+ v1.WorkflowResV1:
+ properties:
+ create_time:
+ type: string
+ create_user_name:
+ type: string
+ desc:
+ type: string
+ mode:
+ enum:
+ - same_sqls
+ - different_sqls
+ type: string
+ record:
+ $ref: '#/definitions/v1.WorkflowRecordResV1'
+ type: object
+ record_history_list:
+ items:
+ $ref: '#/definitions/v1.WorkflowRecordResV1'
+ type: array
+ workflow_name:
+ type: string
+ type: object
+ v1.WorkflowStageDuration:
+ properties:
+ minutes:
+ type: integer
+ type: object
+ v1.WorkflowStatisticsResV1:
+ 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
+ type: object
+ v1.WorkflowStatusCountV1:
+ 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
+ type: object
+ v1.WorkflowStepResV1:
+ properties:
+ assignee_user_name_list:
+ items:
+ type: string
+ type: array
+ desc:
+ type: string
+ number:
+ type: integer
+ operation_time:
+ type: string
+ operation_user_name:
+ type: string
+ reason:
+ type: string
+ state:
+ enum:
+ - initialized
+ - approved
+ - rejected
+ type: string
+ type:
+ enum:
+ - create_workflow
+ - update_workflow
+ - sql_review
+ - sql_execute
+ type: string
+ workflow_step_id:
+ type: integer
+ type: object
+ v1.WorkflowTaskItem:
+ properties:
+ task_id:
+ type: integer
+ type: object
+ v1.WorkflowTemplateDetailResV1:
+ properties:
+ allow_submit_when_less_audit_level:
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ type: string
+ desc:
+ type: string
+ update_time:
+ type: string
+ workflow_step_template_list:
+ items:
+ $ref: '#/definitions/v1.WorkFlowStepTemplateResV1'
+ type: array
+ workflow_template_name:
+ type: string
+ type: object
+ v2.AffectRows:
+ properties:
+ count:
+ type: integer
+ err_message:
+ type: string
+ type: object
+ v2.AuditPlanReportSQLResV2:
+ properties:
+ audit_plan_report_sql:
+ example: select * from t1 where id = 1
+ type: string
+ audit_plan_report_sql_audit_result:
+ items:
+ $ref: '#/definitions/v2.AuditResult'
+ type: array
+ number:
+ example: 1
+ type: integer
+ type: object
+ v2.AuditPlanResV2:
+ properties:
+ audit_plan_cron:
+ example: 0 */2 * * *
+ type: string
+ audit_plan_db_type:
+ example: mysql
+ type: string
+ audit_plan_instance_database:
+ example: app1
+ type: string
+ audit_plan_instance_name:
+ example: test_mysql
+ type: string
+ audit_plan_meta:
+ $ref: '#/definitions/v1.AuditPlanMetaV1'
+ type: object
+ audit_plan_name:
+ example: audit_for_java_app1
+ type: string
+ audit_plan_token:
+ example: it's a JWT Token for scanner
+ type: string
+ rule_template:
+ $ref: '#/definitions/v2.RuleTemplateV2'
+ type: object
+ type: object
+ v2.AuditPlanSQLReqV2:
+ properties:
+ audit_plan_sql_counter:
+ example: "6"
+ type: string
+ audit_plan_sql_fingerprint:
+ example: select * from t1 where id = ?
+ type: string
+ audit_plan_sql_last_receive_text:
+ example: select * from t1 where id = 1
+ type: string
+ audit_plan_sql_last_receive_timestamp:
+ example: RFC3339
+ type: string
+ audit_plan_sql_schema:
+ example: db1
+ type: string
+ db_user:
+ example: database_user001
+ type: string
+ endpoints:
+ items:
+ type: string
+ type: array
+ first_query_at:
+ example: "2023-09-12T02:48:01.317880Z"
+ type: string
+ query_time_avg:
+ example: 3.22
+ type: number
+ query_time_max:
+ example: 5.22
+ type: number
+ type: object
+ v2.AuditResDataV2:
+ properties:
+ audit_level:
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ - ""
+ type: string
+ pass_rate:
+ type: number
+ score:
+ type: integer
+ sql_results:
+ items:
+ $ref: '#/definitions/v2.AuditSQLResV2'
+ type: array
+ type: object
+ v2.AuditResult:
+ properties:
+ db_type:
+ type: string
+ level:
+ example: warn
+ type: string
+ message:
+ example: 避免使用不必要的内置函数md5()
+ type: string
+ rule_name:
+ type: string
+ type: object
+ v2.AuditSQLResV2:
+ properties:
+ audit_level:
+ type: string
+ audit_result:
+ items:
+ $ref: '#/definitions/v2.AuditResult'
+ type: array
+ exec_sql:
+ type: string
+ number:
+ type: integer
+ type: object
+ v2.AuditTaskSQLResV2:
+ properties:
+ audit_level:
+ type: string
+ audit_result:
+ items:
+ $ref: '#/definitions/v2.AuditResult'
+ type: array
+ audit_status:
+ type: string
+ description:
+ type: string
+ exec_result:
+ type: string
+ exec_sql:
+ type: string
+ exec_status:
+ type: string
+ number:
+ type: integer
+ rollback_sql:
+ type: string
+ sql_source_file:
+ type: string
+ type: object
+ v2.BatchCancelWorkflowsReqV2:
+ properties:
+ workflow_id_list:
+ items:
+ type: string
+ type: array
+ type: object
+ v2.BatchCompleteWorkflowsReqV2:
+ properties:
+ workflow_id_list:
+ items:
+ type: string
+ type: array
+ type: object
+ v2.CreateWorkflowReqV2:
+ properties:
+ desc:
+ type: string
+ task_ids:
+ items:
+ type: integer
+ type: array
+ workflow_subject:
+ type: string
+ type: object
+ v2.CreateWorkflowResV2:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v2.CreateWorkflowResV2Data'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v2.CreateWorkflowResV2Data:
+ properties:
+ workflow_id:
+ type: string
+ type: object
+ v2.DirectAuditFileReqV2:
+ properties:
+ file_contents:
+ description: |-
+ 调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现
+ 每个数组元素是一个文件内容
+ example:
+ - select * from t1; select * from t2;
+ items:
+ type: string
+ type: array
+ instance_name:
+ example: instance1
+ type: string
+ instance_type:
+ example: MySQL
+ type: string
+ project_name:
+ example: project1
+ type: string
+ schema_name:
+ example: schema1
+ type: string
+ sql_type:
+ enum:
+ - sql
+ - mybatis
+ - ""
+ example: sql
+ type: string
+ type: object
+ v2.DirectAuditReqV2:
+ properties:
+ instance_type:
+ example: MySQL
+ type: string
+ sql_content:
+ description: 调用方不应该关心SQL是否被完美的拆分成独立的条目, 拆分SQL由SQLE实现
+ example: select * from t1; select * from t2;
+ type: string
+ sql_type:
+ enum:
+ - sql
+ - mybatis
+ - ""
+ example: sql
+ type: string
+ type: object
+ v2.DirectAuditResV2:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v2.AuditResDataV2'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v2.DriverMeta:
+ properties:
+ default_port:
+ type: integer
+ driver_name:
+ type: string
+ logo_url:
+ type: string
+ type: object
+ v2.FullSyncAuditPlanSQLsReqV2:
+ properties:
+ audit_plan_sql_list:
+ items:
+ $ref: '#/definitions/v2.AuditPlanSQLReqV2'
+ type: array
+ type: object
+ v2.GetAuditPlanAnalysisDataResV2:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v2.TaskAnalysisDataV2'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v2.GetAuditPlanReportSQLsResV2:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v2.AuditPlanReportSQLResV2'
+ type: array
+ message:
+ example: ok
+ type: string
+ total_nums:
+ type: integer
+ type: object
+ v2.GetAuditPlansResV2:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v2.AuditPlanResV2'
+ type: array
+ message:
+ example: ok
+ type: string
+ total_nums:
+ type: integer
+ type: object
+ v2.GetAuditTaskSQLsResV2:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v2.AuditTaskSQLResV2'
+ type: array
+ message:
+ example: ok
+ type: string
+ total_nums:
+ type: integer
+ type: object
+ v2.GetDriversRes:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v2.DriverMeta'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v2.GetInstanceResV2:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v2.InstanceResV2'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v2.GetSqlManageListResp:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v2.SqlManage'
+ type: array
+ message:
+ example: ok
+ type: string
+ sql_manage_bad_num:
+ type: integer
+ sql_manage_optimized_num:
+ type: integer
+ sql_manage_total_num:
+ type: integer
+ type: object
+ v2.GetTaskAnalysisDataResV2:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v2.TaskAnalysisDataV2'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v2.GetWorkflowResV2:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ $ref: '#/definitions/v2.WorkflowResV2'
+ type: object
+ message:
+ example: ok
+ type: string
+ type: object
+ v2.GetWorkflowTasksItemV2:
+ properties:
+ current_step_assignee_user_name_list:
+ items:
+ type: string
+ type: array
+ exec_end_time:
+ type: string
+ exec_start_time:
+ type: string
+ execution_user_name:
+ type: string
+ instance_maintenance_times:
+ items:
+ $ref: '#/definitions/v1.MaintenanceTimeResV1'
+ type: array
+ instance_name:
+ type: string
+ schedule_time:
+ type: string
+ status:
+ enum:
+ - wait_for_audit
+ - wait_for_execution
+ - exec_scheduled
+ - exec_failed
+ - exec_succeeded
+ - executing
+ - manually_executed
+ - terminating
+ - terminate_succeeded
+ - terminate_failed
+ type: string
+ task_id:
+ type: integer
+ task_pass_rate:
+ type: number
+ task_score:
+ type: integer
+ type: object
+ v2.GetWorkflowTasksResV2:
+ properties:
+ code:
+ example: 0
+ type: integer
+ data:
+ items:
+ $ref: '#/definitions/v2.GetWorkflowTasksItemV2'
+ type: array
+ message:
+ example: ok
+ type: string
+ type: object
+ v2.InstanceResV2:
+ properties:
+ additional_params:
+ items:
+ $ref: '#/definitions/v1.InstanceAdditionalParamResV1'
+ type: array
+ db_host:
+ example: 10.10.10.10
+ type: string
+ db_port:
+ example: "3306"
+ type: string
+ db_type:
+ example: mysql
+ type: string
+ db_user:
+ example: root
+ type: string
+ desc:
+ example: this is a instance
+ type: string
+ instance_name:
+ type: string
+ maintenance_times:
+ items:
+ $ref: '#/definitions/v1.MaintenanceTimeResV1'
+ type: array
+ rule_template:
+ $ref: '#/definitions/v2.RuleTemplateV2'
+ type: object
+ source:
+ example: SQLE
+ type: string
+ sql_query_config:
+ $ref: '#/definitions/v1.SQLQueryConfigResV1'
+ type: object
+ type: object
+ v2.PartialSyncAuditPlanSQLsReqV2:
+ properties:
+ audit_plan_sql_list:
+ items:
+ $ref: '#/definitions/v2.AuditPlanSQLReqV2'
+ type: array
+ type: object
+ v2.PerformanceStatistics:
+ properties:
+ affect_rows:
+ $ref: '#/definitions/v2.AffectRows'
+ type: object
+ type: object
+ v2.RejectWorkflowReqV2:
+ properties:
+ reason:
+ type: string
+ type: object
+ v2.RuleTemplateV2:
+ properties:
+ is_global_rule_template:
+ type: boolean
+ name:
+ type: string
+ type: object
+ v2.SQLExplain:
+ properties:
+ classic_result:
+ $ref: '#/definitions/v1.ExplainClassicResult'
+ type: object
+ err_message:
+ type: string
+ sql:
+ type: string
+ type: object
+ v2.SqlManage:
+ properties:
+ assignees:
+ items:
+ type: string
+ type: array
+ audit_result:
+ items:
+ $ref: '#/definitions/v1.AuditResult'
+ type: array
+ endpoints:
+ items:
+ type: string
+ type: array
+ first_appear_timestamp:
+ type: string
+ fp_count:
+ type: integer
+ id:
+ type: integer
+ instance_name:
+ type: string
+ last_receive_timestamp:
+ type: string
+ remark:
+ type: string
+ schema_name:
+ type: string
+ source:
+ $ref: '#/definitions/v1.Source'
+ type: object
+ sql:
+ type: string
+ sql_fingerprint:
+ type: string
+ status:
+ enum:
+ - unhandled
+ - solved
+ - ignored
+ - manual_audited
+ type: string
+ type: object
+ v2.TableMetas:
+ properties:
+ err_message:
+ type: string
+ table_meta_items:
+ items:
+ $ref: '#/definitions/v1.TableMeta'
+ type: array
+ type: object
+ v2.TaskAnalysisDataV2:
+ properties:
+ performance_statistics:
+ $ref: '#/definitions/v2.PerformanceStatistics'
+ type: object
+ sql_explain:
+ $ref: '#/definitions/v2.SQLExplain'
+ type: object
+ table_metas:
+ $ref: '#/definitions/v2.TableMetas'
+ type: object
+ type: object
+ v2.UpdateWorkflowReqV2:
+ properties:
+ task_ids:
+ items:
+ type: integer
+ type: array
+ type: object
+ v2.UpdateWorkflowScheduleReqV2:
+ properties:
+ schedule_time:
+ type: string
+ type: object
+ v2.WorkflowRecordResV2:
+ properties:
+ current_step_number:
+ type: integer
+ status:
+ enum:
+ - wait_for_audit
+ - wait_for_execution
+ - rejected
+ - canceled
+ - exec_failed
+ - executing
+ - finished
+ type: string
+ tasks:
+ items:
+ $ref: '#/definitions/v2.WorkflowTaskItem'
+ type: array
+ workflow_step_list:
+ items:
+ $ref: '#/definitions/v2.WorkflowStepResV2'
+ type: array
+ type: object
+ v2.WorkflowResV2:
+ properties:
+ create_time:
+ type: string
+ create_user_name:
+ type: string
+ desc:
+ type: string
+ mode:
+ enum:
+ - same_sqls
+ - different_sqls
+ type: string
+ record:
+ $ref: '#/definitions/v2.WorkflowRecordResV2'
+ type: object
+ record_history_list:
+ items:
+ $ref: '#/definitions/v2.WorkflowRecordResV2'
+ type: array
+ workflow_id:
+ type: string
+ workflow_name:
+ type: string
+ type: object
+ v2.WorkflowStepResV2:
+ properties:
+ assignee_user_name_list:
+ items:
+ type: string
+ type: array
+ desc:
+ type: string
+ number:
+ type: integer
+ operation_time:
+ type: string
+ operation_user_name:
+ type: string
+ reason:
+ type: string
+ state:
+ enum:
+ - initialized
+ - approved
+ - rejected
+ type: string
+ type:
+ enum:
+ - create_workflow
+ - update_workflow
+ - sql_review
+ - sql_execute
+ type: string
+ workflow_step_id:
+ type: integer
+ type: object
+ v2.WorkflowTaskItem:
+ properties:
+ task_id:
+ type: integer
+ type: object
+info:
+ contact: {}
+ description: This is a sample server for dev.
+ license: {}
+ title: Sqle API Docs
+ version: "1.0"
+paths:
+ /v1/audit_files:
+ post:
+ description: Direct audit sql from SQL files and MyBatis files
+ operationId: directAuditFilesV1
+ parameters:
+ - description: files that should be audited
+ in: body
+ name: req
+ required: true
+ schema:
+ $ref: '#/definitions/v1.DirectAuditFileReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.DirectAuditResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 直接从文件内容提取SQL并审核,SQL文件暂时只支持一次解析一个文件
+ tags:
+ - sql_audit
+ /v1/audit_plan_metas:
+ get:
+ description: get audit plan metas
+ operationId: getAuditPlanMetasV1
+ parameters:
+ - description: filter instance type
+ in: query
+ name: filter_instance_type
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetAuditPlanMetasResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取扫描任务元信息
+ tags:
+ - audit_plan
+ /v1/audit_plan_types:
+ get:
+ description: get audit plan types
+ operationId: getAuditPlanTypesV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetAuditPlanTypesResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取扫描任务类型
+ tags:
+ - audit_plan
+ /v1/company_notice:
+ get:
+ description: get company notice info
+ operationId: getCompanyNotice
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetCompanyNoticeResp'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取企业公告
+ tags:
+ - companyNotice
+ patch:
+ consumes:
+ - application/json
+ description: update company notice info
+ operationId: updateCompanyNotice
+ parameters:
+ - description: company notice
+ in: body
+ name: companyNotice
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateCompanyNoticeReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 更新企业公告
+ tags:
+ - companyNotice
+ /v1/configurations/ding_talk:
+ get:
+ description: get dingTalk configuration
+ operationId: getDingTalkConfigurationV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetDingTalkConfigurationResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取 dingTalk 配置
+ tags:
+ - configuration
+ patch:
+ consumes:
+ - application/json
+ description: update DingTalk configuration
+ operationId: updateDingTalkConfigurationV1
+ parameters:
+ - description: update DingTalk configuration req
+ in: body
+ name: instance
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateDingTalkConfigurationReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 添加或更新 DingTalk 配置
+ tags:
+ - configuration
+ /v1/configurations/ding_talk/test:
+ post:
+ consumes:
+ - application/json
+ description: test DingTalk configuration
+ operationId: testDingTalkConfigV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.TestDingTalkConfigResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 测试 DingTalk 配置
+ tags:
+ - configuration
+ /v1/configurations/drivers:
+ get:
+ description: get drivers
+ operationId: getDriversV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetDriversResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取当前 server 支持的审核类型
+ tags:
+ - configuration
+ /v1/configurations/feishu_audit:
+ get:
+ description: get feishu audit configuration
+ operationId: getFeishuAuditConfigurationV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetFeishuAuditConfigurationResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取飞书审核配置
+ tags:
+ - configuration
+ patch:
+ consumes:
+ - application/json
+ description: update feishu audit configuration
+ operationId: updateFeishuAuditConfigurationV1
+ parameters:
+ - description: update feishu audit configuration req
+ in: body
+ name: param
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateFeishuConfigurationReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 添加或更新飞书配置
+ tags:
+ - configuration
+ /v1/configurations/feishu_audit/test:
+ post:
+ consumes:
+ - application/json
+ description: test feishu audit configuration
+ operationId: testFeishuAuditConfigV1
+ parameters:
+ - description: test feishu configuration req
+ in: body
+ name: req
+ required: true
+ schema:
+ $ref: '#/definitions/v1.TestFeishuConfigurationReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.TestFeishuConfigResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 测试飞书审批配置
+ tags:
+ - configuration
+ /v1/configurations/license:
+ get:
+ description: get sqle license
+ operationId: getSQLELicenseV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetLicenseResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取 sqle license
+ tags:
+ - configuration
+ post:
+ consumes:
+ - multipart/form-data
+ description: set sqle license
+ operationId: setSQLELicenseV1
+ parameters:
+ - description: SQLE license file
+ in: formData
+ name: license_file
+ required: true
+ type: file
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 导入 sqle license
+ tags:
+ - configuration
+ /v1/configurations/license/check:
+ post:
+ consumes:
+ - multipart/form-data
+ description: parse and check sqle license
+ operationId: checkSQLELicenseV1
+ parameters:
+ - description: SQLE license file
+ in: formData
+ name: license_file
+ required: true
+ type: file
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.CheckLicenseResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 解析和校验 sqle license
+ tags:
+ - configuration
+ /v1/configurations/license/info:
+ get:
+ description: get the information needed to generate the sqle license
+ operationId: GetSQLELicenseInfoV1
+ responses:
+ "200":
+ description: server info
+ schema:
+ type: file
+ security:
+ - ApiKeyAuth: []
+ summary: 获取生成 sqle license需要的的信息
+ tags:
+ - configuration
+ /v1/configurations/system_variables:
+ get:
+ description: get system variables
+ operationId: getSystemVariablesV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetSystemVariablesResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取系统变量
+ tags:
+ - configuration
+ patch:
+ consumes:
+ - application/json
+ description: update system variables
+ operationId: updateSystemVariablesV1
+ parameters:
+ - description: update system variables request
+ in: body
+ name: instance
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateSystemVariablesReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 修改系统变量
+ tags:
+ - configuration
+ /v1/custom_rules:
+ get:
+ description: get all custom rule template
+ operationId: getCustomRulesV1
+ parameters:
+ - description: filter db type
+ in: query
+ name: filter_db_type
+ type: string
+ - description: filter desc
+ in: query
+ name: filter_desc
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetCustomRulesResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 自定义规则列表
+ tags:
+ - rule_template
+ post:
+ description: create custom rule
+ operationId: createCustomRuleV1
+ parameters:
+ - description: add custom rule
+ in: body
+ name: instance
+ required: true
+ schema:
+ $ref: '#/definitions/v1.CreateCustomRuleReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 添加自定义规则
+ tags:
+ - rule_template
+ /v1/custom_rules/{db_type}/rule_types:
+ get:
+ description: get rule type by db type
+ operationId: getRuleTypeByDBTypeV1
+ parameters:
+ - description: db type
+ in: query
+ name: db_type
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetRuleTypeByDBTypeResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取规则分类
+ tags:
+ - rule_template
+ /v1/custom_rules/{rule_id}:
+ delete:
+ description: delete custom rule
+ operationId: deleteCustomRuleV1
+ parameters:
+ - description: rule id
+ in: path
+ name: rule_id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 删除自定义规则
+ tags:
+ - rule_template
+ get:
+ description: get custom rule by rule_id
+ operationId: getCustomRuleV1
+ parameters:
+ - description: rule id
+ in: path
+ name: rule_id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetCustomRuleResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取自定义规则
+ tags:
+ - rule_template
+ patch:
+ description: update custom rule
+ operationId: updateCustomRuleV1
+ parameters:
+ - description: rule id
+ in: path
+ name: rule_id
+ required: true
+ type: string
+ - description: update custom rule
+ in: body
+ name: instance
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateCustomRuleReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 更新自定义规则
+ tags:
+ - rule_template
+ /v1/dashboard:
+ get:
+ description: get dashboard info
+ operationId: getDashboardV1
+ parameters:
+ - description: filter project name
+ in: query
+ name: filter_project_name
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetDashboardResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取 dashboard 信息
+ tags:
+ - dashboard
+ /v1/operation_records:
+ get:
+ description: Get operation record list
+ operationId: getOperationRecordListV1
+ parameters:
+ - description: filter_operate_time_from
+ in: query
+ name: filter_operate_time_from
+ type: string
+ - description: filter_operate_time_to
+ in: query
+ name: filter_operate_time_to
+ type: string
+ - description: filter_operate_project_name
+ in: query
+ name: filter_operate_project_name
+ type: string
+ - description: fuzzy_search_operate_user_name
+ in: query
+ name: fuzzy_search_operate_user_name
+ type: string
+ - description: filter_operate_type_name
+ in: query
+ name: filter_operate_type_name
+ type: string
+ - description: filter_operate_action
+ in: query
+ name: filter_operate_action
+ type: string
+ - description: page_index
+ in: query
+ name: page_index
+ required: true
+ type: integer
+ - description: page_size
+ in: query
+ name: page_size
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetOperationRecordListResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取操作记录列表
+ tags:
+ - OperationRecord
+ /v1/operation_records/exports:
+ get:
+ description: Export operation record list
+ operationId: getExportOperationRecordListV1
+ parameters:
+ - description: filter_operate_time_from
+ in: query
+ name: filter_operate_time_from
+ type: string
+ - description: filter_operate_time_to
+ in: query
+ name: filter_operate_time_to
+ type: string
+ - description: filter_operate_project_name
+ in: query
+ name: filter_operate_project_name
+ type: string
+ - description: fuzzy_search_operate_user_name
+ in: query
+ name: fuzzy_search_operate_user_name
+ type: string
+ - description: filter_operate_type_name
+ in: query
+ name: filter_operate_type_name
+ type: string
+ - description: filter_operate_action
+ in: query
+ name: filter_operate_action
+ type: string
+ responses:
+ "200":
+ description: get export operation record list
+ schema:
+ type: file
+ security:
+ - ApiKeyAuth: []
+ summary: 导出操作记录列表
+ tags:
+ - OperationRecord
+ /v1/operation_records/operation_actions:
+ get:
+ description: Get operation action list
+ operationId: getOperationActionList
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetOperationActionListResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取操作内容列表
+ tags:
+ - OperationRecord
+ /v1/operation_records/operation_type_names:
+ get:
+ description: Get operation type name list
+ operationId: GetOperationTypeNameList
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetOperationTypeNamesListResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取操作类型名列表
+ tags:
+ - OperationRecord
+ /v1/operations:
+ get:
+ description: get permission operations
+ operationId: GetOperationsV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetOperationsResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取权限动作列表
+ tags:
+ - operation
+ /v1/projects/{project_name}/audit_plans:
+ get:
+ description: get audit plan info list
+ operationId: getAuditPlansV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: filter audit plan db type
+ in: query
+ name: filter_audit_plan_db_type
+ type: string
+ - description: fuzzy search audit plan name
+ in: query
+ name: fuzzy_search_audit_plan_name
+ type: string
+ - description: filter audit plan type
+ in: query
+ name: filter_audit_plan_type
+ type: string
+ - description: filter audit plan instance name
+ in: query
+ name: filter_audit_plan_instance_name
+ type: string
+ - description: page index
+ in: query
+ name: page_index
+ required: true
+ type: integer
+ - description: size of per page
+ in: query
+ name: page_size
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetAuditPlansResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取扫描任务信息列表
+ tags:
+ - audit_plan
+ post:
+ consumes:
+ - application/json
+ description: create audit plan
+ operationId: createAuditPlanV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: create audit plan
+ in: body
+ name: audit_plan
+ required: true
+ schema:
+ $ref: '#/definitions/v1.CreateAuditPlanReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 添加扫描任务
+ tags:
+ - audit_plan
+ /v1/projects/{project_name}/audit_plans/{audit_plan_name}/:
+ delete:
+ description: delete audit plan
+ operationId: deleteAuditPlanV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 删除扫描任务
+ tags:
+ - audit_plan
+ get:
+ description: get audit plan
+ operationId: getAuditPlanV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetAuditPlanResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取指定扫描任务
+ tags:
+ - audit_plan
+ patch:
+ description: update audit plan
+ operationId: updateAuditPlanV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ - description: update audit plan
+ in: body
+ name: audit_plan
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateAuditPlanReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 更新扫描任务
+ tags:
+ - audit_plan
+ /v1/projects/{project_name}/audit_plans/{audit_plan_name}/notify_config:
+ get:
+ description: get audit plan notify config
+ operationId: getAuditPlanNotifyConfigV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetAuditPlanNotifyConfigResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取扫描任务消息推送设置
+ tags:
+ - audit_plan
+ patch:
+ description: update audit plan notify config
+ operationId: updateAuditPlanNotifyConfigV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ - description: update audit plan notify config
+ in: body
+ name: config
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateAuditPlanNotifyConfigReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 更新扫描任务通知设置
+ tags:
+ - audit_plan
+ /v1/projects/{project_name}/audit_plans/{audit_plan_name}/notify_config/test:
+ get:
+ description: Test audit task message push
+ operationId: testAuditPlanNotifyConfigV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.TestAuditPlanNotifyConfigResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 测试扫描任务消息推送
+ tags:
+ - audit_plan
+ /v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports:
+ get:
+ description: get audit plan report list
+ operationId: getAuditPlanReportsV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ - description: page index
+ in: query
+ name: page_index
+ required: true
+ type: integer
+ - description: size of per page
+ in: query
+ name: page_size
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetAuditPlanReportsResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取指定扫描任务的报告列表
+ tags:
+ - audit_plan
+ /v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/:
+ get:
+ description: get audit plan report
+ operationId: getAuditPlanReportV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ - description: audit plan report id
+ in: path
+ name: audit_plan_report_id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetAuditPlanReportResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取指定扫描任务的SQL扫描记录统计信息
+ tags:
+ - audit_plan
+ /v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/export:
+ get:
+ description: export audit plan report as csv
+ operationId: exportAuditPlanReportV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ - description: audit plan report id
+ in: path
+ name: audit_plan_report_id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: get export audit plan report
+ schema:
+ type: file
+ security:
+ - ApiKeyAuth: []
+ summary: 以csv的形式导出扫描报告
+ tags:
+ - audit_plan
+ /v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls:
+ get:
+ description: get audit plan report SQLs
+ operationId: getAuditPlanReportsSQLsV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ - description: audit plan report id
+ in: path
+ name: audit_plan_report_id
+ required: true
+ type: string
+ - description: page index
+ in: query
+ name: page_index
+ required: true
+ type: integer
+ - description: size of per page
+ in: query
+ name: page_size
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetAuditPlanReportSQLsResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取指定扫描任务的SQL扫描详情
+ tags:
+ - audit_plan
+ /v1/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls/{number}/analysis:
+ get:
+ description: get SQL explain and related table metadata for analysis
+ operationId: getTaskAnalysisData
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ - description: audit plan report id
+ in: path
+ name: audit_plan_report_id
+ required: true
+ type: string
+ - description: sql number
+ in: path
+ name: number
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetAuditPlanAnalysisDataResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取task相关的SQL执行计划和表元数据
+ tags:
+ - audit_plan
+ /v1/projects/{project_name}/audit_plans/{audit_plan_name}/sqls:
+ get:
+ description: get audit plan SQLs
+ operationId: getAuditPlanSQLsV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ - description: page index
+ in: query
+ name: page_index
+ required: true
+ type: integer
+ - description: size of per page
+ in: query
+ name: page_size
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetAuditPlanSQLsResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取指定扫描任务的SQLs信息(不包括扫描结果)
+ tags:
+ - audit_plan
+ /v1/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/full:
+ post:
+ deprecated: true
+ description: full sync audit plan SQLs
+ operationId: fullSyncAuditPlanSQLsV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ - description: full sync audit plan SQLs request
+ in: body
+ name: sqls
+ required: true
+ schema:
+ $ref: '#/definitions/v1.FullSyncAuditPlanSQLsReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 全量同步SQL到扫描任务
+ tags:
+ - audit_plan
+ /v1/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/partial:
+ post:
+ deprecated: true
+ description: partial sync audit plan SQLs
+ operationId: partialSyncAuditPlanSQLsV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ - description: partial sync audit plan SQLs request
+ in: body
+ name: sqls
+ required: true
+ schema:
+ $ref: '#/definitions/v1.PartialSyncAuditPlanSQLsReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 增量同步SQL到扫描任务
+ tags:
+ - audit_plan
+ /v1/projects/{project_name}/audit_plans/{audit_plan_name}/trigger:
+ post:
+ description: trigger audit plan
+ operationId: triggerAuditPlanV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.TriggerAuditPlanResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 触发扫描任务
+ tags:
+ - audit_plan
+ /v1/projects/{project_name}/audit_whitelist:
+ get:
+ description: get all whitelist
+ operationId: getAuditWhitelistV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: page index
+ in: query
+ name: page_index
+ required: true
+ type: string
+ - description: page size
+ in: query
+ name: page_size
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetAuditWhitelistResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取Sql审核白名单
+ tags:
+ - audit_whitelist
+ post:
+ consumes:
+ - application/json
+ description: create a sql whitelist
+ operationId: createAuditWhitelistV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: add sql whitelist req
+ in: body
+ name: instance
+ required: true
+ schema:
+ $ref: '#/definitions/v1.CreateAuditWhitelistReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 添加SQL白名单
+ tags:
+ - audit_whitelist
+ /v1/projects/{project_name}/audit_whitelist/{audit_whitelist_id}/:
+ delete:
+ description: remove sql white
+ operationId: deleteAuditWhitelistByIdV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit whitelist id
+ in: path
+ name: audit_whitelist_id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 删除SQL白名单信息
+ tags:
+ - audit_whitelist
+ patch:
+ consumes:
+ - application/json
+ description: update sql whitelist by id
+ operationId: UpdateAuditWhitelistByIdV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: sql audit whitelist id
+ in: path
+ name: audit_whitelist_id
+ required: true
+ type: string
+ - description: update sql whitelist req
+ in: body
+ name: instance
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateAuditWhitelistReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 更新SQL白名单
+ tags:
+ - audit_whitelist
+ /v1/projects/{project_name}/instance_tips:
+ get:
+ description: get instance tip list
+ operationId: getInstanceTipListV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: filter db type
+ in: query
+ name: filter_db_type
+ type: string
+ - description: filter workflow template id
+ in: query
+ name: filter_workflow_template_id
+ type: string
+ - description: functional module
+ enum:
+ - create_audit_plan
+ - create_workflow
+ - sql_manage
+ in: query
+ name: functional_module
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetInstanceTipsResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取实例提示列表
+ tags:
+ - instance
+ /v1/projects/{project_name}/instances/{instance_name}/connection:
+ get:
+ description: test instance db connection
+ operationId: checkInstanceIsConnectableByNameV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: instance name
+ in: path
+ name: instance_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetInstanceConnectableResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 实例连通性测试(实例提交后)
+ tags:
+ - instance
+ /v1/projects/{project_name}/instances/{instance_name}/rules:
+ get:
+ description: get instance all rule
+ operationId: getInstanceRuleListV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: instance name
+ in: path
+ name: instance_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetRulesResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取实例应用的规则列表
+ tags:
+ - instance
+ /v1/projects/{project_name}/instances/{instance_name}/schemas:
+ get:
+ description: instance schema list
+ operationId: getInstanceSchemasV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: instance name
+ in: path
+ name: instance_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetInstanceSchemaResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 实例 Schema 列表
+ tags:
+ - instance
+ /v1/projects/{project_name}/instances/{instance_name}/schemas/{schema_name}/tables:
+ get:
+ description: list table by schema
+ operationId: listTableBySchema
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: instance name
+ in: path
+ name: instance_name
+ required: true
+ type: string
+ - description: schema name
+ in: path
+ name: schema_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.ListTableBySchemaResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取数据库下的所有表
+ tags:
+ - instance
+ /v1/projects/{project_name}/instances/{instance_name}/schemas/{schema_name}/tables/{table_name}/metadata:
+ get:
+ description: get table metadata
+ operationId: getTableMetadata
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: instance name
+ in: path
+ name: instance_name
+ required: true
+ type: string
+ - description: schema name
+ in: path
+ name: schema_name
+ required: true
+ type: string
+ - description: table name
+ in: path
+ name: table_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetTableMetadataResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取表元数据
+ tags:
+ - instance
+ /v1/projects/{project_name}/instances/connections:
+ post:
+ description: batch test instance db connections
+ operationId: batchCheckInstanceIsConnectableByName
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: instances
+ in: body
+ name: instances
+ required: true
+ schema:
+ $ref: '#/definitions/v1.BatchCheckInstanceConnectionsReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.BatchGetInstanceConnectionsResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 批量测试实例连通性(实例提交后)
+ tags:
+ - instance
+ /v1/projects/{project_name}/rule_template_tips:
+ get:
+ description: get rule template tips in project
+ operationId: getProjectRuleTemplateTipsV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: filter db type
+ in: query
+ name: filter_db_type
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetRuleTemplateTipsResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取项目规则模板提示
+ tags:
+ - rule_template
+ /v1/projects/{project_name}/rule_templates:
+ get:
+ description: get all rule template in a project
+ operationId: getProjectRuleTemplateListV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: page index
+ in: query
+ name: page_index
+ required: true
+ type: integer
+ - description: size of per page
+ in: query
+ name: page_size
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetProjectRuleTemplatesResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 项目规则模板列表
+ tags:
+ - rule_template
+ post:
+ consumes:
+ - application/json
+ description: create a rule template in project
+ operationId: createProjectRuleTemplateV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: add rule template request
+ in: body
+ name: req
+ required: true
+ schema:
+ $ref: '#/definitions/v1.CreateProjectRuleTemplateReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 添加项目规则模板
+ tags:
+ - rule_template
+ /v1/projects/{project_name}/rule_templates/{rule_template_name}/:
+ delete:
+ description: delete rule template in project
+ operationId: deleteProjectRuleTemplateV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: rule template name
+ in: path
+ name: rule_template_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 删除项目规则模板
+ tags:
+ - rule_template
+ get:
+ description: get rule template detail in project
+ operationId: getProjectRuleTemplateV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: rule template name
+ in: path
+ name: rule_template_name
+ required: true
+ type: string
+ - description: fuzzy rule,keyword for desc and annotation
+ in: query
+ name: fuzzy_keyword_rule
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetProjectRuleTemplateResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取项目规则模板信息
+ tags:
+ - rule_template
+ patch:
+ description: update rule template in project
+ operationId: updateProjectRuleTemplateV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: rule template name
+ in: path
+ name: rule_template_name
+ required: true
+ type: string
+ - description: update rule template request
+ in: body
+ name: req
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateProjectRuleTemplateReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 更新项目规则模板
+ tags:
+ - rule_template
+ /v1/projects/{project_name}/rule_templates/{rule_template_name}/clone:
+ post:
+ consumes:
+ - application/json
+ description: clone a rule template in project
+ operationId: cloneProjectRuleTemplateV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: rule template name
+ in: path
+ name: rule_template_name
+ required: true
+ type: string
+ - description: clone rule template request
+ in: body
+ name: req
+ required: true
+ schema:
+ $ref: '#/definitions/v1.CloneProjectRuleTemplateReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 克隆项目规则模板
+ tags:
+ - rule_template
+ /v1/projects/{project_name}/rule_templates/{rule_template_name}/export:
+ get:
+ description: export rule template in a project
+ operationId: exportProjectRuleTemplateV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: rule template name
+ in: path
+ name: rule_template_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: sqle rule template file
+ schema:
+ type: file
+ security:
+ - ApiKeyAuth: []
+ summary: 导出项目规则模板
+ tags:
+ - rule_template
+ /v1/projects/{project_name}/sql_audit_records:
+ get:
+ description: get sql audit records
+ operationId: getSQLAuditRecordsV1
+ parameters:
+ - description: fuzzy search tags
+ in: query
+ name: fuzzy_search_tags
+ type: string
+ - description: filter sql audit status
+ enum:
+ - auditing
+ - successfully
+ in: query
+ name: filter_sql_audit_status
+ type: string
+ - description: filter instance id
+ in: query
+ name: filter_instance_id
+ type: integer
+ - description: filter create time from
+ in: query
+ name: filter_create_time_from
+ type: string
+ - description: filter create time to
+ in: query
+ name: filter_create_time_to
+ type: string
+ - description: filter sql audit record ids
+ in: query
+ name: filter_sql_audit_record_ids
+ type: string
+ - description: page index
+ in: query
+ name: page_index
+ required: true
+ type: integer
+ - description: size of per page
+ in: query
+ name: page_size
+ required: true
+ type: integer
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetSQLAuditRecordsResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取SQL审核记录列表
+ tags:
+ - sql_audit_record
+ post:
+ consumes:
+ - multipart/form-data
+ description: |-
+ SQL audit
+ 1. formData[sql]: sql content;
+ 2. file[input_sql_file]: it is a sql file;
+ 3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.
+ 4. file[input_zip_file]: it is ZIP file that sql will be parsed from xml or sql file inside it.
+ 5. formData[git_http_url]:the url which scheme is http(s) and end with .git.
+ 6. formData[git_user_name]:The name of the user who owns the repository read access.
+ 7. formData[git_user_password]:The password corresponding to git_user_name.
+ operationId: CreateSQLAuditRecordV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: instance name
+ in: formData
+ name: instance_name
+ type: string
+ - description: schema of instance
+ in: formData
+ name: instance_schema
+ type: string
+ - description: db type of instance
+ in: formData
+ name: db_type
+ type: string
+ - description: sqls for audit
+ in: formData
+ name: sqls
+ type: string
+ - description: input SQL file
+ in: formData
+ name: input_sql_file
+ type: file
+ - description: input mybatis XML file
+ in: formData
+ name: input_mybatis_xml_file
+ type: file
+ - description: input ZIP file
+ in: formData
+ name: input_zip_file
+ type: file
+ - description: git repository url
+ in: formData
+ name: git_http_url
+ type: string
+ - description: the name of user to clone the repository
+ in: formData
+ name: git_user_name
+ type: string
+ - description: the password corresponding to git_user_name
+ in: formData
+ name: git_user_password
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.CreateSQLAuditRecordResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: SQL审核
+ tags:
+ - sql_audit_record
+ /v1/projects/{project_name}/sql_audit_records/{sql_audit_record_id}/:
+ get:
+ description: get sql audit record info
+ operationId: getSQLAuditRecordV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: sql audit record id
+ in: path
+ name: sql_audit_record_id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetSQLAuditRecordResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取SQL审核记录信息
+ tags:
+ - sql_audit_record
+ patch:
+ consumes:
+ - application/json
+ description: update SQL audit record
+ operationId: updateSQLAuditRecordV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: sql audit record id
+ in: path
+ name: sql_audit_record_id
+ required: true
+ type: string
+ - description: update SQL audit record
+ in: body
+ name: param
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateSQLAuditRecordReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 更新SQL审核记录
+ tags:
+ - sql_audit_record
+ /v1/projects/{project_name}/sql_audit_records/tag_tips:
+ get:
+ description: get sql audit record tag tips
+ operationId: GetSQLAuditRecordTagTipsV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetSQLAuditRecordTagTipsResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取SQL审核记录标签列表
+ tags:
+ - sql_audit_record
+ /v1/projects/{project_name}/sql_manages:
+ get:
+ deprecated: true
+ description: get sql manage list
+ operationId: GetSqlManageList
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: fuzzy search sql fingerprint
+ in: query
+ name: fuzzy_search_sql_fingerprint
+ type: string
+ - description: assignee
+ in: query
+ name: filter_assignee
+ type: string
+ - description: instance name
+ in: query
+ name: filter_instance_name
+ type: string
+ - description: source
+ enum:
+ - audit_plan
+ - sql_audit_record
+ in: query
+ name: filter_source
+ type: string
+ - description: audit level
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ in: query
+ name: filter_audit_level
+ type: string
+ - description: last audit start time from
+ in: query
+ name: filter_last_audit_start_time_from
+ type: string
+ - description: last audit start time to
+ in: query
+ name: filter_last_audit_start_time_to
+ type: string
+ - description: status
+ enum:
+ - unhandled
+ - solved
+ - ignored
+ - manual_audited
+ in: query
+ name: filter_status
+ type: string
+ - description: rule name
+ in: query
+ name: filter_rule_name
+ type: string
+ - description: db type
+ in: query
+ name: filter_db_type
+ type: string
+ - description: fuzzy search endpoint
+ in: query
+ name: fuzzy_search_endpoint
+ type: string
+ - description: fuzzy search schema name
+ in: query
+ name: fuzzy_search_schema_name
+ type: string
+ - description: sort field
+ enum:
+ - first_appear_timestamp
+ - last_receive_timestamp
+ - fp_count
+ in: query
+ name: sort_field
+ type: string
+ - description: sort order
+ enum:
+ - asc
+ - desc
+ in: query
+ name: sort_order
+ type: string
+ - description: page index
+ in: query
+ name: page_index
+ required: true
+ type: integer
+ - description: size of per page
+ in: query
+ name: page_size
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetSqlManageListResp'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取管控sql列表
+ tags:
+ - SqlManage
+ /v1/projects/{project_name}/sql_manages/{sql_manage_id}/sql_analysis:
+ get:
+ description: get sql manage analysis
+ operationId: GetSqlManageSqlAnalysisV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: sql manage id
+ in: path
+ name: sql_manage_id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetSqlManageSqlAnalysisResp'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取SQL管控SQL分析
+ tags:
+ - SqlManage
+ /v1/projects/{project_name}/sql_manages/batch:
+ patch:
+ description: batch update sql manage
+ operationId: BatchUpdateSqlManage
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: batch update sql manage request
+ in: body
+ name: BatchUpdateSqlManageReq
+ required: true
+ schema:
+ $ref: '#/definitions/v1.BatchUpdateSqlManageReq'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 批量更新SQL管控
+ tags:
+ - SqlManage
+ /v1/projects/{project_name}/sql_manages/exports:
+ get:
+ description: export sql manage
+ operationId: exportSqlManageV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: fuzzy search sql fingerprint
+ in: query
+ name: fuzzy_search_sql_fingerprint
+ type: string
+ - description: assignee
+ in: query
+ name: filter_assignee
+ type: string
+ - description: instance name
+ in: query
+ name: filter_instance_name
+ type: string
+ - description: source
+ enum:
+ - audit_plan
+ - sql_audit_record
+ in: query
+ name: filter_source
+ type: string
+ - description: audit level
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ in: query
+ name: filter_audit_level
+ type: string
+ - description: last audit start time from
+ in: query
+ name: filter_last_audit_start_time_from
+ type: string
+ - description: last audit start time to
+ in: query
+ name: filter_last_audit_start_time_to
+ type: string
+ - description: status
+ enum:
+ - unhandled
+ - solved
+ - ignored
+ - manual_audited
+ in: query
+ name: filter_status
+ type: string
+ - description: db type
+ in: query
+ name: filter_db_type
+ type: string
+ - description: rule name
+ in: query
+ name: filter_rule_name
+ type: string
+ - description: fuzzy search endpoint
+ in: query
+ name: fuzzy_search_endpoint
+ type: string
+ - description: fuzzy search schema name
+ in: query
+ name: fuzzy_search_schema_name
+ type: string
+ - description: sort field
+ enum:
+ - first_appear_timestamp
+ - last_receive_timestamp
+ - fp_count
+ in: query
+ name: sort_field
+ type: string
+ - description: sort order
+ enum:
+ - asc
+ - desc
+ in: query
+ name: sort_order
+ type: string
+ responses:
+ "200":
+ description: export sql manage
+ schema:
+ type: file
+ security:
+ - ApiKeyAuth: []
+ summary: 导出SQL管控
+ tags:
+ - SqlManage
+ /v1/projects/{project_name}/sql_manages/rule_tips:
+ get:
+ description: get sql manage rule tips
+ operationId: GetSqlManageRuleTips
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetSqlManageRuleTipsResp'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取管控规则tips
+ tags:
+ - SqlManage
+ /v1/projects/{project_name}/statistic/audit_plans:
+ get:
+ description: statistic audit plan
+ operationId: statisticAuditPlanV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.StatisticAuditPlanResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取各类型数据源上的扫描任务数量
+ tags:
+ - statistic
+ /v1/projects/{project_name}/statistic/audited_sqls:
+ get:
+ description: statistics audited sql
+ operationId: statisticsAuditedSQLV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.StatisticsAuditedSQLResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取审核SQL总数,以及触发审核规则的SQL数量
+ tags:
+ - statistic
+ /v1/projects/{project_name}/statistic/instance_health:
+ get:
+ description: get instance health
+ operationId: GetInstanceHealthV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetInstanceHealthResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取各类型数据源的健康情况
+ tags:
+ - statistic
+ /v1/projects/{project_name}/statistic/project_score:
+ get:
+ description: get project score
+ operationId: GetProjectScoreV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetProjectScoreResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取项目分数
+ tags:
+ - statistic
+ /v1/projects/{project_name}/statistic/risk_audit_plans:
+ get:
+ description: get risk audit plan
+ operationId: getRiskAuditPlanV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetRiskAuditPlanResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取扫描任务报告评分低于60的扫描任务
+ tags:
+ - statistic
+ /v1/projects/{project_name}/statistic/risk_workflow:
+ get:
+ description: statistic risk workflow
+ operationId: statisticRiskWorkflowV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.StatisticRiskWorkflowResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取存在风险的工单
+ tags:
+ - statistic
+ /v1/projects/{project_name}/statistic/role_user:
+ get:
+ description: get role user count
+ operationId: getRoleUserCountV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetRoleUserCountResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取各角色类型对应的成员数量
+ tags:
+ - statistic
+ /v1/projects/{project_name}/statistic/workflow_status:
+ get:
+ description: statistic workflow status
+ operationId: statisticWorkflowStatusV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetWorkflowStatusCountResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取项目下工单各个状态的数量
+ tags:
+ - statistic
+ /v1/projects/{project_name}/statistics:
+ get:
+ description: get project statistics
+ operationId: getProjectStatisticsV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetProjectStatisticsResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取项目统计信息
+ tags:
+ - statistic
+ /v1/projects/{project_name}/task_groups:
+ post:
+ consumes:
+ - application/json
+ description: create tasks group.
+ operationId: createAuditTasksV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: parameters for creating audit tasks group
+ in: body
+ name: req
+ required: true
+ schema:
+ $ref: '#/definitions/v1.CreateAuditTasksGroupReqV1'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.CreateAuditTasksGroupResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 创建审核任务组
+ tags:
+ - task
+ /v1/projects/{project_name}/tasks/audits:
+ post:
+ consumes:
+ - multipart/form-data
+ description: |-
+ create and audit a task, you can upload sql content in three ways, any one can be used, but only one is effective.
+ 1. formData[sql]: sql content;
+ 2. file[input_sql_file]: it is a sql file;
+ 3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.
+ operationId: createAndAuditTaskV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: instance name
+ in: formData
+ name: instance_name
+ required: true
+ type: string
+ - description: schema of instance
+ in: formData
+ name: instance_schema
+ type: string
+ - description: sqls for audit
+ in: formData
+ name: sql
+ type: string
+ - description: input SQL file
+ in: formData
+ name: input_sql_file
+ type: file
+ - description: input mybatis XML file
+ in: formData
+ name: input_mybatis_xml_file
+ type: file
+ - description: input ZIP file
+ in: formData
+ name: input_zip_file
+ type: file
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetAuditTaskResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 创建Sql扫描任务并提交审核
+ tags:
+ - task
+ /v1/projects/{project_name}/workflow_template:
+ get:
+ description: get workflow template detail
+ operationId: getWorkflowTemplateV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetWorkflowTemplateResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取审批流程模板详情
+ tags:
+ - workflow
+ patch:
+ consumes:
+ - application/json
+ description: update the workflow template
+ operationId: updateWorkflowTemplateV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: create workflow template
+ in: body
+ name: instance
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateWorkflowTemplateReqV1'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 更新Sql审批流程模板
+ tags:
+ - workflow
+ /v1/projects/{project_name}/workflows:
+ get:
+ description: get workflow list
+ operationId: getWorkflowsV1
+ parameters:
+ - description: filter subject
+ in: query
+ name: filter_subject
+ type: string
+ - description: filter by workflow_id
+ in: query
+ name: filter_workflow_id
+ type: string
+ - description: fuzzy search by workflow description
+ in: query
+ name: fuzzy_search_workflow_desc
+ type: string
+ - description: filter create time from
+ in: query
+ name: filter_create_time_from
+ type: string
+ - description: filter create time to
+ in: query
+ name: filter_create_time_to
+ type: string
+ - description: filter_task_execute_start_time_from
+ in: query
+ name: filter_task_execute_start_time_from
+ type: string
+ - description: filter_task_execute_start_time_to
+ in: query
+ name: filter_task_execute_start_time_to
+ type: string
+ - description: filter create user id
+ in: query
+ name: filter_create_user_id
+ type: string
+ - description: filter workflow status
+ enum:
+ - wait_for_audit
+ - wait_for_execution
+ - rejected
+ - executing
+ - canceled
+ - exec_failed
+ - finished
+ in: query
+ name: filter_status
+ type: string
+ - description: filter current step assignee user id
+ in: query
+ name: filter_current_step_assignee_user_id
+ type: string
+ - description: filter instance name
+ in: query
+ name: filter_task_instance_name
+ type: string
+ - description: page index
+ in: query
+ name: page_index
+ required: true
+ type: integer
+ - description: size of per page
+ in: query
+ name: page_size
+ required: true
+ type: integer
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: fuzzy matching subject/workflow_id
+ in: query
+ name: fuzzy_keyword
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetWorkflowsResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取工单列表
+ tags:
+ - workflow
+ post:
+ consumes:
+ - application/json
+ deprecated: true
+ description: create workflow
+ operationId: createWorkflowV1
+ parameters:
+ - description: create workflow request
+ in: body
+ name: instance
+ required: true
+ schema:
+ $ref: '#/definitions/v1.CreateWorkflowReqV1'
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 创建工单
+ tags:
+ - workflow
+ /v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/terminate:
+ post:
+ description: execute one task on workflow
+ operationId: terminateSingleTaskByWorkflowV1
+ parameters:
+ - description: workflow id
+ in: path
+ name: workflow_id
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: task id
+ in: path
+ name: task_id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 终止单个上线任务
+ tags:
+ - workflow
+ /v1/projects/{project_name}/workflows/{workflow_id}/tasks/terminate:
+ post:
+ description: terminate multiple task by project and workflow
+ operationId: terminateMultipleTaskByWorkflowV1
+ parameters:
+ - description: workflow id
+ in: path
+ name: workflow_id
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 终止工单下多个上线任务
+ tags:
+ - workflow
+ /v1/projects/{project_name}/workflows/{workflow_name}/:
+ get:
+ deprecated: true
+ description: get workflow detail
+ operationId: getWorkflowV1
+ parameters:
+ - description: workflow name
+ in: path
+ name: workflow_name
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetWorkflowResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取工单详情
+ tags:
+ - workflow
+ patch:
+ consumes:
+ - application/json
+ deprecated: true
+ description: update workflow when it is rejected to creator.
+ operationId: updateWorkflowV1
+ parameters:
+ - description: workflow name
+ in: path
+ name: workflow_name
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: update workflow request
+ in: body
+ name: instance
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateWorkflowReqV1'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 更新工单(驳回后才可更新)
+ tags:
+ - workflow
+ /v1/projects/{project_name}/workflows/{workflow_name}/cancel:
+ post:
+ deprecated: true
+ description: cancel workflow
+ operationId: cancelWorkflowV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: workflow name
+ in: path
+ name: workflow_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 审批关闭(中止)
+ tags:
+ - workflow
+ /v1/projects/{project_name}/workflows/{workflow_name}/steps/{workflow_step_id}/approve:
+ post:
+ deprecated: true
+ description: approve workflow
+ operationId: approveWorkflowV1
+ parameters:
+ - description: workflow name
+ in: path
+ name: workflow_name
+ required: true
+ type: string
+ - description: workflow step id
+ in: path
+ name: workflow_step_id
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 审批通过
+ tags:
+ - workflow
+ /v1/projects/{project_name}/workflows/{workflow_name}/steps/{workflow_step_id}/reject:
+ post:
+ deprecated: true
+ description: reject workflow
+ operationId: rejectWorkflowV1
+ parameters:
+ - description: workflow name
+ in: path
+ name: workflow_name
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: workflow step id
+ in: path
+ name: workflow_step_id
+ required: true
+ type: string
+ - description: workflow approve request
+ in: body
+ name: workflow_approve
+ required: true
+ schema:
+ $ref: '#/definitions/v1.RejectWorkflowReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 审批驳回
+ tags:
+ - workflow
+ /v1/projects/{project_name}/workflows/{workflow_name}/tasks:
+ get:
+ deprecated: true
+ description: get summary of workflow instance tasks
+ operationId: getSummaryOfInstanceTasksV1
+ parameters:
+ - description: workflow name
+ in: path
+ name: workflow_name
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetWorkflowTasksResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取工单数据源任务概览
+ tags:
+ - workflow
+ /v1/projects/{project_name}/workflows/{workflow_name}/tasks/{task_id}/execute:
+ post:
+ deprecated: true
+ description: execute one task on workflow
+ operationId: executeOneTaskOnWorkflowV1
+ parameters:
+ - description: workflow name
+ in: path
+ name: workflow_name
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: task id
+ in: path
+ name: task_id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 工单提交单个数据源上线
+ tags:
+ - workflow
+ /v1/projects/{project_name}/workflows/{workflow_name}/tasks/{task_id}/schedule:
+ put:
+ consumes:
+ - application/json
+ deprecated: true
+ description: update workflow schedule.
+ operationId: updateWorkflowScheduleV1
+ parameters:
+ - description: workflow name
+ in: path
+ name: workflow_name
+ required: true
+ type: string
+ - description: task id
+ in: path
+ name: task_id
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: update workflow schedule request
+ in: body
+ name: instance
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateWorkflowScheduleReqV1'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 设置工单数据源定时上线时间(设置为空则代表取消定时时间,需要SQL审核流程都通过后才可以设置)
+ tags:
+ - workflow
+ /v1/projects/{project_name}/workflows/{workflow_name}/tasks/execute:
+ post:
+ deprecated: true
+ description: execute tasks on workflow
+ operationId: executeTasksOnWorkflowV1
+ parameters:
+ - description: workflow name
+ in: path
+ name: workflow_name
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 多数据源批量上线
+ tags:
+ - workflow
+ /v1/projects/{project_name}/workflows/cancel:
+ post:
+ deprecated: true
+ description: batch cancel workflows
+ operationId: batchCancelWorkflowsV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: batch cancel workflows request
+ in: body
+ name: BatchCancelWorkflowsReqV1
+ required: true
+ schema:
+ $ref: '#/definitions/v1.BatchCancelWorkflowsReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 批量取消工单
+ tags:
+ - workflow
+ /v1/projects/{project_name}/workflows/complete:
+ post:
+ deprecated: true
+ description: this api will directly change the work order status to finished
+ without real online operation
+ operationId: batchCompleteWorkflowsV1
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: batch complete workflows request
+ in: body
+ name: data
+ required: true
+ schema:
+ $ref: '#/definitions/v1.BatchCompleteWorkflowsReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 批量完成工单
+ tags:
+ - workflow
+ /v1/projects/{project_name}/workflows/exports:
+ get:
+ description: export workflow
+ operationId: exportWorkflowV1
+ parameters:
+ - description: filter subject
+ in: query
+ name: filter_subject
+ type: string
+ - description: fuzzy search by workflow description
+ in: query
+ name: fuzzy_search_workflow_desc
+ type: string
+ - description: filter create time from
+ in: query
+ name: filter_create_time_from
+ type: string
+ - description: filter create time to
+ in: query
+ name: filter_create_time_to
+ type: string
+ - description: filter_task_execute_start_time_from
+ in: query
+ name: filter_task_execute_start_time_from
+ type: string
+ - description: filter_task_execute_start_time_to
+ in: query
+ name: filter_task_execute_start_time_to
+ type: string
+ - description: filter create user id
+ in: query
+ name: filter_create_user_id
+ type: string
+ - description: filter workflow status
+ enum:
+ - wait_for_audit
+ - wait_for_execution
+ - rejected
+ - executing
+ - canceled
+ - exec_failed
+ - finished
+ in: query
+ name: filter_status
+ type: string
+ - description: filter current step assignee user id
+ in: query
+ name: filter_current_step_assignee_user_id
+ type: string
+ - description: filter instance name
+ in: query
+ name: filter_task_instance_name
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: fuzzy matching subject/workflow_id/desc
+ in: query
+ name: fuzzy_keyword
+ type: string
+ responses:
+ "200":
+ description: export workflow
+ schema:
+ type: file
+ security:
+ - ApiKeyAuth: []
+ summary: 导出工单
+ tags:
+ - workflow
+ /v1/rule_knowledge/db_types/{db_type}/custom_rules/{rule_name}/:
+ get:
+ description: get custom rule knowledge
+ operationId: getCustomRuleKnowledgeV1
+ parameters:
+ - description: rule name
+ in: path
+ name: rule_name
+ required: true
+ type: string
+ - description: db type of rule
+ in: path
+ name: db_type
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetRuleKnowledgeResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 查看自定义规则知识库
+ tags:
+ - rule_template
+ patch:
+ description: update custom rule knowledge
+ operationId: updateCustomRuleKnowledge
+ parameters:
+ - description: rule name
+ in: path
+ name: rule_name
+ required: true
+ type: string
+ - description: db type of rule
+ in: path
+ name: db_type
+ required: true
+ type: string
+ - description: update rule knowledge
+ in: body
+ name: req
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateRuleKnowledgeReq'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 更新自定义规则知识库
+ tags:
+ - rule_template
+ /v1/rule_knowledge/db_types/{db_type}/rules/{rule_name}/:
+ get:
+ description: get rule knowledge
+ operationId: getRuleKnowledgeV1
+ parameters:
+ - description: rule name
+ in: path
+ name: rule_name
+ required: true
+ type: string
+ - description: db type of rule
+ in: path
+ name: db_type
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetRuleKnowledgeResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 查看规则知识库
+ tags:
+ - rule_template
+ patch:
+ description: update rule knowledge
+ operationId: updateRuleKnowledge
+ parameters:
+ - description: rule name
+ in: path
+ name: rule_name
+ required: true
+ type: string
+ - description: db type of rule
+ in: path
+ name: db_type
+ required: true
+ type: string
+ - description: update rule knowledge
+ in: body
+ name: req
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateRuleKnowledgeReq'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 更新规则知识库
+ tags:
+ - rule_template
+ /v1/rule_template_tips:
+ get:
+ description: get global rule template tips
+ operationId: getRuleTemplateTipsV1
+ parameters:
+ - description: filter db type
+ in: query
+ name: filter_db_type
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetRuleTemplateTipsResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取全局规则模板提示
+ tags:
+ - rule_template
+ /v1/rule_templates:
+ get:
+ description: get all global rule template
+ operationId: getRuleTemplateListV1
+ parameters:
+ - description: page index
+ in: query
+ name: page_index
+ required: true
+ type: integer
+ - description: size of per page
+ in: query
+ name: page_size
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetRuleTemplatesResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 全局规则模板列表
+ tags:
+ - rule_template
+ post:
+ consumes:
+ - application/json
+ description: create a global rule template
+ operationId: createRuleTemplateV1
+ parameters:
+ - description: add rule template request
+ in: body
+ name: req
+ required: true
+ schema:
+ $ref: '#/definitions/v1.CreateRuleTemplateReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 添加全局规则模板
+ tags:
+ - rule_template
+ /v1/rule_templates/{rule_template_name}/:
+ delete:
+ description: delete global rule template
+ operationId: deleteRuleTemplateV1
+ parameters:
+ - description: rule template name
+ in: path
+ name: rule_template_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 删除全局规则模板
+ tags:
+ - rule_template
+ get:
+ description: get global rule template
+ operationId: getRuleTemplateV1
+ parameters:
+ - description: rule template name
+ in: path
+ name: rule_template_name
+ required: true
+ type: string
+ - description: fuzzy rule,keyword for desc and annotation
+ in: query
+ name: fuzzy_keyword_rule
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetRuleTemplateResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取全局规则模板信息
+ tags:
+ - rule_template
+ patch:
+ description: update global rule template
+ operationId: updateRuleTemplateV1
+ parameters:
+ - description: rule template name
+ in: path
+ name: rule_template_name
+ required: true
+ type: string
+ - description: update rule template request
+ in: body
+ name: req
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateRuleTemplateReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 更新全局规则模板
+ tags:
+ - rule_template
+ /v1/rule_templates/{rule_template_name}/clone:
+ post:
+ consumes:
+ - application/json
+ description: clone a rule template
+ operationId: CloneRuleTemplateV1
+ parameters:
+ - description: rule template name
+ in: path
+ name: rule_template_name
+ required: true
+ type: string
+ - description: clone rule template request
+ in: body
+ name: req
+ required: true
+ schema:
+ $ref: '#/definitions/v1.CloneRuleTemplateReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 克隆全局规则模板
+ tags:
+ - rule_template
+ /v1/rule_templates/{rule_template_name}/export:
+ get:
+ description: export rule template
+ operationId: exportRuleTemplateV1
+ parameters:
+ - description: rule template name
+ in: path
+ name: rule_template_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: sqle rule template file
+ schema:
+ type: file
+ security:
+ - ApiKeyAuth: []
+ summary: 导出全局规则模板
+ tags:
+ - rule_template
+ /v1/rule_templates/parse:
+ post:
+ consumes:
+ - multipart/form-data
+ description: parse rule template
+ operationId: importProjectRuleTemplateV1
+ parameters:
+ - description: SQLE rule template file
+ in: formData
+ name: rule_template_file
+ required: true
+ type: file
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.ParseProjectRuleTemplateFileResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 解析规则模板文件
+ tags:
+ - rule_template
+ /v1/rules:
+ get:
+ description: get all rule template
+ operationId: getRuleListV1
+ parameters:
+ - description: filter db type
+ in: query
+ name: filter_db_type
+ type: string
+ - description: fuzzy rule,keyword for desc and annotation
+ in: query
+ name: fuzzy_keyword_rule
+ type: string
+ - description: filter global rule template name
+ in: query
+ name: filter_global_rule_template_name
+ type: string
+ - description: filter rule name list
+ in: query
+ name: filter_rule_names
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetRulesResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 规则列表
+ tags:
+ - rule_template
+ /v1/sql_analysis:
+ get:
+ description: Direct get sql analysis result
+ operationId: directGetSQLAnalysisV1
+ parameters:
+ - description: project name
+ in: query
+ name: project_name
+ required: true
+ type: string
+ - description: instance name
+ in: query
+ name: instance_name
+ required: true
+ type: string
+ - description: schema name
+ in: query
+ name: schema_name
+ type: string
+ - description: sql
+ in: query
+ name: sql
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.DirectGetSQLAnalysisResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 直接获取SQL分析结果
+ tags:
+ - sql_analysis
+ /v1/sql_audit:
+ post:
+ deprecated: true
+ description: Direct audit sql
+ operationId: directAuditV1
+ parameters:
+ - description: sqls that should be audited
+ in: body
+ name: req
+ required: true
+ schema:
+ $ref: '#/definitions/v1.DirectAuditReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.DirectAuditResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 直接审核SQL
+ tags:
+ - sql_audit
+ /v1/statistic/instances/sql_average_execution_time:
+ get:
+ description: get average execution time of sql
+ operationId: getSqlAverageExecutionTimeV1
+ parameters:
+ - description: the limit of result item number
+ in: query
+ name: limit
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetSqlAverageExecutionTimeResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取sql上线平均耗时,按平均耗时降序排列
+ tags:
+ - statistic
+ /v1/statistic/instances/sql_execution_fail_percent:
+ get:
+ description: get sql execution fail percent
+ operationId: getSqlExecutionFailPercentV1
+ parameters:
+ - description: the limit of result item number
+ in: query
+ name: limit
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetSqlExecutionFailPercentResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取SQL上线失败率,按失败率降序排列
+ tags:
+ - statistic
+ /v1/statistic/instances/type_percent:
+ get:
+ description: get database instances' types percent
+ operationId: getInstancesTypePercentV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetInstancesTypePercentResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取数据源类型百分比
+ tags:
+ - statistic
+ /v1/statistic/license/usage:
+ get:
+ description: get usage of license
+ operationId: getLicenseUsageV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetLicenseUsageResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取License使用情况
+ tags:
+ - statistic
+ /v1/statistic/workflows/audit_pass_percent:
+ get:
+ description: get workflow audit pass percent
+ operationId: getWorkflowAuditPassPercentV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetWorkflowAuditPassPercentResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取工单审核通过率
+ tags:
+ - statistic
+ /v1/statistic/workflows/counts:
+ get:
+ description: get workflow counts
+ operationId: getWorkflowCountV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetWorkflowCountsResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取工单数量统计数据
+ tags:
+ - statistic
+ /v1/statistic/workflows/duration_of_waiting_for_audit:
+ get:
+ description: get duration from workflow being created to audited
+ operationId: getWorkflowDurationOfWaitingForAuditV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetWorkflowDurationOfWaitingForAuditResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取工单从创建到审核结束的平均时长
+ tags:
+ - statistic
+ /v1/statistic/workflows/duration_of_waiting_for_execution:
+ get:
+ deprecated: true
+ description: get duration from workflow being created to executed
+ operationId: getWorkflowDurationOfWaitingForExecutionV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetWorkflowDurationOfWaitingForExecutionResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取工单各从审核完毕到执行上线的平均时长
+ tags:
+ - statistic
+ /v1/statistic/workflows/each_day_counts:
+ get:
+ description: get counts of created workflow each day
+ operationId: getWorkflowCreatedCountEachDayV1
+ parameters:
+ - description: filter date from.(format:yyyy-mm-dd)
+ in: query
+ name: filter_date_from
+ required: true
+ type: string
+ - description: filter date to.(format:yyyy-mm-dd)
+ in: query
+ name: filter_date_to
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetWorkflowCreatedCountsEachDayResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取每天工单创建数量
+ tags:
+ - statistic
+ /v1/statistic/workflows/instance_type_percent:
+ get:
+ description: get workflows percent counted by instance type
+ operationId: getWorkflowPercentCountedByInstanceTypeV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetWorkflowPercentCountedByInstanceTypeResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取按数据源类型统计的工单百分比
+ tags:
+ - statistic
+ /v1/statistic/workflows/pass_percent:
+ get:
+ deprecated: true
+ description: get workflow pass percent
+ operationId: getWorkflowPassPercentV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetWorkflowPassPercentResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取工单通过率
+ tags:
+ - statistic
+ /v1/statistic/workflows/rejected_percent_group_by_creator:
+ get:
+ description: get workflows rejected percent group by creator. The result will
+ be sorted by rejected percent in descending order
+ operationId: getWorkflowRejectedPercentGroupByCreatorV1
+ parameters:
+ - description: the limit of result item number
+ in: query
+ name: limit
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetWorkflowRejectedPercentGroupByCreatorResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取各个用户提交的工单驳回率,按驳回率降序排列
+ tags:
+ - statistic
+ /v1/statistic/workflows/rejected_percent_group_by_instance:
+ get:
+ deprecated: true
+ description: get workflow rejected percent group by instance. The result will
+ be sorted by rejected percent in descending order
+ operationId: getWorkflowRejectedPercentGroupByInstanceV1
+ parameters:
+ - description: the limit of result item number
+ in: query
+ name: limit
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetWorkflowRejectedPercentGroupByInstanceResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取各个数据源相关的工单驳回率,按驳回率降序排列
+ tags:
+ - statistic
+ /v1/statistic/workflows/status_count:
+ get:
+ description: get count of workflow status
+ operationId: getWorkflowStatusCountV1
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetWorkflowStatusCountResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取各种状态工单的数量
+ tags:
+ - statistic
+ /v1/task_groups/audit:
+ post:
+ consumes:
+ - multipart/form-data
+ description: |-
+ audit task group.
+ 1. formData[sql]: sql content;
+ 2. file[input_sql_file]: it is a sql file;
+ 3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.
+ 4. file[input_zip_file]: it is zip file, sql will be parsed from it.
+ operationId: auditTaskGroupIdV1
+ parameters:
+ - description: group id of tasks
+ in: formData
+ name: task_group_id
+ required: true
+ type: integer
+ - description: sqls for audit
+ in: formData
+ name: sql
+ type: string
+ - description: input SQL file
+ in: formData
+ name: input_sql_file
+ type: file
+ - description: input mybatis XML file
+ in: formData
+ name: input_mybatis_xml_file
+ type: file
+ - description: input ZIP file
+ in: formData
+ name: input_zip_file
+ type: file
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.AuditTaskGroupResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 审核任务组
+ tags:
+ - task
+ /v1/tasks/audits/{task_id}/:
+ get:
+ description: get task
+ operationId: getAuditTaskV1
+ parameters:
+ - description: task id
+ in: path
+ name: task_id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetAuditTaskResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取Sql扫描任务信息
+ tags:
+ - task
+ /v1/tasks/audits/{task_id}/sql_content:
+ get:
+ description: get SQL content for the audit task
+ operationId: getAuditTaskSQLContentV1
+ parameters:
+ - description: task id
+ in: path
+ name: task_id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetAuditTaskSQLContentResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取指定扫描任务的SQL内容
+ tags:
+ - task
+ /v1/tasks/audits/{task_id}/sql_file:
+ get:
+ description: download SQL file for the audit task
+ operationId: downloadAuditTaskSQLFileV1
+ parameters:
+ - description: task id
+ in: path
+ name: task_id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: sql file
+ schema:
+ type: file
+ security:
+ - ApiKeyAuth: []
+ summary: 下载指定扫描任务的SQL文件
+ tags:
+ - task
+ /v1/tasks/audits/{task_id}/sql_report:
+ get:
+ description: download report file of all SQLs information belong to the specified
+ audit task
+ operationId: downloadAuditTaskSQLReportV1
+ parameters:
+ - description: task id
+ in: path
+ name: task_id
+ required: true
+ type: string
+ - description: select unique (fingerprint and audit result) for task sql
+ in: query
+ name: no_duplicate
+ type: boolean
+ responses:
+ "200":
+ description: sql report csv file
+ schema:
+ type: file
+ security:
+ - ApiKeyAuth: []
+ summary: 下载指定扫描任务的SQLs信息报告
+ tags:
+ - task
+ /v1/tasks/audits/{task_id}/sqls:
+ get:
+ description: get information of all SQLs belong to the specified audit task
+ operationId: getAuditTaskSQLsV1
+ parameters:
+ - description: task id
+ in: path
+ name: task_id
+ required: true
+ type: string
+ - description: 'filter: exec status of task sql'
+ enum:
+ - initialized
+ - doing
+ - succeeded
+ - failed
+ - manually_executed
+ in: query
+ name: filter_exec_status
+ type: string
+ - description: 'filter: audit status of task sql'
+ enum:
+ - initialized
+ - doing
+ - finished
+ in: query
+ name: filter_audit_status
+ type: string
+ - description: 'filter: audit level of task sql'
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ in: query
+ name: filter_audit_level
+ type: string
+ - description: select unique (fingerprint and audit result) for task sql
+ in: query
+ name: no_duplicate
+ type: boolean
+ - description: page index
+ in: query
+ name: page_index
+ required: true
+ type: string
+ - description: page size
+ in: query
+ name: page_size
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetAuditTaskSQLsResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取指定扫描任务的SQLs信息
+ tags:
+ - task
+ /v1/tasks/audits/{task_id}/sqls/{number}:
+ patch:
+ consumes:
+ - application/json
+ description: modify the relevant information of a certain SQL in the audit task
+ operationId: updateAuditTaskSQLsV1
+ parameters:
+ - description: task id
+ in: path
+ name: task_id
+ required: true
+ type: string
+ - description: sql number
+ in: path
+ name: number
+ required: true
+ type: string
+ - description: modify the relevant information of a certain SQL in the audit
+ task
+ in: body
+ name: audit_plan
+ required: true
+ schema:
+ $ref: '#/definitions/v1.UpdateAuditTaskSQLsReqV1'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 修改扫描任务中某条SQL的相关信息
+ tags:
+ - task
+ /v1/tasks/audits/{task_id}/sqls/{number}/analysis:
+ get:
+ description: get SQL explain and related table metadata for analysis
+ operationId: getTaskAnalysisData
+ parameters:
+ - description: task id
+ in: path
+ name: task_id
+ required: true
+ type: string
+ - description: sql number
+ in: path
+ name: number
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetTaskAnalysisDataResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取task相关的SQL执行计划和表元数据
+ tags:
+ - task
+ /v1/user_tips:
+ get:
+ description: get user tip list
+ operationId: getUserTipListV1
+ parameters:
+ - description: project name
+ in: query
+ name: filter_project
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetUserTipsResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取用户提示列表
+ tags:
+ - user
+ /v1/workflows:
+ get:
+ description: get global workflow list
+ operationId: getGlobalWorkflowsV1
+ parameters:
+ - description: filter subject
+ in: query
+ name: filter_subject
+ type: string
+ - description: filter create time from
+ in: query
+ name: filter_create_time_from
+ type: string
+ - description: filter create time to
+ in: query
+ name: filter_create_time_to
+ type: string
+ - description: filter_task_execute_start_time_from
+ in: query
+ name: filter_task_execute_start_time_from
+ type: string
+ - description: filter_task_execute_start_time_to
+ in: query
+ name: filter_task_execute_start_time_to
+ type: string
+ - description: filter create user id
+ in: query
+ name: filter_create_user_id
+ type: string
+ - description: filter workflow status
+ enum:
+ - wait_for_audit
+ - wait_for_execution
+ - rejected
+ - executing
+ - canceled
+ - exec_failed
+ - finished
+ in: query
+ name: filter_status
+ type: string
+ - description: filter current step assignee user id
+ in: query
+ name: filter_current_step_assignee_user_id
+ type: string
+ - description: filter instance id
+ in: query
+ name: filter_task_instance_name
+ type: string
+ - description: page index
+ in: query
+ name: page_index
+ required: true
+ type: integer
+ - description: size of per page
+ in: query
+ name: page_size
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.GetWorkflowsResV1'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取全局工单列表
+ tags:
+ - workflow
+ /v2/audit_files:
+ post:
+ description: Direct audit sql from SQL files and MyBatis files
+ operationId: directAuditFilesV2
+ parameters:
+ - description: files that should be audited
+ in: body
+ name: req
+ required: true
+ schema:
+ $ref: '#/definitions/v2.DirectAuditFileReqV2'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v2.DirectAuditResV2'
+ security:
+ - ApiKeyAuth: []
+ summary: 直接从文件内容提取SQL并审核,SQL文件暂时只支持一次解析一个文件
+ tags:
+ - sql_audit
+ /v2/configurations/drivers:
+ get:
+ description: get drivers
+ operationId: getDriversV2
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v2.GetDriversRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取当前 server 支持的审核类型
+ tags:
+ - configuration
+ /v2/projects/{project_name}/audit_plans:
+ get:
+ description: get audit plan info list
+ operationId: getAuditPlansV2
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: filter audit plan db type
+ in: query
+ name: filter_audit_plan_db_type
+ type: string
+ - description: fuzzy search audit plan name
+ in: query
+ name: fuzzy_search_audit_plan_name
+ type: string
+ - description: filter audit plan type
+ in: query
+ name: filter_audit_plan_type
+ type: string
+ - description: filter audit plan instance name
+ in: query
+ name: filter_audit_plan_instance_name
+ type: string
+ - description: page index
+ in: query
+ name: page_index
+ required: true
+ type: integer
+ - description: size of per page
+ in: query
+ name: page_size
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v2.GetAuditPlansResV2'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取扫描任务信息列表
+ tags:
+ - audit_plan
+ /v2/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls:
+ get:
+ description: get audit plan report SQLs
+ operationId: getAuditPlanReportsSQLs
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ - description: audit plan report id
+ in: path
+ name: audit_plan_report_id
+ required: true
+ type: string
+ - description: page index
+ in: query
+ name: page_index
+ required: true
+ type: integer
+ - description: size of per page
+ in: query
+ name: page_size
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v2.GetAuditPlanReportSQLsResV2'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取指定扫描任务的SQL扫描详情
+ tags:
+ - audit_plan
+ /v2/projects/{project_name}/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls/{number}/analysis:
+ get:
+ description: get SQL explain and related table metadata for analysis
+ operationId: getAuditPlantAnalysisDataV2
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ - description: audit plan report id
+ in: path
+ name: audit_plan_report_id
+ required: true
+ type: string
+ - description: sql number
+ in: path
+ name: number
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v2.GetAuditPlanAnalysisDataResV2'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取task相关的SQL执行计划和表元数据
+ tags:
+ - audit_plan
+ /v2/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/full:
+ post:
+ description: full sync audit plan SQLs
+ operationId: fullSyncAuditPlanSQLsV2
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ - description: full sync audit plan SQLs request
+ in: body
+ name: sqls
+ required: true
+ schema:
+ $ref: '#/definitions/v2.FullSyncAuditPlanSQLsReqV2'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 全量同步SQL到扫描任务
+ tags:
+ - audit_plan
+ /v2/projects/{project_name}/audit_plans/{audit_plan_name}/sqls/partial:
+ post:
+ description: partial sync audit plan SQLs
+ operationId: partialSyncAuditPlanSQLsV2
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: audit plan name
+ in: path
+ name: audit_plan_name
+ required: true
+ type: string
+ - description: partial sync audit plan SQLs request
+ in: body
+ name: sqls
+ required: true
+ schema:
+ $ref: '#/definitions/v2.PartialSyncAuditPlanSQLsReqV2'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 增量同步SQL到扫描任务
+ tags:
+ - audit_plan
+ /v2/projects/{project_name}/instances/{instance_name}/:
+ get:
+ description: get instance db
+ operationId: getInstanceV2
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: instance name
+ in: path
+ name: instance_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v2.GetInstanceResV2'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取实例信息
+ tags:
+ - instance
+ /v2/projects/{project_name}/sql_manages:
+ get:
+ description: get sql manage list
+ operationId: GetSqlManageListV2
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: fuzzy search sql fingerprint
+ in: query
+ name: fuzzy_search_sql_fingerprint
+ type: string
+ - description: assignee
+ in: query
+ name: filter_assignee
+ type: string
+ - description: instance name
+ in: query
+ name: filter_instance_name
+ type: string
+ - description: source
+ enum:
+ - audit_plan
+ - sql_audit_record
+ in: query
+ name: filter_source
+ type: string
+ - description: audit level
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ in: query
+ name: filter_audit_level
+ type: string
+ - description: last audit start time from
+ in: query
+ name: filter_last_audit_start_time_from
+ type: string
+ - description: last audit start time to
+ in: query
+ name: filter_last_audit_start_time_to
+ type: string
+ - description: status
+ enum:
+ - unhandled
+ - solved
+ - ignored
+ - manual_audited
+ in: query
+ name: filter_status
+ type: string
+ - description: rule name
+ in: query
+ name: filter_rule_name
+ type: string
+ - description: db type
+ in: query
+ name: filter_db_type
+ type: string
+ - description: fuzzy search endpoint
+ in: query
+ name: fuzzy_search_endpoint
+ type: string
+ - description: fuzzy search schema name
+ in: query
+ name: fuzzy_search_schema_name
+ type: string
+ - description: sort field
+ enum:
+ - first_appear_timestamp
+ - last_receive_timestamp
+ - fp_count
+ in: query
+ name: sort_field
+ type: string
+ - description: sort order
+ enum:
+ - asc
+ - desc
+ in: query
+ name: sort_order
+ type: string
+ - description: page index
+ in: query
+ name: page_index
+ required: true
+ type: integer
+ - description: size of per page
+ in: query
+ name: page_size
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v2.GetSqlManageListResp'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取管控sql列表
+ tags:
+ - SqlManage
+ /v2/projects/{project_name}/workflows:
+ post:
+ consumes:
+ - application/json
+ description: create workflow
+ operationId: createWorkflowV2
+ parameters:
+ - description: create workflow request
+ in: body
+ name: instance
+ required: true
+ schema:
+ $ref: '#/definitions/v2.CreateWorkflowReqV2'
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v2.CreateWorkflowResV2'
+ security:
+ - ApiKeyAuth: []
+ summary: 创建工单
+ tags:
+ - workflow
+ /v2/projects/{project_name}/workflows/{workflow_id}/:
+ get:
+ description: get workflow detail
+ operationId: getWorkflowV2
+ parameters:
+ - description: workflow id
+ in: path
+ name: workflow_id
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v2.GetWorkflowResV2'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取工单详情
+ tags:
+ - workflow
+ patch:
+ consumes:
+ - application/json
+ description: update workflow when it is rejected to creator.
+ operationId: updateWorkflowV2
+ parameters:
+ - description: workflow id
+ in: path
+ name: workflow_id
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: update workflow request
+ in: body
+ name: instance
+ required: true
+ schema:
+ $ref: '#/definitions/v2.UpdateWorkflowReqV2'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 更新工单(驳回后才可更新)
+ tags:
+ - workflow
+ /v2/projects/{project_name}/workflows/{workflow_id}/cancel:
+ post:
+ description: cancel workflow
+ operationId: cancelWorkflowV2
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: workflow id
+ in: path
+ name: workflow_id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 审批关闭(中止)
+ tags:
+ - workflow
+ /v2/projects/{project_name}/workflows/{workflow_id}/steps/{workflow_step_id}/approve:
+ post:
+ description: approve workflow
+ operationId: approveWorkflowV2
+ parameters:
+ - description: workflow id
+ in: path
+ name: workflow_id
+ required: true
+ type: string
+ - description: workflow step id
+ in: path
+ name: workflow_step_id
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 审批通过
+ tags:
+ - workflow
+ /v2/projects/{project_name}/workflows/{workflow_id}/steps/{workflow_step_id}/reject:
+ post:
+ description: reject workflow
+ operationId: rejectWorkflowV2
+ parameters:
+ - description: workflow id
+ in: path
+ name: workflow_id
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: workflow step id
+ in: path
+ name: workflow_step_id
+ required: true
+ type: string
+ - description: workflow approve request
+ in: body
+ name: workflow_approve
+ required: true
+ schema:
+ $ref: '#/definitions/v2.RejectWorkflowReqV2'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 审批驳回
+ tags:
+ - workflow
+ /v2/projects/{project_name}/workflows/{workflow_id}/tasks:
+ get:
+ description: get summary of workflow instance tasks
+ operationId: getSummaryOfInstanceTasksV2
+ parameters:
+ - description: workflow id
+ in: path
+ name: workflow_id
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v2.GetWorkflowTasksResV2'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取工单数据源任务概览
+ tags:
+ - workflow
+ /v2/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/execute:
+ post:
+ description: execute one task on workflow
+ operationId: executeOneTaskOnWorkflowV2
+ parameters:
+ - description: workflow id
+ in: path
+ name: workflow_id
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: task id
+ in: path
+ name: task_id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 工单提交单个数据源上线
+ tags:
+ - workflow
+ /v2/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/schedule:
+ put:
+ consumes:
+ - application/json
+ description: update workflow schedule.
+ operationId: updateWorkflowScheduleV2
+ parameters:
+ - description: workflow id
+ in: path
+ name: workflow_id
+ required: true
+ type: string
+ - description: task id
+ in: path
+ name: task_id
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: update workflow schedule request
+ in: body
+ name: instance
+ required: true
+ schema:
+ $ref: '#/definitions/v2.UpdateWorkflowScheduleReqV2'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 设置工单数据源定时上线时间(设置为空则代表取消定时时间,需要SQL审核流程都通过后才可以设置)
+ tags:
+ - workflow
+ /v2/projects/{project_name}/workflows/{workflow_id}/tasks/execute:
+ post:
+ description: execute tasks on workflow
+ operationId: executeTasksOnWorkflowV2
+ parameters:
+ - description: workflow id
+ in: path
+ name: workflow_id
+ required: true
+ type: string
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 多数据源批量上线
+ tags:
+ - workflow
+ /v2/projects/{project_name}/workflows/cancel:
+ post:
+ description: batch cancel workflows
+ operationId: batchCancelWorkflowsV2
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: batch cancel workflows request
+ in: body
+ name: BatchCancelWorkflowsReqV2
+ required: true
+ schema:
+ $ref: '#/definitions/v2.BatchCancelWorkflowsReqV2'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 批量取消工单
+ tags:
+ - workflow
+ /v2/projects/{project_name}/workflows/complete:
+ post:
+ description: this api will directly change the work order status to finished
+ without real online operation
+ operationId: batchCompleteWorkflowsV2
+ parameters:
+ - description: project name
+ in: path
+ name: project_name
+ required: true
+ type: string
+ - description: batch complete workflows request
+ in: body
+ name: data
+ required: true
+ schema:
+ $ref: '#/definitions/v2.BatchCompleteWorkflowsReqV2'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/controller.BaseRes'
+ security:
+ - ApiKeyAuth: []
+ summary: 批量完成工单
+ tags:
+ - workflow
+ /v2/sql_audit:
+ post:
+ deprecated: true
+ description: Direct audit sql
+ operationId: directAuditV2
+ parameters:
+ - description: sqls that should be audited
+ in: body
+ name: req
+ required: true
+ schema:
+ $ref: '#/definitions/v2.DirectAuditReqV2'
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v2.DirectAuditResV2'
+ security:
+ - ApiKeyAuth: []
+ summary: 直接审核SQL
+ tags:
+ - sql_audit
+ /v2/tasks/audits/{task_id}/sqls:
+ get:
+ description: get information of all SQLs belong to the specified audit task
+ operationId: getAuditTaskSQLsV2
+ parameters:
+ - description: task id
+ in: path
+ name: task_id
+ required: true
+ type: string
+ - description: 'filter: exec status of task sql'
+ enum:
+ - initialized
+ - doing
+ - succeeded
+ - failed
+ - manually_executed
+ - terminating
+ - terminate_succeeded
+ - terminate_failed
+ in: query
+ name: filter_exec_status
+ type: string
+ - description: 'filter: audit status of task sql'
+ enum:
+ - initialized
+ - doing
+ - finished
+ in: query
+ name: filter_audit_status
+ type: string
+ - description: 'filter: audit level of task sql'
+ enum:
+ - normal
+ - notice
+ - warn
+ - error
+ in: query
+ name: filter_audit_level
+ type: string
+ - description: select unique (fingerprint and audit result) for task sql
+ in: query
+ name: no_duplicate
+ type: boolean
+ - description: page index
+ in: query
+ name: page_index
+ required: true
+ type: string
+ - description: page size
+ in: query
+ name: page_size
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v2.GetAuditTaskSQLsResV2'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取指定扫描任务的SQLs信息
+ tags:
+ - task
+ /v2/tasks/audits/{task_id}/sqls/{number}/analysis:
+ get:
+ description: get SQL explain and related table metadata for analysis
+ operationId: getTaskAnalysisDataV2
+ parameters:
+ - description: task id
+ in: path
+ name: task_id
+ required: true
+ type: string
+ - description: sql number
+ in: path
+ name: number
+ required: true
+ type: integer
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v2.GetTaskAnalysisDataResV2'
+ security:
+ - ApiKeyAuth: []
+ summary: 获取task相关的SQL执行计划和表元数据
+ tags:
+ - task
+securityDefinitions:
+ ApiKeyAuth:
+ in: header
+ name: Authorization
+ type: apiKey
+swagger: "2.0"
diff --git a/internal/apiserver/service/router.go b/internal/apiserver/service/router.go
index f2d6ffce..0a47f722 100644
--- a/internal/apiserver/service/router.go
+++ b/internal/apiserver/service/router.go
@@ -28,8 +28,7 @@ func (s *APIServer) initRouter() error {
api.Config.InstanceName = url
}
}
- next(c)
- return nil
+ return next(c)
}
})