launcher

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TaskRunning task failed
	TaskRunning = "RUNNING"
	// TaskFailed task failed
	TaskFailed = "FAILED"
	// TaskStopped task stopped
	TaskStopped = "STOPPED"
	// TaskSucceeded task succeeded
	TaskSucceeded = "SUCCEEDED"
)

Variables

View Source
var (
	// ErrMissingParams missing the params required by the ecs launch
	ErrMissingParams = errors.New("service params are missing from Definition, configure either ECS or Codebuild")
	// ErrInvalidParams either missing or configured more than service one parameters entry
	ErrInvalidParams = errors.New("Requires only one service parameters entry, ecs or codebuild")
)

Functions

This section is empty.

Types

type BaseTaskResult

type BaseTaskResult struct {
	ECS        *LaunchTaskECSResult
	CodeBuild  *LaunchTaskCodebuildResult
	ID         string
	TaskStatus string
	StartTime  *time.Time
	EndTime    *time.Time
}

BaseTaskResult common base task result

func (*BaseTaskResult) Valid

func (rt *BaseTaskResult) Valid() error

Valid validate input structure of run task params

type CleanupTaskParams

type CleanupTaskParams struct {
	ECS       *ECSCleanupTaskParams       `json:"ecs,omitempty"`
	Codebuild *CodebuildCleanupTaskParams `json:"codebuild,omitempty"`
}

CleanupTaskParams cleanup definition params

func (*CleanupTaskParams) Valid

func (ct *CleanupTaskParams) Valid() error

Valid validate input structure of definition params

type CleanupTaskResult

type CleanupTaskResult struct {
}

CleanupTaskResult cleanup definition result

type CodebuildCleanupTaskParams

type CodebuildCleanupTaskParams struct {
	ProjectName string `json:"project_name,omitempty" jsonschema:"required"`
}

CodebuildCleanupTaskParams cleanup definition params for codebuild

type CodebuildDefineAndLaunchParams

type CodebuildDefineAndLaunchParams struct {
	ProjectName    string  `json:"project_name,omitempty" jsonschema:"required"`
	ComputeType    string  `json:"compute_type,omitempty" jsonschema:"required"`
	PrivilegedMode *bool   `json:"privileged_mode,omitempty"`
	Buildspec      string  `json:"buildspec,omitempty" jsonschema:"required"`
	ServiceRole    string  `json:"service_role,omitempty" jsonschema:"required"`
	Image          *string `json:"image,omitempty"`
}

CodebuildDefineAndLaunchParams define and launch parameters for Codebuild

type CodebuildDefineTaskParams

type CodebuildDefineTaskParams struct {
	ProjectName    string `json:"project_name,omitempty" jsonschema:"required"`
	ComputeType    string `json:"compute_type,omitempty" jsonschema:"required"`
	PrivilegedMode *bool  `json:"privileged_mode,omitempty"`
	Buildspec      string `json:"buildspec,omitempty" jsonschema:"required"`
	ServiceRole    string `json:"service_role,omitempty" jsonschema:"required"`
}

CodebuildDefineTaskParams Codebuild related definition parameters

type CodebuildTaskLogsParams

type CodebuildTaskLogsParams struct {
	ProjectName string `json:"project_name,omitempty" jsonschema:"required"`
	TaskID      string `json:"task_id,omitempty" jsonschema:"required"`
}

CodebuildTaskLogsParams logs params for codebuild

type CodebuildTaskParams

type CodebuildTaskParams struct {
	ProjectName    string  `json:"project_name,omitempty" jsonschema:"required"`
	ComputeType    *string `json:"compute_type,omitempty"`
	PrivilegedMode *bool   `json:"privileged_mode,omitempty"`
	Image          *string `json:"image,omitempty"`
	ServiceRole    *string `json:"service_role,omitempty"`
}

CodebuildTaskParams Codebuild related run task parameters

type DefineAndLaunchParams

type DefineAndLaunchParams struct {
	ECS         *ECSDefineAndLaunchParams       `json:"ecs,omitempty"`
	Codebuild   *CodebuildDefineAndLaunchParams `json:"codebuild,omitempty"`
	Region      string                          `json:"region,omitempty" jsonschema:"required"`
	TaskRoleARN *string                         `json:"task_role_arn,omitempty"` // optional
	Image       string                          `json:"image,omitempty" jsonschema:"required"`
	Environment map[string]string               `json:"environment,omitempty"`
	Tags        map[string]string               `json:"tags,omitempty"`
}

DefineAndLaunchParams define and launch parameters

func (*DefineAndLaunchParams) BuildDefineTask

func (dlp *DefineAndLaunchParams) BuildDefineTask() *DefineTaskParams

BuildDefineTask build a define task params

func (*DefineAndLaunchParams) BuildLaunchTask

func (dlp *DefineAndLaunchParams) BuildLaunchTask(definitionID string) *LaunchTaskParams

BuildLaunchTask build a launch task params

func (*DefineAndLaunchParams) Valid

func (dlp *DefineAndLaunchParams) Valid() error

Valid validate input structure of define and launch task params

type DefineAndLaunchResult

type DefineAndLaunchResult struct {
	*BaseTaskResult
	CloudwatchLogGroupName string `json:"cloudwatch_log_group_name,omitempty"`
	CloudwatchStreamPrefix string `json:"cloudwatch_stream_prefix,omitempty"`
	DefinitionID           string `json:"definition_id,omitempty"`
}

DefineAndLaunchResult define and launch result

type DefineTaskParams

