import requests
url = "https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/environment"
payload = { "environment": "<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({environment: '<string>'})
};
fetch('https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/environment', 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}/environment \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"environment": "<string>"
}
'{
"criticality": "production",
"environment": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "<string>",
"error_code": "LOCK_TIMEOUT",
"retry_after": 123
}Set what a cluster is called and what it is for (browser session)
Sets the environment label and, when the body carries one, the criticality that decides how loudly the cluster reports. Both are written in a single transaction because to the operator they are one decision: picking an environment without a matching criticality is how a cluster ends up labelled for testing while the insight scanner still grades every finding on it at production weight. A body without a criticality leaves the stored one untouched and answers with the environment alone, which is the shape every caller written before the two settings were merged sends and expects. A member’s own session records the label as their choice of what the cluster is for (environment_source person). Ankra staff in a support session record it as automation, which confirms nothing, and may not take production away from the cluster: moving it off a production label or lowering a production criticality answers 403. Nor may they relabel the cluster into or out of a dynamic cluster group with an environment selector, or change whether the cluster’s tickets pass the ticket notify allow-list: that answers 403 too, and nothing is written. Requires clusters.write.
import requests
url = "https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/environment"
payload = { "environment": "<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({environment: '<string>'})
};
fetch('https://api.platform.ankra.app/org/clusters/imported/{cluster_id}/environment', 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}/environment \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"environment": "<string>"
}
'{
"criticality": "production",
"environment": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "<string>",
"error_code": "LOCK_TIMEOUT",
"retry_after": 123
}