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

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Identifier. The resource name of the BackupPlan. Format: projects/{project}/locations/{location}/backupPlans/{backup_plan}
backupRulesarrayOptional. The backup rules for this BackupPlan.
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.
createTimestring (google-datetime)Output only. When the BackupPlan was created.
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.
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"}.
logRetentionDaysstring (int64)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.
resourceTypestringRequired. 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".
revisionIdstringOutput only. The user friendly revision ID of the BackupPlanRevision. Example: v0, v1, v2, etc.
revisionNamestringOutput only. The resource id of the BackupPlanRevision. Format: projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id}
statestringOutput only. The State for the BackupPlan.
supportedResourceTypesarrayOutput only. All resource types to which backupPlan can be applied.
updateTimestring (google-datetime)Output only. When the BackupPlan was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, backupPlansIdGets details of a single BackupPlan.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists BackupPlans in a given project and location.
createinsertprojectsId, locationsIdbackupPlanId, requestIdCreate a BackupPlan
patchupdateprojectsId, locationsId, backupPlansIdupdateMask, requestIdUpdate a BackupPlan.
deletedeleteprojectsId, locationsId, backupPlansIdrequestIdDeletes a single BackupPlan.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
backupPlansIdstring
locationsIdstring
projectsIdstring
backupPlanIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details of a single BackupPlan.

SELECT
name,
backupRules,
backupVault,
backupVaultServiceAccount,
createTime,
description,
etag,
labels,
logRetentionDays,
resourceType,
revisionId,
revisionName,
state,
supportedResourceTypes,
updateTime
FROM google.backupdr.backup_plans
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND backupPlansId = '{{ backupPlansId }}' -- required;

INSERT examples

Create a BackupPlan

INSERT INTO google.backupdr.backup_plans (
data__description,
data__labels,
data__backupRules,
data__resourceType,
data__etag,
data__backupVault,
data__logRetentionDays,
projectsId,
locationsId,
backupPlanId,
requestId
)
SELECT
'{{ description }}',
'{{ labels }}',
'{{ backupRules }}',
'{{ resourceType }}',
'{{ etag }}',
'{{ backupVault }}',
'{{ logRetentionDays }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ backupPlanId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Update a BackupPlan.

UPDATE google.backupdr.backup_plans
SET
data__description = '{{ description }}',
data__labels = '{{ labels }}',
data__backupRules = '{{ backupRules }}',
data__resourceType = '{{ resourceType }}',
data__etag = '{{ etag }}',
data__backupVault = '{{ backupVault }}',
data__logRetentionDays = '{{ logRetentionDays }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupPlansId = '{{ backupPlansId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single BackupPlan.

DELETE FROM google.backupdr.backup_plans
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupPlansId = '{{ backupPlansId }}' --required
AND requestId = '{{ requestId }}';