Get one imported cluster's aggregated policy violations
import requests
url = "https://platform.ankra.app/org/clusters/imported/{cluster_id}/security/policy-violations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/org/clusters/imported/{cluster_id}/security/policy-violations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/org/clusters/imported/{cluster_id}/security/policy-violations \
--header 'Authorization: Bearer <token>'{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"detail": "<string>",
"policies": [
{
"category": "<string>",
"fail_count": 123,
"pass_count": 123,
"policy": "<string>",
"severity": "<string>",
"top_namespaces": [
{
"fail_count": 123,
"namespace": "<string>"
}
],
"warn_count": 123
}
],
"policy_mode": "audit",
"report_count": 123,
"status": "available",
"totals": {
"error": 123,
"fail": 123,
"pass": 123,
"skip": 123,
"warn": 123
}
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>",
"error_code": "CLUSTER_OFFLINE",
"retry_after": 123
}Security
Get one imported cluster's aggregated policy violations
GET
/
org
/
clusters
/
imported
/
{cluster_id}
/
security
/
policy-violations
Get one imported cluster's aggregated policy violations
import requests
url = "https://platform.ankra.app/org/clusters/imported/{cluster_id}/security/policy-violations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/org/clusters/imported/{cluster_id}/security/policy-violations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/org/clusters/imported/{cluster_id}/security/policy-violations \
--header 'Authorization: Bearer <token>'{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"detail": "<string>",
"policies": [
{
"category": "<string>",
"fail_count": 123,
"pass_count": 123,
"policy": "<string>",
"severity": "<string>",
"top_namespaces": [
{
"fail_count": 123,
"namespace": "<string>"
}
],
"warn_count": 123
}
],
"policy_mode": "audit",
"report_count": 123,
"status": "available",
"totals": {
"error": 123,
"fail": 123,
"pass": 123,
"skip": 123,
"warn": 123
}
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>",
"error_code": "CLUSTER_OFFLINE",
"retry_after": 123
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
The cluster's aggregated Kyverno policy-report rollup (per-policy pass/warn/fail counts with top offending namespaces) plus the stored audit/enforce mode; not_available with a detail when Kyverno has published nothing.
Show child attributes
Show child attributes
Available options:
audit, enforce Available options:
available, not_available Show child attributes
Show child attributes