import requests
url = "https://api.platform.ankra.app/org/ai-remediation/policy/clusters/{cluster_id}"
payload = { "in_scope": True }
headers = {
"cookie": "ankra_session=",
"X-Ankra-CSRF": "<x-ankra-csrf>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
cookie: 'ankra_session=',
'X-Ankra-CSRF': '<x-ankra-csrf>',
'Content-Type': 'application/json'
},
body: JSON.stringify({in_scope: true})
};
fetch('https://api.platform.ankra.app/org/ai-remediation/policy/clusters/{cluster_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://api.platform.ankra.app/org/ai-remediation/policy/clusters/{cluster_id} \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--data '
{
"in_scope": true
}
'{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"in_scope": true,
"scope_reason": "all_clusters",
"policy_configured": true,
"policy_enabled": true,
"autonomy_level": "read_only",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Set a cluster's remediation scope
Puts one cluster in or out of the auto-remediation policy’s scope in a single change, so two clusters switched at once both land. in_scope false adds the cluster to cluster_exclude_list and removes it from cluster_allow_list when there is one; true removes it from cluster_exclude_list and adds it to cluster_allow_list when there is one that does not name it. An organisation with no policy gets the default document carrying the change. Repeating a call changes nothing but updated_at. Organisation admins only.
import requests
url = "https://api.platform.ankra.app/org/ai-remediation/policy/clusters/{cluster_id}"
payload = { "in_scope": True }
headers = {
"cookie": "ankra_session=",
"X-Ankra-CSRF": "<x-ankra-csrf>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
cookie: 'ankra_session=',
'X-Ankra-CSRF': '<x-ankra-csrf>',
'Content-Type': 'application/json'
},
body: JSON.stringify({in_scope: true})
};
fetch('https://api.platform.ankra.app/org/ai-remediation/policy/clusters/{cluster_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://api.platform.ankra.app/org/ai-remediation/policy/clusters/{cluster_id} \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--data '
{
"in_scope": true
}
'{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"in_scope": true,
"scope_reason": "all_clusters",
"policy_configured": true,
"policy_enabled": true,
"autonomy_level": "read_only",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Browser session. Mutations also require X-Ankra-CSRF.
Headers
Must match the CSRF cookie.
Path Parameters
Body
false takes the cluster out of scope, true puts it back.
Response
The cluster's scope.
One cluster's place in the auto-remediation policy's cluster scope. in_scope says only whether the policy's cluster lists admit the cluster; whether remediation actually runs there also needs policy_enabled and an autonomy_level other than read_only.
true when the cluster lists admit the cluster.
Why: all_clusters when there is no allow list and the cluster is not excluded, listed when the allow list names it, excluded when the exclusion list names it (whatever the allow list says), not_listed when an allow list is set that does not name it.
all_clusters, listed, excluded, not_listed false when the organisation has no policy row, so every other field is the default document.
read_only, propose, auto When the policy was last written; null exactly when policy_configured is false.