2017-02-23 06:12:16 +01:00
|
|
|
package db
|
2016-04-04 15:44:34 +02:00
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
2018-03-27 22:12:47 +02:00
|
|
|
//Task is a model of a task which will be executed by the runner
|
2016-04-04 15:44:34 +02:00
|
|
|
type Task struct {
|
2016-04-08 21:41:20 +02:00
|
|
|
ID int `db:"id" json:"id"`
|
|
|
|
TemplateID int `db:"template_id" json:"template_id" binding:"required"`
|
2021-05-13 15:49:32 +02:00
|
|
|
ProjectID int `db:"project_id" json:"project_id"`
|
2016-04-08 21:41:20 +02:00
|
|
|
|
|
|
|
Status string `db:"status" json:"status"`
|
|
|
|
Debug bool `db:"debug" json:"debug"`
|
|
|
|
|
2016-06-30 16:57:45 +02:00
|
|
|
DryRun bool `db:"dry_run" json:"dry_run"`
|
|
|
|
|
2016-04-08 21:41:20 +02:00
|
|
|
// override variables
|
2016-04-04 15:44:34 +02:00
|
|
|
Playbook string `db:"playbook" json:"playbook"`
|
|
|
|
Environment string `db:"environment" json:"environment"`
|
2018-09-11 13:29:05 +02:00
|
|
|
// to fit into []string
|
|
|
|
Arguments *string `db:"arguments" json:"arguments"`
|
2016-04-17 02:20:23 +02:00
|
|
|
|
2016-06-26 00:43:59 +02:00
|
|
|
UserID *int `db:"user_id" json:"user_id"`
|
|
|
|
|
2016-04-17 02:20:23 +02:00
|
|
|
Created time.Time `db:"created" json:"created"`
|
|
|
|
Start *time.Time `db:"start" json:"start"`
|
|
|
|
End *time.Time `db:"end" json:"end"`
|
2016-04-04 15:44:34 +02:00
|
|
|
}
|
|
|
|
|
2021-06-24 19:45:28 +02:00
|
|
|
// TaskWithTpl is the task data with additional fields
|
2021-03-12 18:41:41 +01:00
|
|
|
type TaskWithTpl struct {
|
|
|
|
Task
|
|
|
|
TemplatePlaybook string `db:"tpl_playbook" json:"tpl_playbook"`
|
|
|
|
TemplateAlias string `db:"tpl_alias" json:"tpl_alias"`
|
|
|
|
UserName *string `db:"user_name" json:"user_name"`
|
|
|
|
}
|
|
|
|
|
2018-03-27 22:12:47 +02:00
|
|
|
// TaskOutput is the ansible log output from the task
|
2016-04-04 15:44:34 +02:00
|
|
|
type TaskOutput struct {
|
|
|
|
TaskID int `db:"task_id" json:"task_id"`
|
2016-04-17 20:01:51 +02:00
|
|
|
Task string `db:"task" json:"task"`
|
2016-04-04 15:44:34 +02:00
|
|
|
Time time.Time `db:"time" json:"time"`
|
|
|
|
Output string `db:"output" json:"output"`
|
|
|
|
}
|