v1

package
v1.2203.0-pre4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2022 License: MPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InputSQLFileName        = "input_sql_file"
	InputMyBatisXMLFileName = "input_mybatis_xml_file"
)

Variables

View Source
var ErrForbidMyBatisXMLTask = errors.New(errors.DataConflict,
	fmt.Errorf("the task for audit mybatis xml file is not allow to create workflow"))
View Source
var ErrNoLicenseRequired = errors.New(errors.ErrAccessDeniedError, e.New("sqle-qa no license required"))
View Source
var ErrTaskNoAccess = errors.New(errors.DataNotExist, fmt.Errorf("task is not exist or you can't access it"))
View Source
var ErrWorkflowNoAccess = errors.New(errors.DataNotExist, fmt.Errorf("workflow is not exist or you can't access it"))

Functions

func ApproveWorkflow

func ApproveWorkflow(c echo.Context) error

@Summary 审批通过 @Description approve workflow @Tags workflow @Id approveWorkflowV1 @Security ApiKeyAuth @Param workflow_id path string true "workflow id" @Param workflow_step_id path string true "workflow step id" @Success 200 {object} controller.BaseRes @router /v1/workflows/{workflow_id}/steps/{workflow_step_id}/approve [post]

func BatchCancelWorkflows

func BatchCancelWorkflows(c echo.Context) error

BatchCancelWorkflows batch cancel workflows. @Summary 批量取消工单 @Description batch cancel workflows @Tags workflow @Id batchCancelWorkflowsV1 @Security ApiKeyAuth @Param BatchCancelWorkflowsReqV1 body v1.BatchCancelWorkflowsReqV1 true "batch cancel workflows request" @Success 200 {object} controller.BaseRes @router /v1/workflows/cancel [post]

func CancelWorkflow

func CancelWorkflow(c echo.Context) error

@Summary 审批关闭(中止) @Description cancel workflow @Tags workflow @Id cancelWorkflowV1 @Security ApiKeyAuth @Param workflow_id path string true "workflow id" @Success 200 {object} controller.BaseRes @router /v1/workflows/{workflow_id}/cancel [post]

func CheckCurrentUserCanAccessAuditPlan added in v1.2201.0

func CheckCurrentUserCanAccessAuditPlan(c echo.Context, apName string) error

func CheckInstanceAndRuleTemplateDbType

func CheckInstanceAndRuleTemplateDbType(ruleTemplates []*model.RuleTemplate, instances ...*model.Instance) error

func CheckInstanceCanBindOneRuleTemplate

func CheckInstanceCanBindOneRuleTemplate(ruleTemplates []string) bool

func CheckInstanceIsConnectable

func CheckInstanceIsConnectable(c echo.Context) error

CheckInstanceIsConnectable test instance db connection @Summary 实例连通性测试(实例提交前) @Description test instance db connection 注:可直接提交创建实例接口的body,该接口的json 内容是创建实例的 json 的子集 @Accept json @Id checkInstanceIsConnectableV1 @Tags instance @Security ApiKeyAuth @Param instance body v1.GetInstanceConnectableReqV1 true "instance info" @Success 200 {object} v1.GetInstanceConnectableResV1 @router /v1/instance_connection [post]

func CheckInstanceIsConnectableByName

func CheckInstanceIsConnectableByName(c echo.Context) error

CheckInstanceIsConnectableByName test instance db connection @Summary 实例连通性测试(实例提交后) @Description test instance db connection @Id checkInstanceIsConnectableByNameV1 @Tags instance @Security ApiKeyAuth @Param instance_name path string true "instance name" @Success 200 {object} v1.GetInstanceConnectableResV1 @router /v1/instances/{instance_name}/connection [get]

func CheckLicense added in v1.2203.0

func CheckLicense(c echo.Context) error

CheckLicense parse and check sqle license @Summary 解析和校验 sqle license @Description parse and check sqle license @Id checkSQLELicenseV1 @Tags configuration @Accept mpfd @Security ApiKeyAuth @Param license_file formData file true "SQLE license file" @Success 200 {object} v1.CheckLicenseResV1 @router /v1/configurations/license/check [post]

func CheckRuleTemplateCanBeBindEachInstance

func CheckRuleTemplateCanBeBindEachInstance(s *model.Storage, tplName string, instances []*model.Instance) error

func CloneRuleTemplate

func CloneRuleTemplate(c echo.Context) error

@Summary 克隆规则模板 @Description clone a rule template @Id CloneRuleTemplateV1 @Tags rule_template @Security ApiKeyAuth @Accept json @Param rule_template_name path string true "rule template name" @Param instance body v1.CloneRuleTemplateReqV1 true "clone rule template request" @Success 200 {object} controller.BaseRes @router /v1/rule_templates/{rule_template_name}/clone [post]

func CreateAndAuditTask

func CreateAndAuditTask(c echo.Context) error

@Summary 创建Sql审核任务并提交审核 @Description create and audit a task, you can upload sql content in three ways, any one can be used, but only one is effective. @Description 1. formData[sql]: sql content; @Description 2. file[input_sql_file]: it is a sql file; @Description 3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it. @Accept mpfd @Produce json @Tags task @Id createAndAuditTaskV1 @Security ApiKeyAuth @Param instance_name formData string true "instance name" @Param instance_schema formData string false "schema of instance" @Param sql formData string false "sqls for audit" @Param input_sql_file formData file false "input SQL file" @Param input_mybatis_xml_file formData file false "input mybatis XML file" @Success 200 {object} v1.GetAuditTaskResV1 @router /v1/tasks/audits [post]

func CreateAuditPlan

func CreateAuditPlan(c echo.Context) error

@Summary 添加审核计划 @Description create audit plan @Id createAuditPlanV1 @Tags audit_plan @Security ApiKeyAuth @Accept json @Param audit_plan body v1.CreateAuditPlanReqV1 true "create audit plan" @Success 200 {object} controller.BaseRes @router /v1/audit_plans [post]

func CreateAuditWhitelist

func CreateAuditWhitelist(c echo.Context) error

@Summary 添加SQL白名单 @Description create a sql whitelist @Accept json @Id createAuditWhitelistV1 @Tags audit_whitelist @Security ApiKeyAuth @Param instance body v1.CreateAuditWhitelistReqV1 true "add sql whitelist req" @Success 200 {object} controller.BaseRes @router /v1/audit_whitelist [post]

func CreateInstance

func CreateInstance(c echo.Context) error

CreateInstance create instance @Summary 添加实例 @Description create a instance @Id createInstanceV1 @Tags instance @Security ApiKeyAuth @Accept json @Param instance body v1.CreateInstanceReqV1 true "add instance" @Success 200 {object} controller.BaseRes @router /v1/instances [post]

func CreateRole

func CreateRole(c echo.Context) error

@Summary 创建角色 @Description create role @Deprecated @Id createRoleV1 @Tags role @Security ApiKeyAuth @Accept json @Produce json @Param instance body v1.CreateRoleReqV1 true "create role" @Success 200 {object} controller.BaseRes @router /v1/roles [post]

func CreateRuleTemplate

func CreateRuleTemplate(c echo.Context) error

@Summary 添加规则模板 @Description create a rule template @Id createRuleTemplateV1 @Tags rule_template @Security ApiKeyAuth @Accept json @Param instance body v1.CreateRuleTemplateReqV1 true "add rule template request" @Success 200 {object} controller.BaseRes @router /v1/rule_templates [post]

func CreateUser

func CreateUser(c echo.Context) error

@Summary 创建用户 @Description create user @Id createUserV1 @Tags user @Security ApiKeyAuth @Accept json @Produce json @Param instance body v1.CreateUserReqV1 true "create user" @Success 200 {object} controller.BaseRes @router /v1/users [post]

func CreateUserGroup added in v1.2202.0

func CreateUserGroup(c echo.Context) (err error)

@Summary 创建用户组 @Description create user group @Id CreateUserGroupV1 @Tags user_group @Security ApiKeyAuth @Accept json @Produce json @Param instance body v1.CreateUserGroupReqV1 true "create user group" @Success 200 {object} controller.BaseRes @router /v1/user_groups [post]

func CreateWorkflow

func CreateWorkflow(c echo.Context) error

@Summary 创建工单 @Description create workflow @Accept json @Produce json @Tags workflow @Id createWorkflowV1 @Security ApiKeyAuth @Param instance body v1.CreateWorkflowReqV1 true "create workflow request" @Success 200 {object} controller.BaseRes @router /v1/workflows [post]

func CreateWorkflowTemplate

func CreateWorkflowTemplate(c echo.Context) error

@Summary 创建Sql审批流程模板 @Description create a workflow template @Accept json @Produce json @Tags workflow @Id createWorkflowTemplateV1 @Security ApiKeyAuth @Param instance body v1.CreateWorkflowTemplateReqV1 true "create workflow template request" @Success 200 {object} controller.BaseRes @router /v1/workflow_templates [post]

func Dashboard

func Dashboard(c echo.Context) error

@Summary 获取 dashboard 信息 @Description get dashboard info @Id getDashboardV1 @Tags dashboard @Security ApiKeyAuth @Produce json @Success 200 {object} v1.GetDashboardResV1 @router /v1/dashboard [get]

func DeleteAuditPlan

func DeleteAuditPlan(c echo.Context) error

@Summary 删除审核计划 @Description delete audit plan @Id deleteAuditPlanV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @Success 200 {object} controller.BaseRes @router /v1/audit_plans/{audit_plan_name}/ [delete]

func DeleteAuditWhitelistById

func DeleteAuditWhitelistById(c echo.Context) error

@Summary 删除SQL白名单信息 @Description remove sql white @Id deleteAuditWhitelistByIdV1 @Tags audit_whitelist @Security ApiKeyAuth @Param audit_whitelist_id path string true "audit whitelist id" @Success 200 {object} controller.BaseRes @router /v1/audit_whitelist/{audit_whitelist_id}/ [delete]

func DeleteInstance

func DeleteInstance(c echo.Context) error

DeleteInstance delete instance @Summary 删除实例 @Description delete instance db @Id deleteInstanceV1 @Tags instance @Security ApiKeyAuth @Param instance_name path string true "instance name" @Success 200 {object} controller.BaseRes @router /v1/instances/{instance_name}/ [delete]

func DeleteRole

func DeleteRole(c echo.Context) error

@Summary 删除角色 @Description delete role @Id deleteRoleV1 @Tags role @Security ApiKeyAuth @Accept json @Produce json @Param role_name path string true "role name" @Success 200 {object} controller.BaseRes @router /v1/roles/{role_name}/ [delete]

func DeleteRuleTemplate

func DeleteRuleTemplate(c echo.Context) error

@Summary 删除规则模板 @Description delete rule template @Id deleteRuleTemplateV1 @Tags rule_template @Security ApiKeyAuth @Param rule_template_name path string true "rule template name" @Success 200 {object} controller.BaseRes @router /v1/rule_templates/{rule_template_name}/ [delete]

func DeleteUser

func DeleteUser(c echo.Context) error

@Summary 删除用户 @Description delete user @Id deleteUserV1 @Tags user @Security ApiKeyAuth @Param user_name path string true "user name" @Success 200 {object} controller.BaseRes @router /v1/users/{user_name}/ [delete]

func DeleteUserGroup added in v1.2202.0

func DeleteUserGroup(c echo.Context) (err error)

@Summary 删除用户组 @Description delete user group @Id deleteUserGroupV1 @Tags user_group @Security ApiKeyAuth @Param user_group_name path string true "user_group_name" @Success 200 {object} controller.BaseRes @router /v1/user_groups/{user_group_name}/ [delete]

func DeleteWorkflowTemplate

func DeleteWorkflowTemplate(c echo.Context) error

