import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/security/policy-mode"
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/api/v1/org/clusters/imported/{cluster_id}/security/policy-mode', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/security/policy-mode \
--header 'Authorization: Bearer <token>'{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"policy_engine_installed": true,
"policy_mode": "off",
"requested_mode": "off"
}{
"detail": "<string>"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}Get one imported cluster's stored security policy mode
Returns the security-baseline policy mode the platform has stored for the cluster (off, audit or enforce), read from the database without contacting the cluster, so it answers while the cluster is offline. off means the policy engine was switched off and is not installed; null means no security baseline is installed. Requires security.read.
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/security/policy-mode"
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/api/v1/org/clusters/imported/{cluster_id}/security/policy-mode', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/security/policy-mode \
--header 'Authorization: Bearer <token>'{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"policy_engine_installed": true,
"policy_mode": "off",
"requested_mode": "off"
}{
"detail": "<string>"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
The cluster's stored security-baseline policy mode: off, audit or enforce, or null when no security baseline is installed.
A cluster's stored security-baseline policy mode, read from the database.
Whether a Kyverno or kyverno-policies add-on is installed and not being removed.
off, audit or enforce; null when the cluster carries no security baseline. off whenever no policy engine is installed and the stored baseline does not enforce.
off, audit, enforce The mode the last policy-mode write asked for; null when no mode was ever set.
off, audit, enforce