Exemplo n.º 1
0
// open populates the context fields and creates an ECS Client
func (context *Context) open() error {
	// perform libcomposeContext open which loads the compose file and determines projectname
	err := context.Context.Open()
	if err != nil {
		utils.LogError(err, "Unable to open ECS context")
		return err
	}
	context.ECSClient = ecsclient.NewECSClient()
	context.ECSClient.Initialize(context.ECSParams)

	context.EC2Client = ec2client.NewEC2Client(context.ECSParams)
	return nil
}
Exemplo n.º 2
0
func ClusterScale(c *cli.Context) {
	rdwr, err := config.NewReadWriter()
	if err != nil {
		logrus.Error("Error executing 'scale': ", err)
		return
	}

	ecsClient := ecsclient.NewECSClient()
	cfnClient := cloudformation.NewCloudformationClient()
	if err := scaleCluster(c, rdwr, ecsClient, cfnClient); err != nil {
		logrus.Error("Error executing 'scale': ", err)
		return
	}
}
Exemplo n.º 3
0
func ClusterPS(c *cli.Context) {
	rdwr, err := config.NewReadWriter()
	if err != nil {
		logrus.Error("Error executing 'ps ", err)
		return
	}

	ecsClient := ecsclient.NewECSClient()
	infoSet, err := clusterPS(c, rdwr, ecsClient)
	if err != nil {
		logrus.Error("Error executing 'ps ", err)
		return
	}
	os.Stdout.WriteString(infoSet.String(ecscompose.ContainerInfoColumns, displayTitle))
}
Exemplo n.º 4
0
func ClusterUp(c *cli.Context) {
	rdwr, err := config.NewReadWriter()
	if err != nil {
		logrus.Error("Error executing 'up': ", err)
		return
	}

	ecsClient := ecsclient.NewECSClient()
	cfnClient := cloudformation.NewCloudformationClient()
	amiIds := ami.NewStaticAmiIds()
	if err := createCluster(c, rdwr, ecsClient, cfnClient, amiIds); err != nil {
		logrus.Error("Error executing 'up': ", err)
		return
	}
}