@Summary 删除Sql审批流程模板 @Description update the workflow template @Tags workflow @Id deleteWorkflowTemplateV1 @Security ApiKeyAuth @Accept json @Produce json @Param workflow_template_name path string true "workflow template name" @Success 200 {object} controller.BaseRes @router /v1/workflow_templates/{workflow_template_name}/ [delete]

func DownloadTaskSQLFile

func DownloadTaskSQLFile(c echo.Context) error

@Summary 下载指定审核任务的SQL文件 @Description download SQL file for the audit task @Tags task @Id downloadAuditTaskSQLFileV1 @Security ApiKeyAuth @Param task_id path string true "task id" @Success 200 file 1 "sql file" @router /v1/tasks/audits/{task_id}/sql_file [get]

func DownloadTaskSQLReportFile

func DownloadTaskSQLReportFile(c echo.Context) error

@Summary 下载指定审核任务的SQLs信息报告 @Description download report file of all SQLs information belong to the specified audit task @Tags task @Id downloadAuditTaskSQLReportV1 @Security ApiKeyAuth @Param task_id path string true "task id" @Param no_duplicate query boolean false "select unique (fingerprint and audit result) for task sql" @Success 200 file 1 "sql report csv file" @router /v1/tasks/audits/{task_id}/sql_report [get]

func ExecuteTaskOnWorkflow added in v1.2112.0

func ExecuteTaskOnWorkflow(c echo.Context) error

@Summary 工单提交 SQL 上线 @Description execute task on workflow @Tags workflow @Id executeTaskOnWorkflowV1 @Security ApiKeyAuth @Param workflow_id path string true "workflow id" @Success 200 {object} controller.BaseRes @router /v1/workflows/{workflow_id}/task/execute [post]

func FormatStringToInt

func FormatStringToInt(s string) (ret int, err error)

func FullSyncAuditPlanSQLs

func FullSyncAuditPlanSQLs(c echo.Context) error

@Summary 全量同步SQL到审核计划 @Description full sync audit plan SQLs @Id fullSyncAuditPlanSQLsV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @Param sqls body v1.FullSyncAuditPlanSQLsReqV1 true "full sync audit plan SQLs request" @Success 200 {object} controller.BaseRes @router /v1/audit_plans/{audit_plan_name}/sqls/full [post]

func GetAuditPlan

func GetAuditPlan(c echo.Context) error

@Summary 获取指定审核计划 @Description get audit plan @Id getAuditPlanV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @Success 200 {object} v1.GetAuditPlanResV1 @router /v1/audit_plans/{audit_plan_name}/ [get]

func GetAuditPlanMetas added in v1.2201.0

func GetAuditPlanMetas(c echo.Context) error

@Summary 获取审核任务元信息 @Description get audit plan metas @Id getAuditPlanMetasV1 @Tags audit_plan @Security ApiKeyAuth @Param filter_instance_type query string false "filter instance type" @Success 200 {object} v1.GetAuditPlanMetasResV1 @router /v1/audit_plan_metas [get]

func GetAuditPlanReportSQLs

func GetAuditPlanReportSQLs(c echo.Context) error

@Summary 获取指定审核计划的SQL审核详情 @Description get audit plan report SQLs @Deprecated @Id getAuditPlanReportSQLsV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @Param audit_plan_report_id path string true "audit plan report id" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetAuditPlanReportSQLsResV1 @router /v1/audit_plans/{audit_plan_name}/report/{audit_plan_report_id}/ [get]

func GetAuditPlanReports

func GetAuditPlanReports(c echo.Context) error

@Summary 获取指定审核计划的报告列表 @Description get audit plan report list @Id getAuditPlanReportsV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetAuditPlanReportsResV1 @router /v1/audit_plans/{audit_plan_name}/reports [get]

func GetAuditPlanSQLs

func GetAuditPlanSQLs(c echo.Context) error

@Summary 获取指定审核计划的SQLs信息(不包括审核结果) @Description get audit plan SQLs @Deprecated @Id getAuditPlanSQLsV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetAuditPlanSQLsResV1 @router /v1/audit_plans/{audit_plan_name}/sqls [get]

func GetAuditPlans

func GetAuditPlans(c echo.Context) error

@Summary 获取审核计划信息列表 @Description get audit plan info list @Id getAuditPlansV1 @Tags audit_plan @Security ApiKeyAuth @Param filter_audit_plan_db_type query string false "filter audit plan db type" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetAuditPlansResV1 @router /v1/audit_plans [get]

func GetAuditTaskSQLContent

func GetAuditTaskSQLContent(c echo.Context) error

@Summary 获取指定审核任务的SQL内容 @Description get SQL content for the audit task @Tags task @Id getAuditTaskSQLContentV1 @Security ApiKeyAuth @Param task_id path string true "task id" @Success 200 {object} v1.GetAuditTaskSQLContentResV1 @router /v1/tasks/audits/{task_id}/sql_content [get]

func GetCurrentUser

func GetCurrentUser(c echo.Context) error

@Summary 获取当前用户信息 @Description get current user info @Id getCurrentUserV1 @Tags user @Security ApiKeyAuth @Success 200 {object} v1.GetUserDetailResV1 @router /v1/user [get]

func GetDrivers

func GetDrivers(c echo.Context) error

GetDrivers get support Driver list. @Summary 获取当前 server 支持的审核类型 @Description get drivers @Id getDriversV1 @Tags configuration @Security ApiKeyAuth @Success 200 {object} v1.GetDriversResV1 @router /v1/configurations/drivers [get]

func GetInstance

func GetInstance(c echo.Context) error

GetInstance get instance @Summary 获取实例信息 @Description get instance db @Id getInstanceV1 @Tags instance @Security ApiKeyAuth @Param instance_name path string true "instance name" @Success 200 {object} v1.GetInstanceResV1 @router /v1/instances/{instance_name}/ [get]

func GetInstanceAdditionalMetas added in v1.2203.0

func GetInstanceAdditionalMetas(c echo.Context) error

GetInstanceAdditionalMetas get instance additional metas @Summary 获取实例的额外属性列表 @Description get instance additional metas @Id getInstanceAdditionalMetas @Tags instance @Security ApiKeyAuth @Success 200 {object} v1.GetInstanceAdditionalMetasResV1 @router /v1/instance_additional_metas [get]

func GetInstanceRules

func GetInstanceRules(c echo.Context) error

GetInstanceRules get instance all rule @Summary 获取实例应用的规则列表 @Description get instance all rule @Id getInstanceRuleListV1 @Tags instance @Security ApiKeyAuth @Param instance_name path string true "instance name" @Success 200 {object} v1.GetRulesResV1 @router /v1/instances/{instance_name}/rules [get]

func GetInstanceSchemas

func GetInstanceSchemas(c echo.Context) error

GetInstanceSchemas get instance schema list @Summary 实例 Schema 列表 @Description instance schema list @Id getInstanceSchemasV1 @Tags instance @Security ApiKeyAuth @Param instance_name path string true "instance name" @Success 200 {object} v1.GetInstanceSchemaResV1 @router /v1/instances/{instance_name}/schemas [get]

func GetInstanceTips

func GetInstanceTips(c echo.Context) error

GetInstanceTips get instance tip list @Summary 获取实例提示列表 @Description get instance tip list @Tags instance @Id getInstanceTipListV1 @Security ApiKeyAuth @Param filter_db_type query string false "filter db type" @Success 200 {object} v1.GetInstanceTipsResV1 @router /v1/instance_tips [get]

func GetInstanceWorkflowTemplate added in v1.2201.0

func GetInstanceWorkflowTemplate(c echo.Context) error

GetInstanceWorkflowTemplate get instance workflow template @Summary 获取实例应用的工作流程模板 @Description get instance workflow template @Id getInstanceWorkflowTemplateV1 @Tags instance @Security ApiKeyAuth @Param instance_name path string true "instance name" @Success 200 {object} v1.GetInstanceWorkflowTemplateResV1 @router /v1/instances/{instance_name}/workflow_template [get]

func GetInstances

func GetInstances(c echo.Context) error

GetInstances get instances @Summary 获取实例信息列表 @Description get instance info list @Id getInstanceListV1 @Tags instance @Security ApiKeyAuth @Param filter_instance_name query string false "filter instance name" @Param filter_db_type query string false "filter db type" @Param filter_db_host query string false "filter db host" @Param filter_db_port query string false "filter db port" @Param filter_db_user query string false "filter db user" @Param filter_workflow_template_name query string false "filter workflow rule template name" @Param filter_rule_template_name query string false "filter rule template name" @Param filter_role_name query string false "filter role name" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetInstancesResV1 @router /v1/instances [get]

func GetLDAPConfiguration added in v1.2111.0

func GetLDAPConfiguration(c echo.Context) error

@Summary 获取 LDAP 配置 @Description get LDAP configuration @Id getLDAPConfigurationV1 @Tags configuration @Security ApiKeyAuth @Success 200 {object} v1.GetLDAPConfigurationResV1 @router /v1/configurations/ldap [get]

func GetLicense added in v1.2203.0

func GetLicense(c echo.Context) error

GetLicense get sqle license @Summary 获取 sqle license @Description get sqle license @Id getSQLELicenseV1 @Tags configuration @Security ApiKeyAuth @Success 200 {object} v1.GetLicenseResV1 @router /v1/configurations/license [get]

func GetOperations added in v1.2202.0

func GetOperations(c echo.Context) error

@Summary 获取权限动作列表 @Description get permission operations @Id GetOperationsV1 @Tags operation @Security ApiKeyAuth @Success 200 {object} v1.GetOperationsResV1 @Router /v1/operations [get]

func GetRoleTips

func GetRoleTips(c echo.Context) error

@Summary 获取角色提示列表 @Description get role tip list @Tags role @Id getRoleTipListV1 @Security ApiKeyAuth @Success 200 {object} v1.GetRoleTipsResV1 @router /v1/role_tips [get]

func GetRoles

func GetRoles(c echo.Context) error

@Summary 获取角色列表 @Description get role list @Deprecated @Id getRoleListV1 @Tags role @Security ApiKeyAuth @Accept json @Produce json @Param filter_role_name query string false "filter role name" @Param filter_user_name query string false "filter user name" @Param filter_instance_name query string false "filter instance name" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetRolesResV1 @router /v1/roles [get]

func GetRuleTemplate

func GetRuleTemplate(c echo.Context) error

@Summary 获取规则模板信息 @Description get rule template @Id getRuleTemplateV1 @Tags rule_template @Security ApiKeyAuth @Param rule_template_name path string true "rule template name" @Success 200 {object} v1.GetRuleTemplateResV1 @router /v1/rule_templates/{rule_template_name}/ [get]

func GetRuleTemplateTips

func GetRuleTemplateTips(c echo.Context) error

@Summary 获取规则模板提示 @Description get rule template tips @Id getRuleTemplateTipsV1 @Tags rule_template @Security ApiKeyAuth @Param filter_db_type query string false "filter db type" @Success 200 {object} v1.GetRuleTemplateTipsResV1 @router /v1/rule_template_tips [get]

func GetRuleTemplates

func GetRuleTemplates(c echo.Context) error

@Summary 规则模板列表 @Description get all rule template @Id getRuleTemplateListV1 @Tags rule_template @Security ApiKeyAuth @Param filter_instance_name query string false "filter instance name" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetRuleTemplatesResV1 @router /v1/rule_templates [get]

func GetRules

func GetRules(c echo.Context) error

@Summary 规则列表 @Description get all rule template @Id getRuleListV1 @Tags rule_template @Security ApiKeyAuth @Param filter_db_type query string false "filter db type" @Success 200 {object} v1.GetRulesResV1 @router /v1/rules [get]

