api

package
v1.0.25 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace = "AWS/ECS"
	CPU       = "CPUUtilization"
	Memory    = "MemoryUtilization"
)
View Source
const (
	MaxTaskDefinitionFamily   = 50
	MaxTaskDefinitionRevision = 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoScalingData

type AutoScalingData struct {
	Targets    []types.ScalableTarget
	Policies   []types.ScalingPolicy
	Actions    []types.ScheduledAction
	Activities []types.ScalingActivity
}

type FullTaskDefinition

type FullTaskDefinition = map[string][]string

type MetricsData

type MetricsData struct {
	CPUUtilization    []types.Datapoint
	MemoryUtilization []types.Datapoint
}

type SsmStartSessionInput added in v1.0.25

type SsmStartSessionInput struct {
	ClusterName string
	TaskId      string
	RuntimeId   string
	RemoteHost  bool
	Host        string
	Port        string
	LocalPort   string
}

type Store

type Store struct {
	*aws.Config
	// contains filtered or unexported fields
}

func NewStore

func NewStore(logr *logrus.Logger) (*Store, error)

func (*Store) DescribeTaskDefinition

func (store *Store) DescribeTaskDefinition(tdArn *string) (types.TaskDefinition, error)

Equivalent to aws ecs describe-task-definition --task-definition ${taskDefinition}

func (*Store) GetAutoscaling added in v1.0.7

func (store *Store) GetAutoscaling(serviceArn *string) (*AutoScalingData, error)

func (*Store) GetLogs added in v1.0.11

func (store *Store) GetLogs(tdArn *string) ([]cloudwatchlogsTypes.OutputLogEvent, error)

Get the latest 10 log events from the log stream

aws logs get-log-events \
  --log-group-name "$log_group" \
  --log-stream-name "$latest_log_stream" \
  --limit 10 \
  --query "events[*].[timestamp,message]" \
  --output table

func (*Store) GetMetrics

func (store *Store) GetMetrics(cluster, service *string) (*MetricsData, error)

Get ECS service metrics(CPU, Memory)

func (*Store) ListClusters

func (store *Store) ListClusters() ([]types.Cluster, error)

Equivalent to aws ecs list-clusters aws ecs describe-clusters --clusters ${clusters}

func (*Store) ListFullTaskDefinition

func (store *Store) ListFullTaskDefinition() (FullTaskDefinition, error)

Deprecated List all task definition family with revisions for service update form(not support yet)

func (*Store) ListServices

func (store *Store) ListServices(clusterName *string) ([]types.Service, error)

Equivalent to aws ecs list-services --cluster ${cluster} aws ecs describe-services --cluster ${cluster} --services ${service}

func (*Store) ListTaskDefinition

func (store *Store) ListTaskDefinition(name *string) (TaskDefinitionRevision, error)

Equivalent to aws ecs list-task-definitions --family-prefix ${prefix}

func (*Store) ListTaskDefinitionFamilies added in v1.0.2

func (store *Store) ListTaskDefinitionFamilies() ([]string, error)

Equivalent to aws ecs list-task-definition-families

func (*Store) ListTasks

func (store *Store) ListTasks(clusterName, serviceName *string) ([]types.Task, error)

Equivalent to aws ecs list-tasks --cluster ${cluster} --service ${service} aws ecs describe-tasks --cluster ${cluster} --tasks ${taskID}

func (*Store) RegisterTaskDefinition added in v1.0.2

func (store *Store) RegisterTaskDefinition(input *ecs.RegisterTaskDefinitionInput) (string, int32, error)

aws ecs register-task-definition --family ${{family}} --... return registered task definition revision

func (*Store) StartSession added in v1.0.25

func (store *Store) StartSession(input *SsmStartSessionInput) (string, error)

Equivalent to aws ssm start-session --target ecs:${cluster_id}_${task_id}_${runtime_id} --document-name AWS-StartPortForwardingSession --parameters {"portNumber":["${port}"], "localPortNumber":["${local_port}"]} OR aws ssm start-session --target ecs:${cluster_id}_${task_id}_${runtime_id} --document-name AWS-StartPortForwardingSession --parameters {"portNumber":["${port}"], "localPortNumber":["${local_port}"]}

func (*Store) TerminateSessions added in v1.0.25

func (store *Store) TerminateSessions(sessionIds []*string) error

func (*Store) UpdateService

func (store *Store) UpdateService(input *ecs.UpdateServiceInput) (*types.Service, error)

Equivalent to aws ecs update-service --cluster ${cluster} --service ${service} --task-definition ${task-definition} --desired-count ${count} --force-new-deployment

type TaskDefinitionRevision

type TaskDefinitionRevision = []string

Jump to

Keyboard shortcuts

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