开发者社区> 问答> 正文

触发任务:分离ECS实例




描述


从一个伸缩组分离一台或多台 ECS 实例。分离 ECS 实例之后,ECS 实例可以独立于伸缩组存在,您可以将 ECS 实例附加到其他伸缩组( AttachInstances)。分离一台 ECS 实例并不会停止或释放该 ECS 实例,若有相关需要,您可以手动 停止释放 ECS 实例。调用该接口时,您需要注意:


  • 目标伸缩组必须处于 启用(Enable) 状态。

  • 目标伸缩组不能有正在进行的伸缩活动。

  • 目标伸缩组没有正在进行的伸缩活动时,该接口可以绕过 冷却时间 直接执行。

  • 接口成功调用后,仅表示接受了该接口调用的请求。可以照常触发伸缩活动,但不能保证伸缩活动的成功性,您需要通过返回的 ScalingActivityId 查看伸缩活动的状态。

  • 目标伸缩组的 ECS 数减去当前分离的 ECS 数不能小于伸缩组最小实例数(MinSize)。


请求参数

名称类型是否必需描述
ActionString系统规定参数,取值: DetachInstances
ScalingGroupIdString伸缩组 ID。
InstanceId.NStringECS 实例 ID。N 的取值范围为 [1, 20]。


返回参数

名称类型描述
RequestIdString请求 ID
ScalingActivityIdString伸缩活动 ID


示例



请求示例

  1. http://ess.aliyuncs.com/?Action=DetachInstances
  2. &ScalingGroupId=AG6CQdPU8OKdwLjgZcJXXXXX
  3. &InstanceId.1=i-28wt48iaa
  4. &<公共请求参数>


返回示例


XML 格式
  1. <DetachInstancesResponse>
  2.     <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
  3.     <ScalingActivityId>asa-xxxxxxxxx</ScalingActivityId>
  4. </DetachInstancesResponse>

JSON 格式
  1. {
  2.     "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
  3.     "ScalingActivityId": "asa-xxxxxxxxx"
  4. }


错误码

错误代码错误信息HTTP 状态码说明
IncorrectScalingGroupStatusThe current status of the specified scaling group does not support this action.400目标伸缩组必须处于 启用(Enable) 状态。
ScalingActivityInProgressYou cannot delete a scaling group or launch a new scaling activity while there is a scaling activity in progress for the specified scaling group.400目标伸缩组不能有正在进行的伸缩活动。
IncorrectLoadBalancerStatusThe current status of the specified load balancer does not support this action.400目标伸缩组内的负载均衡实例必须处于 运行中(active)状态。
IncorrectDBInstanceStatusThe current status of DB instance “XXX” does not support this action.400目标伸缩组内的 RDS 实例必须处于 运行中(Running)状态。
IncorrectCapacity.MinSizeTo remove the instances, the total capacity will be lesser than the MinSize.400目标伸缩组的 ECS 实例数减去当前分离的 ECS 实例数不能小于伸缩组最少实例数(MinSize)。
Forbidden.UnauthorizedA required authorization for the specified action is not supplied.403您暂未被授权使用 DetachInstances 接口。
[tr=rgb(239, 251, 255)][td]InvalidScalingGroupId.NotFound The specified scaling group does not exist.404指定的伸缩组不存在。 InvalidInstanceId.NotFoundInstance “XXX” does not exist.404指定的 ECS 实例不存在。

展开
收起
青蛙跳 2018-08-17 13:47:56 1435 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
如何运维千台以上游戏云服务器 立即下载
网站/服务器取证 实践与挑战 立即下载
ECS快储存加密技术 立即下载