func GetSMTPConfiguration

func GetSMTPConfiguration(c echo.Context) error

@Summary 获取 SMTP 配置 @Description get SMTP configuration @Id getSMTPConfigurationV1 @Tags configuration @Security ApiKeyAuth @Success 200 {object} v1.GetSMTPConfigurationResV1 @router /v1/configurations/smtp [get]

func GetSQLEInfo added in v1.2201.0

func GetSQLEInfo(c echo.Context) error

GetSQLEInfo get sqle basic info @Summary 获取 sqle 基本信息 @Description get sqle basic info @Id getSQLEInfoV1 @Tags global @Success 200 {object} v1.GetSQLEInfoResV1 @router /v1/basic_info [get]

func GetSQLELicenseInfo added in v1.2203.0

func GetSQLELicenseInfo(c echo.Context) error

GetSQLELicenseInfo get the information needed to generate the sqle license @Summary 获取生成 sqle license需要的的信息 @Description get the information needed to generate the sqle license @Id GetSQLELicenseInfoV1 @Tags configuration @Security ApiKeyAuth @Success 200 file 1 "server info" @router /v1/configurations/license/info [get]

func GetSqlWhitelist

func GetSqlWhitelist(c echo.Context) error

@Summary 获取Sql审核白名单 @Description get all whitelist @Id getAuditWhitelistV1 @Tags audit_whitelist @Security ApiKeyAuth @Param page_index query string false "page index" @Param page_size query string false "page size" @Success 200 {object} v1.GetAuditWhitelistResV1 @router /v1/audit_whitelist [get]

func GetSystemVariables

func GetSystemVariables(c echo.Context) error

@Summary 获取系统变量 @Description get system variables @Id getSystemVariablesV1 @Tags configuration @Security ApiKeyAuth @Success 200 {object} v1.GetSystemVariablesResV1 @router /v1/configurations/system_variables [get]

func GetTask

func GetTask(c echo.Context) error

@Summary 获取Sql审核任务信息 @Description get task @Tags task @Id getAuditTaskV1 @Security ApiKeyAuth @Param task_id path string true "task id" @Success 200 {object} v1.GetAuditTaskResV1 @router /v1/tasks/audits/{task_id}/ [get]

func GetTaskSQLs

func GetTaskSQLs(c echo.Context) error

@Summary 获取指定审核任务的SQLs信息 @Description get information of all SQLs belong to the specified audit task @Tags task @Id getAuditTaskSQLsV1 @Security ApiKeyAuth @Param task_id path string true "task id" @Param filter_exec_status query string false "filter: exec status of task sql" Enums(initialized,doing,succeeded,failed) @Param filter_audit_status query string false "filter: audit status of task sql" Enums(initialized,doing,finished) @Param filter_audit_level query string false "filter: audit level of task sql" Enums(normal,notice,warn,error) @Param no_duplicate query boolean false "select unique (fingerprint and audit result) for task sql" @Param page_index query string false "page index" @Param page_size query string false "page size" @Success 200 {object} v1.GetAuditTaskSQLsResV1 @router /v1/tasks/audits/{task_id}/sqls [get]

func GetUser

func GetUser(c echo.Context) error

@Summary 获取用户信息 @Description get user info @Id getUserV1 @Tags user @Security ApiKeyAuth @Param user_name path string true "user name" @Success 200 {object} v1.GetUserDetailResV1 @router /v1/users/{user_name}/ [get]

func GetUserGroupTips added in v1.2202.0

func GetUserGroupTips(c echo.Context) error

@Summary 获取用户组提示列表 @Description get user group tip list @Tags user_group @Id getUserGroupTipListV1 @Security ApiKeyAuth @Success 200 {object} v1.GetUserGroupTipsResV1 @router /v1/user_group_tips [get]

func GetUserGroups added in v1.2202.0

func GetUserGroups(c echo.Context) (err error)

@Summary 获取用户组列表 @Description get user group info list @Id GetUserGroupsV1 @Tags user_group @Id getUserGroupListV1 @Security ApiKeyAuth @Param filter_user_group_name query string false "filter user group name" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Produce json @Success 200 {object} v1.GetUserGroupsResV1 @router /v1/user_groups [get]

func GetUserTips

func GetUserTips(c echo.Context) error

@Summary 获取用户提示列表 @Description get user tip list @Tags user @Id getUserTipListV1 @Security ApiKeyAuth @Success 200 {object} v1.GetUserTipsResV1 @router /v1/user_tips [get]

func GetUsers

func GetUsers(c echo.Context) error

@Summary 获取用户信息列表 @Description get user info list @Tags user @Id getUserListV1 @Security ApiKeyAuth @Param filter_user_name query string false "filter user name" @Param filter_role_name query string false "filter role name" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetUsersResV1 @router /v1/users [get]

func GetWeChatConfiguration added in v1.2203.0

func GetWeChatConfiguration(c echo.Context) error

GetWeChatConfiguration used to get wechat configure @Summary 获取 企业微信 配置 @Description get WeChat configuration @Id getWeChatConfigurationV1 @Tags configuration @Security ApiKeyAuth @Success 200 {object} v1.GetWeChatConfigurationResV1 @router /v1/configurations/wechat [get]

func GetWorkflow

func GetWorkflow(c echo.Context) error

@Summary 获取审批流程详情 @Description get workflow detail @Tags workflow @Id getWorkflowV1 @Security ApiKeyAuth @Param workflow_id path integer true "workflow id" @Success 200 {object} v1.GetWorkflowResV1 @router /v1/workflows/{workflow_id}/ [get]

func GetWorkflowTemplate

func GetWorkflowTemplate(c echo.Context) error

@Summary 获取审批流程模板详情 @Description get workflow template detail @Tags workflow @Id getWorkflowTemplateV1 @Security ApiKeyAuth @Param workflow_template_name path string true "workflow template name" @Success 200 {object} v1.GetWorkflowTemplateResV1 @router /v1/workflow_templates/{workflow_template_name}/ [get]

func GetWorkflowTemplateTips

func GetWorkflowTemplateTips(c echo.Context) error

@Summary 获取审批流程模板提示信息 @Description get workflow template tips @Tags workflow @Id getWorkflowTemplateTipsV1 @Security ApiKeyAuth @Success 200 {object} v1.GetWorkflowTemplateTipResV1 @router /v1/workflow_template_tips [get]

func GetWorkflowTemplates

func GetWorkflowTemplates(c echo.Context) error

@Summary 获取审批流程模板列表 @Description get workflow template list @Tags workflow @Id getWorkflowTemplateListV1 @Security ApiKeyAuth @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetWorkflowTemplatesResV1 @router /v1/workflow_templates [get]

func GetWorkflows

func GetWorkflows(c echo.Context) error

@Summary 获取审批流程列表 @Description get workflow list @Tags workflow @Id getWorkflowListV1 @Security ApiKeyAuth @Param filter_subject query string false "filter subject" @Param filter_create_time_from query string false "filter create time from" @Param filter_create_time_to query string false "filter create time to" @Param filter_create_user_name query string false "filter create user name" @Param filter_current_step_type query string false "filter current step type" Enums(sql_review, sql_execute) @Param filter_status query string false "filter workflow status" Enums(on_process, rejected, canceled, exec_scheduled, executing, exec_failed, finished) @Param filter_current_step_assignee_user_name query string false "filter current step assignee user name" @Param filter_task_instance_name query string false "filter instance name" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetWorkflowsResV1 @router /v1/workflows [get]

func Login

func Login(c echo.Context) error

@Summary 用户登录 @Description user login @Tags user @Id loginV1 @Param user body v1.UserLoginReqV1 true "user login request" @Success 200 {object} v1.GetUserLoginResV1 @router /v1/login [post]

func PartialSyncAuditPlanSQLs

func PartialSyncAuditPlanSQLs(c echo.Context) error

@Summary 增量同步SQL到审核计划 @Description partial sync audit plan SQLs @Id partialSyncAuditPlanSQLsV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @Param sqls body v1.PartialSyncAuditPlanSQLsReqV1 true "partial sync audit plan SQLs request" @Success 200 {object} controller.BaseRes @router /v1/audit_plans/{audit_plan_name}/sqls/partial [post]

func RejectWorkflow

func RejectWorkflow(c echo.Context) error

@Summary 审批驳回 @Description reject workflow @Tags workflow @Id rejectWorkflowV1 @Security ApiKeyAuth @Param workflow_id path string true "workflow id" @Param workflow_step_id path string true "workflow step id" @param workflow_approve body v1.RejectWorkflowReqV1 true "workflow approve request" @Success 200 {object} controller.BaseRes @router /v1/workflows/{workflow_id}/steps/{workflow_step_id}/reject [post]

func SetLicense added in v1.2203.0

func SetLicense(c echo.Context) error

SetLicense set sqle license @Summary 导入 sqle license @Description set sqle license @Id setSQLELicenseV1 @Tags configuration @Accept mpfd @Security ApiKeyAuth @Param license_file formData file true "SQLE license file" @Success 200 {object} controller.BaseRes @router /v1/configurations/license [post]

func TestSMTPConfigurationV1 added in v1.2203.0

func TestSMTPConfigurationV1(c echo.Context) error

TestSMTPConfigurationV1 used to test SMTP notifications @Summary 测试 邮箱 配置 @Description test SMTP configuration @Accept json @Id testSMTPConfigurationV1 @Tags configuration @Security ApiKeyAuth @Param req body v1.TestSMTPConfigurationReqV1 true "test SMTP configuration req" @Success 200 {object} v1.TestSMTPConfigurationResV1 @router /v1/configurations/smtp/test [post]

func TestWeChatConfigurationV1 added in v1.2203.0

func TestWeChatConfigurationV1(c echo.Context) error

TestWeChatConfigurationV1 used to test WeChat notifications @Summary 测试 企业微信 配置 @Description test WeChat configuration @Accept json @Id testWeChatConfigurationV1 @Tags configuration @Security ApiKeyAuth @Param instance body v1.TestWeChatConfigurationReqV1 true "test WeChat configuration req" @Success 200 {object} v1.TestWeChatConfigurationResV1 @router /v1/configurations/wechat/test [post]

func TriggerAuditPlan

func TriggerAuditPlan(c echo.Context) error

@Summary 触发审核计划 @Description trigger audit plan @Id triggerAuditPlanV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @Success 200 {object} v1.TriggerAuditPlanResV1 @router /v1/audit_plans/{audit_plan_name}/trigger [post]

func UpdateAuditPlan

func UpdateAuditPlan(c echo.Context) error

@Summary 更新审核计划 @Description update audit plan @Id updateAuditPlanV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @param audit_plan body v1.UpdateAuditPlanReqV1 true "update audit plan" @Success 200 {object} controller.BaseRes @router /v1/audit_plans/{audit_plan_name}/ [patch]

func UpdateAuditTaskSQLs added in v1.2201.0

func UpdateAuditTaskSQLs(c echo.Context) error

@Summary 修改审核任务中某条SQL的相关信息 @Description modify the relevant information of a certain SQL in the audit task @Tags task @Id updateAuditTaskSQLsV1 @Accept json @Param task_id path string true "task id" @Param number path string true "sql number" @Param audit_plan body v1.UpdateAuditTaskSQLsReqV1 true "modify the relevant information of a certain SQL in the audit task" @Security ApiKeyAuth @Success 200 {object} controller.BaseRes @router /v1/tasks/audits/{task_id}/sqls/{number} [patch]

func UpdateAuditWhitelistById

func UpdateAuditWhitelistById(c echo.Context) error

