Queries scaling groups.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeScalingGroups

The operation that you want to perform. Set the value to DescribeScalingGroups.

RegionId String Yes cn-qingdao

The region ID of the scaling group.

PageNumber Integer No 1

The page number of the scaling group list to return. Pages start from page 1.

Default value: 1.

PageSize Integer No 10

The number of entries to return on each page. Maximum value: 50.

Default value: 10.

ScalingGroupId.N RepeatList No asg-bp14wlu85wrpchm0****

The ID of scaling group N that you want to query. Valid values of N: 1 to 20. The query result does not contain the IDs of inactive scaling groups, and no errors are returned.

ScalingGroupName.1 String No scalinggroup****

The name of scaling group N that you want to query. Valid values of N: 1 to 20. The query result does not contain the names of inactive scaling groups, and no errors are returned.

Response parameters

Parameter Type Example Description
PageNumber Integer 1

The page number of the returned page.

PageSize Integer 10

The number of entries returned per page.

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

ScalingGroups Array of ScalingGroup

Details about the scaling groups.

ScalingGroup
ActiveCapacity Integer 1

The number of Elastic Compute Service (ECS) instances that are added to the scaling group and are running as expected.

ActiveScalingConfigurationId String asc-bp1et2qekq3ojr33****

The ID of the active scaling configuration in the scaling group.

AlbServerGroups Array of AlbServerGroup

Details about the Application Load Balancer (ALB) server groups.

AlbServerGroup
AlbServerGroupId String sgp-ddwb0y0g6y9bjm****

The ID of the ALB server group.

Port Integer 80

The port number used by the ECS instance after the instance is added to the ALB server group.

Weight Integer 100

The weight of the ECS instance as a backend server after the instance is added to the ALB server group.

CompensateWithOnDemand Boolean true

Indicates whether pay-as-you-go instances can be automatically created to meet the requirements on the number of ECS instances when the expected capacity of preemptible instances cannot be fulfilled due to reasons such as high costs or insufficient resources. The value of this parameter is valid only when MultiAZPolicy is set to COST_OPTIMIZED. Valid values:

  • true: Pay-as-you-go instances can be automatically created.
  • false: Pay-as -you-go instances cannot be automatically created.
CreationTime String 2014-08-14T10:58Z

The time when the scaling group was created.

DBInstanceIds List rm-bp15556qzebg1****

The IDs of the ApsaraDB RDS instances that are associated with the scaling group.

DefaultCooldown Integer 60

The default cooldown time of the scaling group. During the cooldown time, Auto Scaling executes only scaling activities that are triggered by CloudMonitor event-triggered tasks.

DesiredCapacity Integer 5

The expected number of ECS instances in the scaling group. Auto Scaling automatically maintains the specified number of ECS instances.

GroupDeletionProtection Boolean true

Indicates whether deletion protection is enabled for the scaling group. Valid values:

  • true: Deletion protection is enabled for the scaling group, and the scaling group cannot be deleted.
  • false: Deletion protection is disabled for the scaling group.
HealthCheckType String ECS

The health check mode of the scaling group. Valid values:

  • NONE: The system does not perform health checks on ECS instances in the scaling group.
  • ECS: The system performs health checks on ECS instances in the scaling group.
LaunchTemplateId String lt-m5e3ofjr1zn1aw7****

The ID of the launch template used by the scaling group.

LaunchTemplateOverrides Array of LaunchTemplateOverride

Details about the instance type of the extended configurations.

LaunchTemplateOverride
InstanceType String ecs.c5.xlarge

The instance type. The specified instance type overrides the instance type in the launch template.

WeightedCapacity Integer 4

The weight of the instance type. The value for this parameter indicates the capacity of a single instance of this 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.

LaunchTemplateVersion String Default

The version of the launch template used by the scaling group.

LifecycleState String Active

The lifecycle status of the scaling group. Valid values:

  • Active: The scaling group is active. Active scaling groups can receive requests to execute scaling rules and trigger scaling activities.
  • Inactive: The scaling group is inactive. Inactive scaling groups cannot receive requests to execute scaling rules.
  • Deleting: The scaling group is being deleted. Scaling groups that are being deleted cannot receive requests to execute scaling rules, and the parameters of the scaling groups cannot be modified.
LoadBalancerIds List lb-bp19byhscefk3x0li****

The IDs of the Server Load Balancer (SLB) instances that are associated with the scaling group.

MaxSize Integer 2

The maximum number of ECS instances in the scaling group.

MinSize Integer 1

The minimum number of ECS instances in the scaling group.

ModificationTime String 2014-08-14T10:58Z

The time when the scaling group was modified.

MultiAZPolicy String PRIORITY

