Deletes a cluster and specifies whether to delete or retain the associated resources of the cluster. Before you delete a cluster, manually clean up workloads such as stateless, stateful, job, and cron job workloads. Otherwise, the cluster deletion may fail.
Operation description
Risk warnings:
Subscription ECS instances and Lingjun computing nodes in the cluster cannot be automatically released. To avoid unnecessary costs, perform a manual release. For more information, see Cluster deletion and node release rules.
Subscription API server SLB resources cannot be automatically released. To avoid unnecessary costs, perform a manual release.
VPCs, vSwitches, security groups, and RAM roles are retained by default if they are used by other resources and cannot be deleted. Perform a manual release.
Elastic Container Instance (ECI) pods created by using virtual nodes are automatically released.
Some cloud resources created by the cluster are not automatically released when the cluster is deleted. These resources continue to incur charges after the cluster is deleted. Release or retain them based on your business requirements. These resources include: Simple Log Service (SLS) projects automatically created by the cluster, and cloud disks purchased by using dynamic volumes.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cs:DeleteCluster |
delete |
*Cluster
|
None | None |
Request syntax
DELETE /clusters/{ClusterId} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClusterId |
string |
Yes |
The ID of the cluster. |
c905d1364c2dd4b6284a3f41790c4**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| retain_all_resources |
boolean |
No |
Specifies whether to retain all resources. If you set this parameter to Valid values:
Default value: |
false |
keep_slb
deprecated
|
boolean |
No |
Specifies whether to retain the Server Load Balancer (SLB) instances created by using Services. Valid values:
Default value: |
false |
| retain_resources |
array |
No |
The list of resources. To retain resources when you delete the cluster, specify the IDs of the corresponding resources. |
|
|
string |
No |
The ID of the resource. |
sg-2ze6ess9kho6fdn9**** |
|
| delete_options |
array<object> |
No |
The deletion options for the resources associated with the cluster. |
|
|
object |
No |
The deletion options for a specific type of resource. |
||
| resource_type |
string |
No |
The type of the resource. Valid values:
|
SLS_Data |
| delete_mode |
string |
No |
The deletion mode for this type of resource. Valid values:
|
delete |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
||
| cluster_id |
string |
The ID of the cluster. |
cb95aa626a47740afbf6aa099b650**** |
| request_id |
string |
The ID of the request. |
687C5BAA-D103-4993-884B-C35E4314**** |
| task_id |
string |
The ID of the task. |
T-5a54309c80282e39ea**** |
Examples
Success response
JSON format
{
"cluster_id": "cb95aa626a47740afbf6aa099b650****",
"request_id": "687C5BAA-D103-4993-884B-C35E4314****",
"task_id": "T-5a54309c80282e39ea****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.