@Summary 更新SQL白名单 @Description update sql whitelist by id @Accept json @Id UpdateAuditWhitelistByIdV1 @Tags audit_whitelist @Security ApiKeyAuth @Param audit_whitelist_id path string true "sql audit whitelist id" @Param instance body v1.UpdateAuditWhitelistReqV1 true "update sql whitelist req" @Success 200 {object} controller.BaseRes @router /v1/audit_whitelist/{audit_whitelist_id}/ [patch]

func UpdateCurrentUser

func UpdateCurrentUser(c echo.Context) error

@Summary 更新个人信息 @Description update current user @Id updateCurrentUserV1 @Tags user @Security ApiKeyAuth @Accept json @Produce json @Param instance body v1.UpdateCurrentUserReqV1 true "update user" @Success 200 {object} controller.BaseRes @router /v1/user [patch]

func UpdateCurrentUserPassword

func UpdateCurrentUserPassword(c echo.Context) error

@Summary 用户修改密码 @Description update current user's password @Id UpdateCurrentUserPasswordV1 @Tags user @Security ApiKeyAuth @Accept json @Produce json @Param instance body v1.UpdateCurrentUserPasswordReqV1 true "update user's password" @Success 200 {object} controller.BaseRes @router /v1/user/password [put]

func UpdateInstance

func UpdateInstance(c echo.Context) error

UpdateInstance update instance @Summary 更新实例 @Description update instance @Id updateInstanceV1 @Tags instance @Security ApiKeyAuth @Param instance_name path string true "instance name" @param instance body v1.UpdateInstanceReqV1 true "update instance request" @Success 200 {object} controller.BaseRes @router /v1/instances/{instance_name}/ [patch]

func UpdateLDAPConfiguration added in v1.2111.0

func UpdateLDAPConfiguration(c echo.Context) error

@Summary 添加 LDAP 配置 @Description update LDAP configuration @Accept json @Id updateLDAPConfigurationV1 @Tags configuration @Security ApiKeyAuth @Param instance body v1.LDAPConfigurationReqV1 true "update LDAP configuration req" @Success 200 {object} controller.BaseRes @router /v1/configurations/ldap [patch]

func UpdateOtherUserPassword

func UpdateOtherUserPassword(c echo.Context) error

@Summary admin修改其他用户密码 @Description admin modifies the passwords of other users @Id UpdateOtherUserPasswordV1 @Tags user @Security ApiKeyAuth @Accept json @Produce json @Param user_name path string true "user name" @Param instance body v1.UpdateOtherUserPasswordReqV1 true "change user's password" @Success 200 {object} controller.BaseRes @router /v1/users/{user_name}/password [patch]

func UpdateRole

func UpdateRole(c echo.Context) error

@Summary 更新角色信息 @Description update role @Deprecated @Id updateRoleV1 @Tags role @Security ApiKeyAuth @Accept json @Produce json @Param role_name path string true "role name" @Param instance body v1.UpdateRoleReqV1 true "update role request" @Success 200 {object} controller.BaseRes @router /v1/roles/{role_name}/ [patch]

func UpdateRuleTemplate

func UpdateRuleTemplate(c echo.Context) error

@Summary 更新规则模板 @Description update rule template @Id updateRuleTemplateV1 @Tags rule_template @Security ApiKeyAuth @Param rule_template_name path string true "rule template name" @Param instance body v1.UpdateRuleTemplateReqV1 true "update rule template request" @Success 200 {object} controller.BaseRes @router /v1/rule_templates/{rule_template_name}/ [patch]

func UpdateSMTPConfiguration

func UpdateSMTPConfiguration(c echo.Context) error

@Summary 添加 SMTP 配置 @Description update SMTP configuration @Accept json @Id updateSMTPConfigurationV1 @Tags configuration @Security ApiKeyAuth @Param instance body v1.UpdateSMTPConfigurationReqV1 true "update SMTP configuration req" @Success 200 {object} controller.BaseRes @router /v1/configurations/smtp [patch]

func UpdateSystemVariables

func UpdateSystemVariables(c echo.Context) error

@Summary 修改系统变量 @Description update system variables @Accept json @Id updateSystemVariablesV1 @Tags configuration @Security ApiKeyAuth @Param instance body v1.UpdateSystemVariablesReqV1 true "update system variables request" @Success 200 {object} controller.BaseRes @router /v1/configurations/system_variables [patch]

func UpdateUser

func UpdateUser(c echo.Context) error

@Summary 更新用户信息 @Description update user @Id updateUserV1 @Tags user @Security ApiKeyAuth @Accept json @Produce json @Param user_name path string true "user name" @Param instance body v1.UpdateUserReqV1 true "update user" @Success 200 {object} controller.BaseRes @router /v1/users/{user_name}/ [patch]

func UpdateUserGroup added in v1.2202.0

func UpdateUserGroup(c echo.Context) (err error)

@Summary 更新用户组 @Description update user group @Id updateUserGroupV1 @Tags user_group @Security ApiKeyAuth @Param user_group_name path string true "user_group_name" @Param instance body v1.PatchUserGroupReqV1 true "update user group" @Success 200 {object} controller.BaseRes @router /v1/user_groups/{user_group_name}/ [patch]

func UpdateWeChatConfigurationV1 added in v1.2203.0

func UpdateWeChatConfigurationV1(c echo.Context) error

UpdateWeChatConfigurationV1 used to configure WeChat notifications @Summary 添加 企业微信 配置 @Description update WeChat configuration @Accept json @Id updateWeChatConfigurationV1 @Tags configuration @Security ApiKeyAuth @Param instance body v1.UpdateWeChatConfigurationReqV1 true "update WeChat configuration req" @Success 200 {object} controller.BaseRes @router /v1/configurations/wechat [patch]

func UpdateWorkflow

func UpdateWorkflow(c echo.Context) error

@Summary 更新审批流程(驳回后才可更新) @Description update workflow when it is rejected to creator. @Tags workflow @Accept json @Produce json @Id updateWorkflowV1 @Security ApiKeyAuth @Param workflow_id path string true "workflow id" @Param instance body v1.UpdateWorkflowReqV1 true "update workflow request" @Success 200 {object} controller.BaseRes @router /v1/workflows/{workflow_id}/ [patch]

func UpdateWorkflowSchedule added in v1.2112.0

func UpdateWorkflowSchedule(c echo.Context) error

@Summary 设置工单定时上线时间(设置为空则代表取消定时时间,需要SQL审核流程都通过后才可以设置) @Description update workflow schedule. @Tags workflow @Accept json @Produce json @Id updateWorkflowScheduleV1 @Security ApiKeyAuth @Param workflow_id path string true "workflow id" @Param instance body v1.UpdateWorkflowScheduleV1 true "update workflow schedule request" @Success 200 {object} controller.BaseRes @router /v1/workflows/{workflow_id}/schedule [put]

func UpdateWorkflowTemplate

func UpdateWorkflowTemplate(c echo.Context) error

@Summary 更新Sql审批流程模板 @Description update the workflow template @Tags workflow @Id updateWorkflowTemplateV1 @Security ApiKeyAuth @Accept json @Produce json @Param workflow_template_name path string true "workflow template name" @Param instance body v1.UpdateWorkflowTemplateReqV1 true "create workflow template" @Success 200 {object} controller.BaseRes @router /v1/workflow_templates/{workflow_template_name}/ [patch]

Types

type AuditPlanMetaV1 added in v1.2201.0

type AuditPlanMetaV1 struct {
	Type         string                `json:"audit_plan_type"`
	Desc         string                `json:"audit_plan_type_desc"`
	InstanceType string                `json:"instance_type"`
	Params       []AuditPlanParamResV1 `json:"audit_plan_params,omitempty"`
}

type AuditPlanParamReqV1 added in v1.2201.0

type AuditPlanParamReqV1 struct {
	Key   string `json:"key" form:"key" valid:"required"`
	Value string `json:"value" form:"value" valid:"required"`
}

type AuditPlanParamResV1 added in v1.2201.0

type AuditPlanParamResV1 struct {
	Key   string `json:"key"`
	Desc  string `json:"desc"`
	Value string `json:"value"`
	Type  string `json:"type" enums:"string,int,bool"`
}

type AuditPlanReportResV1

type AuditPlanReportResV1 struct {
	Id         string  `json:"audit_plan_report_id" example:"1"`
	AuditLevel string  `json:"audit_level" enums:"normal,notice,warn,error,"`
	Score      int32   `json:"score"`
	PassRate   float64 `json:"pass_rate"`
	Timestamp  string  `json:"audit_plan_report_timestamp" example:"RFC3339"`
}

type AuditPlanReportSQLResV1

type AuditPlanReportSQLResV1 struct {
	Fingerprint          string `json:"audit_plan_report_sql_fingerprint" example:"select * from t1 where id = ?"`
	LastReceiveText      string `json:"audit_plan_report_sql_last_receive_text" example:"select * from t1 where id = 1"`
	LastReceiveTimestamp string `json:"audit_plan_report_sql_last_receive_timestamp" example:"RFC3339"`
	AuditResult          string `json:"audit_plan_report_sql_audit_result" example:"same format as task audit result"`
}

type AuditPlanResV1

type AuditPlanResV1 struct {
	Name             string          `json:"audit_plan_name" example:"audit_for_java_app1"`
	Cron             string          `json:"audit_plan_cron" example:"0 */2 * * *"`
	DBType           string          `json:"audit_plan_db_type" example:"mysql"`
	Token            string          `json:"audit_plan_token" example:"it's a JWT Token for scanner"`
	InstanceName     string          `json:"audit_plan_instance_name" example:"test_mysql"`
	InstanceDatabase string          `json:"audit_plan_instance_database" example:"app1"`
	Meta             AuditPlanMetaV1 `json:"audit_plan_meta"`
}

type AuditPlanSQLReqV1

type AuditPlanSQLReqV1 struct {
	Fingerprint          string `json:"audit_plan_sql_fingerprint" form:"audit_plan_sql_fingerprint" example:"select * from t1 where id = ?"`
	Counter              string `json:"audit_plan_sql_counter" form:"audit_plan_sql_counter" example:"6" valid:"required"`
	LastReceiveText      string `json:"audit_plan_sql_last_receive_text" form:"audit_plan_sql_last_receive_text" example:"select * from t1 where id = 1"`
	LastReceiveTimestamp string `json:"audit_plan_sql_last_receive_timestamp" form:"audit_plan_sql_last_receive_timestamp" example:"RFC3339"`
}

type AuditPlanSQLResV1

type AuditPlanSQLResV1 struct {
	Fingerprint          string `json:"audit_plan_sql_fingerprint" example:"select * from t1 where id = ?"`
	Counter              string `json:"audit_plan_sql_counter" example:"6"`
	LastReceiveText      string `json:"audit_plan_sql_last_receive_text" example:"select * from t1 where id = 1"`
	LastReceiveTimestamp string `json:"audit_plan_sql_last_receive_timestamp" example:"RFC3339"`
}

type AuditTaskResV1

type AuditTaskResV1 struct {
	Id             uint       `json:"task_id"`
	InstanceName   string     `json:"instance_name"`
	InstanceSchema string     `json:"instance_schema" example:"db1"`
	AuditLevel     string     `json:"audit_level" enums:"normal,notice,warn,error,"`
	Score          int32      `json:"score"`
	PassRate       float64    `json:"pass_rate"`
	Status         string     `json:"status" enums:"initialized,audited,executing,exec_success,exec_failed"`
	SQLSource      string     `json:"sql_source" enums:"form_data,sql_file,mybatis_xml_file,audit_plan"`
	ExecStartTime  *time.Time `json:"exec_start_time,omitempty"`
	ExecEndTime    *time.Time `json:"exec_end_time,omitempty"`
}

type AuditTaskSQLContentResV1

type AuditTaskSQLContentResV1 struct {
	Sql string `json:"sql" example:"alter table tb1 drop columns c1"`
}

