Removes instances from a scaling group. If an enabled scaling group has no ongoing scaling activities, you can call the DetachInstances operation to remove one or more Elastic Compute Service (ECS) instances, elastic container instances, or Alibaba Cloud-hosted third-party instances from the scaling group.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ess:DetachInstances |
update |
*ScalingGroup
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ScalingGroupId |
string |
Yes |
The ID of the scaling group. |
asg-bp1igpak5ft1flyp**** |
| DecreaseDesiredCapacity |
boolean |
No |
Specifies whether to adjust the expected number of instances in the scaling group. Valid values:
Default value: true. |
true |
| DetachOption |
string |
No |
Specifies whether to detach the ECS instances or elastic container instances that are marked for removal from the associated load balancers, and whether to remove the private IP addresses of these instances from the IP address whitelists of the associated ApsaraDB RDS instances. Both: detaches the ECS instances or elastic container instances that are marked for removal from the associated load balancers and removes the private IP addresses of these instances from the IP address whitelists of the associated ApsaraDB RDS instances. Note
This parameter is not supported if you want to remove Alibaba Cloud-hosted third-party instances from a scaling group. |
both |
| InstanceIds |
array |
Yes |
The IDs of the ECS instances, elastic container instances, or Aliababa Cloud-managed third-party instances that you want to remove from a scaling group. |
|
|
string |
No |
The ID of the ECS instance, elastic container instance, or Aliababa Cloud-managed third-party instance that you want to remove from a scaling group. Examples:
Note
You can remove only one type of instances at a time. |
i-bp109k5j3dum1ce6**** |
|
| LifecycleHook |
boolean |
No |
Specifies whether to trigger a lifecycle hook for scale-in purposes when ECS instances or elastic container instances are removed from the scaling group. Valid values:
Note
This parameter is not supported if you want to remove Alibaba Cloud-hosted third-party instances from a scaling group. Default value: false. |
false |
| IgnoreInvalidInstance |
boolean |
No |
Specifies whether to ignore invalid instances when you remove a batch of instances from the scaling group. Valid values:
Default value: false. |
false |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see Ensure idempotence. |
123e4567-e89b-12d3-a456-42665544**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| ScalingActivityId |
string |
The ID of the scaling activity. |
asa-bp1gbswjhjrw8tko**** |
| RequestId |
string |
The ID of the request. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
Examples
Success response
JSON format
{
"ScalingActivityId": "asa-bp1gbswjhjrw8tko****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 500 | InternalError | The request processing has failed due to some unknown error, exception or failure. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.