Skip to main content

backups

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

Overview

Namebackups
TypeResource
Idgoogle.backupdr.backups

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Identifier. Name of the backup to create. It must have the format"projects//locations//backupVaults//dataSources/{datasource}/backups/{backup}". {backup} cannot be changed after creation. It must be between 3-63 characters long and must be unique within the datasource.
backupApplianceBackupPropertiesobjectOutput only. Backup Appliance specific backup properties. (id: BackupApplianceBackupProperties)
backupApplianceLocksarrayOptional. The list of BackupLocks taken by the accessor Backup Appliance.
backupTypestringOutput only. Type of the backup, unspecified, scheduled or ondemand.
cloudSqlInstanceBackupPropertiesobjectOutput only. Cloud SQL specific backup properties. (id: CloudSqlInstanceBackupProperties)
computeInstanceBackupPropertiesobjectOutput only. Compute Engine specific backup properties. (id: ComputeInstanceBackupProperties)
consistencyTimestring (google-datetime)Output only. The point in time when this backup was captured from the source.
createTimestring (google-datetime)Output only. The time when the instance was created.
descriptionstringOutput only. The description of the Backup instance (2048 characters or less).
diskBackupPropertiesobjectOutput only. Disk specific backup properties. (id: DiskBackupProperties)
enforcedRetentionEndTimestring (google-datetime)Optional. The backup can not be deleted before this time.
etagstringOptional. Server specified ETag to prevent updates from overwriting each other.
expireTimestring (google-datetime)Optional. When this backup is automatically expired.
gcpBackupPlanInfoobjectOutput only. Configuration for a Google Cloud resource. (id: GCPBackupPlanInfo)
labelsobjectOptional. Resource labels to represent user provided metadata. No labels currently defined.
resourceSizeBytesstring (int64)Output only. source resource size in bytes at the time of the backup.
satisfiesPzibooleanOptional. Output only. Reserved for future use.
satisfiesPzsbooleanOptional. Output only. Reserved for future use.
serviceLocksarrayOutput only. The list of BackupLocks taken by the service to prevent the deletion of the backup.
statestringOutput only. The Backup resource instance state.
updateTimestring (google-datetime)Output only. The time when the instance was updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, backupVaultsId, dataSourcesId, backupsIdviewGets details of a Backup.
listselectprojectsId, locationsId, backupVaultsId, dataSourcesIdpageSize, pageToken, filter, orderBy, viewLists Backups in a given project and location.
patchupdateprojectsId, locationsId, backupVaultsId, dataSourcesId, backupsIdupdateMask, requestIdUpdates the settings of a Backup.
deletedeleteprojectsId, locationsId, backupVaultsId, dataSourcesId, backupsIdrequestIdDeletes a Backup.
restoreexecprojectsId, locationsId, backupVaultsId, dataSourcesId, backupsIdRestore from a Backup

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
backupVaultsIdstring
backupsIdstring
dataSourcesIdstring
locationsIdstring
projectsIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
updateMaskstring (google-fieldmask)
viewstring

SELECT examples

Gets details of a Backup.

SELECT
name,
backupApplianceBackupProperties,
backupApplianceLocks,
backupType,
cloudSqlInstanceBackupProperties,
computeInstanceBackupProperties,
consistencyTime,
createTime,
description,
diskBackupProperties,
enforcedRetentionEndTime,
etag,
expireTime,
gcpBackupPlanInfo,
labels,
resourceSizeBytes,
satisfiesPzi,
satisfiesPzs,
serviceLocks,
state,
updateTime
FROM google.backupdr.backups
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND backupVaultsId = '{{ backupVaultsId }}' -- required
AND dataSourcesId = '{{ dataSourcesId }}' -- required
AND backupsId = '{{ backupsId }}' -- required
AND view = '{{ view }}';

UPDATE examples

Updates the settings of a Backup.

UPDATE google.backupdr.backups
SET
data__labels = '{{ labels }}',
data__enforcedRetentionEndTime = '{{ enforcedRetentionEndTime }}',
data__expireTime = '{{ expireTime }}',
data__etag = '{{ etag }}',
data__backupApplianceLocks = '{{ backupApplianceLocks }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupVaultsId = '{{ backupVaultsId }}' --required
AND dataSourcesId = '{{ dataSourcesId }}' --required
AND backupsId = '{{ backupsId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a Backup.

DELETE FROM google.backupdr.backups
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupVaultsId = '{{ backupVaultsId }}' --required
AND dataSourcesId = '{{ dataSourcesId }}' --required
AND backupsId = '{{ backupsId }}' --required
AND requestId = '{{ requestId }}';

Lifecycle Methods

Restore from a Backup

EXEC google.backupdr.backups.restore 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@backupVaultsId='{{ backupVaultsId }}' --required,
@dataSourcesId='{{ dataSourcesId }}' --required,
@backupsId='{{ backupsId }}' --required
@@json=
'{
"requestId": "{{ requestId }}",
"computeInstanceTargetEnvironment": "{{ computeInstanceTargetEnvironment }}",
"diskTargetEnvironment": "{{ diskTargetEnvironment }}",
"regionDiskTargetEnvironment": "{{ regionDiskTargetEnvironment }}",
"computeInstanceRestoreProperties": "{{ computeInstanceRestoreProperties }}",
"diskRestoreProperties": "{{ diskRestoreProperties }}"
}';