type AuditTaskSQLResV1

type AuditTaskSQLResV1 struct {
	Number      uint   `json:"number"`
	ExecSQL     string `json:"exec_sql"`
	AuditResult string `json:"audit_result"`
	AuditLevel  string `json:"audit_level"`
	AuditStatus string `json:"audit_status"`
	ExecResult  string `json:"exec_result"`
	ExecStatus  string `json:"exec_status"`
	RollbackSQL string `json:"rollback_sql,omitempty"`
	Description string `json:"description"`
}

type AuditWhitelistResV1

type AuditWhitelistResV1 struct {
	Id        uint   `json:"audit_whitelist_id"`
	Value     string `json:"value"`
	MatchType string `json:"match_type"`
	Desc      string `json:"desc"`
}

type BatchCancelWorkflowsReqV1

type BatchCancelWorkflowsReqV1 struct {
	WorkflowIds []string `json:"workflow_ids" form:"workflow_ids"`
}

type CheckLicenseResV1 added in v1.2203.0

type CheckLicenseResV1 struct {
	controller.BaseRes
	Content string        `json:"content"`
	License []LicenseItem `json:"license"`
}

type CloneRuleTemplateReqV1

type CloneRuleTemplateReqV1 struct {
	Name      string   `json:"new_rule_template_name" valid:"required"`
	Desc      string   `json:"desc"`
	Instances []string `json:"instance_name_list"`
}

type CreateAuditPlanReqV1

type CreateAuditPlanReqV1 struct {
	Name             string                `json:"audit_plan_name" form:"audit_plan_name" example:"audit_plan_for_java_repo_1" valid:"required,name"`
	Cron             string                `json:"audit_plan_cron" form:"audit_plan_cron" example:"0 */2 * * *" valid:"required,cron"`
	InstanceType     string                `json:"audit_plan_instance_type" form:"audit_plan_instance_type" example:"mysql" valid:"required"`
	InstanceName     string                `json:"audit_plan_instance_name" form:"audit_plan_instance_name" example:"test_mysql"`
	InstanceDatabase string                `json:"audit_plan_instance_database" form:"audit_plan_instance_database" example:"app1"`
	Type             string                `json:"audit_plan_type" form:"audit_plan_type" example:"slow log"`
	Params           []AuditPlanParamReqV1 `json:"audit_plan_params" valid:"dive,required"`
}

type CreateAuditTaskReqV1

type CreateAuditTaskReqV1 struct {
	InstanceName   string `json:"instance_name" form:"instance_name" example:"inst_1" valid:"required"`
	InstanceSchema string `json:"instance_schema" form:"instance_schema" example:"db1"`
	Sql            string `json:"sql" form:"sql" example:"alter table tb1 drop columns c1"`
}

type CreateAuditWhitelistReqV1

type CreateAuditWhitelistReqV1 struct {
	Value     string `json:"value" example:"create table" valid:"required"`
	MatchType string `json:"match_type" example:"exact_match" enums:"exact_match,fp_match" valid:"omitempty,oneof=exact_match fp_match"`
	Desc      string `json:"desc" example:"used for rapid release"`
}

type CreateInstanceReqV1

type CreateInstanceReqV1 struct {
	Name                 string                          `json:"instance_name" form:"instance_name" example:"test" valid:"required,name"`
	DBType               string                          `json:"db_type" form:"db_type" example:"mysql"`
	User                 string                          `json:"db_user" form:"db_user" example:"root" valid:"required"`
	Host                 string                          `json:"db_host" form:"db_host" example:"10.10.10.10" valid:"required,ip_addr|uri|hostname|hostname_rfc1123"`
	Port                 string                          `json:"db_port" form:"db_port" example:"3306" valid:"required,port"`
	Password             string                          `json:"db_password" form:"db_password" example:"123456" valid:"required"`
	Desc                 string                          `json:"desc" example:"this is a test instance"`
	WorkflowTemplateName string                          `json:"workflow_template_name" form:"workflow_template_name"`
	MaintenanceTimes     []*MaintenanceTimeReqV1         `json:"maintenance_times" from:"maintenance_times"`
	RuleTemplates        []string                        `json:"rule_template_name_list" form:"rule_template_name_list"`
	Roles                []string                        `json:"role_name_list" form:"role_name_list"`
	AdditionalParams     []*InstanceAdditionalParamReqV1 `json:"additional_params" from:"additional_params"`
}

type CreateRoleReqV1

type CreateRoleReqV1 struct {
	Name      string   `json:"role_name" form:"role_name" valid:"required,name"`
	Desc      string   `json:"role_desc" form:"role_desc"`
	Users     []string `json:"user_name_list" form:"user_name_list"`
	Instances []string `json:"instance_name_list" form:"instance_name_list"`
}

type CreateRuleTemplateReqV1

type CreateRuleTemplateReqV1 struct {
	Name      string      `json:"rule_template_name" valid:"required,name"`
	Desc      string      `json:"desc"`
	DBType    string      `json:"db_type" valid:"required"`
	Instances []string    `json:"instance_name_list"`
	RuleList  []RuleReqV1 `json:"rule_list" form:"rule_list" valid:"required,dive,required"`
}

type CreateUserGroupReqV1 added in v1.2202.0

type CreateUserGroupReqV1 struct {
	Name  string   `json:"user_group_name" form:"user_group_name" example:"test" valid:"required,name"`
	Desc  string   `json:"user_group_desc" form:"user_group_desc" example:"this is a group"`
	Roles []string `json:"role_name_list" form:"role_name_list"`
	Users []string `json:"user_name_list" form:"user_name_list"`
}

type CreateUserReqV1

type CreateUserReqV1 struct {
	Name       string   `json:"user_name" form:"user_name" example:"test" valid:"required,name"`
	Password   string   `json:"user_password" form:"user_name" example:"123456" valid:"required"`
	Email      string   `json:"email" form:"email" example:"test@email.com" valid:"omitempty,email"`
	WeChatID   string   `json:"wechat_id" example:"UserID"`
	Roles      []string `json:"role_name_list" form:"role_name_list"`
	UserGroups []string `json:"user_group_name_list" form:"user_group_name_list"`
}

type CreateWorkflowReqV1

type CreateWorkflowReqV1 struct {
	Subject string `json:"workflow_subject" form:"workflow_subject" valid:"required,name"`
	Desc    string `json:"desc" form:"desc"`
	TaskId  string `json:"task_id" form:"task_id" valid:"required"`
}

type CreateWorkflowTemplateReqV1

type CreateWorkflowTemplateReqV1 struct {
	Name                          string                       `json:"workflow_template_name" form:"workflow_template_name" valid:"required,name"`
	Desc                          string                       `json:"desc" form:"desc"`
	AllowSubmitWhenLessAuditLevel string                       `json:"allow_submit_when_less_audit_level" enums:"normal,notice,warn,error"`
	Steps                         []*WorkFlowStepTemplateReqV1 `json:"workflow_step_template_list" form:"workflow_step_template_list" valid:"required,dive,required"`
	Instances                     []string                     `json:"instance_name_list" form:"instance_name_list"`
}

type DashboardResV1

type DashboardResV1 struct {
	WorkflowStatistics *WorkflowStatisticsResV1 `json:"workflow_statistics"`
}

type DownloadAuditTaskSQLsFileReqV1

type DownloadAuditTaskSQLsFileReqV1 struct {
	NoDuplicate bool `json:"no_duplicate" query:"no_duplicate"`
}

type DriversResV1

type DriversResV1 struct {
	Drivers []string `json:"driver_name_list"`
}

type FullSyncAuditPlanSQLsReqV1

type FullSyncAuditPlanSQLsReqV1 struct {
	SQLs []AuditPlanSQLReqV1 `json:"audit_plan_sql_list" form:"audit_plan_sql_list"`
}

type GetAuditPlanMetasReqV1 added in v1.2201.0

type GetAuditPlanMetasReqV1 struct {
	FilterInstanceType *string `json:"filter_instance_type" query:"filter_instance_type"`
}

type GetAuditPlanMetasResV1 added in v1.2201.0

type GetAuditPlanMetasResV1 struct {
	controller.BaseRes
	Data []AuditPlanMetaV1 `json:"data"`
}

type GetAuditPlanReportSQLsReqV1

type GetAuditPlanReportSQLsReqV1 struct {
	PageIndex uint32 `json:"page_index" query:"page_index" valid:"required"`
	PageSize  uint32 `json:"page_size" query:"page_size" valid:"required"`
}

type GetAuditPlanReportSQLsResV1

type GetAuditPlanReportSQLsResV1 struct {
	controller.BaseRes
	Data      []AuditPlanReportSQLResV1 `json:"data"`
	TotalNums uint64                    `json:"total_nums"`
}

type GetAuditPlanReportsReqV1

type GetAuditPlanReportsReqV1 struct {
	PageIndex uint32 `json:"page_index" query:"page_index" valid:"required"`
	PageSize  uint32 `json:"page_size" query:"page_size" valid:"required"`
}

type GetAuditPlanReportsResV1

type GetAuditPlanReportsResV1 struct {
	controller.BaseRes
	Data      []AuditPlanReportResV1 `json:"data"`
	TotalNums uint64                 `json:"total_nums"`
}

type GetAuditPlanResV1

type GetAuditPlanResV1 struct {
	controller.BaseRes
	Data AuditPlanResV1 `json:"data"`
}

type GetAuditPlanSQLsReqV1

type GetAuditPlanSQLsReqV1 struct {
	PageIndex uint32 `json:"page_index" query:"page_index" valid:"required"`
	PageSize  uint32 `json:"page_size" query:"page_size" valid:"required"`
}

type GetAuditPlanSQLsResV1

type GetAuditPlanSQLsResV1 struct {
	controller.BaseRes
	Data      []AuditPlanSQLResV1 `json:"data"`
	TotalNums uint64              `json:"total_nums"`
}

type GetAuditPlansReqV1

type GetAuditPlansReqV1 struct {
	FilterAuditPlanDBType string `json:"filter_audit_plan_db_type" query:"filter_audit_plan_db_type"`
	PageIndex             uint32 `json:"page_index" query:"page_index" valid:"required"`
	PageSize              uint32 `json:"page_size" query:"page_size" valid:"required"`
}

type GetAuditPlansResV1

type GetAuditPlansResV1 struct {
	controller.BaseRes
	Data      []AuditPlanResV1 `json:"data"`
	TotalNums uint64           `json:"total_nums"`
}

type GetAuditTaskResV1

type GetAuditTaskResV1 struct {
	controller.BaseRes
	Data *AuditTaskResV1 `json:"data"`
}

type GetAuditTaskSQLContentResV1

type GetAuditTaskSQLContentResV1 struct {
	controller.BaseRes
	Data *AuditTaskSQLContentResV1 `json:"data"`
}

type GetAuditTaskSQLsReqV1

type GetAuditTaskSQLsReqV1 struct {
	FilterExecStatus  string `json:"filter_exec_status" query:"filter_exec_status"`
	FilterAuditStatus string `json:"filter_audit_status" query:"filter_audit_status"`
	FilterAuditLevel  string `json:"filter_audit_level" query:"filter_audit_level"`
	NoDuplicate       bool   `json:"no_duplicate" query:"no_duplicate"`
	PageIndex         uint32 `json:"page_index" query:"page_index" valid:"required"`
	PageSize          uint32 `json:"page_size" query:"page_size" valid:"required"`
}

type GetAuditTaskSQLsResV1

type GetAuditTaskSQLsResV1 struct {
	controller.BaseRes
	Data      []*AuditTaskSQLResV1 `json:"data"`
	TotalNums uint64               `json:"total_nums"`
}

