Deleting a Specified Cluster¶
Function¶
This API is used to delete a specified cluster.
Note
The URL for cluster management is in the format of https://Endpoint/uri. In the URL, uri indicates the resource path, that is, the path for API access.
URI¶
DELETE /api/v3/projects/{project_id}/clusters/{cluster_id}
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Project ID. For details about how to obtain the project ID, see How to Obtain Parameters in the API URI. |
cluster_id | Yes | String | Cluster ID. For details about how to obtain the cluster ID, see How to Obtain Parameters in the API URI. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
errorStatus | No | String | This field allows a cluster to be in the Error state if exceptions occur when the cluster is being deleted. If the value of errorStatus is null, the cluster stays in the Deleting state, but not Error. Minimum: 0 Maximum: 10 |
delete_efs | No | String | Whether to delete SFS Turbo resources. Value options:
Default: false Enumeration values:
|
delete_eni | No | String | Whether to delete ENI ports. Value options:
Default: false Enumeration values:
|
delete_evs | No | String | Whether to delete EVS disks. Value options:
Default: false Enumeration values:
|
delete_net | No | String | Whether to delete cluster Service/ingress-related resources, such as ELB. Value options:
Default: false Enumeration values:
|
delete_obs | No | String | Whether to delete the OBS resources. Value options:
Default: false Enumeration values:
|
delete_sfs | No | String | Whether to delete the SFS resources. Value options:
Default: false Enumeration values:
|
Request¶
Request parameters:
Table 3 lists the request parameters.
Parameter | Mandatory | Description |
---|---|---|
Content-Type | Yes | Message body type (format). Possible values:
|
X-Auth-Token | Yes | Requests for calling an API can be authenticated using either a token or AK/SK. If token-based authentication is used, this parameter is mandatory and must be set to a user token. For details on how to obtain a user token, see API Usage Guidelines. |
Example request:
N/A
Response¶
Response parameters:
Table 4 describes response parameters.
Parameter | Type | Description |
---|---|---|
kind | String | API type. The value is fixed at Cluster and cannot be changed. |
apiVersion | String | API version. The value is fixed at v3 and cannot be changed. |
metadata | metadata object | Cluster metadata, which is a collection of attributes. |
spec | spec object | Detailed description of the cluster targeted by this API. CCE creates or updates objects by defining or updating its spec. |
status | ClusterStatus object | Cluster status and jobID of the job that deletes a specified project. |
Parameter | Type | Description |
---|---|---|
phase | String | Cluster status. Possible values:
|
jobID | String | Job ID. |
reason | String | Reason of cluster state change. This parameter is returned if the cluster is not in the Available state. |
message | String | Detailed information about why the cluster changes to the current state. This parameter is returned if the cluster is not in the Available state. |
endpoints | ClusterEndpoints objects | Access address of kube-apiserver in the cluster. |
deleteOption | deleteOption Object | Whether to delete configurations. This parameter is contained only in the response to the deletion request. |
deleteStatus | deleteStatus Object | Whether to delete the status information. This parameter is contained only in the response to the deletion request. |
Parameter | Type | Description |
---|---|---|
internal | String | Internal network address. |
external | String | External network address. |
external_otc | String | Endpoint of the cluster to be accessed through API Gateway. |
Parameter | Type | Description |
---|---|---|
delete_sfs | String | Whether to delete SFS Turbo resources. Value options:
Default: delete-false Enumeration values:
|
delete_eni | String | Whether to delete ENI ports. Value options:
Default: delete-false Enumeration values:
|
delete_evs | String | Whether to delete EVS disks. Value options:
Default: delete-false Enumeration values:
|
delete_net | String | Whether to delete cluster Service/ingress-related resources, such as ELB. Value options:
Default: delete-false Enumeration values:
|
delete_obs | String | Whether to delete the OBS resources. Value options:
Default: delete-false Enumeration values:
|
delete_sfs | String | Whether to delete the SFS resources. Value options:
Default: delete-false Enumeration values:
|
Parameter | Type | Description |
---|---|---|
previous_total | Integer | Total number of existing cluster resource records when the cluster is deleted. |
current_total | Integer | Latest number of resource records, which is generated based on the current cluster resource records. |
updated | Integer | Total number of resource records updated when the cluster is deleted. |
added | Integer | Total number of resource records updated when the cluster is deleted. |
deleted | Integer | Total number of resource records deleted when the cluster is deleted. |
Response example:
{
"kind": "Cluster",
"apiVersion": "v3",
"metadata": {
"name": "mycluster",
"uid": "7a661f82-90d9-11ea-9f85-0255ac10110d",
"creationTimestamp": "2020-05-08 03:10:32.403757 +0000 UTC",
"updateTimestamp": "2020-05-08 03:18:29.238331 +0000 UTC"
},
"spec": {
"type": "VirtualMachine",
"flavor": "cce.s1.small",
"version": "v1.17.9-r0",
"az": "eu-de-01",
"ipv6enable": false,
"supportIstio": true,
"hostNetwork": {
"vpc": "23d3725f-6ffe-400e-8fb6-b4f9a7b3e8c1",
"subnet": "c90b3ce5-e1f1-4c87-a006-644d78846438",
"SecurityGroup": "11fb88d1-0fc9-422d-963d-374ababa5f57"
},
"containerNetwork": {
"mode": "overlay_l2",
"cidr": "172.16.0.0/16"
},
"authentication": {
"mode": "rbac",
"authenticatingProxy": {}
},
"billingMode": 0,
"extendParam": {
"alpha.cce/fixPoolMask": "",
"kubernetes.io/cpuManagerPolicy": "",
"upgradefrom": ""
},
"kubernetesSvcIpRange": "10.247.0.0/16",
"kubeProxyMode": "iptables"
},
"status": {
"phase": "Available",
"jobID": "f5fd8cbf-90db-11ea-9f85-0255ac10110d",
"endpoints": {
"Internal": "https://192.168.0.61:5443",
"External": "https://10.185.69.54:5443",
"external_otc": "https://a140174a-2f3e-11e9-9f91-0255ac101405.cce.eu-de.otc.t-systems.com"
},
"deleteOption": {
"delete_eni": "delete-skip",
"delete_net": "delete-block",
"delete_evs": "delete-skip",
"delete_sfs": "delete-skip",
"delete_obs": "delete-skip",
"delete_efs": "delete-skip"
},
"deleteStatus": {
"previous_total": 0,
"current_total": 15,
"updated": 0,
"added": 15,
"deleted": 0
}
}
}
Status Code¶
Table 9 describes the status code of this API.
Status Code | Description |
---|---|
200 | The job for deleting a cluster is successfully delivered. |
For details about error status codes, see Status Code.