You need to enable JavaScript to run this app.
文档中心
弹性伸缩

弹性伸缩

复制全文
下载 pdf
实例管理
DetachInstances - 从伸缩组手动移出实例
复制全文
下载 pdf
DetachInstances - 从伸缩组手动移出实例
从伸缩组中移出一个或者多个实例,操作说明和注意事项请参见手动移出实例。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:DetachInstances​
要执行的操作,取值:DetachInstances。​
​
Version string 必选 示例值:2020-01-01​
API的版本,取值:2020-01-01。​
​
ScalingGroupId string 必选 示例值:scg-ybmssdnnhn5pkgyd****​
伸缩组ID。您可以调用DescribeScalingGroups查询伸缩组ID。​
​
LifecycleHook boolean 可选 示例值:false​
伸缩组移出实例时是否触发缩容生命周期挂钩。取值范围:​
  • true:触发。​
  • false(默认):不触发。​
​
DecreaseDesiredCapacity boolean 可选 示例值:true​
是否修改期望实例数,仅当所选伸缩组设置了期望实例数时有效。​
  • true(默认):完成移出行为后,期望实例数会自动修改为伸缩组中实际的实例数量。​
  • false:期望实例数不变,完成移出行为后,再次执行健康检查时,伸缩组会自动扩容至期望实例数。​
​
DetachOption string 可选 示例值:both​
是否取消实例与负载均衡以及公网IP的关联,取值:​
  • both(默认):解除关联后,实例将自动从负载均衡中移出,并自动删除公网IP资源。​
  • none:不取消关联。​
​
InstanceIds.N string[] 必选 示例值:i-ybmike5l70l8j1ha****​
实例ID列表。您可以调用DescribeScalingInstances查询指定伸缩组中的实例ID。​
  • 参数 - N:表示伸缩组的序号,取值1 ~ 20。​
  • 多个实例ID之间用&分隔。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
ScalingActivityId string 示例值:sga-ybn0mwfy1yl8j1f6****​
伸缩日志ID。​
​
​
​
请求示例​
​
GET /?Action=DetachInstances&InstanceIds.1=i-ybmike5l70l8j1ha****&ScalingGroupId=scg-ybmssdnnhn5pkgyd****&Version=2020-01-01 HTTP/1.1​
Host: auto-scaling.cn-beijing.volcengineapi.com​
X-Date: 20240507T112853Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20240507/cn-beijing/auto_scaling/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "2024050719290206822513523291A0CD",​
"Version": "2020-01-01",​
"Service": "auto_scaling",​
"Region": "cn-beijing"​
},​
"Result": {​
"ScalingActivityId": "sga-ybn0mwfy1yl8j1f6****"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
MissingParameter.ScalingGroupId​
The required parameter ScalingGroupId is not supplied.​
伸缩组ID不能为空。​
400​
InvalidScalingGroup.InvalidStatus​
The specified ScalingGroup is not in the correct status.​
指定的伸缩组当前状态不支持该操作。​
400​
InvalidInstance.InvalidStatus​
The specified Instance [%s] is not in the correct status.​
指定实例的状态不支持该操作。​
400​
InvalidInstanceIds.Malformed​
The specified amount of InstanceIds is malformed.​
指定的实例ID数量超出限制。​
400​
InvalidDetachOption.Malformed​
The specified DetachOption is malformed.​
指定的DetachOption不合法。​
400​
InvalidOperation.Suspended​
The specific operation is rejected by the suspended processes.​
指定的操作被伸缩组挂起流程拒绝​
404​
InvalidScalingGroupId.NotFound​
The specified ScalingGroup [%s] does not exist.​
指定的伸缩组不存在。​
404​
InvalidInstanceId.NotFound​
The specified InstanceId [%s] does not exist.​
指定的实例不存在。​
404​
InvalidScalingInstance.NotFound​
The specified Instance [%s] does not exsit.​
指定的实例不存在。​
412​
InvalidScalingGroup.LockFailed​
The specified operation is denied as the scaling group lock failed.​
锁定伸缩组失败。​
429​
LimitExceeded.OperateScalingGroupInstances​
You've reach the limit on request rate of operating the specified scaling group instances.​
频繁变更指定伸缩组实例。​
500​
InternalError​
An internal error has occurred.​
内部错误,请重试。如果多次尝试失败,请提交工单。​
​
​
最近更新时间:2025.08.27 19:18:33
这个页面对您有帮助吗?
有用
有用
无用
无用