type GetAuditWhitelistReqV1

type GetAuditWhitelistReqV1 struct {
	PageIndex uint32 `json:"page_index" query:"page_index" valid:"required"`
	PageSize  uint32 `json:"page_size" query:"page_size" valid:"required"`
}

type GetAuditWhitelistResV1

type GetAuditWhitelistResV1 struct {
	controller.BaseRes
	Data      []*AuditWhitelistResV1 `json:"data"`
	TotalNums uint32                 `json:"total_nums"`
}

type GetDashboardResV1

type GetDashboardResV1 struct {
	controller.BaseRes
	Data *DashboardResV1 `json:"data"`
}

type GetDriversResV1

type GetDriversResV1 struct {
	controller.BaseRes
	Data DriversResV1 `json:"data"`
}

type GetInstanceAdditionalMetasResV1 added in v1.2203.0

type GetInstanceAdditionalMetasResV1 struct {
	controller.BaseRes
	Metas []*InstanceAdditionalMetaV1 `json:"data"`
}

type GetInstanceConnectableReqV1

type GetInstanceConnectableReqV1 struct {
	DBType           string                          `json:"db_type" form:"db_type" example:"mysql"`
	User             string                          `json:"user" form:"db_user" example:"root" valid:"required"`
	Host             string                          `json:"host" form:"db_host" example:"10.10.10.10" valid:"required,ip_addr|uri|hostname|hostname_rfc1123"`
	Port             string                          `json:"port" form:"db_port" example:"3306" valid:"required,port"`
	Password         string                          `json:"password" form:"db_password" example:"123456"`
	AdditionalParams []*InstanceAdditionalParamReqV1 `json:"additional_params" from:"additional_params"`
}

type GetInstanceConnectableResV1

type GetInstanceConnectableResV1 struct {
	controller.BaseRes
	Data InstanceConnectableResV1 `json:"data"`
}

type GetInstanceResV1

type GetInstanceResV1 struct {
	controller.BaseRes
	Data InstanceResV1 `json:"data"`
}

type GetInstanceSchemaResV1

type GetInstanceSchemaResV1 struct {
	controller.BaseRes
	Data InstanceSchemaResV1 `json:"data"`
}

type GetInstanceTipsResV1

type GetInstanceTipsResV1 struct {
	controller.BaseRes
	Data []InstanceTipResV1 `json:"data"`
}

type GetInstanceWorkflowTemplateResV1 added in v1.2201.0

type GetInstanceWorkflowTemplateResV1 struct {
	controller.BaseRes
	Data *WorkflowTemplateDetailResV1 `json:"data"`
}

type GetInstancesReqV1

type GetInstancesReqV1 struct {
	FilterInstanceName         string `json:"filter_instance_name" query:"filter_instance_name"`
	FilterDBType               string `json:"filter_db_type" query:"filter_db_type"`
	FilterDBHost               string `json:"filter_db_host" query:"filter_db_host"`
	FilterDBPort               string `json:"filter_db_port" query:"filter_db_port"`
	FilterDBUser               string `json:"filter_db_user" query:"filter_db_user"`
	FilterWorkflowTemplateName string `json:"filter_workflow_template_name" query:"filter_workflow_template_name"`
	FilterRuleTemplateName     string `json:"filter_rule_template_name" query:"filter_rule_template_name"`
	FilterRoleName             string `json:"filter_role_name" query:"filter_role_name"`
	PageIndex                  uint32 `json:"page_index" query:"page_index" valid:"required"`
	PageSize                   uint32 `json:"page_size" query:"page_size" valid:"required"`
}

type GetInstancesResV1

type GetInstancesResV1 struct {
	controller.BaseRes
	Data      []InstanceResV1 `json:"data"`
	TotalNums uint64          `json:"total_nums"`
}

type GetLDAPConfigurationResV1 added in v1.2111.0

type GetLDAPConfigurationResV1 struct {
	controller.BaseRes
	Data LDAPConfigurationResV1 `json:"data"`
}

type GetLicenseResV1 added in v1.2203.0

type GetLicenseResV1 struct {
	controller.BaseRes
	Content string        `json:"content"`
	License []LicenseItem `json:"license"`
}

type GetOperationsResV1 added in v1.2202.0

type GetOperationsResV1 struct {
	controller.BaseRes
	Data []*OperationResV1 `json:"data"`
}

type GetRoleTipsResV1

type GetRoleTipsResV1 struct {
	controller.BaseRes
	Data []RoleTipResV1 `json:"data"`
}

type GetRolesReqV1

type GetRolesReqV1 struct {
	FilterRoleName     string `json:"filter_role_name" query:"filter_role_name"`
	FilterUserName     string `json:"filter_user_name" query:"filter_user_name"`
	FilterInstanceName string `json:"filter_instance_name" query:"filter_instance_name"`
	PageIndex          uint32 `json:"page_index" query:"page_index" valid:"required"`
	PageSize           uint32 `json:"page_size" query:"page_size" valid:"required"`
}

type GetRolesResV1

type GetRolesResV1 struct {
	controller.BaseRes
	Data      []RoleResV1 `json:"data"`
	TotalNums uint64      `json:"total_nums"`
}

type GetRuleTemplateResV1

type GetRuleTemplateResV1 struct {
	controller.BaseRes
	Data *RuleTemplateDetailResV1 `json:"data"`
}

type GetRuleTemplateTipsResV1

type GetRuleTemplateTipsResV1 struct {
	controller.BaseRes
	Data []RuleTemplateTipResV1 `json:"data"`
}

type GetRuleTemplatesReqV1

type GetRuleTemplatesReqV1 struct {
	FilterInstanceName string `json:"filter_instance_name" query:"filter_instance_name"`
	PageIndex          uint32 `json:"page_index" query:"page_index" valid:"required"`
	PageSize           uint32 `json:"page_size" query:"page_size" valid:"required"`
}

type GetRuleTemplatesResV1

type GetRuleTemplatesResV1 struct {
	controller.BaseRes
	Data      []RuleTemplateResV1 `json:"data"`
	TotalNums uint64              `json:"total_nums"`
}

type GetRulesReqV1

type GetRulesReqV1 struct {
	FilterDBType string `json:"filter_db_type" query:"filter_db_type"`
}

type GetRulesResV1

type GetRulesResV1 struct {
	controller.BaseRes
	Data []RuleResV1 `json:"data"`
}

type GetSMTPConfigurationResV1

type GetSMTPConfigurationResV1 struct {
	controller.BaseRes
	Data SMTPConfigurationResV1 `json:"data"`
}

type GetSQLEInfoResV1 added in v1.2201.0

type GetSQLEInfoResV1 struct {
	controller.BaseRes
	Version string `json:"version"`
}

type GetSystemVariablesResV1

type GetSystemVariablesResV1 struct {
	controller.BaseRes
	Data SystemVariablesResV1 `json:"data"`
}

type GetUserDetailResV1

type GetUserDetailResV1 struct {
	controller.BaseRes
	Data UserDetailResV1 `json:"data"`
}

type GetUserGroupTipsResV1 added in v1.2202.0

type GetUserGroupTipsResV1 struct {
	controller.BaseRes
	Data []*UserGroupTipListItem `json:"data"`
}

type GetUserGroupsReqV1 added in v1.2202.0

type GetUserGroupsReqV1 struct {
	FilterUserGroupName string `json:"filter_user_group_name" query:"filter_user_group_name"`
	PageIndex           uint32 `json:"page_index" query:"page_index" valid:"required"`
	PageSize            uint32 `json:"page_size" query:"page_size" valid:"required"`
}

type GetUserGroupsResV1 added in v1.2202.0

type GetUserGroupsResV1 struct {
	controller.BaseRes
	Data      []*UserGroupListItemResV1 `json:"data"`
	TotalNums uint64                    `json:"total_nums"`
}

type GetUserLoginResV1

type GetUserLoginResV1 struct {
	controller.BaseRes
	Data UserLoginResV1 `json:"data"`
}

type GetUserTipsResV1

type GetUserTipsResV1 struct {
	controller.BaseRes
	Data []UserTipResV1 `json:"data"`
}

type GetUsersReqV1

type GetUsersReqV1 struct {
	FilterUserName string `json:"filter_user_name" query:"filter_user_name"`
	FilterRoleName string `json:"filter_role_name" query:"filter_role_name"`
	PageIndex      uint32 `json:"page_index" query:"page_index" valid:"required"`
	PageSize       uint32 `json:"page_size" query:"page_size" valid:"required"`
}

type GetUsersResV1

type GetUsersResV1 struct {
	controller.BaseRes
	Data      []UserResV1 `json:"data"`
	TotalNums uint64      `json:"total_nums"`
}

type GetWeChatConfigurationResV1 added in v1.2203.0

type GetWeChatConfigurationResV1 struct {
	controller.BaseRes
	Data WeChatConfigurationResV1 `json:"data"`
}

type GetWorkflowResV1

type GetWorkflowResV1 struct {
	controller.BaseRes
	Data *WorkflowResV1 `json:"data"`
}

type GetWorkflowTemplateResV1

type GetWorkflowTemplateResV1 struct {
	controller.BaseRes
	Data *WorkflowTemplateDetailResV1 `json:"data"`
}

type GetWorkflowTemplateTipResV1

type GetWorkflowTemplateTipResV1 struct {
	controller.BaseRes
	Data []*WorkflowTemplateTipResV1 `json:"data"`
}

type GetWorkflowTemplatesReqV1

type GetWorkflowTemplatesReqV1 struct {
	PageIndex uint32 `json:"page_index" query:"page_index" valid:"required"`
	PageSize  uint32 `json:"page_size" query:"page_size" valid:"required"`
}

type GetWorkflowTemplatesResV1

type GetWorkflowTemplatesResV1 struct {
	controller.BaseRes
	Data      []*WorkflowTemplateResV1 `json:"data"`
	TotalNums uint64                   `json:"total_nums"`
}

type GetWorkflowsReqV1

type GetWorkflowsReqV1 struct {
	FilterSubject                     string `json:"filter_subject" query:"filter_subject"`
	FilterCreateTimeFrom              string `json:"filter_create_time_from" query:"filter_create_time_from"`
	FilterCreateTimeTo                string `json:"filter_create_time_to" query:"filter_create_time_to"`
	FilterCreateUserName              string `json:"filter_create_user_name" query:"filter_create_user_name"`
	FilterCurrentStepType             string `json:"filter_current_step_type" query:"filter_current_step_type" valid:"omitempty,oneof=sql_review sql_execute"`
	FilterStatus                      string `` /* 141-byte string literal not displayed */
	FilterCurrentStepAssigneeUserName string `json:"filter_current_step_assignee_user_name" query:"filter_current_step_assignee_user_name"`
	FilterTaskInstanceName            string `json:"filter_task_instance_name" query:"filter_task_instance_name"`
	PageIndex                         uint32 `json:"page_index" query:"page_index" valid:"required"`
	PageSize                          uint32 `json:"page_size" query:"page_size" valid:"required"`
}

type GetWorkflowsResV1

type GetWorkflowsResV1 struct {
	controller.BaseRes
	Data      []*WorkflowDetailResV1 `json:"data"`
	TotalNums uint64                 `json:"total_nums"`
}

type InstanceAdditionalMetaV1 added in v1.2203.0

type InstanceAdditionalMetaV1 struct {
	DBType string                          `json:"db_type"`
	Params []*InstanceAdditionalParamResV1 `json:"params"`
}

type InstanceAdditionalParamReqV1 added in v1.2203.0

type InstanceAdditionalParamReqV1 struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type InstanceAdditionalParamResV1 added in v1.2203.0

