Update registry retention
import requests
url = "https://platform.ankra.app/api/v1/org/registry-storage/retention"
payload = {}
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({})
};
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 PUT \
--url https://platform.ankra.app/api/v1/org/registry-storage/retention \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'{
"retention": {
"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>"
},
"harbor_applied": true,
"harbor_apply_error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Credentials
Update registry retention
Change the organisation’s project-wide retention policy (null resets it to the platform default), its repository rules (the list replaces the stored one; an empty list removes them all), or both, and apply the result to the registry at once. The newest image of every repository is always kept. harbor_applied false means the change is saved and applies on the next provisioning pass, within about five minutes. A browser session twin is mounted at the same path without the /api/v1 prefix (cookie authentication).
PUT
/
api
/
v1
/
org
/
registry-storage
/
retention
Update registry retention
import requests
url = "https://platform.ankra.app/api/v1/org/registry-storage/retention"
payload = {}
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({})
};
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 PUT \
--url https://platform.ankra.app/api/v1/org/registry-storage/retention \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'{
"retention": {
"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>"
},
"harbor_applied": true,
"harbor_apply_error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json