Documentation ¶
Index ¶
- type ECSClient
- func (e *ECSClient) CleanupTaskDefinitions() error
- func (e *ECSClient) CollectClusters() ([]string, error)
- func (e *ECSClient) CollectServices(clusterARNs []string) (map[string][]string, error)
- func (e *ECSClient) CollectTaskDefinitions() ([]string, error)
- func (e *ECSClient) ConfigureSession() error
- func (e *ECSClient) DeregisterTaskDefinitions(taskDefinitionARNs []string) error
- func (e *ECSClient) DescribeServices(serviceARNsByClusterARN map[string][]string) ([]ecs.Service, error)
- func (e *ECSClient) FilterTaskDefinitions(allTaskDefinitionARNs []string, ecsServices []ecs.Service) ([]string, error)
- type ECSSvc
- type FailedDeregistration
- type Flags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ECSClient ¶
ECSClient is the object through which the `ecs-task` command interacts with AWS.
func NewECSClient ¶
func NewECSClient() *ECSClient
NewECSClient creates an ECSClient and returns a pointer to it.
func (*ECSClient) CleanupTaskDefinitions ¶
CleanupTaskDefinitions defines the overarching logic workflow for cleaning up task definitions.
func (*ECSClient) CollectClusters ¶
CollectClusters gathers the ARNs of all the clusters for the configured account and region.
func (*ECSClient) CollectServices ¶
CollectServices gathers the ARNs of all the services associated with the clusters that are passed in for the configured account and region.
func (*ECSClient) CollectTaskDefinitions ¶
CollectTaskDefinitions gathers the ARNs of all the task definitions for the configured account and region.
func (*ECSClient) ConfigureSession ¶
ConfigureSession configures and instantiates an `ecs.ECS` object into the ECSClient's `Svc` field. This `ecs.ECS` object satisfies the `ECSSvc` interface defined in this package.
func (*ECSClient) DeregisterTaskDefinitions ¶
DeregisterTaskDefinitions creates a stack of ARNs and handles calling ecs.DeregisterTaskDefinition() for all these ARNs.
func (*ECSClient) DescribeServices ¶
func (e *ECSClient) DescribeServices(serviceARNsByClusterARN map[string][]string) ([]ecs.Service, error)
DescribeServices compiles a list of `ecs.Service` objects given a map of cluster ARNs to lists of service ARNs associated with each cluster. Most importantly, these `ecs.Service` objects contain the ARNs of the task definitions currently in use by the services.
func (*ECSClient) FilterTaskDefinitions ¶
func (e *ECSClient) FilterTaskDefinitions(allTaskDefinitionARNs []string, ecsServices []ecs.Service) ([]string, error)
FilterTaskDefinitions takes a master list of task definition ARNs and returns a version of that list from which has been removed:
- All task definitions curently in use by a service.
- All task definitions which are among the `n`-most-recently-used task definitions for each family. `n` is configured via the `--cutoff` flag.
type ECSSvc ¶
type ECSSvc interface { DescribeServices(*ecs.DescribeServicesInput) (*ecs.DescribeServicesOutput, error) DeregisterTaskDefinition(*ecs.DeregisterTaskDefinitionInput) (*ecs.DeregisterTaskDefinitionOutput, error) ListClusters(*ecs.ListClustersInput) (*ecs.ListClustersOutput, error) ListServices(*ecs.ListServicesInput) (*ecs.ListServicesOutput, error) ListTaskDefinitions(*ecs.ListTaskDefinitionsInput) (*ecs.ListTaskDefinitionsOutput, error) }
ECSSvc defines the methods that an object must have in order to be used as the `Svc` object in the ECSClient. The AWS `ecs.ECS` object satisfies this interface.
type FailedDeregistration ¶
FailedDeregistration is a struct that couples a task definition deregistration error to the ARN of the task definition.