import requests
url = "https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/state-snapshot-retention"
payload = { "retention_days": 30 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({retention_days: 30})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/state-snapshot-retention', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/state-snapshot-retention \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"retention_days": 30
}
'{
"cluster_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"retention_days": 30,
"is_default": false,
"default_retention_days": 7,
"minimum_retention_days": 1,
"maximum_retention_days": 90,
"keep_latest": 4
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Set state snapshot retention
Sets the cluster’s retention window for its scheduled etcd backups, in days between 1 and 90 (ankra cluster state-snapshots retention --days N). From the next retention pass on, Ankra keeps the newest backup of each UTC day within the window, on top of the four newest backups. A shorter window deletes the daily backups that fall outside it from the backup vault; a longer one keeps backups from then on and cannot bring back ones already deleted. The newest backup from before the cluster’s last start and its last recovery incidents is kept whatever the window. Every change is recorded in the organisation’s audit log; re-sending the current value changes nothing. Requires clusters.write on the cluster.
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/state-snapshot-retention"
payload = { "retention_days": 30 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({retention_days: 30})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/state-snapshot-retention', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/state-snapshot-retention \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"retention_days": 30
}
'{
"cluster_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"retention_days": 30,
"is_default": false,
"default_retention_days": 7,
"minimum_retention_days": 1,
"maximum_retention_days": 90,
"keep_latest": 4
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Authorizations
Body
Response
Successful response
A cluster's retention window for its scheduled etcd backups.