controller

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsReady = false
View Source
var OkMessage = model.SimpleMsg{}

Functions

func CheckReady

func CheckReady(c echo.Context) error

CheckReady func is for checking Cicada server health.

@ID				health-check-readyz
@Summary		Check Ready
@Description	Check Cicada is ready
@Tags [Admin]	System management
@Accept			json
@Produce		json
@Success		200 {object}	model.SimpleMsg			"Successfully get ready state."
@Failure		500	{object}	common.ErrorResponse	"Failed to check ready state."
@Router			/readyz [get]

func ClearTaskInstances added in v0.2.1

func ClearTaskInstances(c echo.Context) error

ClearTaskInstances godoc

@ID			clear-task-instances
@Summary	Clear taskInstances
@Description	Clear the task Instance.
@Tags	[Workflow]
@Accept	json
@Produce	json
@Param	wfId path string true "ID of the workflow."
@Param	wfRunId path string true "ID of the wfRunId."

@Param request body model.TaskClearOption true "Workflow content" @Success 200 {object} model.TaskInstanceReference "Successfully clear the taskInstances." @Failure 400 {object} common.ErrorResponse "Sent bad request." @Failure 500 {object} common.ErrorResponse "Failed to clear the taskInstances." @Router /workflow/{wfId}/workflowRun/{wfRunId}/range [post]

func CreateTaskComponent

func CreateTaskComponent(c echo.Context) error

CreateTaskComponent godoc

@ID				create-task-component
@Summary		Create TaskComponent
@Description	Register the task component.
@Tags		[Task Component]
@Accept		json
@Produce		json
@Param		TaskComponent body model.CreateTaskComponentReq true "task component to create."
@Success		200	{object}	model.TaskComponent		"Successfully register the task component"
@Failure		400	{object}	common.ErrorResponse	"Sent bad request."
@Failure		500	{object}	common.ErrorResponse	"Failed to register the task component"
@Router		/task_component [post]

func CreateWorkflow

func CreateWorkflow(c echo.Context) error

CreateWorkflow godoc

@ID		create-workflow
@Summary	Create Workflow
@Description	Create a workflow.
@Tags		[Workflow]
@Accept		json
@Produce	json
@Param		request body 	model.CreateWorkflowReq true "Workflow content"
@Success	200	{object}	model.WorkflowTemplate	"Successfully create the workflow."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to create workflow."
@Router		/workflow [post]

func DeleteTaskComponent

func DeleteTaskComponent(c echo.Context) error

DeleteTaskComponent godoc

@ID				delete-task-component
@Summary		Delete TaskComponent
@Description	Delete the task component.
@Tags		[Task Component]
@Accept		json
@Produce		json
@Param		tcId path string true "ID of the task component."
@Success		200	{object}	model.SimpleMsg		"Successfully delete the task component"
@Failure		400	{object}	common.ErrorResponse	"Sent bad request."
@Failure		500	{object}	common.ErrorResponse	"Failed to delete the task component"
@Router		/task_component/{tcId} [delete]

func DeleteWorkflow

func DeleteWorkflow(c echo.Context) error

DeleteWorkflow godoc

@ID		delete-workflow
@Summary	Delete Workflow
@Description	Delete the workflow.
@Tags		[Workflow]
@Accept		json
@Produce	json
@Param		wfId path string true "ID of the workflow."
@Success	200	{object}	model.SimpleMsg		"Successfully delete the workflow"
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to delete the workflow"
@Router		/workflow/{wfId} [delete]

func GetEventLogs added in v0.2.1

func GetEventLogs(c echo.Context) error

GetEventLogs godoc

@ID				get-event-logs
@Summary		Get Eventlog
@Description	Get Eventlog.
@Tags		[Workflow]
@Accept		json
@Produce	json
@Param		wfId path string true "ID of the workflow."
@Param		wfRunId query string false "ID of the workflow run."
@Param		taskId query string false "ID of the task."
@Success	200	{object}	[]model.EventLog			"Successfully get the workflow."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get the workflow."
@Router	/workflow/{wfId}/eventlogs [get]

func GetImportErrors added in v0.2.1

func GetImportErrors(c echo.Context) error

GetImportErrors godoc

@ID			get-import-errors
@Summary	Get importErrors
@Description	Get the importErrors.
@Tags	[Workflow]
@Accept	json
@Produce	json
@Success	200	{object}	airflow.ImportErrorCollection		"Successfully get the importErrors."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get the importErrors."
@Router	 /importErrors [get]