The ECS instance scaling policy for a multi-zone scaling group. Valid values:

  • PRIORITY: ECS instances are scaled based on the VSwitchIds.N parameter. If an ECS instance cannot be created in the zone where the vSwitch that has the highest priority resides, the system uses the vSwitch that has the next highest priority to create the ECS instance.
  • COST_OPTIMIZED: ECS instances are created based on the unit prices of their vCPUs in ascending order. Preemptible instances are preferentially created when preemptible instance types are specified in the active scaling configuration. You can configure the CompensateWithOnDemand parameter to specify whether to automatically create pay-as-you-go instances when preemptible instances cannot be created due to insufficient resources.
    Note COST_OPTIMIZED is valid when multiple instance types are specified or when at least one preemptible instance type is specified.
  • BALANCE: ECS instances are evenly distributed in multiple zones that are specified in the scaling group. If ECS instances are unevenly distributed across zones due to insufficient resources, you can call the RebalanceInstance operation to balance the instances across zones.
OnDemandBaseCapacity Integer 30

The minimum number of pay-as-you-go instances required in the scaling group. Valid values: 0 to 1000. If the number of pay-as-you-go instances is less than the value of this parameter, Auto Scaling preferentially creates pay-as-you-go instances.

OnDemandPercentageAboveBaseCapacity Integer 20

The percentage of pay-as-you-go instances that can be created when instances are added to the scaling group. This parameter takes effect when the number of instances reaches the value for the OnDemandBaseCapacity parameter. Valid values: 0 to 100.

PendingCapacity Integer 0

The number of ECS instances that are being added to the scaling group and are still being configured.

PendingWaitCapacity Integer 1

The number of ECS instances in the Pending state to be added to the scaling group.

ProtectedCapacity Integer 1

The number of ECS instances that are in the Protected state in the scaling group.

RegionId String cn-qingdao

The region ID of the scaling group.

RemovalPolicies List OldestScalingConfiguration

Details about the policies used to remove ECS instances from the scaling group. Valid values:

  • OldestInstance: Auto Scaling removes ECS instances that are created at the earliest point in time.
  • NewestInstance: Auto Scaling removes ECS instances that are most recently created.
  • OldestScalingConfiguration: Auto Scaling removes ECS instances that are created based on the earliest scaling configuration.
RemovingCapacity Integer 0

The number of ECS instances that are being removed from the scaling group.

RemovingWaitCapacity Integer 1

The number of ECS instances in the Pending state to be removed from the scaling group.

ScalingGroupId String asg-bp14wlu85wrpchm0****

The ID of the scaling group.

ScalingGroupName String dyrSuvBOtO1dEdIlIbp****

The name of the scaling group.

ScalingPolicy String recycle

The reclaim mode of the scaling group. Valid values:

  • recycle: The reclaim mode of the scaling group is set to Shutdown and Reclaim Mode.
  • release: The reclaim mode of the scaling group is set to Release Mode.

For more information, see RemoveInstances.

SpotInstancePools Integer 5

The number of instance types that are available. Auto Scaling creates preemptible instances of multiple instance types that are available at the lowest cost. Valid values: 0 to 10.

SpotInstanceRemedy Boolean true

Specifies whether to supplement preemptible instances. If this parameter is set to true, Auto Scaling attempts to create an instance to replace a preemptible instance when Auto Scaling receives a system message, which indicates that the preemptible instance is to be reclaimed.

StandbyCapacity Integer 1

The number of instances that are in the Standby state in the scaling group.

StoppedCapacity Integer 1

The number of instances that are in the Economical Mode state in the scaling group.

SuspendedProcesses List ScaleIn

The process that is suspended. If no process is suspended, the returned value is empty. Valid values:

  • ScaleIn: removes instances.
  • ScaleOut: adds instances.
  • HealthCheck: performs health checks.
  • AlarmNotification: sends alert notifications.
  • ScheduledAction: triggers scheduled tasks.
TotalCapacity Integer 1

If an instance type weight is specified for the scaling group, the value of this parameter indicates the total weighted capacity of all ECS instances in the scaling group. If no instance type weight is specified for the scaling group, the value of this parameter indicates the total number of ECS instances in the scaling group.

TotalInstanceCount Integer 1

The total number of ECS instances in the scaling group.

VServerGroups Array of VServerGroup

The list of backend server groups.

VServerGroup
LoadBalancerId String 147b46d767c-cn-qingdao-cm5****

The ID of the SLB instance to which the backend server group belongs.

VServerGroupAttributes Array of VServerGroupAttribute

The attributes of the backend server group.

VServerGroupAttribute
Port Integer 22

The port number that is used by the SLB instance to provide external services.

VServerGroupId String rsp-bp12bjrny****

The ID of the backend server group.

Weight Integer 1

The weight of the backend server group.

VSwitchId String vsw-bp1whw2u46cn8zubm****

The ID of the vSwitch that is associated with the scaling group.

