import requests
url = "https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/name"
payload = { "name": "<string>" }
headers = {
"cookie": "ankra_session=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {cookie: 'ankra_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/name', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/name \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"name": "<string>"
}
'{
"changed": true,
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"iac_directory": "<string>",
"name": "<string>",
"previous_name": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}Rename a cluster (browser session)
Renames the cluster in place: the platform record name changes, and nothing that was built from the name when the cluster was made does. Server names, hostnames and Kubernetes node names, the cluster’s DNS zone, kubeconfig server URLs, kube tokens, access grants, API tokens, hosted metrics and logs, backups and Vault paths are keyed by the cluster id or were fixed at creation, and keep working. The GitOps directory is pinned to the one the old name resolved to (iac_directory), so stored paths stay valid. The old name is recorded: an ImportCluster file that still names it is refused by cluster apply with 409 naming the current name, instead of creating a second cluster, and an organisation-wide Alertmanager credential still places firings labelled with the old name on this cluster. A cluster synced with a connected GitOps repository, and an Ankra Cloud cluster, are refused with 409. Requires clusters.write at the cluster.
import requests
url = "https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/name"
payload = { "name": "<string>" }
headers = {
"cookie": "ankra_session=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {cookie: 'ankra_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/name', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/name \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"name": "<string>"
}
'{
"changed": true,
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"iac_directory": "<string>",
"name": "<string>",
"previous_name": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}Authorizations
Body
Response
The cluster's name after the write and the name it had before