func GetTask added in v0.2.0

func GetTask(c echo.Context) error

GetTask godoc

@ID		get-task
@Summary	Get Task
@Description	Get the task.
@Tags		[Workflow]
@Accept		json
@Produce	json
@Param		wfId path string true "ID of the workflow."
@Param		taskId path string true "ID of the task."
@Success	200	{object}	model.Task		"Successfully get the task."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get the task."
@Router		/workflow/{wfId}/task/{taskId} [get]

func GetTaskComponent

func GetTaskComponent(c echo.Context) error

GetTaskComponent godoc

@ID				get-task-component
@Summary		Get TaskComponent
@Description	Get the task component.
@Tags		[Task Component]
@Accept		json
@Produce		json
@Param		tcId path string true "ID of the TaskComponent"
@Success		200	{object}	model.TaskComponent		"Successfully get the task component"
@Failure		400	{object}	common.ErrorResponse	"Sent bad request."
@Failure		500	{object}	common.ErrorResponse	"Failed to get the task component"
@Router		/task_component/{tcId} [get]

func GetTaskComponentByName added in v0.2.0

func GetTaskComponentByName(c echo.Context) error

GetTaskComponentByName godoc

@ID				get-task-component-by-name
@Summary		Get TaskComponent by Name
@Description	Get the task component by name.
@Tags		[Task Component]
@Accept		json
@Produce		json
@Param		tcName path string true "Name of the TaskComponent"
@Success		200	{object}	model.TaskComponent		"Successfully get the task component"
@Failure		400	{object}	common.ErrorResponse	"Sent bad request."
@Failure		500	{object}	common.ErrorResponse	"Failed to get the task component"
@Router		/task_component/name/{tcName} [get]

func GetTaskDirectly added in v0.2.0

func GetTaskDirectly(c echo.Context) error

GetTaskDirectly godoc

@ID		get-task-directly
@Summary	Get Task Directly
@Description	Get the task directly.
@Tags		[Workflow]
@Accept		json
@Produce	json
@Param		taskId path string true "ID of the task."
@Success	200	{object}	model.TaskDirectly	"Successfully get the task."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get the task."
@Router		/task/{taskId} [get]

func GetTaskFromTaskGroup added in v0.2.0

func GetTaskFromTaskGroup(c echo.Context) error

GetTaskFromTaskGroup godoc

@ID		get-task-from-task-group
@Summary	Get Task from Task Group
@Description	Get the task from the task group.
@Tags		[Workflow]
@Accept		json
@Produce	json
@Param		wfId path string true "ID of the workflow."
@Param		tgId path string true "ID of the task group."
@Param		taskId path string true "ID of the task."
@Success	200	{object}	model.Task		"Successfully get the task from the task group."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get the task from the task group."
@Router		/workflow/{wfId}/task_group/{tgId}/task/{taskId} [get]

func GetTaskGroup added in v0.2.0

func GetTaskGroup(c echo.Context) error

GetTaskGroup godoc

@ID		get-task-group
@Summary	Get TaskGroup
@Description	Get the task group.
@Tags	[Workflow]
@Accept	json
@Produce	json
@Param	wfId path string true "ID of the workflow."
@Param	tgId path string true "ID of the task group."
@Success	200	{object}	model.Task		"Successfully get the task group."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get the task group."
@Router	/workflow/{wfId}/task_group/{tgId} [get]

func GetTaskGroupDirectly added in v0.2.0

func GetTaskGroupDirectly(c echo.Context) error

GetTaskGroupDirectly godoc

@ID		get-task-group-directly
@Summary	Get TaskGroup Directly
@Description	Get the task group directly.
@Tags	[Workflow]
@Accept	json
@Produce	json
@Param	tgId path string true "ID of the task group."
@Success	200	{object}	model.Task		"Successfully get the task group."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get the task group."
@Router	/task_group/{tgId} [get]

func GetTaskInstances added in v0.2.1

func GetTaskInstances(c echo.Context) error

GetTaskInstances godoc

