set_default_retention
Set a bucket-wide default retention for future objects, choosing GOVERNANCE or COMPLIANCE mode with a duration in days or years; preview with dry-run before applying.
Instructions
[WRITE][risk=high] Set the bucket's DEFAULT retention. Reversible → prior rule.
Applies to objects written from now on; objects already stored are untouched. Undo restores the prior rule — but objects written while this rule was in force keep the retention they were given, and COMPLIANCE retention on them cannot be shortened by anyone afterwards.
Refused (under dry_run too) when the bucket has no object lock, since the rule would have nothing to attach to.
Args: bucket_name: Bucket name (must already have object lock enabled). mode: "GOVERNANCE" (an admin with bypass permission can lift it) or "COMPLIANCE" (nobody can lift it before the date). days: Retention duration in days. Pass exactly one of days/years. years: Retention duration in years. Pass exactly one of days/years. dry_run: If True, preview without applying. target: MinIO target name from config; omit for the default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | ||
| mode | Yes | ||
| years | No | ||
| target | No | ||
| dry_run | No | ||
| bucket_name | Yes |