Minimum age for Backups created via this BackupPlan (in days).
This field MUST be an integer value between 0-90 (inclusive).
A Backup created under this BackupPlan will NOT be deletable until it
reaches Backup's (create_time + backup_delete_lock_days).
Updating this field of a BackupPlan does NOT affect existing Backups
under it. Backups created AFTER a successful update will inherit
the new value.
Default: 0 (no delete blocking)
The default maximum age of a Backup created via this BackupPlan.
This field MUST be an integer value >= 0 and <= 365.
If specified, a Backup created under this BackupPlan will be
automatically deleted after its age reaches (create_time +
backup_retain_days).
If not specified, Backups created under this BackupPlan will NOT be
subject to automatic deletion.
Updating this field does NOT affect existing Backups under it. Backups
created AFTER a successful update will automatically pick up the new
value.
NOTE: backup_retain_days must be >=
backup_delete_lock_days.
If
cron_schedule
is defined, then this must be
<= 360 * the creation interval.
Default: 0 (no automatic deletion)
This flag denotes whether the retention policy of this BackupPlan is
locked. If set to True, no further update is allowed on this policy,
including the locked field itself.
Default: False
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Interface BackupPlan.RetentionPolicyOrBuilder (0.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.16.0 (latest)](/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.gkebackup.v1.BackupPlan.RetentionPolicyOrBuilder)\n- [0.15.0](/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.gkebackup.v1.BackupPlan.RetentionPolicyOrBuilder)\n- [0.14.1](/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.gkebackup.v1.BackupPlan.RetentionPolicyOrBuilder) \n\n public static interface BackupPlan.RetentionPolicyOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### getBackupDeleteLockDays()\n\n public abstract int getBackupDeleteLockDays()\n\nMinimum age for Backups created via this BackupPlan (in days).\nThis field MUST be an integer value between 0-90 (inclusive).\nA Backup created under this BackupPlan will NOT be deletable until it\nreaches Backup's (create_time + backup_delete_lock_days).\nUpdating this field of a BackupPlan does NOT affect existing Backups\nunder it. Backups created AFTER a successful update will inherit\nthe new value.\nDefault: 0 (no delete blocking)\n\n`int32 backup_delete_lock_days = 1;`\n\n### getBackupRetainDays()\n\n public abstract int getBackupRetainDays()\n\nThe default maximum age of a Backup created via this BackupPlan.\nThis field MUST be an integer value \\\u003e= 0 and \\\u003c= 365.\nIf specified, a Backup created under this BackupPlan will be\nautomatically deleted after its age reaches (create_time +\nbackup_retain_days).\nIf not specified, Backups created under this BackupPlan will NOT be\nsubject to automatic deletion.\nUpdating this field does NOT affect existing Backups under it. Backups\ncreated AFTER a successful update will automatically pick up the new\nvalue.\nNOTE: backup_retain_days must be \\\u003e=\nbackup_delete_lock_days.\nIf\ncron_schedule\nis defined, then this must be\n\\\u003c= 360 \\* the creation interval.\nDefault: 0 (no automatic deletion)\n\n`int32 backup_retain_days = 2;`\n\n### getLocked()\n\n public abstract boolean getLocked()\n\nThis flag denotes whether the retention policy of this BackupPlan is\nlocked. If set to True, no further update is allowed on this policy,\nincluding the `locked` field itself.\nDefault: False\n\n`bool locked = 3;`"]]