type DefineTaskParams struct {
	ECS         *ECSDefineTaskParams       `json:"ecs,omitempty"`
	Codebuild   *CodebuildDefineTaskParams `json:"codebuild,omitempty"`
	Region      string                     `json:"region,omitempty" jsonschema:"required"`
	TaskRoleARN *string                    `json:"task_role_arn,omitempty"` // optional
	Image       string                     `json:"image,omitempty" jsonschema:"required"`
	Environment map[string]string          `json:"environment,omitempty"`
	Tags        map[string]string          `json:"tags,omitempty"`
}

DefineTaskParams parameters used to build a container execution environment

func (*DefineTaskParams) Valid

func (dt *DefineTaskParams) Valid() error

Valid validate input structure of definition params

type DefineTaskResult

type DefineTaskResult struct {
	ID                     string `json:"id,omitempty"`
	CloudwatchLogGroupName string `json:"cloudwatch_log_group_name,omitempty"`
	CloudwatchStreamPrefix string `json:"cloudwatch_stream_prefix,omitempty"`
}

DefineTaskResult the results from create definition

type ECSCleanupTaskParams

type ECSCleanupTaskParams struct {
	TaskDefinition string `json:"task_definition,omitempty" jsonschema:"required"`
}

ECSCleanupTaskParams cleanup definition params for ecs

type ECSDefineAndLaunchParams

type ECSDefineAndLaunchParams struct {
	DefinitionName   string   `json:"definition_name,omitempty" jsonschema:"required"`
	ClusterName      string   `json:"cluster_name,omitempty" jsonschema:"required"`
	CPU              int64    `json:"cpu,omitempty" jsonschema:"required"`
	Memory           int64    `json:"memory,omitempty" jsonschema:"required"`
	Subnets          []string `json:"subnets,omitempty" jsonschema:"required"`
	ExecutionRoleARN string   `json:"execution_role_arn,omitempty" jsonschema:"required"`
}

ECSDefineAndLaunchParams define and launch parameters for ecs

type ECSDefineTaskParams

type ECSDefineTaskParams struct {
	ExecutionRoleARN string `json:"execution_role_arn,omitempty" jsonschema:"required"`
	DefinitionName   string `json:"definition_name,omitempty" jsonschema:"required"`
	ContainerName    string `json:"container_name,omitempty" jsonschema:"required"`
}

ECSDefineTaskParams ECS related definition parameters

type ECSTaskLogsParams

type ECSTaskLogsParams struct {
	DefinitionName string `json:"definition_name,omitempty" jsonschema:"required"`
	TaskARN        string `json:"task_arn,omitempty" jsonschema:"required"`
}

ECSTaskLogsParams logs params for ecs

type ECSTaskParams

type ECSTaskParams struct {
	ClusterName    string   `json:"cluster_name,omitempty" jsonschema:"required"`
	ServiceName    string   `json:"service_name,omitempty" jsonschema:"required"`
	ContainerName  string   `json:"container_name,omitempty" jsonschema:"required"`
	TaskDefinition string   `json:"task_definition,omitempty" jsonschema:"required"`
	CPU            int64    `json:"cpu,omitempty" jsonschema:"required"`
	Memory         int64    `json:"memory,omitempty" jsonschema:"required"`
	Subnets        []string `json:"subnets,omitempty" jsonschema:"required"`
}

ECSTaskParams ECS related run task parameters

type GetTaskLogsParams

type GetTaskLogsParams struct {
	ECS       *ECSTaskLogsParams       `json:"ecs,omitempty"`
	Codebuild *CodebuildTaskLogsParams `json:"codebuild,omitempty"`
	NextToken *string                  `json:"next_token,omitempty"`
}

GetTaskLogsParams get logs task params

func (*GetTaskLogsParams) Valid

func (gt *GetTaskLogsParams) Valid() error

Valid validate input structure of logs params

type GetTaskLogsResult

type GetTaskLogsResult struct {
	LogLines  []*cwlogs.LogLine `json:"log_lines,omitempty"`
	NextToken *string           `json:"next_token,omitempty"`
}

GetTaskLogsResult get logs task result

type GetTaskStatusParams

type GetTaskStatusParams struct {
	ID        string
	ECS       *ECSTaskParams
	Codebuild *CodebuildTaskParams
}

GetTaskStatusParams get status task parameters

type GetTaskStatusResult

type GetTaskStatusResult struct {
	*BaseTaskResult
}

GetTaskStatusResult get status task result

type LaunchTaskCodebuildResult

type LaunchTaskCodebuildResult struct {
	BuildArn    string
	BuildStatus string
}

LaunchTaskCodebuildResult codebuild related result information

type LaunchTaskECSResult

type LaunchTaskECSResult struct {
	TaskArn string
	TaskID  string
}

LaunchTaskECSResult ecs related result information

type LaunchTaskParams

type LaunchTaskParams struct {
	ECS         *ECSTaskParams       `json:"ecs,omitempty"`
	Codebuild   *CodebuildTaskParams `json:"codebuild,omitempty"`
	Environment map[string]string    `json:"environment,omitempty"`
	Tags        map[string]string    `json:"tags,omitempty"`
}

LaunchTaskParams used to launch container based tasks

func (*LaunchTaskParams) Valid

func (lt *LaunchTaskParams) Valid() error

Valid validate input structure of run task params

type LaunchTaskResult

type LaunchTaskResult struct {
	*BaseTaskResult
}

LaunchTaskResult summarsied result of the launched task

type Launcher

Launcher build the definition, then launch a container based task

type WaitForTaskParams

type WaitForTaskParams struct {
	ID        string
	ECS       *ECSTaskParams       `json:"ecs,omitempty"`
	Codebuild *CodebuildTaskParams `json:"codebuild,omitempty"`
}

WaitForTaskParams wait for task parameters

type WaitForTaskResult

type WaitForTaskResult struct {
	ID string
}

WaitForTaskResult wait for task parameters

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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