Reference documentation and code samples for the Backup and DR Service V1 API class Google::Cloud::BackupDR::V1::BackupPlan.
A BackupPlan specifies some common fields, such as description as well
as one or more BackupRule messages. Each BackupRule has a retention
policy and defines a schedule by which the system is to perform backup
workloads.
(::String) — Required. Resource name of backup vault which will be used as storage
location for backups. Format:
projects/{project}/locations/{location}/backupVaults/{backupvault}
#backup_vault=
defbackup_vault=(value)->::String
Parameter
value (::String) — Required. Resource name of backup vault which will be used as storage
location for backups. Format:
projects/{project}/locations/{location}/backupVaults/{backupvault}
Returns
(::String) — Required. Resource name of backup vault which will be used as storage
location for backups. Format:
projects/{project}/locations/{location}/backupVaults/{backupvault}
#backup_vault_service_account
defbackup_vault_service_account()->::String
Returns
(::String) — Output only. The Google Cloud Platform Service Account to be used by the
BackupVault for taking backups. Specify the email address of the Backup
Vault Service Account.
(::String) — Optional. The description of the BackupPlan resource.
The description allows for additional details about BackupPlan and its
use cases to be provided. An example description is the following: "This
is a backup plan that performs a daily backup at 6pm and retains data for 3
months". The description must be at most 2048 characters.
#description=
defdescription=(value)->::String
Parameter
value (::String) — Optional. The description of the BackupPlan resource.
The description allows for additional details about BackupPlan and its
use cases to be provided. An example description is the following: "This
is a backup plan that performs a daily backup at 6pm and retains data for 3
months". The description must be at most 2048 characters.
Returns
(::String) — Optional. The description of the BackupPlan resource.
The description allows for additional details about BackupPlan and its
use cases to be provided. An example description is the following: "This
is a backup plan that performs a daily backup at 6pm and retains data for 3
months". The description must be at most 2048 characters.
#etag
defetag()->::String
Returns
(::String) — Optional. etag is returned from the service in the response. As a user of
the service, you may provide an etag value in this field to prevent stale
resources.
#etag=
defetag=(value)->::String
Parameter
value (::String) — Optional. etag is returned from the service in the response. As a user of
the service, you may provide an etag value in this field to prevent stale
resources.
Returns
(::String) — Optional. etag is returned from the service in the response. As a user of
the service, you may provide an etag value in this field to prevent stale
resources.
(::Google::Protobuf::Map{::String => ::String}) — Optional. This collection of key/value pairs allows for custom labels to be
supplied by the user. Example, {"tag": "Weekly"}.
value (::Google::Protobuf::Map{::String => ::String}) — Optional. This collection of key/value pairs allows for custom labels to be
supplied by the user. Example, {"tag": "Weekly"}.
Returns
(::Google::Protobuf::Map{::String => ::String}) — Optional. This collection of key/value pairs allows for custom labels to be
supplied by the user. Example, {"tag": "Weekly"}.
#log_retention_days
deflog_retention_days()->::Integer
Returns
(::Integer) — Optional. Applicable only for CloudSQL resource_type.
Configures how long logs will be stored. It is defined in “days”. This
value should be greater than or equal to minimum enforced log retention
duration of the backup vault.
#log_retention_days=
deflog_retention_days=(value)->::Integer
Parameter
value (::Integer) — Optional. Applicable only for CloudSQL resource_type.
Configures how long logs will be stored. It is defined in “days”. This
value should be greater than or equal to minimum enforced log retention
duration of the backup vault.
Returns
(::Integer) — Optional. Applicable only for CloudSQL resource_type.
Configures how long logs will be stored. It is defined in “days”. This
value should be greater than or equal to minimum enforced log retention
duration of the backup vault.
#name
defname()->::String
Returns
(::String) — Output only. Identifier. The resource name of the BackupPlan.
(::String) — Required. The resource type to which the BackupPlan will be applied.
Examples include, "compute.googleapis.com/Instance",
"sqladmin.googleapis.com/Instance", "alloydb.googleapis.com/Cluster",
"compute.googleapis.com/Disk".
#resource_type=
defresource_type=(value)->::String
Parameter
value (::String) — Required. The resource type to which the BackupPlan will be applied.
Examples include, "compute.googleapis.com/Instance",
"sqladmin.googleapis.com/Instance", "alloydb.googleapis.com/Cluster",
"compute.googleapis.com/Disk".
Returns
(::String) — Required. The resource type to which the BackupPlan will be applied.
Examples include, "compute.googleapis.com/Instance",
"sqladmin.googleapis.com/Instance", "alloydb.googleapis.com/Cluster",
"compute.googleapis.com/Disk".
#revision_id
defrevision_id()->::String
Returns
(::String) — Output only. The user friendly revision ID of the BackupPlanRevision.
Example: v0, v1, v2, etc.
#revision_name
defrevision_name()->::String
Returns
(::String) — Output only. The resource id of the BackupPlanRevision.
[[["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,["# Backup and DR Service V1 API - Class Google::Cloud::BackupDR::V1::BackupPlan (v1.2.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.2.0 (latest)](/ruby/docs/reference/google-cloud-backupdr-v1/latest/Google-Cloud-BackupDR-V1-BackupPlan)\n- [1.1.0](/ruby/docs/reference/google-cloud-backupdr-v1/1.1.0/Google-Cloud-BackupDR-V1-BackupPlan)\n- [1.0.1](/ruby/docs/reference/google-cloud-backupdr-v1/1.0.1/Google-Cloud-BackupDR-V1-BackupPlan)\n- [0.5.0](/ruby/docs/reference/google-cloud-backupdr-v1/0.5.0/Google-Cloud-BackupDR-V1-BackupPlan)\n- [0.4.0](/ruby/docs/reference/google-cloud-backupdr-v1/0.4.0/Google-Cloud-BackupDR-V1-BackupPlan)\n- [0.3.0](/ruby/docs/reference/google-cloud-backupdr-v1/0.3.0/Google-Cloud-BackupDR-V1-BackupPlan)\n- [0.2.1](/ruby/docs/reference/google-cloud-backupdr-v1/0.2.1/Google-Cloud-BackupDR-V1-BackupPlan)\n- [0.1.0](/ruby/docs/reference/google-cloud-backupdr-v1/0.1.0/Google-Cloud-BackupDR-V1-BackupPlan) \nReference documentation and code samples for the Backup and DR Service V1 API class Google::Cloud::BackupDR::V1::BackupPlan.\n\nA `BackupPlan` specifies some common fields, such as `description` as well\nas one or more `BackupRule` messages. Each `BackupRule` has a retention\npolicy and defines a schedule by which the system is to perform backup\nworkloads. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #backup_rules\n\n def backup_rules() -\u003e ::Array\u003c::Google::Cloud::BackupDR::V1::BackupRule\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::BackupDR::V1::BackupRule](./Google-Cloud-BackupDR-V1-BackupRule)\\\u003e) --- Required. The backup rules for this `BackupPlan`. There must be at least one `BackupRule` message.\n\n### #backup_rules=\n\n def backup_rules=(value) -\u003e ::Array\u003c::Google::Cloud::BackupDR::V1::BackupRule\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Cloud::BackupDR::V1::BackupRule](./Google-Cloud-BackupDR-V1-BackupRule)\\\u003e) --- Required. The backup rules for this `BackupPlan`. There must be at least one `BackupRule` message. \n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::BackupDR::V1::BackupRule](./Google-Cloud-BackupDR-V1-BackupRule)\\\u003e) --- Required. The backup rules for this `BackupPlan`. There must be at least one `BackupRule` message.\n\n### #backup_vault\n\n def backup_vault() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. Resource name of backup vault which will be used as storage location for backups. Format: projects/{project}/locations/{location}/backupVaults/{backupvault}\n\n### #backup_vault=\n\n def backup_vault=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. Resource name of backup vault which will be used as storage location for backups. Format: projects/{project}/locations/{location}/backupVaults/{backupvault} \n**Returns**\n\n- (::String) --- Required. Resource name of backup vault which will be used as storage location for backups. Format: projects/{project}/locations/{location}/backupVaults/{backupvault}\n\n### #backup_vault_service_account\n\n def backup_vault_service_account() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Output only. The Google Cloud Platform Service Account to be used by the BackupVault for taking backups. Specify the email address of the Backup Vault Service Account.\n\n### #create_time\n\n def create_time() -\u003e ::Google::Protobuf::Timestamp\n\n**Returns**\n\n- ([::Google::Protobuf::Timestamp](./Google-Protobuf-Timestamp)) --- Output only. When the `BackupPlan` was created.\n\n### #description\n\n def description() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Optional. The description of the `BackupPlan` resource.\n\n\n The description allows for additional details about `BackupPlan` and its\n use cases to be provided. An example description is the following: \"This\n is a backup plan that performs a daily backup at 6pm and retains data for 3\n months\". The description must be at most 2048 characters.\n\n### #description=\n\n def description=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Optional. The description of the `BackupPlan` resource.\n\n\n The description allows for additional details about `BackupPlan` and its\n use cases to be provided. An example description is the following: \"This\n is a backup plan that performs a daily backup at 6pm and retains data for 3\nmonths\". The description must be at most 2048 characters. \n**Returns**\n\n- (::String) --- Optional. The description of the `BackupPlan` resource.\n\n\n The description allows for additional details about `BackupPlan` and its\n use cases to be provided. An example description is the following: \"This\n is a backup plan that performs a daily backup at 6pm and retains data for 3\n months\". The description must be at most 2048 characters.\n\n### #etag\n\n def etag() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Optional. `etag` is returned from the service in the response. As a user of the service, you may provide an etag value in this field to prevent stale resources.\n\n### #etag=\n\n def etag=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Optional. `etag` is returned from the service in the response. As a user of the service, you may provide an etag value in this field to prevent stale resources. \n**Returns**\n\n- (::String) --- Optional. `etag` is returned from the service in the response. As a user of the service, you may provide an etag value in this field to prevent stale resources.\n\n### #labels\n\n def labels() -\u003e ::Google::Protobuf::Map{::String =\u003e ::String}\n\n**Returns**\n\n- (::Google::Protobuf::Map{::String =\\\u003e ::String}) --- Optional. This collection of key/value pairs allows for custom labels to be supplied by the user. Example, {\"tag\": \"Weekly\"}.\n\n### #labels=\n\n def labels=(value) -\u003e ::Google::Protobuf::Map{::String =\u003e ::String}\n\n**Parameter**\n\n- **value** (::Google::Protobuf::Map{::String =\\\u003e ::String}) --- Optional. This collection of key/value pairs allows for custom labels to be supplied by the user. Example, {\"tag\": \"Weekly\"}. \n**Returns**\n\n- (::Google::Protobuf::Map{::String =\\\u003e ::String}) --- Optional. This collection of key/value pairs allows for custom labels to be supplied by the user. Example, {\"tag\": \"Weekly\"}.\n\n### #log_retention_days\n\n def log_retention_days() -\u003e ::Integer\n\n**Returns**\n\n- (::Integer) --- Optional. Applicable only for CloudSQL resource_type.\n\n Configures how long logs will be stored. It is defined in \"days\". This\n value should be greater than or equal to minimum enforced log retention\n duration of the backup vault.\n\n### #log_retention_days=\n\n def log_retention_days=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **value** (::Integer) --- Optional. Applicable only for CloudSQL resource_type.\n\n\n Configures how long logs will be stored. It is defined in \"days\". This\n value should be greater than or equal to minimum enforced log retention\nduration of the backup vault. \n**Returns**\n\n- (::Integer) --- Optional. Applicable only for CloudSQL resource_type.\n\n Configures how long logs will be stored. It is defined in \"days\". This\n value should be greater than or equal to minimum enforced log retention\n duration of the backup vault.\n\n### #name\n\n def name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Output only. Identifier. The resource name of the `BackupPlan`.\n\n\n Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`\n\n### #resource_type\n\n def resource_type() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. The resource type to which the `BackupPlan` will be applied. Examples include, \"compute.googleapis.com/Instance\", \"sqladmin.googleapis.com/Instance\", \"alloydb.googleapis.com/Cluster\", \"compute.googleapis.com/Disk\".\n\n### #resource_type=\n\n def resource_type=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. The resource type to which the `BackupPlan` will be applied. Examples include, \"compute.googleapis.com/Instance\", \"sqladmin.googleapis.com/Instance\", \"alloydb.googleapis.com/Cluster\", \"compute.googleapis.com/Disk\". \n**Returns**\n\n- (::String) --- Required. The resource type to which the `BackupPlan` will be applied. Examples include, \"compute.googleapis.com/Instance\", \"sqladmin.googleapis.com/Instance\", \"alloydb.googleapis.com/Cluster\", \"compute.googleapis.com/Disk\".\n\n### #revision_id\n\n def revision_id() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Output only. The user friendly revision ID of the `BackupPlanRevision`.\n\n\n Example: v0, v1, v2, etc.\n\n### #revision_name\n\n def revision_name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Output only. The resource id of the `BackupPlanRevision`.\n\n\n Format:\n `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id}`\n\n### #state\n\n def state() -\u003e ::Google::Cloud::BackupDR::V1::BackupPlan::State\n\n**Returns**\n\n- ([::Google::Cloud::BackupDR::V1::BackupPlan::State](./Google-Cloud-BackupDR-V1-BackupPlan-State)) --- Output only. The `State` for the `BackupPlan`.\n\n### #supported_resource_types\n\n def supported_resource_types() -\u003e ::Array\u003c::String\u003e\n\n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- Output only. All resource types to which backupPlan can be applied.\n\n### #update_time\n\n def update_time() -\u003e ::Google::Protobuf::Timestamp\n\n**Returns**\n\n- ([::Google::Protobuf::Timestamp](./Google-Protobuf-Timestamp)) --- Output only. When the `BackupPlan` was last updated."]]