workflows

package
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: Apache-2.0 Imports: 44 Imported by: 3

Documentation

Index

Constants

View Source
const (
	MasterTask       = "master"
	NodeTask         = "node"
	ClusterTask      = "cluster"
	PreProvisionTask = "preprovision"
	ImportTask       = "import"
)
View Source
const (
	Prefix = "tasks"

	PostProvision   = "PostProvision"
	PreProvision    = "PreProvision"
	ProvisionMaster = "ProvisionMaster"
	ProvisionNode   = "ProvisionNode"
	DeleteNode      = "DeleteNode"
	DeleteCluster   = "DeleteCluster"
	ImportCluster   = "ImportCluster"
)

Variables

This section is empty.

Functions

func Init

func Init()

func RegisterWorkFlow

func RegisterWorkFlow(workflowName string, workflow Workflow)

Types

type BuildTaskRequest

type BuildTaskRequest struct {
	StepNames []string     `json:"stepNames"`
	Cfg       steps.Config `json:"config"`
	SshConfig ssh.Config   `json:"sshConfig"`
}

type RunTaskRequest

type RunTaskRequest struct {
	WorkflowName string       `json:"workflowName"`
	Cfg          steps.Config `json:"config"`
}

type StepStatus

type StepStatus struct {
	Status   statuses.Status `json:"status"`
	StepName string          `json:"stepName"`
	ErrMsg   string          `json:"errorMessage"`
}

StepStatus aggregates data that is needed to track progress of step to persistent storage.

type Task

type Task struct {
	ID           string          `json:"id"`
	Type         string          `json:"type"`
	Config       *steps.Config   `json:"config"`
	Status       statuses.Status `json:"status"`
	StepStatuses []StepStatus    `json:"stepsStatuses"`
	// contains filtered or unexported fields
}

Task is an entity that has it own state that can be tracked and written to persistent storage through repository, it executes particular workflow of steps.

func DeserializeTask

func DeserializeTask(data []byte, repository storage.Interface) (*Task, error)

func NewTask

func NewTask(config *steps.Config, taskType string, repository storage.Interface) (*Task, error)

func (*Task) Run

func (t *Task) Run(ctx context.Context, config steps.Config, out io.WriteCloser) chan error

Run executes all steps of workflow and tracks the progress in persistent storage

type TaskHandler

type TaskHandler struct {
	// contains filtered or unexported fields
}

func NewTaskHandler

func NewTaskHandler(repository storage.Interface, runnerFactory func(config ssh.Config) (runner.Runner, error), getter cloudAccountGetter) *TaskHandler

func (*TaskHandler) GetLogs

func (h *TaskHandler) GetLogs(w http.ResponseWriter, r *http.Request)

NOTE(stgleb): This is made for testing purposes and example, remove when UI is done.

func (*TaskHandler) GetTask

func (h *TaskHandler) GetTask(w http.ResponseWriter, r *http.Request)

func (*TaskHandler) Register

func (h *TaskHandler) Register(m *mux.Router)

func (*TaskHandler) RestartTask

func (h *TaskHandler) RestartTask(w http.ResponseWriter, r *http.Request)

func (*TaskHandler) StreamLogs

func (h *TaskHandler) StreamLogs(w http.ResponseWriter, r *http.Request)

type TaskResponse

type TaskResponse struct {
	ID string `json:"id"`
}

type TaskType

type TaskType string

type Workflow

type Workflow []steps.Step

Workflow is a template for doing some actions

func GetWorkflow

func GetWorkflow(workflowName string) Workflow

type WorkflowSet

type WorkflowSet struct {
	PreProvision    string
	ProvisionMaster string
	ProvisionNode   string
	DeleteNode      string
	DeleteCluster   string
}

Jump to

Keyboard shortcuts

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