Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sqle/api/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,9 @@ func StartApi(net *gracenet.Net, exitChan chan struct{}, config *config.SqleOpti
v1Router.GET("/dashboard/sql_manages", v1.GetGlobalSqlManageList)
v1Router.GET("/dashboard/sql_manages/statistics", v1.GetGlobalSqlManageStatistics)
v1Router.GET("/dashboard/workflows", v1.GetGlobalWorkflowsV1)
v1Router.GET("/dashboard/data_export_workflows", v1.GetGlobalDataExportWorkflowsV1)
v1Router.GET("/dashboard/workflows/statistics", v1.GetGlobalWorkflowStatistics)
v1Router.GET("/dashboard/data_export_workflows/statistics", v1.GetGlobalDataExportWorkflowStatisticsV1)

// configurations
v1Router.GET("/configurations/drivers", v1.GetDrivers)
Expand Down
36 changes: 36 additions & 0 deletions sqle/api/controller/v1/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,42 @@ func GetGlobalWorkflowStatistics(c echo.Context) error {
})
}

// GetGlobalDataExportWorkflowsV1
// @Summary 获取全局导出工单列表
// @Description get global data export workflows list
// @Tags workflow
// @Id getGlobalDataExportWorkflowsV1
// @Security ApiKeyAuth
// @Param filter_create_user_id query string false "filter create user id"
// @Param filter_status_list query []string false "filter by workflow status,support using many status" Enums(wait_for_approve,wait_for_export,exporting,failed,rejected,cancel,finish)
// @Param filter_project_uid query string false "filter by project uid"
// @Param filter_instance_id query string false "filter by instance id in project"
// @Param filter_project_priority query string false "filter by project priority" Enums(high,medium,low)
// @Param page_index query uint32 true "page index"
// @Param page_size query uint32 true "size of per page"
// @Success 200 {object} v1.GetWorkflowsResV1
// @router /v1/dashboard/data_export_workflows [get]
func GetGlobalDataExportWorkflowsV1(c echo.Context) error {
return getGlobalDataExportWorkflowsV1(c)
}

// GetGlobalDataExportWorkflowStatisticsV1
// @Summary 获取全局导出工单统计数据
// @Description get global data export workflows statistics
// @Tags workflow
// @Id getGlobalDataExportWorkflowStatisticsV1
// @Security ApiKeyAuth
// @Param filter_create_user_id query string false "filter create user id"
// @Param filter_status_list query []string false "filter by workflow status,support using many status" Enums(wait_for_approve,wait_for_export,exporting,failed,rejected,cancel,finish)
// @Param filter_project_uid query string false "filter by project uid"
// @Param filter_instance_id query string false "filter by instance id in project"
// @Param filter_project_priority query string false "filter by project priority" Enums(high,medium,low)
// @Success 200 {object} v1.GlobalWorkflowStatisticsResV1
// @router /v1/dashboard/data_export_workflows/statistics [get]
func GetGlobalDataExportWorkflowStatisticsV1(c echo.Context) error {
return getGlobalDataExportWorkflowStatisticsV1(c)
}

type globalWorkflowBasicFilter struct {
FilterCreateUserId string `json:"filter_create_user_id" query:"filter_create_user_id"`
FilterStatusList []string `json:"filter_status_list" query:"filter_status_list" validate:"dive,oneof=wait_for_audit wait_for_execution rejected canceled executing exec_failed finished"`
Expand Down
9 changes: 9 additions & 0 deletions sqle/api/controller/v1/workflow_ce.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var (
errCommunityEditionDoesNotSupportFeatureExportWorkflowList = errors.New(errors.EnterpriseEditionFeatures, e.New("community edition does not support feature export workflow list"))
errCommunityEditionDoesNotSupportWorkflowTemplate = errors.New(errors.EnterpriseEditionFeatures, e.New("community edition does not support workflow template"))
errCommunityEditionDoesNotSupportFileOrder = errors.New(errors.EnterpriseEditionFeatures, e.New("community edition does not support file order"))
errCommunityEditionDoesNotSupportDataExportWorkflowList = errors.New(errors.EnterpriseEditionFeatures, e.New("community edition does not support data export workflow list"))
)

func exportWorkflowV1(c echo.Context) error {
Expand Down Expand Up @@ -50,3 +51,11 @@ func updateWorkflowTemplate(c echo.Context) error {
func updateSqlFileOrderByWorkflow(c echo.Context) error {
return controller.JSONBaseErrorReq(c, errCommunityEditionDoesNotSupportFileOrder)
}

func getGlobalDataExportWorkflowsV1(c echo.Context) error {
return controller.JSONBaseErrorReq(c, errCommunityEditionDoesNotSupportDataExportWorkflowList)
}

func getGlobalDataExportWorkflowStatisticsV1(c echo.Context) error {
return controller.JSONBaseErrorReq(c, errCommunityEditionDoesNotSupportDataExportWorkflowList)
}
158 changes: 158 additions & 0 deletions sqle/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,164 @@ var doc = `{
}
}
},
"/v1/dashboard/data_export_workflows": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get global data export workflows list",
"tags": [
"workflow"
],
"summary": "获取全局导出工单列表",
"operationId": "getGlobalDataExportWorkflowsV1",
"parameters": [
{
"type": "string",
"description": "filter create user id",
"name": "filter_create_user_id",
"in": "query"
},
{
"enum": [
"wait_for_approve",
"wait_for_export",
"exporting",
"failed",
"rejected",
"cancel",
"finish"
],
"type": "array",
"items": {
"type": "string"
},
"description": "filter by workflow status,support using many status",
"name": "filter_status_list",
"in": "query"
},
{
"type": "string",
"description": "filter by project uid",
"name": "filter_project_uid",
"in": "query"
},
{
"type": "string",
"description": "filter by instance id in project",
"name": "filter_instance_id",
"in": "query"
},
{
"enum": [
"high",
"medium",
"low"
],
"type": "string",
"description": "filter by project priority",
"name": "filter_project_priority",
"in": "query"
},
{
"type": "integer",
"description": "page index",
"name": "page_index",
"in": "query",
"required": true
},
{
"type": "integer",
"description": "size of per page",
"name": "page_size",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/v1.GetWorkflowsResV1"
}
}
}
}
},
"/v1/dashboard/data_export_workflows/statistics": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get global data export workflows statistics",
"tags": [
"workflow"
],
"summary": "获取全局导出工单统计数据",
"operationId": "getGlobalDataExportWorkflowStatisticsV1",
"parameters": [
{
"type": "string",
"description": "filter create user id",
"name": "filter_create_user_id",
"in": "query"
},
{
"enum": [
"wait_for_approve",
"wait_for_export",
"exporting",
"failed",
"rejected",
"cancel",
"finish"
],
"type": "array",
"items": {
"type": "string"
},
"description": "filter by workflow status,support using many status",
"name": "filter_status_list",
"in": "query"
},
{
"type": "string",
"description": "filter by project uid",
"name": "filter_project_uid",
"in": "query"
},
{
"type": "string",
"description": "filter by instance id in project",
"name": "filter_instance_id",
"in": "query"
},
{
"enum": [
"high",
"medium",
"low"
],
"type": "string",
"description": "filter by project priority",
"name": "filter_project_priority",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/v1.GlobalWorkflowStatisticsResV1"
}
}
}
}
},
"/v1/dashboard/sql_manages": {
"get": {
"security": [
Expand Down
Loading
Loading