开发者社区 问答 正文

触发任务:移出ECS实例



描述


从指定的伸缩组里移出ECS实例。

  • 从伸缩组移出弹性伸缩自动创建的ECS实例时,停止和释放该ECS实例。
  • 从伸缩组移出用户手工加入的ECS实例时,不停止和释放该ECS实例。
  • 当伸缩组为active状态,才可以调用该接口。
  • 当伸缩组没有伸缩活动正在执行,才可以调用该接口。
  • 当伸缩组没有伸缩活动正在执行时,该接口可以绕过冷却时间(Cooldown)直接执行。
  • 调用该接口返回成功,只是表示弹性伸缩服务接受了该接口调用的请求,伸缩活动可以执行,但不代表伸缩活动能够执行成功。用户需要通过返回的ScalingActivityId查看该伸缩活动的执行状态。
  • 如果当前伸缩组的实例数(Total Capacity)减去该接口指定的实例数小于MinSize时,则调用失败。


请求参数

名称类型是否必须描述
ActionString操作接口名,系统规定参数,取值:RemoveInstances。
ScalingGroupIdString伸缩组的ID。
InstanceId.NStringECS实例的ID。最多可以输入20个。


返回参数

名称类型描述
ScalingActivityIdString伸缩活动的ID


错误码


关于所有接口的通用性错误,请参考 客户端错误表服务器端错误表
错误错误代码描述HTTP状态码
指定的伸缩组在该用户账号下不存在InvalidScalingGroupId.NotFoundThe specified scaling group does not exist.404
指定的ECS实例在伸缩组下不存在InvalidInstanceId.NotFoundInstance “XXX” does not exist.404
用户并未向弹性伸缩完整授权Open API接口Forbidden.UnauthorizedA required authorization for the specified action is not supplied.403
指定的伸缩组为非active状态IncorrectScalingGroupStatusThe current status of the specified scaling group does not support this action.400
指定的伸缩组有伸缩活动正在进行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
指定伸缩规则所属的伸缩组的负载均衡实例为非active状态IncorrectLoadBalancerStatusThe current status of the specified load balancer does not support this action.400
指定伸缩规则所属的伸缩组的RDS实例为非running状态IncorrectDBInstanceStatusThe current status of DB instance “XXX” does not support this action.400
移出的实例数使得Total Capacity小于MinSizeIncorrectCapacity.MinSizeTo remove the instances, the total capacity will be lesser than the MinSize.400


示例



请求示例

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


返回示例


XML格式:
  1. <RemoveInstancesResponse>
  2.     <ScalingActivityId>bybj9OcaOT4ucPMbFhcqHfA3</ScalingActivityId>
  3.     <RequestId>DD0309B7-2613-4792-9B86-275906695253</RequestId>
  4. </RemoveInstancesResponse>

JSON格式:
  1. "RequestId": "6469DCD0-13AC-487E-85A0-CE4922908FDE",
  2. "ScalingActivityId": "ebta5WbUzC8gcwUWvfchyT4U"

展开
收起
青蛙跳 2018-08-17 13:47:25 1438 分享 版权
0 条回答
写回答
取消 提交回答