You can call the DeleteCluster operation to delete a Container Service for Kubernetes (ACK) cluster by ID and release all nodes in the cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request syntax

DELETE /clusters/ClusterId?retain_all_resources=Boolean&keep_slb=Boolean&retain_resources=["String"] HTTP/1.1
Content-Type:application/json

Request parameters

Table 1. Request path parameters
ParameterTypeRequiredExampleDescription
ClusterIdStringYesc905d1364c2dd4b6284a3f41790c4****

The ID of the cluster.

Table 2. Request query parameters
ParameterTypeRequiredExampleDescription
retain_all_resourcesBooleanNofalse

Specifies whether to retain all resources. If you set the parameter to true, the retain_resources parameter is ignored.

  • true: retains all resources.
  • false: does not retain all resources.

Default value: false.

keep_slbBooleanNofalse

Specifies whether to retain the Server Load Balancer (SLB) instances that are created by the cluster.

  • true: retains the SLB instances that are created by the cluster.
  • false: does not retain the SLB instances that are created by the cluster.

Default value: false.

retain_resourcesArray of StringNosg-2ze6ess9kho6fdn9****

The names of the resources that you want to retain.

Response syntax

HTTP/1.1 200 OK
Content-Type:application/json

{
  "task_id" : "String"
}

Response parameters

Table 3. Response body parameters
ParameterTypeExampleDescription
task_idStringT-5a54309c80282e39ea****

The ID of the task.

Examples

Sample requests

DELETE /clusters/c905d1364c2dd4b6284a3f41790c4****?retain_all_resources=false&keep_slb=false&retain_resources=["sg-2ze6ess9kho6fdn9****"] HTTP/1.1
Host:cs.aliyuncs.com
Content-Type:application/json

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DeleteClusterResponse>
    <task_id>T-5a54309c80282e39ea****</task_id>
</DeleteClusterResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "task_id" : "T-5a54309c80282e39ea****"
}

Error codes

For a list of error codes, visit the API Error Center.