import requests
url = "https://api.platform.ankra.app/org/ai-remediation/policy/clusters/{cluster_id}"
headers = {"cookie": "ankra_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'ankra_session='}};
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 GET \
--url https://api.platform.ankra.app/org/ai-remediation/policy/clusters/{cluster_id} \
--cookie ankra_session={
"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>"
}
]
}Get a cluster's remediation scope
Whether the auto-remediation policy’s cluster lists admit one cluster, and why, with the policy’s state beside it. Readable by any member who can see the cluster; a cluster that is not the organisation’s answers 404. An organisation with no policy reads the default document: every cluster in scope, policy_configured false.
import requests
url = "https://api.platform.ankra.app/org/ai-remediation/policy/clusters/{cluster_id}"
headers = {"cookie": "ankra_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'ankra_session='}};
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 GET \
--url https://api.platform.ankra.app/org/ai-remediation/policy/clusters/{cluster_id} \
--cookie ankra_session={
"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.
Path Parameters
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.