Documentation ¶
Overview ¶
Functions dealing with ECS clusters.
Womply, www.womply.com ¶
Functions dealing with AWS ELBs used by ECS services.
Womply, www.womply.com ¶
Implements the functions that work with ECS services.
Womply, www.womply.com ¶
Implements the functions that work with ECS tasks and task definitions.
Womply, www.womply.com ¶
Utility functions.
Womply, www.womply.com
Index ¶
- func CheckError(action string, err error)
- func CheckService(creds *credentials.Credentials, region string, clusterName string, ...)
- func CheckServiceTasks(awsConn *ecs.ECS, clusterName string, serviceName string, verboseFlag bool, ...) ([]string, int)
- func CreateTask(creds *credentials.Credentials, region string, taskFile string)
- func GetEcsConnection(creds *credentials.Credentials, region string) *ecs.ECS
- func GetElbData(creds *credentials.Credentials, region string, loadBalancers []*string) *elb.DescribeLoadBalancersOutput
- func ListClusters(creds *credentials.Credentials, region string)
- func PrintElbs(creds *credentials.Credentials, region string, loadBalancers []*string)
- func PrintSeparator()
- func PrintServiceTasks(awsConn *ecs.ECS, clusterName string, serviceName string, ...)
- func PrintServices(creds *credentials.Credentials, region string, clusterName string, ...) []*string
- func PrintTaskDefinition(awsConn *ecs.ECS, taskDefinition *string, verboseFlag bool)
- func PrintTasks(creds *credentials.Credentials, region string, taskFamily string, ...)
- func RunTask(creds *credentials.Credentials, region string, clusterName string, ...)
- func UpdateService(creds *credentials.Credentials, region string, clusterName string, ...)
- type TaskDefn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckError ¶
Utility function to check if an error is non-nil. Prints a helpful message and exits if so. The helpful message is passed by the caller along with the error to check.
func CheckService ¶
func CheckService(creds *credentials.Credentials, region string, clusterName string, serviceName string, verboseFlag bool)
Check the status of a service by fetching the tasks and comparing task definitions and run state to see if tasks are running the same task definition revision that the service is associated with.
func CheckServiceTasks ¶
func CreateTask ¶
func CreateTask(creds *credentials.Credentials, region string, taskFile string)
Read a task definition from JSON file and register it.
func GetEcsConnection ¶
func GetEcsConnection(creds *credentials.Credentials, region string) *ecs.ECS
Create a connection object for ECS service work.
func GetElbData ¶
func GetElbData(creds *credentials.Credentials, region string, loadBalancers []*string) *elb.DescribeLoadBalancersOutput
Fetch ELB data
func ListClusters ¶
func ListClusters(creds *credentials.Credentials, region string)
List the user-visible clusters and their service names.
func PrintElbs ¶
func PrintElbs(creds *credentials.Credentials, region string, loadBalancers []*string)
Takes a list of ELB names, retrieves their details and prints.
func PrintSeparator ¶
func PrintSeparator()
Little utility function since we print separators in a few places.
func PrintServiceTasks ¶
func PrintServiceTasks(awsConn *ecs.ECS, clusterName string, serviceName string, taskDefinition string)
Print information about the tasks associated with the specific service.
func PrintServices ¶
func PrintServices(creds *credentials.Credentials, region string, clusterName string, serviceName string, verboseFlag bool, eventsFlag int) []*string
Fetches and prints the information about the services. It also collects the names of the load balancers in use and returns them so that the printElbs() function can use them if desired.
func PrintTaskDefinition ¶
Function to print the details of a service's task definition, since it's got a lot of fiddly details.
func PrintTasks ¶
func PrintTasks(creds *credentials.Credentials, region string, taskFamily string, taskRevision string)
Print the task definitions
func RunTask ¶
func RunTask(creds *credentials.Credentials, region string, clusterName string, taskName string)
Run a task - runs 1 instance of the specified task.
func UpdateService ¶
func UpdateService(creds *credentials.Credentials, region string, clusterName string, serviceName string, newImage string)
Update a service by specifying a new image URL, which will register a new task definition revision and update the service, meaning the service instances are restarted. If the image URL starts with a colon (:) then it will get the current image URL, and update the service with its current URL using the string as the tag. For example, passing ":latest" will update the service with the same image, tagged 'latest'.
Types ¶
type TaskDefn ¶
type TaskDefn struct { ContainerDefinitions []struct { Command []string CPU int64 EntryPoint []string Environment []ecs.KeyValuePair Essential bool Image string Memory int64 Name string PortMappings []ecs.PortMapping } Family string }
TaskDefn is a struct defining the layout of the Task Definition JSON file. This is used in order to parse the JSON file directly into a usable structure.