当前位置: 首页>>代码示例>>Golang>>正文


Golang ecs.UpdateServiceInput类代码示例

本文整理汇总了Golang中github.com/aws/aws-sdk-go/service/ecs.UpdateServiceInput的典型用法代码示例。如果您正苦于以下问题:Golang UpdateServiceInput类的具体用法?Golang UpdateServiceInput怎么用?Golang UpdateServiceInput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了UpdateServiceInput类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: resourceAwsEcsServiceUpdate

func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error {
	conn := meta.(*AWSClient).ecsconn

	log.Printf("[DEBUG] Updating ECS service %s", d.Id())
	input := ecs.UpdateServiceInput{
		Service: aws.String(d.Id()),
		Cluster: aws.String(d.Get("cluster").(string)),
	}

	if d.HasChange("desired_count") {
		_, n := d.GetChange("desired_count")
		input.DesiredCount = aws.Int64(int64(n.(int)))
	}
	if d.HasChange("task_definition") {
		_, n := d.GetChange("task_definition")
		input.TaskDefinition = aws.String(n.(string))
	}

	if d.HasChange("deployment_maximum_percent") || d.HasChange("deployment_minimum_healthy_percent") {
		input.DeploymentConfiguration = &ecs.DeploymentConfiguration{
			MaximumPercent:        aws.Int64(int64(d.Get("deployment_maximum_percent").(int))),
			MinimumHealthyPercent: aws.Int64(int64(d.Get("deployment_minimum_healthy_percent").(int))),
		}
	}

	out, err := conn.UpdateService(&input)
	if err != nil {
		return err
	}
	service := out.Service
	log.Printf("[DEBUG] Updated ECS service %s", service)

	return resourceAwsEcsServiceRead(d, meta)
}
开发者ID:paultyng,项目名称:terraform,代码行数:34,代码来源:resource_aws_ecs_service.go

示例2: resourceAwsEcsServiceUpdate

func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error {
	conn := meta.(*AWSClient).ecsconn

	log.Printf("[DEBUG] Updating ECS service %s", d.Id())
	input := ecs.UpdateServiceInput{
		Service: aws.String(d.Id()),
		Cluster: aws.String(d.Get("cluster").(string)),
	}

	if d.HasChange("desired_count") {
		_, n := d.GetChange("desired_count")
		input.DesiredCount = aws.Long(int64(n.(int)))
	}
	if d.HasChange("task_definition") {
		_, n := d.GetChange("task_definition")
		input.TaskDefinition = aws.String(n.(string))
	}

	out, err := conn.UpdateService(&input)
	if err != nil {
		return err
	}
	service := out.Service
	log.Printf("[DEBUG] Updated ECS service %s", awsutil.StringValue(service))

	return resourceAwsEcsServiceRead(d, meta)
}
开发者ID:econnell,项目名称:terraform,代码行数:27,代码来源:resource_aws_ecs_service.go

示例3: UpdateAppService

// UpdateAppService updates the service for the app.
func (c *Client) UpdateAppService(ctx context.Context, app string, input *ecs.UpdateServiceInput) (*ecs.UpdateServiceOutput, error) {
	input.Service = c.prefix(app, input.Service)
	input.TaskDefinition = c.prefix(app, input.TaskDefinition)
	return c.ECS.UpdateService(ctx, input)
}
开发者ID:yourchanges,项目名称:empire,代码行数:6,代码来源:client.go


注:本文中的github.com/aws/aws-sdk-go/service/ecs.UpdateServiceInput类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。