awsecs

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: May 8, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSEcs

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

AWSEcs serves the ECS related functions

func NewAWSEcs

func NewAWSEcs(sess *session.Session) *AWSEcs

NewAWSEcs creates a new AWSEcs instance

func (*AWSEcs) CreateCluster

func (s *AWSEcs) CreateCluster(ctx context.Context, cluster string) error

CreateCluster creates an ECS cluster

func (*AWSEcs) CreateService

func (s *AWSEcs) CreateService(ctx context.Context, opts *containersvc.CreateServiceOptions) error

CreateService creates a ECS service

func (*AWSEcs) CreateServiceVolume added in v0.9.3

func (s *AWSEcs) CreateServiceVolume(ctx context.Context, service string, memberName string, volumeID string, volumeSizeGB int64, journal bool) (existingVolumeID string, err error)

CreateServiceVolume is a non-op for ecs.

func (*AWSEcs) DeleteCluster

func (s *AWSEcs) DeleteCluster(ctx context.Context, cluster string) error

DeleteCluster deletes the ECS cluster

func (*AWSEcs) DeleteService

func (s *AWSEcs) DeleteService(ctx context.Context, cluster string, service string) error

DeleteService deletes the ECS service and TaskDefinition

func (*AWSEcs) DeleteServiceVolume added in v0.9.3

func (s *AWSEcs) DeleteServiceVolume(ctx context.Context, service string, memberName string, journal bool) error

DeleteServiceVolume is a non-op for ecs.

func (*AWSEcs) DeleteTask

func (s *AWSEcs) DeleteTask(ctx context.Context, cluster string, service string, taskType string) error

DeleteTask deletes the task definition

func (*AWSEcs) DeregisterContainerInstance

func (s *AWSEcs) DeregisterContainerInstance(ctx context.Context, cluster string, instance string) error

DeregisterContainerInstance deregisters the container instance from ECS cluster

func (*AWSEcs) GetContainerSvcType added in v0.9.3

func (s *AWSEcs) GetContainerSvcType() string

GetContainerSvcType gets the containersvc type.

func (*AWSEcs) GetServiceStatus

func (s *AWSEcs) GetServiceStatus(ctx context.Context, cluster string, service string) (*common.ServiceStatus, error)

GetServiceStatus returns the ServiceStatus.

func (*AWSEcs) GetServiceTask

func (s *AWSEcs) GetServiceTask(ctx context.Context, cluster string, service string, containerInstanceID string) (taskID string, err error)

GetServiceTask gets the task running on the containerInstanceID

func (*AWSEcs) GetTaskContainerInstance

func (s *AWSEcs) GetTaskContainerInstance(ctx context.Context, cluster string, taskArn string) (containerInstanceArn string, err error)

GetTaskContainerInstance returns the ContainerInstanceArn the task runs on

func (*AWSEcs) GetTaskStatus

func (s *AWSEcs) GetTaskStatus(ctx context.Context, cluster string, taskArn string) (*common.TaskStatus, error)

GetTaskStatus returns the task's status.

func (*AWSEcs) IsClusterExist

func (s *AWSEcs) IsClusterExist(ctx context.Context, cluster string) (bool, error)

IsClusterExist checks whether the cluster exists.

func (*AWSEcs) IsServiceExist

func (s *AWSEcs) IsServiceExist(ctx context.Context, cluster string, service string) (bool, error)

IsServiceExist checks whether the service exists.

func (*AWSEcs) ListActiveServiceTasks

func (s *AWSEcs) ListActiveServiceTasks(ctx context.Context, cluster string, service string) (taskIDs map[string]bool, err error)

ListActiveServiceTasks lists all running and pending tasks of the service

func (*AWSEcs) ListActiveServiceTasksWithLimit

func (s *AWSEcs) ListActiveServiceTasksWithLimit(ctx context.Context, cluster string, service string, limit int64) (taskIDs map[string]bool, err error)

ListActiveServiceTasksWithLimit lists all tasks of the service by pagination, called by unit test only.

func (*AWSEcs) RollingRestartService added in v0.9.4

func (s *AWSEcs) RollingRestartService(ctx context.Context, cluster string, service string, opts *containersvc.RollingRestartOptions) error

RollingRestartService restarts the service task one after the other.

func (*AWSEcs) RunTask

func (s *AWSEcs) RunTask(ctx context.Context, opts *containersvc.RunTaskOptions) (taskID string, err error)

RunTask starts a new task. ECS limits "startedBy" up to 36 letters.

func (*AWSEcs) ScaleService added in v0.9.2

func (s *AWSEcs) ScaleService(ctx context.Context, cluster string, service string, desiredCount int64) error

ScaleService scales the service containers up/down to the desiredCount.

func (*AWSEcs) StopService

func (s *AWSEcs) StopService(ctx context.Context, cluster string, service string) error

StopService stops all service containers

func (*AWSEcs) UpdateService added in v0.9.5

func (s *AWSEcs) UpdateService(ctx context.Context, opts *containersvc.UpdateServiceOptions) error

UpdateService updates the service

func (*AWSEcs) WaitServiceRunning

func (s *AWSEcs) WaitServiceRunning(ctx context.Context, cluster string, service string, replicas int64, maxWaitSeconds int64) error

WaitServiceRunning waits till all service containers are running or maxWaitSeconds reaches.

func (*AWSEcs) WaitTaskComplete

func (s *AWSEcs) WaitTaskComplete(ctx context.Context, cluster string, taskArn string, maxWaitSeconds int64) error

WaitTaskComplete waits till the task successfully completes.

type EcsInfo

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

func NewEcsInfo

func NewEcsInfo() (*EcsInfo, error)

func (*EcsInfo) GetContainerClusterID

func (s *EcsInfo) GetContainerClusterID() string

func (*EcsInfo) GetLocalContainerInstanceID

func (s *EcsInfo) GetLocalContainerInstanceID() string

Jump to

Keyboard shortcuts

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