set_registry_retention
Change which images the organisation's registry keeps, so it stops filling up: the organisation-wide policy (default), and/or the per-repository rules (rules). Omitted fields stay unchanged. default sets the organisation-wide policy; reset_default true puts it back on the platform default instead. rules REPLACES the whole list of repository rules: read the current rules with get_registry_storage first and send the complete list you want, including the rules to keep; an empty list removes every rule. Pass the retention.version you read as expected_version: if retention changed since, the call is refused ("Retention changed since you read it") - read it again and rebuild the change, never retry the same arguments. A rule replaces the default for the repositories its pattern matches (lowercase, * within a path segment, ** across segments, e.g. ankra-ci/** for the pipeline's build images or my-app/**; ** alone is refused - use default). An image is kept when pushed within keep_days or among the keep_latest newest of its repository. Protections whatever you choose: the newest image of every repository is always kept, and images pulled in the last 7 days are kept. Images outside the policy are deleted at the next daily run (or now with run_registry_retention); the space comes back only at the weekly garbage collection (Sunday 03:00 UTC). Requires credentials.write.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rules | No | The COMPLETE list of repository rules after the change (it replaces the current list). Omit to leave the rules unchanged; an empty list removes them all. | |
| default | No | The new organisation-wide policy for every repository no rule covers. Omit to leave it unchanged. | |
| reset_default | No | true puts the organisation-wide policy back on the platform default. Do not combine with default. | |
| expected_version | No | Always send the retention.version get_registry_storage returned when you read the rules: if someone changed retention since, the change is refused instead of overwriting theirs - read again and rebuild the change. Omit it only when that read returned no version. |