All Products
Search
Document Center

Auto Scaling:DescribeScalingGroups

Last Updated:Sep 27, 2024

Queries information about scaling groups, such as the basic information, instances, and scaling configurations.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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 keyAssociated operation
ess:DescribeScalingGroupsget
  • ScalingGroup
    acs:ess:{#regionId}:{#accountId}:scalinggroup/{#ScalingGroupId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the scaling group.

cn-qingdao
PageNumberintegerNo

The page number. Pages start from page 1.

Default value: 1.

1
PageSizeintegerNo

The number of entries per page. Maximum value: 50.

Default value: 10.

10
GroupTypestringNo

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

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

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

The IDs of inactive scaling groups are not included in the query results, and no error is returned.

stringNo

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

The IDs of inactive scaling groups are not displayed in the query results, and no error is returned.

asg-bp14wlu85wrpchm0****
ScalingGroupNamesarrayNo

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

The names of inactive scaling groups are not displayed in the query results, and no error is reported.

stringNo

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

The names of inactive scaling groups are not displayed in the query results, and no error is reported.

scalinggroup****
ScalingGroupNamestringNo

The name of the scaling group.

scalinggroup****
ResourceGroupIdstringNo

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

Note If no scaling group belongs to the specified resource group, the query result is empty and no error is reported.
rg-123******
Tagsarray<object>No

The tags of the scaling group.

objectNo

The tag of the scaling group.

KeystringNo

The tag key of the scaling group.

Department
ValuestringNo

The tag value of the scaling group.

Finance

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

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

The page number.

1
PageSizeinteger

The number of entries per page.

10
TotalCountinteger

The total number of entries returned.

1
ScalingGroupsarray<object>

The scaling groups.

ScalingGroupobject

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.

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 in the scaling group. Auto Scaling evenly creates preemptible instances of multiple instance types that are provided at the lowest price across the zones of the scaling group. Valid values: 0 to 10.

5
StoppedCapacityinteger

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

1
OnDemandPercentageAboveBaseCapacityinteger

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

20
ModificationTimestring

The time when the scaling group was last modified.

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 Auto Scaling can create pay-as-you-go instances to supplement preemptible instances if preemptible instances cannot be created due to price-related factors or insufficient inventory when MultiAZPolicy is set to COST_OPTIMIZED. Valid values:

  • true
  • false
true
ScalingPolicystring

The instance reclaim mode of the scaling group. Valid values:

  • recycle: economical mode.
  • release: release mode.
  • forcerelease: forced release mode.

For more information, see RemoveInstances .

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 contained 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 checks the health status of ECS instances in the scaling group.
  • LOAD_BALANCER: Auto Scaling checks the health status of instances in the scaling group based on the health check results of load balancers. The health check results of Classic Load Balancer (CLB, formerly known as Server Load Balancer or SLB) instances are not used as the basis to perform health checks on the 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 in the Disabled state. Disabled 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 parameter settings of the scaling groups cannot be modified.
Active
GroupDeletionProtectionboolean

Indicates whether the Deletion Protection feature is enabled for the scaling group. Valid values:

  • true: The Deletion Protection feature is enabled for the scaling group. The scaling group cannot be deleted.
  • false: The Deletion Protection feature 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 instances that are managed by the scaling group.

ECS
MultiAZPolicystring

The scaling policy of the ECS instances in the multi-zone scaling group. Valid values:

  • PRIORITY: ECS instances are created based on the value of VSwitchIds. If Auto Scaling cannot create ECS instances in the zone where the vSwitch of the highest priority resides, Auto Scaling creates ECS instances in the zone where the vSwitch of the next highest priority resides.

  • COST_OPTIMIZED: ECS instances are created based on the unit prices of their vCPUs. Auto Scaling preferentially creates ECS instances whose vCPUs are provided at the lowest price. If preemptible instance types are specified in the scaling configuration, Auto Scaling preferentially creates preemptible instances. You can also specify CompensateWithOnDemand to allow Auto Scaling to create pay-as-you-go instances if preemptible instances cannot be created due to limited stock.

    **

    Note The COST_OPTIMIZED setting takes effect only if your scaling configuration contains multiple instance types or contains preemptible instance types.

  • BALANCE: ECS instances are evenly distributed across the zones that are specified for the scaling group. If ECS instances become unevenly distributed across the specified zones due to limited instance type availability, you can call the RebalanceInstance operation to balance the distribution of the ECS instances.

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 ECS instances that are in the Standby state in the scaling group.

1
CurrentHostNamestring
Note This parameter is unavailable.
hostname
PendingCapacityinteger

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

0
LaunchTemplateIdstring

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

lt-m5e3ofjr1zn1aw7****
TotalCapacityinteger

The total weighted capacity of all ECS instances in the scaling group if Weighted is specified. In other cases, this parameter specifies 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.

5
SpotInstanceRemedyboolean

Indicates whether preemptible instances can be supplemented. If this parameter is set to true, Auto Scaling proactively creates instances to replace the preemptible instances for reclamation when Auto Scaling receives a system notification.

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 vSwitch ID of 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 does not execute the scaling activities that are triggered by CloudMonitor event-triggered tasks.

60
VServerGroupsarray<object>

The backend vServer groups.

VServerGroupobject

The backend vServer group.

LoadBalancerIdstring

The ID of the load balancer to which the backend vServer group belongs.

147b46d767c-cn-qingdao-cm5****
VServerGroupAttributesarray<object>

The attributes of the backend vServer groups.

VServerGroupAttributeobject

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 load balancer to provide external services.

22
LaunchTemplateOverridesarray<object>

The instance types that are extended in the launch template.

LaunchTemplateOverrideobject

The instance type that is extended in 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 higher weight indicates that a smaller number of instances of the specified instance type are required to meet the expected capacity.

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 LaunchTemplateOverride.InstanceType.

Note This parameter takes effect only if you use LaunchTemplateId to specify a launch template.
0.025
AlbServerGroupsarray<object>

The Application Load Balancer (ALB) server groups.

AlbServerGroupobject

The ALB server group.

AlbServerGroupIdstring

The ID of the ALB server group.

sgp-ddwb0y0g6y9bjm****
Weightinteger

The weight of an ECS instance as a backend server in the ALB server group.

100
Portinteger

The port number used by an ECS instance as a backend server in the ALB server group.

80
ServerGroupsarray<object>

The server groups.

Note You can use this parameter to obtain information about ALB server groups and Network Load Balancer (NLB) server groups attached to the scaling group.
ServerGroupobject

The server group.

ServerGroupIdstring

The ID of the server group.

sgp-i9ouakeaerr*****
Typestring

The type of the server group. Valid values:

  • ALB
  • NLB
ALB
Weightinteger

The weight of an ECS instance as a backend server in the server group.

100
Portinteger

The port number used by an ECS instance as a backend server in the server group.

80
RemovalPoliciesarray

The instance removal policies. Valid values:

  • OldestInstance: Auto Scaling removes ECS instances that are added at the earliest point in time to the scaling group.
  • NewestInstance: Auto Scaling removes ECS instances that are most recently added to the scaling group.
  • OldestScalingConfiguration: Auto Scaling removes ECS instances that are created from the earliest scaling configuration.
RemovalPolicystring

The instance removal policy. Valid values:

  • OldestInstance: Auto Scaling removes ECS instances that are added at the earliest point in time to the scaling group.
  • NewestInstance: Auto Scaling removes ECS instances that are most recently added to the scaling group.
  • OldestScalingConfiguration: Auto Scaling removes ECS instances that are created from the earliest scaling configuration.
OldestScalingConfiguration
DBInstanceIdsarray

The IDs of the ApsaraDB RDS instances that are attached to the scaling group.

DBInstanceIdstring

The ID of the ApsaraDB RDS instance that is attached to the scaling group.

rm-bp15556qzebg1****
LoadBalancerIdsarray

The IDs of the load balancers that are attached to the scaling group.

LoadBalancerIdstring

The ID of the load balancer that is attached to the scaling group.

lb-bp19byhscefk3x0li****
VSwitchIdsarray

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

VSwitchIdstring

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

vsw-bp1whw2u46cn8zubm****
SuspendedProcessesarray

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

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

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

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

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

  • true: Auto Scaling stops executing scaling activities in the scaling group if the scaling activities failed for more than seven consecutive days in the scaling group. In this case, you must modify the scaling group or scaling configuration to resume the scaling activities.
  • false: Auto Scaling does not stop executing scaling activities in the scaling group.
true
IsElasticStrengthInAlarmboolean
Note This parameter is not available for use.
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 the specified zones. This parameter takes effect only if you set MultiAZPolicy to COMPOSABLE. Valid values:

  • true
  • false
false
AllocationStrategystring

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

  • priority: Auto Scaling adopts the predefined instance type sequence to create the required number of preemptible instances.
  • lowestPrice: Auto Scaling selects instance types that have the most economical vCPU pricing to create the required number of instances.
priority
SpotAllocationStrategystring

The allocation policy of preemptible instances. This parameter indicates the manner in which Auto Scaling selects instance types to create the required number of preemptible instances. This parameter takes effect only if you set MultiAZPolicy to COMPOSABLE. Valid values:

  • priority: Auto Scaling adopts the predefined instance type sequence to create the required number of preemptible instances.
  • lowestPrice: Auto Scaling selects instance types that have the most economical vCPU pricing to create the required number of preemptible instances.

Default value: priority.

lowestPrice
MaxInstanceLifetimeinteger

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

Valid values: 0 or [86400, Integer.maxValue]. A value of 0 for MaxInstanceLifetime indicates that a previously set limit has been removed. This effectively disables the maximum instance lifetime constraint.

Default value: null.

Note This parameter is not supported by scaling groups of the Elastic Container Instance type and scaling groups whose ScalingPolicy is set to Recycle.
null
CustomPolicyARNstring

The Alibaba Cloud Resource Name (ARN) of the function that is specified in the custom scale-in policy. This parameter takes effect only if you set the first value of RemovalPolicies to CustomPolicy.

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

The number of instances that are initialized before they are added into the scaling group.

0
ResourceGroupIdstring

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

rg-123****
LoadBalancerConfigsarray<object>

The load balancer configurations.

LoadBalancerConfigobject

The load balancer configuration.

LoadBalancerIdstring

The ID of the CLB instance.

lb-2zep8alpq5zq1a2xwyxxx
Weightinteger

The weight of an ECS instance as a backend server in the CLB server group. An increase in the weight of an ECS instance indicates an increase in the number of access requests that are forwarded to the ECS instance. If you set the weight of an ECS instance to 0, no access requests are forwarded to the ECS instance. Valid values: 0 to 100.

10
EnableDesiredCapacityboolean

Indicates whether the Expected Number of Instances feature is enabled. Valid values:

  • true
  • false
false
Tagsarray<object>

The tags of the scaling group.

Tagobject

The tag of the scaling group.

TagKeystring

The tag key of the scaling group.

Department
TagValuestring

The tag value of the scaling group.

Finance
Propagateboolean

Indicates whether the tags of the scaling group can be propagated to instances. Valid values:

  • true: The tags of the scaling group can be propagated only to new instances.
  • false: The tags of the scaling group cannot be propagated to instances.

Default value: false.

false
HealthCheckTypesarray

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

  • NONE: Auto Scaling does not perform health checks.
  • ECS: Auto Scaling checks the health status of ECS instances in the scaling group.
  • LOAD_BALANCER: Auto Scaling checks the health status of instances in the scaling group based on the health check results of load balancers. The health check results of CLB instances are not used as the basis to perform health checks on the instances in the scaling group.
HealthCheckTypestring

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

  • NONE: Auto Scaling does not perform health checks.
  • ECS: Auto Scaling checks the health status of ECS instances in the scaling group.
  • LOAD_BALANCER: Auto Scaling checks the health status of instances in the scaling group based on the health check results of load balancers. The health check results of CLB instances are not used as the basis to perform health checks on the instances in the scaling group.
ECS
DBInstancesarray<object>

The databases that are attached to the scaling group.

DBInstanceobject

The database that is attached to the scaling group.

DBInstanceIdstring

The ID of the database.

rm-m5eqju85s45mu0***
Typestring

The type of the database. Valid values:

  • RDS.
  • Redis.
  • MongoDB.
RDS
SecurityGroupIdsarray

The IDs of the security groups that are added to the security group whitelist of the attached database.

SecurityGroupIdstring

The ID of the security group that is added to the security group whitelist of the attached database.

If you set RemoveSecurityGroup in the DetachDBInstances operation to true, the security groups specified by this parameter are removed from the security group whitelist of the attached database.

sg-uf65zt66cf2a0q47***

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****",
      "LoadBalancerConfigs": [
        {
          "LoadBalancerId": "lb-2zep8alpq5zq1a2xwyxxx",
          "Weight": 10
        }
      ],
      "EnableDesiredCapacity": false,
      "Tags": [
        {
          "TagKey": "Department",
          "TagValue": "Finance",
          "Propagate": false
        }
      ],
      "HealthCheckTypes": [
        "ECS"
      ],
      "DBInstances": [
        {
          "DBInstanceId": "rm-m5eqju85s45mu0***\n",
          "Type": "RDS",
          "SecurityGroupIds": [
            "sg-uf65zt66cf2a0q47***"
          ]
        }
      ],
      "SpotCapacity": 0
    }
  ]
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-08-21The response structure of the API has changedView Change Details
2024-04-23The response structure of the API has changedView Change Details
2024-02-01The response structure of the API has changedView Change Details
2023-11-14The response structure of the API has changedView Change Details
2023-10-09The response structure of the API has changedView Change Details
2023-09-19The request parameters of the API has changedView Change Details
2023-06-27The response structure of the API has changedView Change Details
2023-03-30The response structure of the API has changedView Change Details
2022-12-22The response structure of the API has changedView Change Details