Deletes a scaling group.

Description

Before you call the DeleteScalingGroup operation to delete a scaling group, take note of the following items:

  • If you delete a scaling group, the scaling configuration, scaling rules, scaling activities, and scaling requests related to the scaling group are also deleted.
  • If you delete a scaling group, the scheduled tasks and event-triggered tasks of the scaling group are not deleted. The Server Load Balancer (SLB) instances and ApsaraDB RDS instances with which the scaling group is associated are also not deleted.

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 DeleteScalingGroup

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

ScalingGroupId String Yes asg-bp18p2yfxow2dloq****

The ID of the scaling group.

ForceDelete Boolean No false

Specifies whether to forcibly delete the scaling group and remove and release Elastic Compute Service (ECS) instances in the scaling group when the ECS instances or ongoing scaling activities exist in the scaling group. Valid values:

  • true: The scaling group is disabled and new scaling requests are rejected. After all existing scaling requests are processed, the ECS instances in the scaling group are removed. Then, the scaling group is deleted. If the ECS instances are manually added to the scaling group, the ECS instances are removed. If the ECS instances are automatically created in the scaling group, the ECS instances are removed and released.
  • false: You can set this parameter to false if the following conditions are met:
    • No ongoing scaling activities exist in the scaling group.
    • The Total Capacity parameter is set to 0, which specifies that no ECS instances exist in the scaling group.

Default value: false.

RegionId String No cn-qingdao

The ID of the region where the scaling group resides.

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

Examples

Sample requests

http(s)://ess.aliyuncs.com/?Action=DeleteScalingGroup
&ScalingGroupId=asg-bp18p2yfxow2dloq****
&ForceDelete=false
&RegionId=cn-qingdao
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DeleteScalingGroupResponse>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
</DeleteScalingGroupResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

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

HTTP status code

Error code

Error message

Description

404

InvalidScalingGroupId.NotFound

The specified scaling group does not exist.

The error message returned because the scaling group does not exist within the Alibaba Cloud account.

403

Forbidden.Unauthorized

A required authorization for the specified action is not supplied.

The error message returned because Auto Scaling is not authorized to call the operation.

400

InstanceInUse

You cannot delete a scaling configuration or scaling group while there is an instance associated with it.

The error message returned because the scaling group contains ECS instances.