ecs

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package ecs provides a client to make API requests to Amazon Elastic Container Service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ECS added in v0.0.8

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

ECS wraps an AWS ECS client.

func New

func New(s *session.Session) *ECS

New returns a Service configured against the input session.

func (*ECS) Service added in v0.0.8

func (e *ECS) Service(clusterName, serviceName string) (*Service, error)

Service calls ECS API and returns the specified service running in the cluster.

func (*ECS) ServiceTasks added in v0.0.8

func (e *ECS) ServiceTasks(clusterName, serviceName string) ([]*Task, error)

ServiceTasks calls ECS API and returns ECS tasks running in the cluster.

func (*ECS) TaskDefinition added in v0.0.8

func (e *ECS) TaskDefinition(taskDefName string) (*TaskDefinition, error)

TaskDefinition calls ECS API and returns the task definition.

type Image added in v0.0.8

type Image struct {
	ID     string
	Digest string
}

Image contains very basic info of a container image.

type Service

type Service ecs.Service

Service wraps up ECS Service struct.

func (*Service) ServiceStatus added in v0.0.8

func (s *Service) ServiceStatus() ServiceStatus

ServiceStatus returns the status of the running service.

type ServiceArn added in v0.0.8

type ServiceArn string

ServiceArn is the arn of an ECS service.

func (*ServiceArn) ClusterName added in v0.0.8

func (s *ServiceArn) ClusterName() (string, error)

ClusterName returns the cluster name. For example: arn:aws:ecs:us-west-2:1234567890:service/my-project-test-Cluster-9F7Y0RLP60R7/my-project-test-my-app-Service-JSOH5GYBFAIB will return my-project-test-Cluster-9F7Y0RLP60R7

func (*ServiceArn) ServiceName added in v0.0.8

func (s *ServiceArn) ServiceName() (string, error)

ServiceName returns the service name. For example: arn:aws:ecs:us-west-2:1234567890:service/my-project-test-Cluster-9F7Y0RLP60R7/my-project-test-my-app-Service-JSOH5GYBFAIB will return my-project-test-my-app-Service-JSOH5GYBFAIB

type ServiceStatus added in v0.0.8

type ServiceStatus struct {
	DesiredCount     int64  `json:"desiredCount"`
	RunningCount     int64  `json:"runningCount"`
	Status           string `json:"status"`
	LastDeploymentAt int64  `json:"lastDeploymentAt"`
	TaskDefinition   string `json:"taskDefinition"`
}

ServiceStatus contains the status info of a service.

type Task added in v0.0.8

type Task ecs.Task

Task wraps up ECS Task struct.

func (*Task) TaskStatus added in v0.0.8

func (t *Task) TaskStatus() (*TaskStatus, error)

TaskStatus returns the status of the running task.

type TaskDefinition

type TaskDefinition ecs.TaskDefinition

TaskDefinition wraps up ECS TaskDefinition struct.

func (*TaskDefinition) EnvironmentVariables

func (t *TaskDefinition) EnvironmentVariables() map[string]string

EnvironmentVariables returns environment variables of the task definition.

type TaskStatus added in v0.0.8

type TaskStatus struct {
	Health        string  `json:"health"`
	ID            string  `json:"id"`
	Images        []Image `json:"images"`
	LastStatus    string  `json:"lastStatus"`
	StartedAt     int64   `json:"startedAt"`
	StoppedAt     int64   `json:"stoppedAt"`
	StoppedReason string  `json:"stoppedReason"`
}

TaskStatus contains the status info of a task.

func (TaskStatus) HumanString added in v0.0.8

func (t TaskStatus) HumanString() string

HumanString returns the stringified TaskStatus struct with human readable format. Example output:

6ca7a60d          f884127d            RUNNING             UNKNOWN             19 hours ago        -

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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