Reference documentation and code samples for the Google Cloud Backup Dr V1 Client class BackupRule.
BackupRule binds the backup schedule to a retention policy.
Generated from protobuf message google.cloud.backupdr.v1.BackupRule
Namespace
Google \ Cloud \ BackupDR \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ rule_id
string
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][a-z0-9-]{,62}/.
↳ backup_retention_days
int
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.
Optional. Defines a schedule that runs within the confines of a defined window of time.
getRuleId
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][a-z0-9-]{,62}/.
Returns
Type
Description
string
setRuleId
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][a-z0-9-]{,62}/.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getBackupRetentionDays
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.
Returns
Type
Description
int
setBackupRetentionDays
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.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getStandardSchedule
Optional. Defines a schedule that runs within the confines of a defined
window of time.
[[["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-09-04 UTC."],[],[],null,["# Google Cloud Backup Dr V1 Client - Class BackupRule (0.7.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.7.0 (latest)](/php/docs/reference/cloud-backupdr/latest/V1.BackupRule)\n- [0.6.2](/php/docs/reference/cloud-backupdr/0.6.2/V1.BackupRule)\n- [0.5.1](/php/docs/reference/cloud-backupdr/0.5.1/V1.BackupRule)\n- [0.4.2](/php/docs/reference/cloud-backupdr/0.4.2/V1.BackupRule)\n- [0.3.0](/php/docs/reference/cloud-backupdr/0.3.0/V1.BackupRule)\n- [0.2.0](/php/docs/reference/cloud-backupdr/0.2.0/V1.BackupRule)\n- [0.1.0](/php/docs/reference/cloud-backupdr/0.1.0/V1.BackupRule) \nReference documentation and code samples for the Google Cloud Backup Dr V1 Client class BackupRule.\n\n`BackupRule` binds the backup schedule to a retention policy.\n\nGenerated from protobuf message `google.cloud.backupdr.v1.BackupRule`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ BackupDR \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### 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\\]\\[a-z0-9-\\]{,62}/.\n\n### setRuleId\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\\]\\[a-z0-9-\\]{,62}/.\n\n### 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### setBackupRetentionDays\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### getStandardSchedule\n\nOptional. Defines a schedule that runs within the confines of a defined\nwindow of time.\n\n### hasStandardSchedule\n\n### setStandardSchedule\n\nOptional. Defines a schedule that runs within the confines of a defined\nwindow of time.\n\n### getBackupScheduleOneof"]]