import requests
url = "https://platform.ankra.app/api/v1/org/registry-storage/retention"
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/registry-storage/retention', 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/registry-storage/retention \
--header 'Authorization: Bearer <token>'{
"organisation_id": "<string>",
"default": {
"keep_days": 1825,
"keep_latest": 500
},
"platform_default": {
"keep_days": 1825,
"keep_latest": 500
},
"source": "default",
"updated_by": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"rules": [
{
"id": "<string>",
"repository_pattern": "<string>",
"application_id": "<string>",
"keep_days": 123,
"keep_latest": 123,
"updated_by": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"recently_pulled_days": 123,
"runs_daily_at": "<string>",
"space_freed_at": "<string>",
"version": "<string>",
"rule_slots": {
"used": 1,
"limit": 2
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get registry retention
Read which images the organisation keeps: its project-wide retention policy (or the platform default), its per-repository rules, the protections every organisation-set policy carries, when retention runs and when deleted images stop counting against storage. A browser session twin is mounted at the same path without the /api/v1 prefix (cookie authentication).
import requests
url = "https://platform.ankra.app/api/v1/org/registry-storage/retention"
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/registry-storage/retention', 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/registry-storage/retention \
--header 'Authorization: Bearer <token>'{
"organisation_id": "<string>",
"default": {
"keep_days": 1825,
"keep_latest": 500
},
"platform_default": {
"keep_days": 1825,
"keep_latest": 500
},
"source": "default",
"updated_by": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"rules": [
{
"id": "<string>",
"repository_pattern": "<string>",
"application_id": "<string>",
"keep_days": 123,
"keep_latest": 123,
"updated_by": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"recently_pulled_days": 123,
"runs_daily_at": "<string>",
"space_freed_at": "<string>",
"version": "<string>",
"rule_slots": {
"used": 1,
"limit": 2
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
Successful Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
default, organisation Repository rules, ordered by pattern byte by byte. Where patterns overlap, the most specific rule that matches a repository decides it: the pattern with the most characters other than *, and on a tie the first in this order.
Show child attributes
Show child attributes
Images pulled within this many days are kept under an organisation-set policy; 0 on the platform default.
When the organisation project's retention runs, HH:MM UTC.
When deleted images stop counting against storage.
Opaque version of the stored policy and rules. Send it back as expected_version when saving; never parse it.
How many of the registry's retention rules this retention takes in the organisation's project, out of how many the registry accepts. The organisation-wide default and every repository rule take one for keep_days (when above 0) and one for keep_latest, and the recently-pulled protection takes one; rules with the same keep_days, or the same keep_latest, share one wherever that cannot change which rule decides a repository. A save that would need more than limit is refused with 422.
Show child attributes
Show child attributes