All Products
Search
Document Center

Container Service for Kubernetes:UpdateResourcesDeleteProtection

Last Updated:Aug 28, 2026

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cs:UpdateResourcesDeleteProtection

update

*Cluster

acs:cs:{#regionId}:{#accountId}:cluster/{#ClusterId}

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 :

    deletion protection is enabled.

  • disable :

    deletion protection is disabled.

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.