Deletes stacks for specified accounts in specified regions.
This topic provides an example on how to delete stacks from a stack group. In this example, the stacks that are deployed within the 151266687691****
Alibaba Cloud account in the China (Beijing) region are deleted from a stack group named MyStackGroup
. The stack group is deployed in the China (Hangzhou) region and granted self-managed permissions.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DeleteStackInstances | The operation that you want to perform. Set the value to DeleteStackInstances. |
RegionId | String | Yes | cn-hangzhou | The ID of the region to which the stack group belongs. You can call the DescribeRegions operation to query the most recent region list. |
StackGroupName | String | Yes | MyStackGroup | The name of the stack group. The name must be unique in a region. The name can be up to 255 characters in length, and can contain digits, letters, hyphens (-), and underscores (_). The name must start with a digit or letter. |
AccountIds | Array of String | No | ["151266687691****","141261387191****"] | The IDs of the accounts within the self-managed permission model is used to deploy stacks. You can specify up to 20 account IDs. |
RegionIds | Array of String | Yes | ["cn-hangzhou","cn-beijing"] | The IDs of the regions from which you want to delete the stacks. You can specify up to 20 region IDs. |
RetainStacks | Boolean | Yes | false | Specifies whether to retain the stacks. Valid values:
|
ClientToken | String | No | 123e4567-e89b-12d3-a456-42665544**** | The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that the value is unique among different requests. The token can be up to 64 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). For more information, see Ensure idempotence. |
OperationDescription | String | No | Delete stack instances in hangzhou and beijing | The description of the operation that you want to perform to delete the stacks. The description must be 1 to 256 characters in length. |
OperationPreferences | Map | No | {"FailureToleranceCount": 1, "MaxConcurrentCount": 2} | The settings that you configure to delete the stacks. The following parameters are included:
Separate multiple parameters with commas (,).
Note
|
DeploymentTargets | Object | No | The folders in which the service-managed permission model is used to deploy stacks. |
|
RdFolderIds | Array of String | Yes | ["fd-4PvlVLOL8v"] | The IDs of the folders in the resource directory. You can specify up to five folder IDs. You can create stacks within all members in the specified folders. If you create stacks in the Root folder, the stacks are created within all members in the resource directory.
Note To view the folder IDs, go to the
Overview page in the
Resource Management console. For more information, see
View the basic information of a folder.
|
For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 14A07460-EBE7-47CA-9757-12CC4761D47A | The ID of the request. |
OperationId | String | 6da106ca-1784-4a6f-a7e1-e723863d**** | The ID of the operation. |
Examples
Sample requests
http(s)://ros.aliyuncs.com/?Action=DeleteStackInstances
&AccountIds=["151266687691****"]
&RegionId=cn-hangzhou
&RegionIds=["cn-beijing"]
&StackGroupName=MyStackGroup
&RetainStacks=false
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DeleteStackInstancesResponse>
<RequestId>14A07460-EBE7-47CA-9757-12CC4761D47A</RequestId>
<OperationId>6da106ca-1784-4a6f-a7e1-e723863d****</OperationId>
</DeleteStackInstancesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "14A07460-EBE7-47CA-9757-12CC4761D47A",
"OperationId" : "6da106ca-1784-4a6f-a7e1-e723863d****"
}
Error codes
For a list of error codes, see Service error codes.
Error code |
Error message |
HTTP status code |
Description |
---|---|---|---|
InvalidParameter |
The specified parameter {name} is invalid, {reason}. |
400 |
The error message returned because the parameter is invalid. name indicates the parameter name. reason indicates the cause of the error. |
StackGroupNotFound |
The StackGroup ({name}) could not be found. |
404 |
The error message returned because the stack group does not exist. name indicates the name of the stack group. |
StackGroupOperationInProgress |
Another Operation on StackGroup ({name}) is in progress. |
409 |
The error message returned because an operation is being performed on the stack group. name indicates the name of the stack group. |