All Products
Search
Document Center

Auto Scaling:DescribeScalingGroups

Last Updated:Mar 24, 2023

Queries scaling groups.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociation operation
ess:DescribeScalingGroupsRead
  • AutoScaling
    acs:ess:{#regionId}:{#accountId}:scalinggroup/{#ScalingGroupId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the scaling group.

cn-qingdao
PageNumberintegerNo

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

Default value: 1.

1
PageSizeintegerNo

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

Default value: 10.

10
GroupTypestringNo

The type of the instances that are managed by the scaling group. Valid values:

  • ECS: Elastic Compute Service (ECS) instances.
  • ECI: elastic container instances.

Default value: ECS.

ECS
ScalingGroupIdsarrayNo

The IDs of the scaling groups that you want to query.

The query result does not contain the IDs of inactive scaling groups, and no errors are returned.

stringNo

The ID of the scaling group that you want to query.

The query result does not contain the IDs of inactive scaling groups, and no errors are returned.

asg-bp14wlu85wrpchm0****
ScalingGroupNamesarrayNo

The names of the scaling groups that you want to query.

The query result does not contain the names of inactive scaling groups, and no errors are returned.

stringNo

The name of the scaling group that you want to query.

The query result does not contain the names of inactive scaling groups, and no errors are returned.

scalinggroup****
ScalingGroupNamestringNo

The name of the scaling group.

scalinggroup****
ResourceGroupIdstringNo

The ID of the resource group to which the scaling group you want to query belongs.

NoteIf the specified resource group contains no scaling groups, null is returned.
rg-123******

Response parameters

ParameterTypeDescriptionExample
object

The scaling groups.

RequestIdstring

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****
PageNumberinteger

The page number of the returned page.

1
PageSizeinteger

The number of entries returned per page.

10
TotalCountinteger

The total number of scaling groups.

1
ScalingGroupsarray

Details of the scaling groups.

object

Details of the scaling group.

VpcIdstring

The ID of the virtual private cloud (VPC) in which the scaling group resides.

vpc-bp1vwnn14rqpyiczj****
CreationTimestring

The time when the scaling group was created. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.

2014-08-14T10:58Z
TotalInstanceCountinteger

The total number of ECS instances in the scaling group.

1
ScalingGroupNamestring

The name of the scaling group.

dyrSuvBOtO1dEdIlIbp****
SpotInstancePoolsinteger

The number of instance types that are specified. Auto Scaling evenly creates preemptible instances of multiple instance types that are provided at the lowest price across zones. Valid values: 0 to 10.

5
StoppedCapacityinteger

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

1
OnDemandPercentageAboveBaseCapacityinteger

The percentage of pay-as-you-go instances in the excess instances when the minimum number of pay-as-you-go instances reaches the requirement. Valid values: 0 to 100.

20
ModificationTimestring

The time when the scaling group was modified. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.

2014-08-14T10:58Z
MinSizeinteger

The minimum number of ECS instances that must be contained in the scaling group.

1
ScalingGroupIdstring

The ID of the scaling group.

asg-bp14wlu85wrpchm0****
CompensateWithOnDemandboolean

Indicates whether pay-as-you-go instances can be automatically created to meet the requirement on the number of ECS instances when the expected capacity of preemptible instances cannot be provided due to reasons such as cost-related issues and insufficient resources. This parameter is available only if you set the MultiAZPolicy parameter to COST_OPTIMIZED. Valid values:

  • true
  • false
true
ScalingPolicystring

The reclaim mode of the scaling group. Valid values:

  • recycle: economical mode.
  • release: release mode.
recycle
RemovingWaitCapacityinteger

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

1
ActiveCapacityinteger

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

1
OnDemandBaseCapacityinteger

The minimum number of pay-as-you-go instances that must be included 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.

30
ProtectedCapacityinteger

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

1
HealthCheckTypestring

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

  • NONE: Auto Scaling does not perform health checks.
  • ECS: Auto Scaling performs health checks on ECS instances in the scaling group.
ECS
LifecycleStatestring

The 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. In addition, the parameter settings of the scaling groups cannot be modified.
Active
GroupDeletionProtectionboolean

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

  • true: Deletion protection is enabled for the scaling group. This way, the scaling group cannot be deleted.
  • false: Deletion protection is disabled for the scaling group.
true
ActiveScalingConfigurationIdstring

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

asc-bp1et2qekq3ojr33****
GroupTypestring

The type of the instances that are managed by the scaling group.

ECS
MultiAZPolicystring

The scaling policy for the multi-zone scaling group that contains ECS instances. Valid values:

  • PRIORITY: ECS instances are scaled based on the value of the VSwitchIds.N parameter. If Auto Scaling fails to create ECS instances in the zone where the vSwitch that has the highest priority resides, Auto Scaling creates ECS instances in the zone where the vSwitch that has the next highest priority resides.

  • COST_OPTIMIZED: ECS instances are scaled based on the unit price of vCPUs. Auto Scaling preferentially creates ECS instances whose vCPUs have the lowest price. If preemptible instance types are specified in the scaling configuration, Auto Scaling preferentially creates preemptible instances. You can use the CompensateWithOnDemand parameter to specify whether to automatically create pay-as-you-go instances when preemptible instances cannot be created due to insufficient resources.

    **

    NoteThe COST_OPTIMIZED setting takes effect only when multiple instance types are specified or at least one preemptible instance type is specified.

  • BALANCE: ECS instances are evenly distributed across zones that are specified for the scaling group. If ECS instances are unevenly distributed across the specified zones due to insufficient resources, you can call the RebalanceInstance operation to evenly redistribute the ECS instances across the zones.

PRIORITY
RemovingCapacityinteger

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

0
PendingWaitCapacityinteger

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

1
StandbyCapacityinteger

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

1
CurrentHostNamestring
NoteThis parameter is unavailable.
hostname
PendingCapacityinteger

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

0
LaunchTemplateIdstring

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

lt-m5e3ofjr1zn1aw7****
TotalCapacityinteger

If the WeightedCapacity parameter is specified, the value of this parameter indicates the total weighted capacity of all ECS instances in the scaling group. In other cases, the value of this parameter indicates the total number of ECS instances in the scaling group.

1
DesiredCapacityinteger

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

5
SpotInstanceRemedyboolean

Indicates whether preemptible instances can be supplemented. If this parameter is set to true, Auto Scaling creates an instance to replace a preemptible instance when Auto Scaling receives the system message which indicates that the preemptible instance is to be reclaimed.

true
LaunchTemplateVersionstring

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

Default
RegionIdstring

The region ID of the scaling group.

cn-qingdao
VSwitchIdstring

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

vsw-bp1whw2u46cn8zubm****
MaxSizeinteger

The maximum number of ECS instances that can be contained in the scaling group.

2
DefaultCooldowninteger

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

60
VServerGroupsarray

The backend vServer groups.

object

The backend vServer groups.

LoadBalancerIdstring

The ID of the Server Load Balancer (SLB) instance to which the backend vServer group belongs.

147b46d767c-cn-qingdao-cm5****
VServerGroupAttributesarray

The attributes of the backend vServer groups.

object

The attributes of the backend vServer group.

VServerGroupIdstring

The ID of the backend vServer group.

rsp-bp12bjrny****
Weightinteger

The weight of the backend vServer group.

1
Portinteger

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

22
LaunchTemplateOverridesarray

The information about the instance types that are specified by using the Extended Configurations feature of the launch template.

object

The information about the instance type that is specified by using the Extended Configurations feature of the launch template.

WeightedCapacityinteger

The weight of the instance type. The value of this parameter 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.

4
InstanceTypestring

The instance type. The instance type that is specified by this parameter overrides the instance type that is specified in the launch template.

ecs.c5.xlarge
SpotPriceLimitfloat

The maximum bid price of the instance type that is specified by the InstanceType parameter. You can specify 1 to 10 instance types by using the Extended Configurations feature of the launch template.

NoteThis parameter is available only if you specify the LaunchTemplateId parameter.
0.025
AlbServerGroupsarray

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

object

Details of the ALB server group.

AlbServerGroupIdstring

The ID of the ALB server group.

sgp-ddwb0y0g6y9bjm****
Weightinteger

The weight of an ECS instance after Auto Scaling adds the ECS instance to the ALB server group as a backend server.

100
Portinteger

The port number that is used by an ECS instance after Auto Scaling adds the ECS instance to the ALB server group.

80
RemovalPoliciesarray

Details of the policies that are used to remove ECS instances from the scaling group. Valid values:

  • OldestInstance: ECS instances that are created at the earliest point in time are removed.
  • NewestInstance: ECS instances that are created at the most recent point in time are removed.
  • OldestScalingConfiguration: ECS instances that are created based on the earliest scaling configuration are removed.
string

Details of the policy that is used to remove ECS instances from the scaling group. Valid values:

  • OldestInstance: ECS instances that are created at the earliest point in time are removed.
  • NewestInstance: ECS instances that are created at the most recent point in time are removed.
  • OldestScalingConfiguration: ECS instances that are created based on the earliest scaling configuration are removed.
OldestScalingConfiguration
DBInstanceIdsarray

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

string

The ID of the ApsaraDB RDS instance that is associated with the scaling group.

rm-bp15556qzebg1****
LoadBalancerIdsarray

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

string

The ID of the SLB instance that is associated with the scaling group.

lb-bp19byhscefk3x0li****
VSwitchIdsarray

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

string

The ID of the vSwitch that is associated with the scaling group. If you specify the VSwitchIds parameter, the VSwitchId parameter is ignored.

vsw-bp1whw2u46cn8zubm****
SuspendedProcessesarray

The processes that are suspended. If no process is suspended, null is returned. Valid values:

  • ScaleIn: scale-in
  • ScaleOut: scale-out
  • HealthCheck: health check
  • AlarmNotification: event-triggered task
  • ScheduledAction: scheduled task
string

The process that is suspended. If no process is suspended, null is returned. Valid values:

  • ScaleIn: scale-in
  • ScaleOut: scale-out
  • HealthCheck: health check
  • AlarmNotification: event-triggered task
  • ScheduledAction: scheduled task
ScaleIn
SystemSuspendedboolean

Indicates whether Auto Scaling stops executing scaling activities in the scaling group. Valid values:

  • true: If the scaling activities fail for more than seven consecutive days, Auto Scaling stops executing scaling activities in the scaling group. You must modify the scaling group or scaling configuration to resume the execution of the scaling activities.
  • false: Auto Scaling does not stop executing scaling activities in the scaling group.
true
IsElasticStrengthInAlarmboolean
NoteThis parameter is unavailable.
false
MonitorGroupIdstring

The ID of the CloudMonitor application group that is associated with the scaling group.

1497****
AzBalanceboolean

Indicates whether instances in the scaling group are evenly distributed across zones. This parameter is available only if you set the MultiAZPolicy parameter to COMPOSABLE. Valid values:

  • true
  • false
false
AllocationStrategystring

The allocation policy of instances. Auto Scaling selects instance types based on the allocation policy to create the required number of instances. The policy can be applied to pay-as-you-go instances and preemptible instances. This parameter is available only if you set the MultiAZPolicy parameter to COMPOSABLE. Valid values:

  • priority: Auto Scaling selects instance types based on the specified order of the instance types to create the required number of instances.
  • lowestPrice: Auto Scaling selects instance types that have the lowest unit price of vCPUs to create the required number of instances.
priority
SpotAllocationStrategystring

The allocation policy of preemptible instances. You can use this parameter to individually specify the allocation policy of preemptible instances. This parameter is available only if you set the MultiAZPolicy parameter to COMPOSABLE. Valid values:

  • priority: Auto Scaling selects instance types based on the specified order of the instance types to create the required number of preemptible instances.
  • lowestPrice: Auto Scaling selects instance types that have the lowest unit price of vCPUs to create the required number of preemptible instances.

Default value: priority.

lowestPrice
MaxInstanceLifetimeinteger

The maximum life span of an instance in the scaling group. Unit: seconds.

Valid values: 0 or from 86400 to the value of the Integer.maxValue parameter. If you set this parameter to 0, the instance has an unlimited life span.

Default value: null.

NoteThis parameter is unavailable for scaling groups that manage elastic container instances or scaling groups whose ScalingPolicy is set to recycle.
null
CustomPolicyARNstring

The Alibaba Cloud Resource Name (ARN) of the custom scale-in policy (Function). This parameter is available only if you specify CustomPolicy as the first step to remove instances.

acs:fc:cn-zhangjiakou:16145688****:services/ess_custom_terminate_policy.LATEST/functions/ess_custom_terminate_policy_name
InitCapacityinteger

The number of instances that are in the Initialized state before the instances are added to the scaling group.

0
ResourceGroupIdstring

The ID of the resource group to which the scaling group belongs.

rg-123****

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "PageNumber": 1,
  "PageSize": 10,
  "TotalCount": 1,
  "ScalingGroups": [
    {
      "VpcId": "vpc-bp1vwnn14rqpyiczj****",
      "CreationTime": "2014-08-14T10:58Z",
      "TotalInstanceCount": 1,
      "ScalingGroupName": "dyrSuvBOtO1dEdIlIbp****",
      "SpotInstancePools": 5,
      "StoppedCapacity": 1,
      "OnDemandPercentageAboveBaseCapacity": 20,
      "ModificationTime": "2014-08-14T10:58Z",
      "MinSize": 1,
      "ScalingGroupId": "asg-bp14wlu85wrpchm0****",
      "CompensateWithOnDemand": true,
      "ScalingPolicy": "recycle",
      "RemovingWaitCapacity": 1,
      "ActiveCapacity": 1,
      "OnDemandBaseCapacity": 30,
      "ProtectedCapacity": 1,
      "HealthCheckType": "ECS",
      "LifecycleState": "Active",
      "GroupDeletionProtection": true,
      "ActiveScalingConfigurationId": "asc-bp1et2qekq3ojr33****",
      "GroupType": "ECS",
      "MultiAZPolicy": "PRIORITY",
      "RemovingCapacity": 0,
      "PendingWaitCapacity": 1,
      "StandbyCapacity": 1,
      "CurrentHostName": "hostname",
      "PendingCapacity": 0,
      "LaunchTemplateId": "lt-m5e3ofjr1zn1aw7****",
      "TotalCapacity": 1,
      "DesiredCapacity": 5,
      "SpotInstanceRemedy": true,
      "LaunchTemplateVersion": "Default",
      "RegionId": "cn-qingdao",
      "VSwitchId": "vsw-bp1whw2u46cn8zubm****",
      "MaxSize": 2,
      "DefaultCooldown": 60,
      "VServerGroups": [
        {
          "LoadBalancerId": "147b46d767c-cn-qingdao-cm5****",
          "VServerGroupAttributes": [
            {
              "VServerGroupId": "rsp-bp12bjrny****",
              "Weight": 1,
              "Port": 22
            }
          ]
        }
      ],
      "LaunchTemplateOverrides": [
        {
          "WeightedCapacity": 4,
          "InstanceType": "ecs.c5.xlarge",
          "SpotPriceLimit": 0.025
        }
      ],
      "AlbServerGroups": [
        {
          "AlbServerGroupId": "sgp-ddwb0y0g6y9bjm****",
          "Weight": 100,
          "Port": 80
        }
      ],
      "ServerGroups": [
        {
          "ServerGroupId": "sgp-i9ouakeaerr*****",
          "Type": "ALB",
          "Weight": 100,
          "Port": 80
        }
      ],
      "RemovalPolicies": [
        "OldestScalingConfiguration"
      ],
      "DBInstanceIds": [
        "rm-bp15556qzebg1****"
      ],
      "LoadBalancerIds": [
        "lb-bp19byhscefk3x0li****"
      ],
      "VSwitchIds": [
        "vsw-bp1whw2u46cn8zubm****"
      ],
      "SuspendedProcesses": [
        "ScaleIn"
      ],
      "SystemSuspended": true,
      "IsElasticStrengthInAlarm": false,
      "MonitorGroupId": "1497****",
      "AzBalance": false,
      "AllocationStrategy": "priority",
      "SpotAllocationStrategy": "lowestPrice",
      "MaxInstanceLifetime": 0,
      "CustomPolicyARN": "acs:fc:cn-zhangjiakou:16145688****:services/ess_custom_terminate_policy.LATEST/functions/ess_custom_terminate_policy_name",
      "InitCapacity": 0,
      "ResourceGroupId": "rg-123****"
    }
  ]
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-12-22The response structure of the API operation changes.
Change itemChange content
Output ParametersThe response structure of the API operation changes.