v2

package
v1.2210.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrForbidMyBatisXMLTask = func(taskId uint) error {
	return errors.New(errors.DataConflict,
		fmt.Errorf("the task for audit mybatis xml file is not allow to create workflow. taskId=%v", taskId))
}
View Source
var ErrWorkflowExecuteTimeIncorrect = errors.New(errors.TaskActionInvalid, fmt.Errorf("please go online during instance operation and maintenance time"))

Functions

func CreateRole added in v1.2202.0

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

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

func CreateWorkflowV2 added in v1.2209.0

func CreateWorkflowV2(c echo.Context) error

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

func ExecuteTasksOnWorkflow added in v1.2209.0

func ExecuteTasksOnWorkflow(c echo.Context) error

ExecuteTasksOnWorkflow @Summary 多数据源批量上线 @Description execute tasks on workflow @Tags workflow @Id executeTasksOnWorkflowV2 @Security ApiKeyAuth @Param workflow_id path string true "workflow id" @Success 200 {object} controller.BaseRes @router /v2/workflows/{workflow_id}/tasks/execute [post]

func GetAuditPlanReportSQLs

func GetAuditPlanReportSQLs(c echo.Context) error

@Summary 获取指定扫描任务的SQL扫描详情 @Description get audit plan report SQLs @Id getAuditPlanReportSQLsV2 @Deprecated @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} v2.GetAuditPlanReportSQLsResV2 @router /v2/audit_plans/{audit_plan_name}/report/{audit_plan_report_id}/ [get]

func GetAuditPlanReportSQLsV2 added in v1.2204.0

func GetAuditPlanReportSQLsV2(c echo.Context) error

GetAuditPlanReportSQLsV2 is to fix the irregular uri used by GetAuditPlanReportSQLs issue: https://github.com/actiontech/sqle/issues/429 @Summary 获取指定扫描任务的SQL扫描详情 @Description get audit plan report SQLs @Id getAuditPlanReportsSQLsV2 @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} v2.GetAuditPlanReportSQLsResV2 @router /v2/audit_plans/{audit_plan_name}/reports/{audit_plan_report_id}/sqls [get]

func GetAuditPlanSQLs

func GetAuditPlanSQLs(c echo.Context) error

@Summary 获取指定扫描任务的SQLs信息(不包括扫描结果) @Description get audit plan SQLs @Id getAuditPlanSQLsV2 @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} v2.GetAuditPlanSQLsResV2 @router /v2/audit_plans/{audit_plan_name}/sqls [get]

func GetRoles added in v1.2202.0

func GetRoles(c echo.Context) error

@Summary 获取角色列表 @Description get role list @Id getRoleListV2 @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} v2.GetRolesResV2 @router /v2/roles [get]

func GetWorkflowV2 added in v1.2209.0

func GetWorkflowV2(c echo.Context) error

GetWorkflowV2 @Summary 获取工单详情 @Description get workflow detail @Tags workflow @Id getWorkflowV2 @Security ApiKeyAuth @Param workflow_id path integer true "workflow id" @Success 200 {object} v2.GetWorkflowResV2 @router /v2/workflows/{workflow_id}/ [get]

func GetWorkflowsV2 added in v1.2209.0

func GetWorkflowsV2(c echo.Context) error

GetWorkflowsV2 @Summary 获取工单列表 @Description get workflow list @Tags workflow @Id getWorkflowsV2 @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_task_execute_start_time_from query string false "filter_task_execute_start_time_from" @Param filter_task_execute_start_time_to query string false "filter_task_execute_start_time_to" @Param filter_create_user_name query string false "filter create user name" @Param filter_status query string false "filter workflow status" Enums(wait_for_audit,wait_for_execution,rejected,executing,canceled,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} v2.GetWorkflowsResV2 @router /v2/workflows [get]

func UpdateRole added in v1.2202.0

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

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

func UpdateWorkflowScheduleV2 added in v1.2209.0

func UpdateWorkflowScheduleV2(c echo.Context) error

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

func UpdateWorkflowV2 added in v1.2209.0

func UpdateWorkflowV2(c echo.Context) error

UpdateWorkflowV2 @Summary 更新工单(驳回后才可更新) @Description update workflow when it is rejected to creator. @Tags workflow @Accept json @Produce json @Id updateWorkflowV2 @Security ApiKeyAuth @Param workflow_id path string true "workflow id" @Param instance body v2.UpdateWorkflowReqV2 true "update workflow request" @Success 200 {object} controller.BaseRes @router /v2/workflows/{workflow_id}/ [patch]

Types

type AuditPlanReportSQLResV2

type AuditPlanReportSQLResV2 struct {
	SQL         string `json:"audit_plan_report_sql" example:"select * from t1 where id = 1"`
	AuditResult string `json:"audit_plan_report_sql_audit_result" example:"same format as task audit result"`
	Number      uint   `json:"number" example:"1"`
}

type AuditPlanSQLHeadV2

type AuditPlanSQLHeadV2 struct {
	Name string `json:"name"`
	Desc string `json:"desc"`
	Type string `json:"type,omitempty" enums:"sql"`
}

type AuditPlanSQLResV2

