You can call this operation to delete a scaling group.

Description

You can call this operation to delete a scaling group.

The ForceDelete parameter specifies whether to forcibly delete a scaling group and remove or release its associated ECS instances when the scaling group contains ECS instances or is executing any scaling activity.

  • If the ForceDelete parameter is set to false and the following two conditions are met, the scaling group is stopped and then deleted.
    • Condition 1: The scaling group is not executing any scaling activity.
    • Condition 2: The number of ECS instances in the scaling group (Total Capacity) is 0.
  • If the ForceDelete parameter is set to true, the scaling group is disabled to reject new scaling requests. When the existing scaling activities are completed, all ECS instances are removed from the scaling group and the group is then deleted. Manually added ECS instances are removed from the scaling group, whereas automatically created instances are deleted.

Deleting a scaling group also deletes its scaling configurations, rules, activities, and requests.

The following tasks and instances are not deleted when a scaling group is deleted: scheduled tasks, CloudMonitor monitoring tasks, SLB instances, and RDS instances.

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
ScalingGroupId String Yes dmIDKNcyWfzncX9MWX1****

The ID of the scaling group.

Action String No DeleteScalingGroup

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

ForceDelete Boolean No false

Specifies whether to forcibly delete a scaling group and remove and release its ECS instances when the scaling group contains ECS instances or is executing any scaling activity. Valid values:

  • true: deletes the scaling group.
  • false: does not delete the scaling group.

Default value: false

Response parameters

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

The ID of the request.

Examples

Sample requests


http://ess.aliyuncs.com/?Action=DeleteScalingGroup
&ScalingGroupId=dmIDKNcyWfzncX9MWX1****
&<Common request parameters>

Sample success responses

XML format

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

JSON format

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

Error codes

For more information about error codes, visit 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 specified scaling group does not exist in the current 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 specified 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 specified scaling group still contains ECS instances.