Documentation
¶
Index ¶
- Constants
- type AutoScalingData
- type MetricsData
- type SsmStartSessionInput
- type Store
- func (store *Store) DescribeTaskDefinition(tdArn *string) (types.TaskDefinition, error)
- func (store *Store) GetAutoscaling(serviceArn *string) (*AutoScalingData, error)
- func (store *Store) GetLogStreamLogs(tdArn *string, taskId string, containerName string) ([]string, error)
- func (store *Store) GetMetrics(cluster, service *string) (*MetricsData, error)
- func (store *Store) GetServiceLogs(tdArn *string) ([]string, error)
- func (store *Store) GetServiceRevision(serviceRevisionArn *string) (*types.ServiceRevision, error)
- func (store *Store) GetTaskInstanceId(cluster, containerInstance *string) (string, error)
- func (store *Store) ListClusters() ([]types.Cluster, error)
- func (store *Store) ListContainerInstances(cluster *string) ([]types.ContainerInstance, error)
- func (store *Store) ListFullTaskDefinition(taskDefinition *string) ([]types.TaskDefinition, error)
- func (store *Store) ListServiceDeployments(cluster, service *string) ([]types.ServiceDeployment, error)
- func (store *Store) ListServices(clusterName *string) ([]types.Service, error)
- func (store *Store) ListTaskDefinition(familyName *string) (TaskDefinitionRevision, error)
- func (store *Store) ListTaskDefinitionFamilies() ([]string, error)
- func (store *Store) ListTasks(clusterName, serviceName *string, status types.DesiredStatus) ([]types.Task, bool, error)
- func (store *Store) RegisterTaskDefinition(input *ecs.RegisterTaskDefinitionInput) (string, int32, error)
- func (store *Store) StartSession(input *SsmStartSessionInput) (*string, error)
- func (store *Store) StopTask(input *ecs.StopTaskInput) error
- func (store *Store) TerminateSessions(sessionIds []*string) error
- func (store *Store) UpdateService(input *ecs.UpdateServiceInput) (*types.Service, error)
- type TaskDefinitionRevision
Constants ¶
const ( Namespace = "AWS/ECS" CPU = "CPUUtilization" Memory = "MemoryUtilization" )
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 MetricsData ¶
type SsmStartSessionInput ¶
type Store ¶
type Store struct { *aws.Config Region string Profile string // contains filtered or unexported fields }
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 ¶
func (store *Store) GetAutoscaling(serviceArn *string) (*AutoScalingData, error)
func (*Store) GetLogStreamLogs ¶ added in v1.0.39
func (store *Store) GetLogStreamLogs(tdArn *string, taskId string, containerName string) ([]string, error)
Get the 50 log events for each container Equivalent to
aws logs get-log-events \ --log-group-name "$log_group" \ --log-stream-name "$stream_prefix/$container_name/$task_id" \ --limit 50 \ --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) GetServiceLogs ¶ added in v1.0.39
Get the latest 100 log events from the log stream ¶
aws logs get-log-events \ --log-group-name "$log_group" \ --log-stream-name "$latest_log_stream" \ --limit 100 \ --query "events[*].[timestamp,message]" \ --output table
func (*Store) GetServiceRevision ¶ added in v1.0.44
func (store *Store) GetServiceRevision(serviceRevisionArn *string) (*types.ServiceRevision, error)
Equivalent to aws ecs describe-service-revisions --service-revision-arns ${arn1}
func (*Store) GetTaskInstanceId ¶ added in v1.0.45
aws ecs describe-container-instances --cluster ${cluster} --container-instances ${instanceId}
func (*Store) ListClusters ¶
Equivalent to aws ecs list-clusters aws ecs describe-clusters --clusters ${clusters}
func (*Store) ListContainerInstances ¶ added in v1.0.45
func (store *Store) ListContainerInstances(cluster *string) ([]types.ContainerInstance, error)
ListContainerInstances gets container instances in an ECS cluster Equivalent to: aws ecs list-container-instances --cluster ${cluster} aws ecs describe-container-instances --cluster ${cluster} --container-instances ${instance1} ${instance2}
func (*Store) ListFullTaskDefinition ¶
func (store *Store) ListFullTaskDefinition(taskDefinition *string) ([]types.TaskDefinition, error)
List given task definition revision with contents Equivalent to aws ecs list-task-definitions --family-prefix ${prefix} aws ecs describe-task-definition --task-definition ${taskDefinition}
func (*Store) ListServiceDeployments ¶ added in v1.0.43
func (store *Store) ListServiceDeployments(cluster, service *string) ([]types.ServiceDeployment, error)
Equivalent to aws ecs list-service-deployments --cluster ${cluster} --service ${service} aws ecs describe-service-deployments --service-deployment-arns ${arn1} ${arn2}
func (*Store) ListServices ¶
Equivalent to aws ecs list-services --cluster ${cluster} aws ecs describe-services --cluster ${cluster} --services ${service}
func (*Store) ListTaskDefinition ¶
func (store *Store) ListTaskDefinition(familyName *string) (TaskDefinitionRevision, error)
Equivalent to aws ecs list-task-definitions --family-prefix ${prefix}
func (*Store) ListTaskDefinitionFamilies ¶
Equivalent to aws ecs list-task-definition-families
func (*Store) ListTasks ¶
func (store *Store) ListTasks(clusterName, serviceName *string, status types.DesiredStatus) ([]types.Task, bool, error)
Equivalent to aws ecs list-tasks --cluster ${cluster} --service ${service} OR aws ecs list-tasks --cluster ${cluster} aws ecs describe-tasks --cluster ${cluster} --tasks ${taskID} OR aws ecs list-tasks --cluster ${cluster} --desired-status STOPPED `aws ecs list-tasks --cluster ${CLUSTER} --service-name ${SERVICE} --desired-status STOPPED` return nothing `aws ecs list-tasks --cluster ${CLUSTER} --desired-status STOPPED` return all stopped tasks in cluster
func (*Store) RegisterTaskDefinition ¶
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 ¶
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) StopTask ¶ added in v1.0.32
func (store *Store) StopTask(input *ecs.StopTaskInput) error
aws ecs stop-task --cluster ${cluster} --task ${taskId}
func (*Store) TerminateSessions ¶
func (*Store) UpdateService ¶
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