Skip to main content

backup_plans

Creates, updates, deletes, gets or lists a backup_plans resource.

Overview

Namebackup_plans
TypeResource
Idgoogle.backupdr.backup_plans

Fields

NameDatatypeDescription
namestringOutput only. Identifier. The resource name of the BackupPlan. Format: projects/{project}/locations/{location}/backupPlans/{backup_plan}
descriptionstringOptional. 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.
backupRulesarrayRequired. The backup rules for this BackupPlan. There must be at least one BackupRule message.
backupVaultstringRequired. Resource name of backup vault which will be used as storage location for backups. Format: projects/{project}/locations/{location}/backupVaults/{backupvault}
backupVaultServiceAccountstringOutput 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.
createTimestringOutput only. When the BackupPlan was created.
etagstringOptional. 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.
labelsobjectOptional. This collection of key/value pairs allows for custom labels to be supplied by the user. Example, {"tag": "Weekly"}.
resourceTypestringRequired. The resource type to which the BackupPlan will be applied. Examples include, "compute.googleapis.com/Instance" and "storage.googleapis.com/Bucket".
statestringOutput only. The State for the BackupPlan.
updateTimestringOutput only. When the BackupPlan was last updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECTbackupPlansId, locationsId, projectsIdGets details of a single BackupPlan.
listSELECTlocationsId, projectsIdLists BackupPlans in a given project and location.
createINSERTlocationsId, projectsIdCreate a BackupPlan
deleteDELETEbackupPlansId, locationsId, projectsIdDeletes a single BackupPlan.

SELECT examples

Lists BackupPlans in a given project and location.

SELECT
name,
description,
backupRules,
backupVault,
backupVaultServiceAccount,
createTime,
etag,
labels,
resourceType,
state,
updateTime
FROM google.backupdr.backup_plans
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new backup_plans resource.

/*+ create */
INSERT INTO google.backupdr.backup_plans (
locationsId,
projectsId,
description,
labels,
backupRules,
resourceType,
etag,
backupVault
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ description }}',
'{{ labels }}',
'{{ backupRules }}',
'{{ resourceType }}',
'{{ etag }}',
'{{ backupVault }}'
;

DELETE example

Deletes the specified backup_plans resource.

/*+ delete */
DELETE FROM google.backupdr.backup_plans
WHERE backupPlansId = '{{ backupPlansId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';