Set the security baseline policy mode (audit or enforce)
import requests
url = "https://platform.ankra.app/org/clusters/imported/{cluster_id}/security/policy-mode"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://platform.ankra.app/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 POST \
--url https://platform.ankra.app/org/clusters/imported/{cluster_id}/security/policy-mode \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'{
"commit_sha": "<string>",
"commit_url": "<string>",
"mode": "audit",
"valid": true
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}Security
Set the security baseline policy mode (audit or enforce)
POST
/
org
/
clusters
/
imported
/
{cluster_id}
/
security
/
policy-mode
Set the security baseline policy mode (audit or enforce)
import requests
url = "https://platform.ankra.app/org/clusters/imported/{cluster_id}/security/policy-mode"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://platform.ankra.app/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 POST \
--url https://platform.ankra.app/org/clusters/imported/{cluster_id}/security/policy-mode \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'{
"commit_sha": "<string>",
"commit_url": "<string>",
"mode": "audit",
"valid": true
}{
"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
Body
application/json
Available options:
audit, enforce