type InstanceAdditionalParamResV1 struct {
	Name        string `json:"name" example:"param name" form:"name"`
	Description string `json:"description" example:"参数项中文名" form:"description"`
	Type        string `json:"type" example:"int" form:"type"`
	Value       string `json:"value" example:"0" form:"value"`
}

type InstanceConnectableResV1

type InstanceConnectableResV1 struct {
	IsInstanceConnectable bool   `json:"is_instance_connectable"`
	ConnectErrorMessage   string `json:"connect_error_message,omitempty"`
}

type InstanceResV1

type InstanceResV1 struct {
	Name                 string                          `json:"instance_name"`
	DBType               string                          `json:"db_type" example:"mysql"`
	Host                 string                          `json:"db_host" example:"10.10.10.10"`
	Port                 string                          `json:"db_port" example:"3306"`
	User                 string                          `json:"db_user" example:"root"`
	Desc                 string                          `json:"desc" example:"this is a instance"`
	WorkflowTemplateName string                          `json:"workflow_template_name,omitempty"`
	MaintenanceTimes     []*MaintenanceTimeResV1         `json:"maintenance_times" from:"maintenance_times"`
	RuleTemplates        []string                        `json:"rule_template_name_list,omitempty"`
	Roles                []string                        `json:"role_name_list,omitempty"`
	AdditionalParams     []*InstanceAdditionalParamResV1 `json:"additional_params"`
}

type InstanceSchemaResV1

type InstanceSchemaResV1 struct {
	Schemas []string `json:"schema_name_list"`
}

type InstanceTipReqV1

type InstanceTipReqV1 struct {
	FilterDBType string `json:"filter_db_type" query:"filter_db_type"`
}

type InstanceTipResV1

type InstanceTipResV1 struct {
	Name string `json:"instance_name"`
	Type string `json:"instance_type"`
}

type LDAPConfigurationReqV1 added in v1.2111.0

type LDAPConfigurationReqV1 struct {
	EnableLdap          *bool   `json:"enable_ldap"`
	LdapServerHost      *string `json:"ldap_server_host"`
	LdapServerPort      *string `json:"ldap_server_port"`
	LdapConnectDn       *string `json:"ldap_connect_dn"`
	LdapConnectPwd      *string `json:"ldap_connect_pwd"`
	LdapSearchBaseDn    *string `json:"ldap_search_base_dn"`
	LdapUserNameRdnKey  *string `json:"ldap_user_name_rdn_key"`
	LdapUserEmailRdnKey *string `json:"ldap_user_email_rdn_key"`
}

type LDAPConfigurationResV1 added in v1.2111.0

type LDAPConfigurationResV1 struct {
	EnableLdap          bool   `json:"enable_ldap"`
	LdapServerHost      string `json:"ldap_server_host"`
	LdapServerPort      string `json:"ldap_server_port"`
	LdapConnectDn       string `json:"ldap_connect_dn"`
	LdapSearchBaseDn    string `json:"ldap_search_base_dn"`
	LdapUserNameRdnKey  string `json:"ldap_user_name_rdn_key"`
	LdapUserEmailRdnKey string `json:"ldap_user_email_rdn_key"`
}

type LicenseItem added in v1.2203.0

type LicenseItem struct {
	Description string `json:"description"`
	Name        string `json:"name"`
	Limit       string `json:"limit"`
}

type LoginChecker added in v1.2111.0

type LoginChecker interface {
	// contains filtered or unexported methods
}

func GetLoginCheckerByUserName added in v1.2111.0

func GetLoginCheckerByUserName(userName string) (LoginChecker, error)

GetLoginCheckerByUserName get login checker by user name and init login checker

type MaintenanceTimeReqV1 added in v1.2203.0

type MaintenanceTimeReqV1 struct {
	MaintenanceStartTime *TimeReqV1 `json:"maintenance_start_time"`
	MaintenanceStopTime  *TimeReqV1 `json:"maintenance_stop_time"`
}

type MaintenanceTimeResV1 added in v1.2203.0

type MaintenanceTimeResV1 struct {
	MaintenanceStartTime *TimeResV1 `json:"maintenance_start_time"`
	MaintenanceStopTime  *TimeResV1 `json:"maintenance_stop_time"`
}

type OperationResV1 added in v1.2202.0

type OperationResV1 struct {
	Code uint   `json:"op_code"`
	Desc string `json:"op_desc"`
}

type PartialSyncAuditPlanSQLsReqV1

type PartialSyncAuditPlanSQLsReqV1 struct {
	SQLs []AuditPlanSQLReqV1 `json:"audit_plan_sql_list" form:"audit_plan_sql_list"`
}

type PatchUserGroupReqV1 added in v1.2202.0

type PatchUserGroupReqV1 struct {
	Desc       *string   `json:"user_group_desc,omitempty" form:"user_group_desc" example:"this is a group"`
	Users      *[]string `json:"user_name_list,omitempty" form:"user_name_list"`
	IsDisabled *bool     `json:"is_disabled,omitempty" form:"is_disabled"`
	Roles      *[]string `json:"role_name_list,omitempty" form:"role_name_list"`
}

type RejectWorkflowReqV1

type RejectWorkflowReqV1 struct {
	Reason string `json:"reason" form:"reason"`
}

type RoleResV1

type RoleResV1 struct {
	Name      string   `json:"role_name"`
	Desc      string   `json:"role_desc"`
	Users     []string `json:"user_name_list,omitempty"`
	Instances []string `json:"instance_name_list,omitempty"`
}

type RoleTipResV1

type RoleTipResV1 struct {
	Name string `json:"role_name"`
}

type RuleParamReqV1 added in v1.2112.0

type RuleParamReqV1 struct {
	Key   string `json:"key" form:"key" valid:"required"`
	Value string `json:"value" form:"value" valid:"required"`
}

type RuleParamResV1 added in v1.2112.0

type RuleParamResV1 struct {
	Key   string `json:"key" form:"key"`
	Value string `json:"value" form:"value"`
	Desc  string `json:"desc" form:"desc"`
	Type  string `json:"type" form:"type" enums:"string,int,bool"`
}

type RuleReqV1

type RuleReqV1 struct {
	Name   string           `json:"name" form:"name" valid:"required" example:"ddl_check_index_count"`
	Level  string           `json:"level" form:"level" valid:"required" example:"error"`
	Params []RuleParamReqV1 `json:"params" form:"params" valid:"dive,required"`
}

type RuleResV1

type RuleResV1 struct {
	Name   string           `json:"rule_name"`
	Desc   string           `json:"desc"`
	Level  string           `json:"level" example:"error" enums:"normal,notice,warn,error"`
	Typ    string           `json:"type" example:"全局配置" `
	DBType string           `json:"db_type" example:"mysql"`
	Params []RuleParamResV1 `json:"params,omitempty"`
}

type RuleTemplateDetailResV1

type RuleTemplateDetailResV1 struct {
	Name      string      `json:"rule_template_name"`
	Desc      string      `json:"desc"`
	DBType    string      `json:"db_type"`
	Instances []string    `json:"instance_name_list,omitempty"`
	RuleList  []RuleResV1 `json:"rule_list,omitempty"`
}

type RuleTemplateResV1

type RuleTemplateResV1 struct {
	Name      string   `json:"rule_template_name"`
	Desc      string   `json:"desc"`
	DBType    string   `json:"db_type"`
	Instances []string `json:"instance_name_list,omitempty"`
}

type RuleTemplateTipReqV1

type RuleTemplateTipReqV1 struct {
	FilterDBType string `json:"filter_db_type" query:"filter_db_type"`
}

type RuleTemplateTipResV1

type RuleTemplateTipResV1 struct {
	Name   string `json:"rule_template_name"`
	DBType string `json:"db_type"`
}

type SMTPConfigurationResV1

type SMTPConfigurationResV1 struct {
	EnableSMTPNotify bool   `json:"enable_smtp_notify"`
	Host             string `json:"smtp_host"`
	Port             string `json:"smtp_port"`
	Username         string `json:"smtp_username"`
}

type SystemVariablesResV1

type SystemVariablesResV1 struct {
	WorkflowExpiredHours int `json:"workflow_expired_hours"`
}

type TestSMTPConfigurationReqV1 added in v1.2203.0

type TestSMTPConfigurationReqV1 struct {
	RecipientAddr string `json:"recipient_addr" from:"recipient_addr" description:"消息接收者邮箱地址" valid:"required,email"`
}

type TestSMTPConfigurationResDataV1 added in v1.2203.0

type TestSMTPConfigurationResDataV1 struct {
	IsSMTPSendNormal bool   `json:"is_smtp_send_normal"`
	SendErrorMessage string `json:"send_error_message,omitempty"`
}

type TestSMTPConfigurationResV1 added in v1.2203.0

type TestSMTPConfigurationResV1 struct {
	controller.BaseRes
	Data TestSMTPConfigurationResDataV1 `json:"data"`
}

type TestWeChatConfigurationReqV1 added in v1.2203.0

type TestWeChatConfigurationReqV1 struct {
	RecipientID string `json:"recipient_id" from:"recipient_id" description:"消息接收者企业微信ID"`
}

type TestWeChatConfigurationResDataV1 added in v1.2203.0

type TestWeChatConfigurationResDataV1 struct {
	IsWeChatSendNormal bool   `json:"is_wechat_send_normal"`
	SendErrorMessage   string `json:"send_error_message,omitempty"`
}

type TestWeChatConfigurationResV1 added in v1.2203.0

type TestWeChatConfigurationResV1 struct {
	controller.BaseRes
	Data TestWeChatConfigurationResDataV1 `json:"data"`
}

type TimeReqV1 added in v1.2203.0

type TimeReqV1 struct {
	Hour   int `json:"hour"`
	Minute int `json:"minute"`
}

type TimeResV1 added in v1.2203.0

type TimeResV1 struct {
	Hour   int `json:"hour"`
	Minute int `json:"minute"`
}

type TriggerAuditPlanResV1

type TriggerAuditPlanResV1 struct {
	controller.BaseRes
	Data AuditPlanReportResV1 `json:"data"`
}

type UpdateAuditPlanReqV1

type UpdateAuditPlanReqV1 struct {
	Cron             *string               `json:"audit_plan_cron" form:"audit_plan_cron" example:"0 */2 * * *" valid:"omitempty,cron"`
	InstanceName     *string               `json:"audit_plan_instance_name" form:"audit_plan_instance_name" example:"test_mysql"`
	InstanceDatabase *string               `json:"audit_plan_instance_database" form:"audit_plan_instance_database" example:"app1"`
	Params           []AuditPlanParamReqV1 `json:"audit_plan_params" valid:"dive,required"`
}

type UpdateAuditTaskSQLsReqV1 added in v1.2201.0

type UpdateAuditTaskSQLsReqV1 struct {
	Description string `json:"description"`
}

type UpdateAuditWhitelistReqV1

type UpdateAuditWhitelistReqV1 struct {
	Value     *string `json:"value" example:"create table"`
	MatchType *string `json:"match_type" example:"exact_match" enums:"exact_match,fp_match"`
	Desc      *string `json:"desc" example:"used for rapid release"`
}

type UpdateCurrentUserPasswordReqV1

type UpdateCurrentUserPasswordReqV1 struct {
	Password    string `json:"password" valid:"required"`
	NewPassword string `json:"new_password"  valid:"required"`
}

type UpdateCurrentUserReqV1

type UpdateCurrentUserReqV1 struct {
	Email    *string `json:"email"`
	WeChatID *string `json:"wechat_id" example:"UserID"`
}

type UpdateInstanceReqV1