VSwitchIds List vsw-bp1whw2u46cn8zubm****

The IDs of the vSwitches that are associated with the scaling group. If you configure the VSwitchIds parameter, the VSwitchId parameter is ignored.

VpcId String vpc-bp1vwnn14rqpyiczj****

The ID of the virtual private cloud (VPC) to which the scaling group belongs.

TotalCount Integer 1

The total number of scaling groups.

Examples

Sample requests

https://ess.aliyuncs.com/?Action=DescribeScalingGroups
&RegionId=cn-qingdao
&PageSize=10
&<Common request parameters>

Sample success responses

XML format

<DescribeScalingGroupsResponse> 
      <RequestId>68386699-8B9E-4D5B-BC4C-75A28F6C2A00</RequestId>
      <TotalCount>1</TotalCount>
      <PageSize>10</PageSize>
      <PageNumber>1</PageNumber>
      <ScalingGroups>
            <ScalingGroup>
                  <ScalingGroupId>asg-bp14wlu85wrpchm0****</ScalingGroupId>
                  <ScalingGroupName>scalinggroup****</ScalingGroupName>
                  <RegionId>cn-qingdao</RegionId>
                  <RemovingCapacity>0</RemovingCapacity>
                  <DefaultCooldown>300</DefaultCooldown>
                  <MinSize>1</MinSize>
                  <MaxSize>2</MaxSize>
                  <LifecycleState>Inactive</LifecycleState>
                  <TotalInstanceCount>0</TotalInstanceCount>
                  <AlbServerGroups>
                        <AlbServerGroup>
                              <AlbServerGroupId>sgp-ddwb0y0g6y9bjm****</AlbServerGroupId>
                              <Port>80</Port>
                              <Weight>100</Weight>
                        </AlbServerGroup>
                  </AlbServerGroups>
                  <ActiveScalingConfigurationId>asc-bp1et2qekq3ojr33****</ActiveScalingConfigurationId>
                  <LoadBalancerIds>
                        <LoadBalancerId>lb-bp19byhscefk3x0li****</LoadBalancerId>
                  </LoadBalancerIds>
                  <PendingCapacity>0</PendingCapacity>
                  <TotalCapacity>0</TotalCapacity>
                  <ActiveCapacity>0</ActiveCapacity>
                  <CreationTime>2014-08-14T10:58Z</CreationTime>
                  <DBInstanceIds>
                        <DBInstanceId>rm-bp15556qzebg1****</DBInstanceId>
                        <DBInstanceId>rm-bp52316qzhbg6****</DBInstanceId>
                  </DBInstanceIds>
                  <VSwitchId>vsw-bp1whw2u46cn8zubm****</VSwitchId>
                  <RemovalPolicies>
                        <RemovalPolicy>OldestScalingConfiguration</RemovalPolicy>
                        <RemovalPolicy>OldestInstance</RemovalPolicy>
                  </RemovalPolicies>
            </ScalingGroup>
      </ScalingGroups>
</DescribeScalingGroupsResponse>

JSON format

{
    "RequestId": "68386699-8B9E-4D5B-BC4C-75A28F6C2A00",
    "TotalCount": 1,
    "PageSize": 10,
    "PageNumber": 1,
    "ScalingGroups": {
        "ScalingGroup": [
            {
                "ScalingGroupId": "asg-bp14wlu85wrpchm0****",
                "ScalingGroupName": "scalinggroup****",
                "RegionId": "cn-qingdao",
                "RemovingCapacity": 0,
                "DefaultCooldown": 300,
                "MinSize": 1,
                "MaxSize": 2,
                "LifecycleState": "Inactive",
                "TotalInstanceCount": 0,
                "AlbServerGroups": {
                    "AlbServerGroup": [
                        {
                            "AlbServerGroupId": "sgp-ddwb0y0g6y9bjm****",
                            "Port": 80,
                            "Weight": 100
                        }
                    ]
                },
                "ActiveScalingConfigurationId": "asc-bp1et2qekq3ojr33****",
                "LoadBalancerIds": {
                    "LoadBalancerId": [
                        "lb-bp19byhscefk3x0li****"
                    ]
                },
                "PendingCapacity": 0,
                "TotalCapacity": 0,
                "ActiveCapacity": 0,
                "CreationTime": "2014-08-14T10:58Z",
                "DBInstanceIds": {
                    "DBInstanceId": [
                        "rm-bp15556qzebg1****",
                        "rm-bp52316qzhbg6****"
                    ]
                },
                "VSwitchId": "vsw-bp1whw2u46cn8zubm****",
                "RemovalPolicies": {
                    "RemovalPolicy": [
                        "OldestScalingConfiguration",
                        "OldestInstance"
                    ]
                }
            }
        ]
    }
}

Error codes

For a list of error codes, visit the API Error Center.