type AuditPlanSQLResV2 struct {
	Head []AuditPlanSQLHeadV2 `json:"head"`
	Rows []map[string]string  `json:"rows"`
}

type CreateRoleReqV2 added in v1.2202.0

type CreateRoleReqV2 struct {
	Name           string   `json:"role_name" form:"role_name" valid:"required,name"`
	Desc           string   `json:"role_desc" form:"role_desc"`
	Instances      []string `json:"instance_name_list" form:"instance_name_list"`
	OperationCodes []uint   `json:"operation_code_list" form:"operation_code_list"`
	Users          []string `json:"user_name_list,omitempty" form:"user_name_list"`
	UserGroups     []string `json:"user_group_name_list,omitempty" form:"user_group_name_list"`
}

type CreateWorkflowReqV2 added in v1.2209.0

type CreateWorkflowReqV2 struct {
	Subject string `json:"workflow_subject" form:"workflow_subject" valid:"required,name"`
	Desc    string `json:"desc" form:"desc"`
	TaskIds []uint `json:"task_ids" form:"task_ids" valid:"required"`
}

type GetAuditPlanReportSQLsReqV2

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

type GetAuditPlanReportSQLsResV2

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

type GetAuditPlanSQLsReqV2

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

type GetAuditPlanSQLsResV2

type GetAuditPlanSQLsResV2 struct {
	controller.BaseRes
	Data      AuditPlanSQLResV2 `json:"data"`
	TotalNums uint64            `json:"total_nums"`
}

type GetRolesReqV2 added in v1.2202.0

type GetRolesReqV2 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 GetRolesResV2 added in v1.2202.0

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

type GetWorkflowResV2 added in v1.2209.0

type GetWorkflowResV2 struct {
	controller.BaseRes
	Data *WorkflowResV2 `json:"data"`
}

type GetWorkflowsReqV2 added in v1.2209.0

type GetWorkflowsReqV2 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"`
	FilterStatus                      string `` /* 149-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"`
	FilterTaskExecuteStartTimeFrom    string `json:"filter_task_execute_start_time_from" query:"filter_task_execute_start_time_from"`
	FilterTaskExecuteStartTimeTo      string `json:"filter_task_execute_start_time_to" query:"filter_task_execute_start_time_to"`
	PageIndex                         uint32 `json:"page_index" query:"page_index" valid:"required"`
	PageSize                          uint32 `json:"page_size" query:"page_size" valid:"required"`
}

type GetWorkflowsResV2 added in v1.2209.0

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

type Operation added in v1.2202.0

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

type RoleResV2 added in v1.2202.0

type RoleResV2 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"`
	Operations []*Operation `json:"operation_list,omitempty"`
	UserGroups []string     `json:"user_group_name_list,omitempty" form:"user_group_name_list"`
	IsDisabled bool         `json:"is_disabled,omitempty"`
}

type UpdateRoleReqV2 added in v1.2202.0

type UpdateRoleReqV2 struct {
	Desc           *string   `json:"role_desc" form:"role_desc"`
	Users          *[]string `json:"user_name_list,omitempty" form:"user_name_list"`
	Instances      *[]string `json:"instance_name_list,omitempty" form:"instance_name_list"`
	OperationCodes *[]uint   `json:"operation_code_list,omitempty" form:"operation_code_list"`
	UserGroups     *[]string `json:"user_group_name_list,omitempty" form:"user_group_name_list"`
	IsDisabled     *bool     `json:"is_disabled,omitempty"`
}

type UpdateWorkflowReqV2 added in v1.2209.0

type UpdateWorkflowReqV2 struct {
	TaskIds []uint `json:"task_ids" form:"task_ids" valid:"required"`
}

type WorkflowDetailResV2 added in v1.2209.0

type WorkflowDetailResV2 struct {
	Id                      uint       `json:"workflow_id"`
	Subject                 string     `json:"subject"`
	Desc                    string     `json:"desc"`
	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:"wait_for_audit,wait_for_execution,rejected,canceled,exec_failed,executing,finished"`
}

type WorkflowRecordResV2 added in v1.2209.0

type WorkflowRecordResV2 struct {
	Tasks             []*WorkflowTaskItem     `json:"tasks"`
	CurrentStepNumber uint                    `json:"current_step_number,omitempty"`
	Status            string                  `json:"status" enums:"wait_for_audit,wait_for_execution,rejected,canceled,exec_failed,executing,finished"`
	Steps             []*v1.WorkflowStepResV1 `json:"workflow_step_list,omitempty"`
}

type WorkflowResV2 added in v1.2209.0

type WorkflowResV2 struct {
	Id            uint                   `json:"workflow_id"`
	Subject       string                 `json:"subject"`
	Desc          string                 `json:"desc,omitempty"`
	Mode          string                 `json:"mode" enums:"same_sqls,different_sqls"`
	CreateUser    string                 `json:"create_user_name"`
	CreateTime    *time.Time             `json:"create_time"`
	Record        *WorkflowRecordResV2   `json:"record"`
	RecordHistory []*WorkflowRecordResV2 `json:"record_history_list,omitempty"`
}

type WorkflowTaskItem added in v1.2209.0

type WorkflowTaskItem struct {
	Id uint `json:"task_id"`
}

Jump to

Keyboard shortcuts

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