Required. Configures the duration for which backup data will be kept. It is
defined in “days”. The value should be greater than or equal to minimum
enforced retention of the backup vault.
Minimum value is 1 and maximum value is 36159 for custom retention
on-demand backup.
Minimum and maximum values are workload specific for all other rules.
Required. Immutable. The unique id of this BackupRule. The rule_id is
unique per BackupPlan.The rule_id must start with a lowercase letter
followed by up to 62 lowercase letters, numbers, or hyphens. Pattern,
/a-z{,62}/.
Required. Immutable. The unique id of this BackupRule. The rule_id is
unique per BackupPlan.The rule_id must start with a lowercase letter
followed by up to 62 lowercase letters, numbers, or hyphens. Pattern,
/a-z{,62}/.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-18 UTC."],[],[],null,["# Interface BackupRuleOrBuilder (0.31.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.31.0 (latest)](/java/docs/reference/google-cloud-backupdr/latest/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.29.0](/java/docs/reference/google-cloud-backupdr/0.29.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.27.0](/java/docs/reference/google-cloud-backupdr/0.27.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.26.0](/java/docs/reference/google-cloud-backupdr/0.26.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.23.0](/java/docs/reference/google-cloud-backupdr/0.23.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.22.0](/java/docs/reference/google-cloud-backupdr/0.22.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.21.0](/java/docs/reference/google-cloud-backupdr/0.21.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.19.0](/java/docs/reference/google-cloud-backupdr/0.19.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.18.0](/java/docs/reference/google-cloud-backupdr/0.18.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.17.0](/java/docs/reference/google-cloud-backupdr/0.17.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.16.0](/java/docs/reference/google-cloud-backupdr/0.16.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.15.0](/java/docs/reference/google-cloud-backupdr/0.15.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.14.0](/java/docs/reference/google-cloud-backupdr/0.14.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.13.0](/java/docs/reference/google-cloud-backupdr/0.13.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.12.0](/java/docs/reference/google-cloud-backupdr/0.12.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.11.0](/java/docs/reference/google-cloud-backupdr/0.11.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.10.0](/java/docs/reference/google-cloud-backupdr/0.10.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.8.0](/java/docs/reference/google-cloud-backupdr/0.8.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.7.0](/java/docs/reference/google-cloud-backupdr/0.7.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.6.0](/java/docs/reference/google-cloud-backupdr/0.6.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.5.0](/java/docs/reference/google-cloud-backupdr/0.5.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.4.0](/java/docs/reference/google-cloud-backupdr/0.4.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.3.0](/java/docs/reference/google-cloud-backupdr/0.3.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.2.0](/java/docs/reference/google-cloud-backupdr/0.2.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder)\n- [0.1.0](/java/docs/reference/google-cloud-backupdr/0.1.0/com.google.cloud.backupdr.v1.BackupRuleOrBuilder) \n\n public interface BackupRuleOrBuilder 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### getBackupRetentionDays()\n\n public abstract int getBackupRetentionDays()\n\nRequired. Configures the duration for which backup data will be kept. It is\ndefined in \"days\". The value should be greater than or equal to minimum\nenforced retention of the backup vault.\n\nMinimum value is 1 and maximum value is 36159 for custom retention\non-demand backup.\nMinimum and maximum values are workload specific for all other rules.\n\n`int32 backup_retention_days = 4 [(.google.api.field_behavior) = REQUIRED];`\n\n### getBackupScheduleOneofCase()\n\n public abstract BackupRule.BackupScheduleOneofCase getBackupScheduleOneofCase()\n\n### getRuleId()\n\n public abstract String getRuleId()\n\nRequired. Immutable. The unique id of this `BackupRule`. The `rule_id` is\nunique per `BackupPlan`.The `rule_id` must start with a lowercase letter\nfollowed by up to 62 lowercase letters, numbers, or hyphens. Pattern,\n/a-z{,62}/.\n\n`\nstring rule_id = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];\n`\n\n### getRuleIdBytes()\n\n public abstract ByteString getRuleIdBytes()\n\nRequired. Immutable. The unique id of this `BackupRule`. The `rule_id` is\nunique per `BackupPlan`.The `rule_id` must start with a lowercase letter\nfollowed by up to 62 lowercase letters, numbers, or hyphens. Pattern,\n/a-z{,62}/.\n\n`\nstring rule_id = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];\n`\n\n### getStandardSchedule()\n\n public abstract StandardSchedule getStandardSchedule()\n\nOptional. Defines a schedule that runs within the confines of a defined\nwindow of time.\n\n`\n.google.cloud.backupdr.v1.StandardSchedule standard_schedule = 5 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getStandardScheduleOrBuilder()\n\n public abstract StandardScheduleOrBuilder getStandardScheduleOrBuilder()\n\nOptional. Defines a schedule that runs within the confines of a defined\nwindow of time.\n\n`\n.google.cloud.backupdr.v1.StandardSchedule standard_schedule = 5 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### hasStandardSchedule()\n\n public abstract boolean hasStandardSchedule()\n\nOptional. Defines a schedule that runs within the confines of a defined\nwindow of time.\n\n`\n.google.cloud.backupdr.v1.StandardSchedule standard_schedule = 5 [(.google.api.field_behavior) = OPTIONAL];\n`"]]