@ID			get-task-instances
@Summary	Get taskInstances
@Description	Get the task Logs.
@Tags	[Workflow]
@Accept	json
@Produce	json
@Param	wfId path string true "ID of the workflow."
@Param	wfRunId path string true "ID of the workflow."
@Success	200	{object}	model.TaskInstance		"Successfully get the taskInstances."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get the taskInstances."
@Router	 /workflow/{wfId}/workflowRun/{wfRunId}/taskInstances [get]

func GetTaskLogDownload added in v0.3.1

func GetTaskLogDownload(c echo.Context) error

GetTaskLogDownload godoc

@ID			get-task-logs-download
@Summary	Download Task Logs
@Description	Download the task logs as a file.
@Tags		[Workflow]
@Accept		json
@Produce	text/plain
@Param		wfId path string true "ID of the workflow."
@Param		wfRunId path string true "ID of the workflowRunId."
@Param		taskId path string true "ID of the task."
@Param		taskTryNum path string true "ID of the taskTryNum."
@Success	200 {file} file "Log file downloaded successfully."
@Failure	400 {object} common.ErrorResponse "Sent bad request."
@Failure	500 {object} common.ErrorResponse "Failed to get the task Logs."
@Router		/workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTryNum}/logs/download [get]

func GetTaskLogs added in v0.2.1

func GetTaskLogs(c echo.Context) error

GetTaskLogs godoc

@ID			get-task-logs
@Summary	Get Task Logs
@Description	Get the task Logs.
@Tags	[Workflow]
@Accept	json
@Produce	json
@Param	wfId path string true "ID of the workflow."
@Param	wfRunId path string true "ID of the workflowRunId."
@Param	taskId path string true "ID of the task."
@Param	taskTryNum path string true "ID of the taskTryNum."
@Success	200	{object}	airflow.InlineResponse200		"Successfully get the task Logs."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get the task Logs."
@Router	 /workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTryNum}/logs [get]

func GetWorkflow

func GetWorkflow(c echo.Context) error

GetWorkflow godoc

@ID		get-workflow
@Summary	Get Workflow
@Description	Get the workflow.
@Tags		[Workflow]
@Accept		json
@Produce	json
@Param		wfId path string true "ID of the workflow."
@Success	200	{object}	model.Workflow		"Successfully get the workflow."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get the workflow."
@Router		/workflow/{wfId} [get]

func GetWorkflowByName added in v0.2.0

func GetWorkflowByName(c echo.Context) error

GetWorkflowByName godoc

@ID		get-workflow-by-name
@Summary	Get Workflow by Name
@Description	Get the workflow by name.
@Tags		[Workflow]
@Accept		json
@Produce	json
@Param		wfName path string true "Name of the workflow."
@Success	200	{object}	model.Workflow		"Successfully get the workflow."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get the workflow."
@Router		/workflow/name/{wfName} [get]

func GetWorkflowRuns added in v0.2.1

func GetWorkflowRuns(c echo.Context) error

GetWorkflowRuns godoc

@ID			get-workflow-runs
@Summary	Get workflowRuns
@Description	Get the task Logs.
@Tags	[Workflow]
@Accept	json
@Produce	json
@Param	wfId path string true "ID of the workflow."
@Success	200	{object}	[]model.WorkflowRun		"Successfully get the workflowRuns."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get the workflowRuns."
@Router	 /workflow/{wfId}/runs [get]

func GetWorkflowStatus added in v0.3.1

func GetWorkflowStatus(c echo.Context) error

GetWorkflowStatus godoc

@ID		get-WorkflowStatus
@Summary	Get WorkflowStatus
@Description	Get the WorkflowStatus.
@Tags		[Workflow]
@Accept		json
@Produce	json
@Param		wfId path string true "wfId of the workflow"
@Success	200	{object}	[]model.WorkflowStatus		"Successfully get the WorkflowVersion."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get the WorkflowVersion."
@Router		/workflow/{wfId}/status [get]

func GetWorkflowTemplate

func GetWorkflowTemplate(c echo.Context) error

GetWorkflowTemplate godoc

@ID				get-workflow-template
@Summary		Get WorkflowTemplate
@Description	Get the workflow template.
@Tags			[Workflow Template]
@Accept			json
@Produce		json
@Param			wftId path string true "ID of the WorkflowTemplate"
@Success		200	{object}	model.GetWorkflowTemplate	"Successfully get the workflow template"
@Failure		400	{object}	common.ErrorResponse		"Sent bad request."
@Failure		500	{object}	common.ErrorResponse		"Failed to get the workflow template"
@Router			/workflow_template/{wftId} [get]

