You SetDeletionProtection call this operation to modify deletion protection for a stack.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | SetDeletionProtection |
The operation that you want to perform. Set the value to SetDeletionProtection. |
DeletionProtection | String | Yes | Enabled |
Indicates whether stack deletion protection is enabled. Valid values:
Note The deletion of nested stacks is the same as the root stack.
|
RegionId | String | Yes | cn-hangzhou |
The region ID of the stack. You can call the DescribeRegions operation to query the most recent region list. |
StackId | String | Yes | 4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
The ID of the stack. The delete protection attribute of a nested stack is determined by the root stack and remains unchanged from the root stack. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | B288A0BE-D927-4888-B0F7-B35EF84B6E6F |
The ID of the request. |
Examples
Sample requests
http(s)://ros.aliyuncs.com/? Action=SetDeletionProtection
&DeletionProtection=Enabled
&RegionId=cn-hangzhou
&StackId=4a6c9851-3b0f-4f5f-b4ca-a14bf691****
&<Common request parameters>
Sample success responses
XML
format
<SetDeletionProtectionResponse>
<RequestId>B288A0BE-D927-4888-B0F7-B35EF84B6E6F</RequestId>
</SetDeletionProtectionResponse>
JSON
format
{
"RequestId": "B288A0BE-D927-4888-B0F7-B35EF84B6E6F"
}
Error codes
For more information about error codes, visit API Error Center.
HTTP status code |
Error code |
Error message |
Description |
---|---|---|---|
400 |
InvalidOperation.SetDeletionProtection |
Fail to set deletion protection for {type} {ID}, {reason}. |
Failed to set deletion protection. type indicates the type of the operation object, ID indicates the ID of the operation object, and reason indicates the reason of the failure. |
404 |
StackNotFound |
The Stack ({name}) could not be found. |
The error message returned because the specified stack does not exist. name indicates the name or ID of the stack. |