Updates the deletion protection status of the specified resources. You can enable or disable deletion protection for namespaces and Services. You can call this operation to enable deletion protection for namespaces or Services that involve businesses-critical and sensitive data to avoid incurring maintenance costs caused by accidental namespace or Service deletion.
Operation description
调用本接口前,您需要先为集群安装或升级安全策略组件。具体操作,请参见启用安全策略管理。
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cs:UpdateResourcesDeleteProtection |
update |
*Cluster
|
None | None |
Request syntax
PUT /clusters/{ClusterId}/resources/protection HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClusterId |
string |
Yes |
The ID of the cluster. |
c850429a2287b4d968e27e87a4921**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body that specifies the status of deletion protection for the specified resource. |
|
| namespace |
string |
No |
The namespace to which the resource belongs. |
default |
| resource_type |
string |
Yes |
The type of resource for which deletion protection is enabled or disabled. You can specify namespaces or Services. |
services |
| resources |
array |
No |
The resources list. |
|
|
string |
No |
The name of the resource. |
test |
|
| enable |
boolean |
No |
Specifies whether to enable deletion protection. Set the value to true to enable deletion protection and set the value to false to disable deletion protection. |
true |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| requestId |
string |
Id of the request |
0527ac9a-c899-4341-a21a-xxxxxxxxx |
| namespace |
string |
The namespace to which the resource belongs. |
default |
| resource_type |
string |
The type of resource for which deletion protection is enabled or disabled. |
namespaces |
| resources |
array |
The list of resources whose deletion protection status is updated. |
|
|
string |
The name of the resource whose deletion protection status is updated. |
test1 |
|
| protection |
string |
Indicates the status of deletion protection. A value of true indicates that deletion protection is enabled and a value of false indicates that deletion protection is disabled. Valid values:
|
enable |
Examples
Success response
JSON format
{
"requestId": "0527ac9a-c899-4341-a21a-xxxxxxxxx",
"namespace": "default",
"resource_type": "namespaces",
"resources": [
"test1"
],
"protection": "enable"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.