func GetWorkflowTemplateByName added in v0.2.0

func GetWorkflowTemplateByName(c echo.Context) error

GetWorkflowTemplateByName godoc

@ID				get-workflow-template-by-name
@Summary		Get WorkflowTemplate by Name
@Description	Get the workflow template by name.
@Tags			[Workflow Template]
@Accept			json
@Produce		json
@Param			wfName path string true "Name of the WorkflowTemplate"
@Success		200	{object}	model.GetWorkflowTemplate	"Successfully get the workflow template"
@Failure		400	{object}	common.ErrorResponse		"Sent bad request."
@Failure		500	{object}	common.ErrorResponse		"Failed to get the workflow template"
@Router			/workflow_template/name/{wfName} [get]

func GetWorkflowVersion added in v0.2.3

func GetWorkflowVersion(c echo.Context) error

GetWorkflowVersion godoc

@ID		get-WorkflowVersion
@Summary	Get WorkflowVersion
@Description	Get the WorkflowVersion.
@Tags		[Workflow]
@Accept		json
@Produce	json
@Param		wfId path string true "wfId of the workflow"
@Param		verId path string true "ID of the WorkflowVersion."
@Success	200	{object}	model.Workflow		"Successfully get the WorkflowVersion."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get the WorkflowVersion."
@Router		/workflow/{wfId}/version/{verId} [get]

func ListTask added in v0.2.0

func ListTask(c echo.Context) error

ListTask godoc

@ID		list-task
@Summary	List Task
@Description	Get a task list of the workflow.
@Tags		[Workflow]
@Accept		json
@Produce	json
@Param		wfId path string true "ID of the workflow."
@Success	200	{object}	[]model.Task		"Successfully get a task list."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get a task list."
@Router		/workflow/{wfId}/task [get]

func ListTaskComponent

func ListTaskComponent(c echo.Context) error

ListTaskComponent godoc

@ID				list-task-component
@Summary		List TaskComponent
@Description	Get a list of task component.
@Tags			[Task Component]
@Accept			json
@Produce		json
@Param			page query string false "Page of the task component list."
@Param			row query string false "Row of the task component list."
@Success		200	{object}	[]model.TaskComponent	"Successfully get a list of task component."
@Failure		400	{object}	common.ErrorResponse	"Sent bad request."
@Failure		500	{object}	common.ErrorResponse	"Failed to get a list of task component."
@Router			/task_component [get]

func ListTaskFromTaskGroup added in v0.2.0

func ListTaskFromTaskGroup(c echo.Context) error

ListTaskFromTaskGroup godoc

@ID		list-task-from-task-group
@Summary	List Task from Task Group
@Description	Get a task list from the task group.
@Tags	[Workflow]
@Accept	json
@Produce	json
@Param	wfId path string true "ID of the workflow."
@Param	tgId path string true "ID of the task group."
@Success	200	{object}	[]model.Task		"Successfully get a task list from the task group."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get a task list from the task group."
@Router	/workflow/{wfId}/task_group/{tgId}/task [get]

func ListTaskGroup added in v0.2.0

func ListTaskGroup(c echo.Context) error

ListTaskGroup godoc

@ID		list-task-group
@Summary	List TaskGroup
@Description	Get a task group list of the workflow.
@Tags		[Workflow]
@Accept		json
@Produce	json
@Param		wfId path string true "ID of the workflow."
@Success	200	{object}	[]model.TaskGroup	"Successfully get a task group list."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get a task group list."
@Router		/workflow/{wfId}/task_group [get]

func ListWorkflow

func ListWorkflow(c echo.Context) error

ListWorkflow godoc

@ID		list-workflow
@Summary	List Workflow
@Description	Get a workflow list.
@Tags		[Workflow]
@Accept		json
@Produce	json
@Param		name query string false "Name of the workflow"
@Param		page query string false "Page of the workflow list."
@Param		row query string false "Row of the workflow list."
@Success	200	{object}	[]model.Workflow	"Successfully get a workflow list."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get a workflow list."
@Router		/workflow [get]

func ListWorkflowTemplate

func ListWorkflowTemplate(c echo.Context) error

ListWorkflowTemplate godoc

