Amazon Elastic Container Service
开发人员指南 (API 版本 2014-11-13)
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 Amazon AWS 入门

ecs-cli compose service rm, delete, down

将服务的预期数量更新为 0,然后删除服务。

语法

此命令在使用时接受 rmdeletedown

ecs-cli compose service rm|delete|down [--timeout value] [--delete-namespace] [--help]

选项

名称 说明

--timeout value

Specifies the timeout value, in minutes (decimals supported), to wait for the running task count to change. If the running task count has not changed for the specified period of time, then the Amazon ECS CLI times out and returns an error. Setting the timeout to 0 causes the command to return without checking for success. The default timeout value is 5 (minutes).

Default value: 5

Required: No

--delete-namespace

如果指定,将删除使用 compose service createcompose service up 命令创建的私有命名空间。

必需:否

--region, -r region

Specifies the AWS Region to use. Defaults to the cluster configured using the configure command.

Type: String

Required: No

--cluster-config cluster_config_name

Specifies the name of the Amazon ECS cluster configuration to use. Defaults to the cluster configuration set as the default.

Type: String

Required: No

--ecs-profile ecs_profile

Specifies the name of the Amazon ECS profile configuration to use. Defaults to the profile configured using the configure profile command.

Type: String

Required: No

--aws-profile aws_profile

Specifies the AWS profile to use. Enables you to use the AWS credentials from an existing named profile in ~/.aws/credentials.

Type: String

Required: No

--cluster, -c cluster_name

Specifies the Amazon ECS cluster name to use. Defaults to the cluster configured using the configure command.

Type: String

Required: No

--help, -h

Shows the help text for the specified command.

Required: No

示例

示例 1

此示例将由 hello-world 项目创建的服务扩展至预期数量 ,然后删除服务。0

ecs-cli compose --project-name hello-world --file hello-world.yml service rm

输出:

INFO[0000] Updated ECS service successfully desiredCount=0 serviceName=ecscompose-service-hello-world INFO[0000] Service status desiredCount=0 runningCount=2 serviceName=ecscompose-service-hello-world INFO[0015] Service status desiredCount=0 runningCount=0 serviceName=ecscompose-service-hello-world INFO[0015] (service ecscompose-service-hello-world) has stopped 2 running tasks: (task 682dc22f-8bfa-4c28-b6f8-3a916bd8f86a) (task 80602da8-442c-48ea-a8a9-80328c302b89). timestamp=2017-08-18 21:25:28 +0000 UTC INFO[0015] ECS Service has reached a stable state desiredCount=0 runningCount=0 serviceName=ecscompose-service-hello-world INFO[0015] Deleted ECS service service=ecscompose-service-hello-world INFO[0015] ECS Service has reached a stable state desiredCount=0 runningCount=0 serviceName=ecscompose-service-hello-world

本页内容: