handler

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelResolution

func CancelResolution(c *gin.Context, in *cancelResolutionIn) error

CancelResolution "kills" a live resolution and its corresponding task, rendering it non-runnable (and garbage-collectable)

func CreateBatch

func CreateBatch(c *gin.Context, in *createBatchIn) (*task.Batch, error)

CreateBatch handles the creation of a collection of tasks based on the same template one task is created for each element in the "inputs" slice all tasks share a common "batchID" which can be used as a listing filter on /task

func CreateComment

func CreateComment(c *gin.Context, in *createCommentIn) (*task.Comment, error)

CreateComment create a comment related to a task

func CreateResolution

func CreateResolution(c *gin.Context, in *createResolutionIn) (*resolution.Resolution, error)

CreateResolution handles the creation of a resolution for a given task the creator of the resolution (aka "resolver") might have to provide extra inputs depending on the task's template definition

func CreateTask

func CreateTask(c *gin.Context, in *createTaskIn) (*task.Task, error)

CreateTask handles the creation of a new task based on an existing template the template determines the expected input an initial comment on the task can be provided for context watchers will be able to follow the state of this task while having no right to act on it a delay can be set to offset this task's execution by a certain amount of time delay is expressed according to https://golang.org/pkg/time/#ParseDuration A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

func DeleteComment

func DeleteComment(c *gin.Context, in *deleteCommentIn) error

DeleteComment delete a specific comment related to a task

func DeleteTask

func DeleteTask(c *gin.Context, in *deleteTaskIn) error

DeleteTask removes a task from the data backend

func ExtendResolution

func ExtendResolution(c *gin.Context, in *extendResolutionIn) error

ExtendResolution increments a resolution's remaining execution retries in case it has reached state BLOCKED_MAXRETRIES

func GetComment

func GetComment(c *gin.Context, in *getCommentIn) (*task.Comment, error)

GetComment return a specific comment related to a task

func GetFunction added in v1.8.0

func GetFunction(c *gin.Context, in *getFunctionIn) (*functions.Function, error)

GetFunction returns the full representation of a function, steps included

func GetResolution

func GetResolution(c *gin.Context, in *getResolutionIn) (*resolution.Resolution, error)

GetResolution returns a single resolution, with its full content (all step outputs included)

func GetResolutionStep added in v1.11.0

func GetResolutionStep(c *gin.Context, in *getResolutionStepIn) (*step.Step, error)

GetResolutionStep returns a single step resolution, with its full content (output included)

func GetTask

func GetTask(c *gin.Context, in *getTaskIn) (*task.Task, error)

GetTask returns a single task inputs of type password are obfuscated to every user except administrators

func GetTemplate

func GetTemplate(c *gin.Context, in *getTemplateIn) (*tasktemplate.TaskTemplate, error)

GetTemplate returns the full representation of a template, steps included

func ListComments

func ListComments(c *gin.Context, in *listCommentsIn) ([]*task.Comment, error)

ListComments return a list of comments related to a task

func ListFunctions added in v1.8.0

func ListFunctions(c *gin.Context, in *listFunctionsIn) ([]*functions.Function, error)

ListFunctions returns a list of available functions in simplified format (steps not included)

func ListResolutions

func ListResolutions(c *gin.Context, in *listResolutionsIn) (rr []*resolution.Resolution, err error)

ListResolutions returns a list of resolutions, which can be filtered by state and instance ID type=own (default option) filters resolutions for which the user is the "resolver" type=all returns every resolution, provided that the user is an administrator the resolutions are simplified and do not include the content of steps

func ListTasks

func ListTasks(c *gin.Context, in *listTasksIn) (t []*task.Task, err error)

ListTasks returns a list of tasks, which can be filtered by state, batch ID, and last activity time (before and/or after) type=own (default) returns tasks for which the user is the requester type=resolvable returns tasks for which the user is a potential resolver type=all returns every task (only available to administrator users)

func ListTemplates

func ListTemplates(c *gin.Context, in *listTemplatesIn) ([]*tasktemplate.TaskTemplate, error)

ListTemplates returns a list of available templates in simplified format (steps not included)

func PauseResolution

func PauseResolution(c *gin.Context, in *pauseResolutionIn) error

PauseResolution sets a resolution's state to PAUSED allowing for it to be edited this action can only be performed by administrators and can be "forced" when dealing with exceptions in which a resolution doesn't exit RUNNING state

func RunResolution

func RunResolution(c *gin.Context, in *runResolutionIn) error

RunResolution launches the asynchronous execution of a resolution the engine determines if resolution is eligible for execution

func UpdateComment

func UpdateComment(c *gin.Context, in *updateCommentIn) (*task.Comment, error)

UpdateComment update a specific comment related to a task

func UpdateResolution

func UpdateResolution(c *gin.Context, in *updateResolutionIn) error

UpdateResolution is a special handler reserved to administrators, which allows the edition of a live resolution, in case a template mistake needs to be hotfixed use sparingly, this opens the door to completely breaking execution can only be called when resolution is in state PAUSED

func UpdateResolutionStep added in v1.11.0

func UpdateResolutionStep(c *gin.Context, in *updateResolutionStepIn) error

UpdateResolutionStep is a special handler reserved to administrators, which allows the edition of a live resolution. It's equivalent to UpdateResolution, but focus on a singular step instead of live patch the whole resolution. can only be called when resolution is in state PAUSED

func UpdateResolutionStepState added in v1.11.0

func UpdateResolutionStepState(c *gin.Context, in *updateResolutionStepStateIn) error

UpdateResolutionStepState allows the edition of a step state. Can only be called when the resolution is in state PAUSED, and by a resolution manager.

func UpdateTask

func UpdateTask(c *gin.Context, in *updateTaskIn) (*task.Task, error)

UpdateTask modifies a task, allowing it's requester or an administrator to fix a broken input, or to add/remove watchers

func WontfixTask

func WontfixTask(c *gin.Context, in *wontfixTaskIn) error

WontfixTask changes a task's state to prevent it from ever being resolved

Types

This section is empty.

Jump to

Keyboard shortcuts

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