Queries information about Elastic Compute Service (ECS) instances, elastic container instances, or managed non-Alibaba Cloud instances in a scaling group.
Usage notes
You can specify a scaling group ID to query the information about the ECS instances, elastic container instances, or managed non-Alibaba Cloud instances in the specified scaling group. You can also query instances by scaling configuration ID, instance health status, instance lifecycle status, and instance creation type.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | DescribeScalingInstances | The operation that you want to perform. Set the value to DescribeScalingInstances. |
RegionId | String | Yes | cn-hangzhou | The region ID of the scaling group. |
ScalingGroupId | String | No | asg-bp1igpak5ft1flyp**** | The ID of the scaling group. |
ScalingConfigurationId | String | No | asc-bp1i65jd06v04vdh**** | The ID of the associated scaling configuration. |
HealthStatus | String | No | Healthy | The health status of the ECS instance or elastic instance in the scaling group. An ECS instance or elastic container instance that is not in the Running state is considered unhealthy. Valid values:
Auto Scaling removes unhealthy ECS instances or elastic container instances from scaling groups. If the unhealthy ECS instances or elastic container instances are automatically created, Auto Scaling releases the instances after the removal. Whether to release ECS instances or elastic container instances that are manually added to a scaling group is determined by the management status of the instances. If the lifecycles of the instances are not managed by the scaling group, Auto Scaling removes the instances from the scaling group but does not release the instances. If the lifecycles of the instances are managed by the scaling group, Auto Scaling removes the instances from the scaling group and releases the instances. Note Make sure that you have sufficient balance within your Alibaba Cloud account. If your Alibaba Cloud account has overdue payments, all pay-as-you-go and preemptible ECS instances or elastic container instances are stopped or even released. For information about status changes of ECS instances and elastic container instances in the event of overdue payments, see Overdue payments. |
LifecycleState | String | No | InService | The lifecycle status of the ECS instance, elastic container instance, or managed non-Alibaba Cloud instance. Valid values:
|
CreationType | String | No | AutoCreated | The instance creation type. Valid values:
|
PageNumber | Integer | No | 1 | The page number. Pages start from page 1. Default value: 1. |
PageSize | Integer | No | 10 | The number of entries per page. Maximum value: 100. Default value: 10. |
ScalingActivityId | String | No | asa-bp1c9djwrgxjyk31**** | The ID of the scaling activity. |
InstanceId.N | String | No | i-bp109k5j3dum1ce6**** | The ID of instance N in the scaling group. Valid values of N: 1 to 20. Invalid instance IDs are not displayed in the query result, and no error is reported. |
CreationTypes.N | String | No | AutoCreated | The instance creation type. If you specify this parameter, you cannot specify CreationType. Valid values:
|
LifecycleStates.N | String | No | InService | The lifecycle status of the ECS instance, elastic container instance, or managed non-Alibaba Cloud instance. Valid values:
|
Response parameters
Parameter | Type | Example | Description |
RequestId | String | B13527BF-1FBD-4334-A512-20F5E9D3**** | The request ID. |
PageSize | Integer | 10 | The number of entries per page. |
PageNumber | Integer | 1 | The page number. |
TotalSpotCount | Integer | 4 | The total number of preemptible instances that run as expected in the scaling group. |
TotalCount | Integer | 1 | The total number of instances. |
ScalingInstances | Array of ScalingInstance | The information about the instances. | |
ScalingInstance | |||
CreationTime | String | 2020-05-18T03:11Z | The time when the instances were added to the scaling group. The value is accurate to minutes. |
LoadBalancerWeight | Integer | 50 | The SLB weight of an instance as a backend server. |
LaunchTemplateId | String | lt-m5e3ofjr1zn1aw7**** | The ID of the launch template. |
InstanceId | String | i-bp109k5j3dum1ce6**** | The ID of the instance. |
SpotStrategy | String | SpotWithPriceLimit | The bidding policy for the preemptible instance. Valid values:
|
LaunchTemplateVersion | String | 1 | The version number of the launch template. |
HealthStatus | String | Healthy | The health status of the ECS instance or elastic instance in the scaling group. An ECS instance or elastic container instance that is not in the Running state is considered unhealthy. Valid values:
Auto Scaling removes unhealthy ECS instances or elastic container instances from scaling groups. If the unhealthy ECS instances or elastic container instances are automatically created, Auto Scaling releases the instances after the removal. Whether to release ECS instances or elastic container instances that are manually added to a scaling group is determined by the management status of the instances. If the lifecycles of the instances are not managed by the scaling group, Auto Scaling removes the instances from the scaling group but does not release the instances. If the lifecycles of the instances are managed by the scaling group, Auto Scaling removes the instances from the scaling group and releases the instances. Note Make sure that you have sufficient balance within your Alibaba Cloud account. If your Alibaba Cloud account has overdue payments, all pay-as-you-go and preemptible ECS instances or elastic container instances are stopped or even released. For information about status changes of ECS instances and elastic container instances in the event of overdue payments, see Overdue payments. |
ScalingGroupId | String | asg-bp1igpak5ft1flyp**** | The ID of the scaling group to which the instances belong. |
WarmupState | String | NoNeedWarmup | The warmup status of the instance. Valid values:
|
LifecycleState | String | InService | The lifecycle status of the ECS instance, elastic container instance, or managed non-Alibaba Cloud instance in the scaling group. Valid values:
|
CreationType | String | AutoCreated | The instance creation type. Valid values:
|
ZoneId | String | cn-hangzhou-g | The zone ID of the instance. |
ScalingConfigurationId | String | asc-bp1i65jd06v04vdh**** | The ID of the associated scaling configuration. |
Entrusted | Boolean | true | Indicates whether the lifecycles of the ECS instances that are manually added to the scaling group are managed by the scaling group. If the scaling group manages the lifecycles of the ECS instances that are manually added, Auto Scaling releases the ECS instances after Auto Scaling removes the ECS instances from the scaling group. The release rule does not apply to ECS instances that are manually removed from the scaling group. Valid values:
|
WeightedCapacity | Integer | 4 | The weight of the instance type, which indicates the capacity of a single instance of the specified instance type in the scaling group. A greater weight indicates that a smaller number of instances of the specified instance type are required to meet the expected capacity requirement. |
CreatedTime | String | 2020-05-18T03:11:39Z | The time when the instance was added to the scaling group. The value is accurate to seconds. |
ScalingActivityId | String | asa-bp1c9djwrgxjyk31**** | The ID of the scaling activity during which the instance was added to the scaling group. |
InstanceType | String | ecs.n1.small | The instance type. |
ScalingInstanceId | String | asi-j6cj1gcte640ekhb**** | The identifier of the instance in the scaling group. The identifier of an ECS instance or elastic container instance matches the ID of the ECS instance or elastic container instance. |
PrivateIpAddress | String | 1**.2*.1**.2** | The private IP address of the instance in the scaling group. |
Examples
Sample requests
http(s)://ess.aliyuncs.com/?Action=DescribeScalingInstances
&RegionId=cn-hangzhou
&ScalingGroupId=asg-bp1igpak5ft1flyp****
&ScalingConfigurationId=asc-bp1i65jd06v04vdh****
&HealthStatus=Healthy
&LifecycleState=InService
&CreationType=AutoCreated
&PageNumber=1
&PageSize=10
&ScalingActivityId=asa-bp1c9djwrgxjyk31****
&InstanceId=["i-bp109k5j3dum1ce6****"]
&CreationTypes=["AutoCreated"]
&LifecycleStates=["InService"]
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeScalingInstancesResponse>
<RequestId>B13527BF-1FBD-4334-A512-20F5E9D3****</RequestId>
<PageSize>10</PageSize>
<PageNumber>1</PageNumber>
<TotalSpotCount>4</TotalSpotCount>
<TotalCount>1</TotalCount>
<ScalingInstances>
<CreationTime>2020-05-18T03:11Z</CreationTime>
<LoadBalancerWeight>50</LoadBalancerWeight>
<LaunchTemplateId>lt-m5e3ofjr1zn1aw7****</LaunchTemplateId>
<InstanceId>i-bp109k5j3dum1ce6****</InstanceId>
<SpotStrategy>SpotWithPriceLimit</SpotStrategy>
<LaunchTemplateVersion>1</LaunchTemplateVersion>
<HealthStatus>Healthy</HealthStatus>
<ScalingGroupId>asg-bp1igpak5ft1flyp****</ScalingGroupId>
<WarmupState>NoNeedWarmup</WarmupState>
<LifecycleState>InService</LifecycleState>
<CreationType>AutoCreated</CreationType>
<ZoneId>cn-hangzhou-g</ZoneId>
<ScalingConfigurationId>asc-bp1i65jd06v04vdh****</ScalingConfigurationId>
<Entrusted>true</Entrusted>
<WeightedCapacity>4</WeightedCapacity>
<CreatedTime>2020-05-18T03:11:39Z</CreatedTime>
<ScalingActivityId>asa-bp1c9djwrgxjyk31****</ScalingActivityId>
<InstanceType>ecs.n1.small</InstanceType>
<ScalingInstanceId>asi-j6cj1gcte640ekhb****</ScalingInstanceId>
<PrivateIpAddress>1**.2*.1**.2**</PrivateIpAddress>
</ScalingInstances>
</DescribeScalingInstancesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "B13527BF-1FBD-4334-A512-20F5E9D3****",
"PageSize" : 10,
"PageNumber" : 1,
"TotalSpotCount" : 4,
"TotalCount" : 1,
"ScalingInstances" : [ {
"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**"
} ]
}
Error codes
For a list of error codes, see Service error codes.