DescribeScalingInstances
Queries the list of ECS instances in a scaling group and their information by scaling group ID, including the total number of running spot instances, total number of ECS instances, warmup state of ECS instances, and lifecycle state. You can also filter ECS instances by health check status, lifecycle state, or creation type.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ess:DescribeScalingInstances |
get |
*ScalingGroup
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the scaling group. |
cn-hangzhou |
| ScalingGroupId |
string |
No |
The ID of the scaling group. |
asg-bp1igpak5ft1flyp**** |
| ScalingConfigurationId |
string |
No |
The ID of the associated scaling configuration. |
asc-bp1i65jd06v04vdh**** |
| HealthStatus |
string |
No |
The health check status of the ECS instance or ECI instance in the scaling group. ECS instances or ECI instances that are not in the Running state are considered unhealthy. Valid values:
Auto Scaling automatically removes unhealthy ECS instances or ECI instances from the scaling group and releases automatically created ECS instances or ECI instances. Whether manually added ECS instances or ECI instances are released depends on their managed state. If the instance lifecycle is not managed by the scaling group, the instance is only removed but not released. If the instance lifecycle is managed by the scaling group, the instance is removed and released. Note
Ensure that your account has sufficient available quota. If your account has an overdue payment, all pay-as-you-go ECS instances or ECI instances (including pay-as-you-go instances and spot instances) are stopped or even released. For more information about how instance status changes after an overdue payment, see Overdue payments. |
Healthy |
| LifecycleState |
string |
No |
The lifecycle state of the ECS instance, ECI instance, or managed instance in the scaling group. Valid values:
Note
Managed instances do not support lifecycle hooks, load balancing association, or health check features. |
InService |
| CreationType |
string |
No |
The method used to create instances in the scaling group. Valid values:
|
AutoCreated |
| PageNumber |
integer |
No |
The page number of the instance list. Minimum value: 1. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page for the paged query. Maximum value: 100. Default value: 10. |
10 |
| ScalingActivityId |
string |
No |
The ID of the scaling activity. |
asa-bp1c9djwrgxjyk31**** |
| InstanceId |
array |
No |
The IDs of instances in the scaling group. |
i-bp109k5j3dum1ce6**** |
|
string |
No |
The ID of the instance in the scaling group. Valid values of N: 1 to 20. Invalid InstanceId values are ignored in the query results, and no error is returned. |
i-bp109k5j3dum1ce6**** |
|
| CreationTypes |
array |
No |
The methods used to create instances in the scaling group. You can specify only one of this parameter and CreationType. |
|
|
string |
No |
The method used to create instances in the scaling group. You cannot set both this parameter and CreationType. Valid values:
Note
When you set this parameter, you can select multiple creation types (for example, AutoCreated, Attached, and Managed). |
AutoCreated |
|
| LifecycleStates |
array |
No |
The lifecycle states of ECS instances, ECI instances, or managed instances in the scaling group. You can specify only one of this parameter and LifecycleState. We recommend that you use this parameter. |
|
|
string |
No |
The lifecycle state of the ECS instance, ECI instance, or managed instance in the scaling group. Valid values:
Note
Managed instances do not support lifecycle hooks, load balancing association, or health check features. |
InService |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
B13527BF-1FBD-4334-A512-20F5E9D3**** |
| PageSize |
integer |
The number of entries per page. |
10 |
| PageNumber |
integer |
The current page number. |
1 |
| TotalSpotCount |
integer |
The total number of running spot instances in the scaling group. |
4 |
| TotalCount |
integer |
The total number of instances. |
1 |
| ScalingInstances |
object |
||
| ScalingInstance |
array<object> |
The collection of instance information. |
|
|
object |
The collection of instance information. |
||
| CreationTime |
string |
The time when the instance was added to the scaling group. The value is accurate to the minute. |
2020-05-18T03:11Z |
| LoadBalancerWeight |
integer |
The weight of the load balancing instance. Note
This parameter is deprecated. |
50 |
| LaunchTemplateId |
string |
The ID of the launch template. |
lt-m5e3ofjr1zn1aw7**** |
| InstanceId |
string |
The ID of the instance. |
i-bp109k5j3dum1ce6**** |
| SpotStrategy |
string |
The preemption policy of the spot instance. Valid values:
|
SpotWithPriceLimit |
| LaunchTemplateVersion |
string |
The version of the launch template. |
1 |
| HealthStatus |
string |
The health check status of the ECS instance or ECI instance in the scaling group. ECS instances or ECI instances that are not in the Running state are considered unhealthy. Valid values:
Auto Scaling automatically removes unhealthy ECS instances or ECI instances from the scaling group and releases the ones created through automatic creation. Whether manually added ECS instances or ECI instances are released depends on their managed status. If the instance lifecycle is not managed by the scaling group, the instance is only removed but not released. If the instance lifecycle is managed by the scaling group, the instance is removed and released. Note
Ensure that your account has sufficient active quota. If your account has an overdue payment, all pay-as-you-go ECS instances or ECI instances, including pay-as-you-go and spot instances, are stopped or even released. For more information about how instance status changes after an overdue payment, see Overdue payments. |
Healthy |
| ScalingGroupId |
string |
The ID of the scaling group to which the instance belongs. |
asg-bp1igpak5ft1flyp**** |
| WarmupState |
string |
The warmup state of the instance. Valid values:
|
NoNeedWarmup |
| LifecycleState |
string |
The lifecycle state of the ECS instance, ECI instance, or managed instance in the scaling group. Valid values:
Note
Managed instances do not support lifecycle hooks, load balancing association, or health check features. |
InService |
| CreationType |
string |
The method used to create the instance in the scaling group. Valid values:
|
AutoCreated |
| ZoneId |
string |
The zone ID of the instance. |
cn-hangzhou-g |
| ScalingConfigurationId |
string |
The ID of the associated scaling configuration. |
asc-bp1i65jd06v04vdh**** |
| Entrusted |
boolean |
Indicates whether the manually added instance is managed by the scaling group. Managed instances that are manually added are released when they are removed from the scaling group (excluding manual removal). Valid values:
|
true |
| WeightedCapacity |
integer |
The weight of the instance type. The weight indicates the capacity that a single instance of the specified instance type represents in the scaling group. A higher weight means that fewer instances of this type are required to meet the expected capacity. |
4 |
| CreatedTime |
string |
The time when the instance was added to the scaling group. The value is accurate to the second. |
2020-05-18T03:11:39Z |
| ScalingActivityId |
string |
The ID of the scaling activity during which the instance was added to the scaling group. |
asa-bp1c9djwrgxjyk31**** |
| InstanceType |
string |
The instance type of the instance. |
ecs.n1.small |
| ScalingInstanceId |
string |
The instance identity of the instance in the scaling group, which has a one-to-one mapping with the ECS instance ID or ECI instance ID. |
asi-j6cj1gcte640ekhb**** |
| PrivateIpAddress |
string |
The internal IP address of the instance in the scaling group. |
1**.2*.1**.2** |
| ReplaceStatus |
string |
ReBalance |
Examples
Success response
JSON format
{
"RequestId": "B13527BF-1FBD-4334-A512-20F5E9D3****",
"PageSize": 10,
"PageNumber": 1,
"TotalSpotCount": 4,
"TotalCount": 1,
"ScalingInstances": {
"ScalingInstance": [
{
"CreationTime": "2020-05-18T03:11Z",
"LoadBalancerWeight": 50,
"LaunchTemplateId": "lt-m5e3ofjr1zn1aw7****",
"InstanceId": "i-bp109k5j3dum1ce6****",
"SpotStrategy": "SpotWithPriceLimit",
"LaunchTemplateVersion": "1",
"HealthStatus": "Healthy",
"ScalingGroupId": "asg-bp1igpak5ft1flyp****",
"WarmupState": "NoNeedWarmup",
"LifecycleState": "InService",
"CreationType": "AutoCreated",
"ZoneId": "cn-hangzhou-g",
"ScalingConfigurationId": "asc-bp1i65jd06v04vdh****",
"Entrusted": true,
"WeightedCapacity": 4,
"CreatedTime": "2020-05-18T03:11:39Z",
"ScalingActivityId": "asa-bp1c9djwrgxjyk31****",
"InstanceType": "ecs.n1.small",
"ScalingInstanceId": "asi-j6cj1gcte640ekhb****",
"PrivateIpAddress": "1**.2*.1**.2**",
"ReplaceStatus": "ReBalance"
}
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.