本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
ecs-cli compose service rm, delete, down
将服务的预期数量更新为 0
,然后删除服务。
Syntax
此命令在使用时接受 rm
、delete
或 down
。
ecs-cli compose service rm|delete|down [--timeout
value
] [--delete-namespace]
[--help]
Options
名称 |
描述 |
---|---|
|
指定等待运行任务计数更改的超时值(以分钟为单位,支持小数)。如果运行任务计数在指定时长内未更改,Amazon ECS CLI 将超时并返回错误。将超时时间设置为 默认值: 必需:否 |
|
如果指定,将删除使用 compose service create 或 compose service up 命令创建的私有命名空间。 必需:否 |
|
指定要使用的 AWS 区域。默认为使用 configure 命令配置的集群。 类型:字符串 必需:否 |
|
指定要使用的 Amazon ECS 集群配置的名称。默认为作为默认值设置的集群设置。 类型:字符串 必需:否 |
|
指定要使用的 Amazon ECS 配置文件的名称。默认为使用 configure profile 命令配置的配置文件。 类型:字符串 必需:否 |
|
指定要使用的 AWS 配置文件。使您能够使用 类型:字符串 必需:否 |
|
指定要使用的 Amazon ECS 集群名称。默认为使用 configure 命令配置的集群。 类型:字符串 必需:否 |
|
显示指定命令的帮助文本。 必需:否 |
Examples
示例 1
此示例将由 hello-world
项目创建的服务扩展至预期数量,然后删除服务。0
ecs-cli compose --project-name
hello-world
--filehello-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