import requests
url = "https://platform.ankra.app/api/v1/clusters/morpheus/{cluster_id}/node-groups/{group_name}/nodes/{node}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/clusters/morpheus/{cluster_id}/node-groups/{group_name}/nodes/{node}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request DELETE \
--url https://platform.ankra.app/api/v1/clusters/morpheus/{cluster_id}/node-groups/{group_name}/nodes/{node} \
--header 'Authorization: Bearer <token>'{
"group_name": "<string>",
"node_name": "<string>",
"kubernetes_node_name": "<string>",
"node_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"previous_count": 123,
"new_count": 123,
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"status": "accepted",
"group_name": "<string>",
"node_name": "<string>",
"kubernetes_node_name": "<string>",
"node_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"previous_count": 123,
"new_count": 123,
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Remove a node from a node group of a HPE Morpheus cluster
Removes one named worker from its node group and lowers the group’s count by one. node is the worker’s node id, its server name, the name of the Kubernetes node it registered as, or the providerID that node reports, matched case-insensitively; escape the slashes of a providerID (hcloud:%2F%2F168428300). The worker is drained through its PodDisruptionBudgets from a surviving control plane and then deleted; if the drain is refused the worker stays in service, the group keeps its count, and the operation fails with the reason; ask for the same removal again once it is resolved. Pass force_drain=true to take the worker down on a cluster teardown’s drain instead. Refused with 409: any removal while the cluster is stopped (start the cluster first), a control plane, a worker of another group, a worker already marked for deletion or whose server is stopping, the group’s last node that has joined the cluster (scale the node group to 0 or delete it instead), a removal that would take an autoscaling group below its min_count (for both, a worker still being created or whose node never joined the cluster does not count), a name several nodes answer to, one already leaving included (the answer names each by its node id), a name the platform cannot resolve right now (a providerID while it has no current view of the cluster’s nodes, or while a candidate’s node reports no providerID or one another node shares; on AWS a node name it has not recorded yet), and a providerID the candidates’ nodes cannot be matched with because they report only a k3s:// placeholder, which a node keeps for good; name the node by its server name or node id instead. A node the node group does not have answers 404, a providerID none of the group’s nodes reports included once every candidate’s node reports its own, and a UUID that is no node’s id even while an AWS node name is not recorded yet; a blank node, or a path segment that is not valid percent-encoding, answers 422. By default the change runs in the background and the call answers 202 {"status": "accepted"}, with the removed node, the counts and operation_id when the removal was decided within the request (409 if the same removal is already in flight; a refusal decided later is put on the cluster’s operations list); pass wait=true to run it in the request and receive the result with 200. Requires clusters.delete.
import requests
url = "https://platform.ankra.app/api/v1/clusters/morpheus/{cluster_id}/node-groups/{group_name}/nodes/{node}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/clusters/morpheus/{cluster_id}/node-groups/{group_name}/nodes/{node}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request DELETE \
--url https://platform.ankra.app/api/v1/clusters/morpheus/{cluster_id}/node-groups/{group_name}/nodes/{node} \
--header 'Authorization: Bearer <token>'{
"group_name": "<string>",
"node_name": "<string>",
"kubernetes_node_name": "<string>",
"node_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"previous_count": 123,
"new_count": 123,
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"status": "accepted",
"group_name": "<string>",
"node_name": "<string>",
"kubernetes_node_name": "<string>",
"node_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"previous_count": 123,
"new_count": 123,
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The worker to remove: its node id, its server name, its Kubernetes node name, or the providerID its node reports with its slashes escaped as %2F. Matched case-insensitively.
Query Parameters
Take the worker down on a cluster teardown's drain, without honouring PodDisruptionBudgets. Off by default: the worker is drained through its budgets, and a refused drain keeps the worker and the group's count and fails the operation naming what refused it.
Response
The worker is being removed (wait=true)
The server name of the removed worker, as the node group's node list shows it. It is not always the name of its Kubernetes node: that is kubernetes_node_name.
The name of the Kubernetes node the removed worker registered as: its lowercased server name on every provider but AWS, where it is the EC2 private DNS name the platform records once the instance exists. Null while that is not recorded yet.
The node id of the removed worker.
The group's node count before the removal.
The group's node count once the worker is gone.
The operation draining and deleting the worker, followed on /api/v1/org/executions/{execution_id}. Null when the request created none: the removal is saved and the platform's reconcile dispatches it, because the request could not start the operation itself: another operation is still changing a node of the cluster, or a reconcile pass holds the cluster's dispatch; the cluster is inside a force-stop admission window; the work waits for the cluster's agent, which is offline; the re-planned deletes are held to their retry backoff; or creating the operation failed.