@ID				list-workflow-template
@Summary		List WorkflowTemplate
@Description	Get a list of workflow template.
@Tags			[Workflow Template]
@Accept			json
@Produce		json
@Param			name query string false "Name of the workflow template"
@Param			page query string false "Page of the workflow template list."
@Param			row query string false "Row of the workflow template list."
@Success		200	{object}	[]model.WorkflowTemplate		"Successfully get a list of workflow template."
@Failure		400	{object}	common.ErrorResponse	"Sent bad request."
@Failure		500	{object}	common.ErrorResponse	"Failed to get a list of workflow template."
@Router			/workflow_template [get]

func ListWorkflowVersion added in v0.2.3

func ListWorkflowVersion(c echo.Context) error

ListWorkflowVersion godoc

@ID		list-workflowVersion
@Summary	List workflowVersion
@Description	Get a workflowVersion list.
@Tags		[Workflow]
@Accept		json
@Produce	json
@Param		wfId path string true "wfId of the workflow"
@Param		page query string false "Page of the workflowVersion list."
@Param		row query string false "Row of the workflowVersion list."
@Success	200	{object}	[]model.WorkflowVersion	"Successfully get a workflowVersion list."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to get a workflowVersion list."
@Router		/workflow/{wfId}/version [get]

func RunScript added in v0.4.1

func RunScript(c echo.Context) error

RunScript godoc

@ID				run-script
@Summary		Run script on target
@Description	Run script on target with NS ID, MCI ID and VM ID.
@Tags			[Cicada Task Component]
@Accept			json
@Produce		json
@Param			request body 	model.RunScriptReq true "Workflow content"
@Success		200	{object}	model.ScriptResult		"Result of the script running"
@Failure		400	{object}	common.ErrorResponse	"Sent bad request."
@Failure		500	{object}	common.ErrorResponse	"Failed to run script"
@Router			/run_script [post]

func RunWorkflow

func RunWorkflow(c echo.Context) error

RunWorkflow godoc

@ID		run-workflow
@Summary	Run Workflow
@Description	Run the workflow.
@Tags		[Workflow]
@Accept		json
@Produce	json
@Param		wfId path string true "ID of the workflow."
@Success	200	{object}	model.SimpleMsg		"Successfully run the workflow."
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to run the Workflow"
@Router		/workflow/{wfId}/run [post]

func SleepTime added in v0.4.1

func SleepTime(c echo.Context) error

SleepTime godoc

@ID				sleep-time
@Summary		Run sleep command on cicada
@Description	Runs sleep command on cicada and waits for configured time. Wait for 10 seconds if time value is not provided.
@Tags			[Cicada Task Component]
@Accept			json
@Produce		json
@Param			request body 	model.SleepTimeReq true "SleepTime request"
@Success		200	{object}	model.ScriptResult		"Result of sleep"
@Failure		400	{object}	common.ErrorResponse	"Sent bad request."
@Failure		500	{object}	common.ErrorResponse	"Failed to run script"
@Router			/sleep_time [post]

func UpdateTaskComponent

func UpdateTaskComponent(c echo.Context) error

UpdateTaskComponent godoc

@ID				update-task-component
@Summary		Update TaskComponent
@Description	Update the task component.
@Tags		[Task Component]
@Accept		json
@Produce		json
@Param		tcId path string true "ID of the TaskComponent"
@Param		TaskComponent body model.CreateTaskComponentReq true "task component to modify."
@Success		200	{object}	model.TaskComponent		"Successfully update the task component"
@Failure		400	{object}	common.ErrorResponse	"Sent bad request."
@Failure		500	{object}	common.ErrorResponse	"Failed to update the task component"
@Router		/task_component/{tcId} [put]

func UpdateWorkflow

func UpdateWorkflow(c echo.Context) error

UpdateWorkflow godoc

@ID		update-workflow
@Summary	Update Workflow
@Description	Update the workflow content.
@Tags		[Workflow]
@Accept		json
@Produce	json
@Param		wfId path string true "ID of the workflow."
@Param		Workflow body 	model.CreateWorkflowReq true "Workflow to modify."
@Success	200	{object}	model.Workflow	"Successfully update the workflow"
@Failure	400	{object}	common.ErrorResponse	"Sent bad request."
@Failure	500	{object}	common.ErrorResponse	"Failed to update the workflow"
@Router		/workflow/{wfId} [put]

Types

This section is empty.

Jump to

Keyboard shortcuts

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