type UpdateInstanceReqV1 struct {
	DBType               *string                         `json:"db_type" form:"db_type" example:"mysql"`
	User                 *string                         `json:"db_user" form:"db_user" example:"root"`
	Host                 *string                         `json:"db_host" form:"db_host" example:"10.10.10.10" valid:"omitempty,ip_addr|uri|hostname|hostname_rfc1123"`
	Port                 *string                         `json:"db_port" form:"db_port" example:"3306" valid:"omitempty,port"`
	Password             *string                         `json:"db_password" form:"db_password" example:"123456"`
	Desc                 *string                         `json:"desc" example:"this is a test instance"`
	WorkflowTemplateName *string                         `json:"workflow_template_name" form:"workflow_template_name"`
	MaintenanceTimes     []*MaintenanceTimeReqV1         `json:"maintenance_times" from:"maintenance_times"`
	RuleTemplates        []string                        `json:"rule_template_name_list" form:"rule_template_name_list"`
	Roles                []string                        `json:"role_name_list" form:"role_name_list"`
	AdditionalParams     []*InstanceAdditionalParamReqV1 `json:"additional_params" from:"additional_params"`
}

type UpdateOtherUserPasswordReqV1

type UpdateOtherUserPasswordReqV1 struct {
	Password string `json:"password"  valid:"required"`
}

type UpdateRoleReqV1

type UpdateRoleReqV1 struct {
	Desc      *string  `json:"role_desc" form:"role_desc"`
	Users     []string `json:"user_name_list" form:"user_name_list"`
	Instances []string `json:"instance_name_list" form:"instance_name_list"`
}

type UpdateRuleTemplateReqV1

type UpdateRuleTemplateReqV1 struct {
	Desc      *string     `json:"desc"`
	Instances []string    `json:"instance_name_list" example:"mysql-xxx"`
	RuleList  []RuleReqV1 `json:"rule_list" form:"rule_list" valid:"dive,required"`
}

type UpdateSMTPConfigurationReqV1

type UpdateSMTPConfigurationReqV1 struct {
	EnableSMTPNotify *bool   `json:"enable_smtp_notify" from:"enable_smtp_notify" description:"是否启用邮件通知"`
	Host             *string `json:"smtp_host" form:"smtp_host" example:"smtp.email.qq.com"`
	Port             *string `json:"smtp_port" form:"smtp_port" example:"465" valid:"omitempty,port"`
	Username         *string `json:"smtp_username" form:"smtp_username" example:"test@qq.com" valid:"omitempty,email"`
	Password         *string `json:"smtp_password" form:"smtp_password" example:"123"`
}

type UpdateSystemVariablesReqV1

type UpdateSystemVariablesReqV1 struct {
	WorkflowExpiredHours *int `json:"workflow_expired_hours" form:"workflow_expired_hours" example:"720"`
}

type UpdateUserReqV1

type UpdateUserReqV1 struct {
	Email      *string   `json:"email" valid:"omitempty,email" form:"email"`
	WeChatID   *string   `json:"wechat_id" example:"UserID"`
	Roles      *[]string `json:"role_name_list" form:"role_name_list"`
	IsDisabled *bool     `json:"is_disabled,omitempty" form:"is_disabled"`
	UserGroups *[]string `json:"user_group_name_list" form:"user_group_name_list"`
}

type UpdateWeChatConfigurationReqV1 added in v1.2203.0

type UpdateWeChatConfigurationReqV1 struct {
	EnableWeChatNotify *bool   `json:"enable_wechat_notify" from:"enable_wechat_notify" description:"是否启用微信通知"`
	CorpID             *string `json:"corp_id" from:"corp_id" description:"企业微信ID"`
	CorpSecret         *string `json:"corp_secret" from:"corp_secret" description:"企业微信ID对应密码"`
	AgentID            *int    `json:"agent_id" from:"agent_id" description:"企业微信应用ID"`
	SafeEnabled        *bool   `json:"safe_enabled" from:"safe_enabled" description:"是否对传输信息加密"`
	ProxyIP            *string `json:"proxy_ip" from:"proxy_ip" description:"企业微信代理服务器IP"`
}

type UpdateWorkflowReqV1

type UpdateWorkflowReqV1 struct {
	TaskId string `json:"task_id" form:"task_id" valid:"required"`
}

type UpdateWorkflowScheduleV1 added in v1.2112.0

type UpdateWorkflowScheduleV1 struct {
	ScheduleTime *time.Time `json:"schedule_time"`
}

type UpdateWorkflowTemplateReqV1

type UpdateWorkflowTemplateReqV1 struct {
	Desc                          *string                      `json:"desc" form:"desc"`
	AllowSubmitWhenLessAuditLevel *string                      `json:"allow_submit_when_less_audit_level" enums:"normal,notice,warn,error"`
	Steps                         []*WorkFlowStepTemplateReqV1 `json:"workflow_step_template_list" form:"workflow_step_template_list"`
	Instances                     []string                     `json:"instance_name_list" form:"instance_name_list"`
}

type UserDetailResV1

type UserDetailResV1 struct {
	Name       string   `json:"user_name"`
	Email      string   `json:"email"`
	IsAdmin    bool     `json:"is_admin"`
	WeChatID   string   `json:"wechat_id"`
	LoginType  string   `json:"login_type"`
	Roles      []string `json:"role_name_list,omitempty"`
	IsDisabled bool     `json:"is_disabled,omitempty"`
	UserGroups []string `json:"user_group_name_list,omitempty"`
}

type UserGroupListItemResV1 added in v1.2202.0

type UserGroupListItemResV1 struct {
	Name       string   `json:"user_group_name"`
	Desc       string   `json:"user_group_desc"`
	IsDisabled bool     `json:"is_disabled,omitempty"`
	Users      []string `json:"user_name_list,omitempty"`
	Roles      []string `json:"role_name_list,omitempty"`
}

type UserGroupTipListItem added in v1.2202.0

type UserGroupTipListItem struct {
	Name string `json:"user_group_name"`
}

type UserLoginReqV1

type UserLoginReqV1 struct {
	UserName string `json:"username" form:"username" example:"test" valid:"required"`
	Password string `json:"password" form:"password" example:"123456" valid:"required"`
}

type UserLoginResV1

type UserLoginResV1 struct {
	Token string `json:"token" example:"this is a jwt token string"`
}

type UserResV1

type UserResV1 struct {
	Name       string   `json:"user_name"`
	Email      string   `json:"email"`
	WeChatID   string   `json:"wechat_id"`
	LoginType  string   `json:"login_type"`
	IsDisabled bool     `json:"is_disabled,omitempty"`
	Roles      []string `json:"role_name_list,omitempty"`
	UserGroups []string `json:"user_group_name_list,omitempty"`
}

type UserTipResV1

type UserTipResV1 struct {
	Name string `json:"user_name"`
}

type WeChatConfigurationResV1 added in v1.2203.0

type WeChatConfigurationResV1 struct {
	EnableWeChatNotify bool   `json:"enable_wechat_notify"`
	CorpID             string `json:"corp_id"`
	AgentID            int    `json:"agent_id"`
	SafeEnabled        bool   `json:"safe_enabled"`
	ProxyIP            string `json:"proxy_ip"`
}

type WorkFlowStepTemplateReqV1

type WorkFlowStepTemplateReqV1 struct {
	Type  string   `json:"type" form:"type" valid:"oneof=sql_review sql_execute" enums:"sql_review,sql_execute"`
	Desc  string   `json:"desc" form:"desc"`
	Users []string `json:"assignee_user_name_list" form:"assignee_user_name_list" valid:"required"`
}

type WorkFlowStepTemplateResV1

type WorkFlowStepTemplateResV1 struct {
	Number int      `json:"number"`
	Typ    string   `json:"type"`
	Desc   string   `json:"desc,omitempty"`
	Users  []string `json:"assignee_user_name_list"`
}

type WorkflowDetailResV1

type WorkflowDetailResV1 struct {
	Id                      uint       `json:"workflow_id"`
	Subject                 string     `json:"subject"`
	Desc                    string     `json:"desc"`
	TaskPassRate            float64    `json:"task_pass_rate"`
	TaskScore               int32      `json:"task_score"`
	TaskInstance            string     `json:"task_instance_name"`
	TaskInstanceSchema      string     `json:"task_instance_schema"`
	CreateUser              string     `json:"create_user_name"`
	CreateTime              *time.Time `json:"create_time"`
	CurrentStepType         string     `json:"current_step_type,omitempty" enums:"sql_review,sql_execute"`
	CurrentStepAssigneeUser []string   `json:"current_step_assignee_user_name_list,omitempty"`
	Status                  string     `json:"status" enums:"on_process,rejected,canceled,exec_scheduled,executing,exec_failed,finished"`
	ScheduleTime            *time.Time `json:"schedule_time,omitempty"`
}

type WorkflowRecordResV1

type WorkflowRecordResV1 struct {
	TaskId            uint                 `json:"task_id"`
	CurrentStepNumber uint                 `json:"current_step_number,omitempty"`
	Status            string               `json:"status" enums:"on_process,rejected,canceled,exec_scheduled,executing,exec_failed,finished"`
	ScheduleTime      *time.Time           `json:"schedule_time,omitempty"`
	ScheduleUser      string               `json:"schedule_user,omitempty"`
	Steps             []*WorkflowStepResV1 `json:"workflow_step_list,omitempty"`
}

type WorkflowResV1

type WorkflowResV1 struct {
	Id                       uint                    `json:"workflow_id"`
	Subject                  string                  `json:"subject"`
	Desc                     string                  `json:"desc,omitempty"`
	CreateUser               string                  `json:"create_user_name"`
	CreateTime               *time.Time              `json:"create_time"`
	InstanceMaintenanceTimes []*MaintenanceTimeResV1 `json:"instance_maintenance_times"`
	Record                   *WorkflowRecordResV1    `json:"record"`
	RecordHistory            []*WorkflowRecordResV1  `json:"record_history_list,omitempty"`
}

type WorkflowStatisticsResV1

type WorkflowStatisticsResV1 struct {
	MyWorkflowNumber         uint64 `json:"my_on_process_workflow_number"`
	MyRejectedWorkflowNumber uint64 `json:"my_rejected_workflow_number"`
	NeedMeReviewNumber       uint64 `json:"need_me_to_review_workflow_number"`
	NeedMeExecuteNumber      uint64 `json:"need_me_to_execute_workflow_number"`
}

type WorkflowStepResV1

type WorkflowStepResV1 struct {
	Id            uint       `json:"workflow_step_id,omitempty"`
	Number        uint       `json:"number"`
	Type          string     `json:"type" enums:"create_workflow,update_workflow,sql_review,sql_execute"`
	Desc          string     `json:"desc,omitempty"`
	Users         []string   `json:"assignee_user_name_list,omitempty"`
	OperationUser string     `json:"operation_user_name,omitempty"`
	OperationTime *time.Time `json:"operation_time,omitempty"`
	State         string     `json:"state,omitempty" enums:"initialized,approved,rejected"`
	Reason        string     `json:"reason,omitempty"`
}

type WorkflowTemplateDetailResV1

type WorkflowTemplateDetailResV1 struct {
	Name                          string                       `json:"workflow_template_name"`
	Desc                          string                       `json:"desc,omitempty"`
	AllowSubmitWhenLessAuditLevel string                       `json:"allow_submit_when_less_audit_level" enums:"normal,notice,warn,error"`
	Steps                         []*WorkFlowStepTemplateResV1 `json:"workflow_step_template_list"`
	Instances                     []string                     `json:"instance_name_list,omitempty"`
}

type WorkflowTemplateResV1

type WorkflowTemplateResV1 struct {
	Name string `json:"workflow_template_name"`
	Desc string `json:"desc"`
}

type WorkflowTemplateTipResV1

type WorkflowTemplateTipResV1 struct {
	Name string `json:"workflow_template_name"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL