Skip to main content

backups

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

Overview

Namebackups
TypeResource
Idgoogle.file.backups

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name of the backup, in the format projects/{project_number}/locations/{location_id}/backups/{backup_id}.
capacityGbstring (int64)Output only. Capacity of the source file share when the backup was created.
createTimestring (google-datetime)Output only. The time when the backup was created.
descriptionstringA description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.
downloadBytesstring (int64)Output only. Amount of bytes that will be downloaded if the backup is restored. This may be different than storage bytes, since sequential backups of the same disk will share storage.
fileSystemProtocolstringOutput only. The file system protocol of the source Filestore instance that this backup is created from.
kmsKeystringImmutable. KMS key name used for data encryption.
labelsobjectResource labels to represent user provided metadata.
satisfiesPzibooleanOutput only. Reserved for future use.
satisfiesPzsbooleanOutput only. Reserved for future use.
sourceFileSharestringName of the file share in the source Filestore instance that the backup is created from.
sourceInstancestringThe resource name of the source Filestore instance, in the format projects/{project_number}/locations/{location_id}/instances/{instance_id}, used to create this backup.
sourceInstanceTierstringOutput only. The service tier of the source Filestore instance that this backup is created from.
statestringOutput only. The backup state.
storageBytesstring (int64)Output only. The size of the storage used by the backup. As backups share storage, this number is expected to change with backup creation/deletion.
tagsobjectOptional. Input only. Immutable. Tag key-value pairs bound to this resource. Each key must be a namespaced name and each value a short name. Example: "123456789012/environment" : "production", "123456789013/costCenter" : "marketing" See the documentation for more information: - Namespaced name: https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_key - Short name: https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_value

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, backupsIdGets the details of a specific backup.
listselectprojectsId, locationsIdpageSize, pageToken, orderBy, filterLists all backups in a project for either a specified location or for all locations.
createinsertprojectsId, locationsIdbackupIdCreates a backup.
patchupdateprojectsId, locationsId, backupsIdupdateMaskUpdates the settings of a specific backup.
deletedeleteprojectsId, locationsId, backupsIdDeletes 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
backupsIdstring
locationsIdstring
projectsIdstring
backupIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets the details of a specific backup.

SELECT
name,
capacityGb,
createTime,
description,
downloadBytes,
fileSystemProtocol,
kmsKey,
labels,
satisfiesPzi,
satisfiesPzs,
sourceFileShare,
sourceInstance,
sourceInstanceTier,
state,
storageBytes,
tags
FROM google.file.backups
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND backupsId = '{{ backupsId }}' -- required;

INSERT examples

Creates a backup.

INSERT INTO google.file.backups (
data__description,
data__labels,
data__sourceInstance,
data__sourceFileShare,
data__kmsKey,
data__tags,
projectsId,
locationsId,
backupId
)
SELECT
'{{ description }}',
'{{ labels }}',
'{{ sourceInstance }}',
'{{ sourceFileShare }}',
'{{ kmsKey }}',
'{{ tags }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ backupId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the settings of a specific backup.

UPDATE google.file.backups
SET
data__description = '{{ description }}',
data__labels = '{{ labels }}',
data__sourceInstance = '{{ sourceInstance }}',
data__sourceFileShare = '{{ sourceFileShare }}',
data__kmsKey = '{{ kmsKey }}',
data__tags = '{{ tags }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupsId = '{{ backupsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a backup.

DELETE FROM google.file.backups
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupsId = '{{ backupsId }}' --required;