Skip to main content

backups

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

Overview

Namebackups
TypeResource
Idgoogle.file.backups

Fields

NameDatatypeDescription
namestringOutput only. The resource name of the backup, in the format projects/{project_number}/locations/{location_id}/backups/{backup_id}.
descriptionstringA description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.
capacityGbstringOutput only. Capacity of the source file share when the backup was created.
createTimestringOutput only. The time when the backup was created.
downloadBytesstringOutput 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.
storageBytesstringOutput 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 are bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing"

Methods

NameAccessible byRequired ParamsDescription
getSELECTbackupsId, locationsId, projectsIdGets the details of a specific backup.
listSELECTlocationsId, projectsIdLists all backups in a project for either a specified location or for all locations.
createINSERTlocationsId, projectsIdCreates a backup.
deleteDELETEbackupsId, locationsId, projectsIdDeletes a backup.
patchUPDATEbackupsId, locationsId, projectsIdUpdates the settings of a specific backup.

SELECT examples

Lists all backups in a project for either a specified location or for all locations.

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

INSERT example

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

/*+ create */
INSERT INTO google.file.backups (
locationsId,
projectsId,
description,
labels,
sourceInstance,
sourceFileShare,
kmsKey,
tags
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ description }}',
'{{ labels }}',
'{{ sourceInstance }}',
'{{ sourceFileShare }}',
'{{ kmsKey }}',
'{{ tags }}'
;

UPDATE example

Updates a backups resource.

/*+ update */
UPDATE google.file.backups
SET
description = '{{ description }}',
labels = '{{ labels }}',
sourceInstance = '{{ sourceInstance }}',
sourceFileShare = '{{ sourceFileShare }}',
kmsKey = '{{ kmsKey }}',
tags = '{{ tags }}'
WHERE
backupsId = '{{ backupsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified backups resource.

/*+ delete */
DELETE FROM google.file.backups
WHERE backupsId = '{{ backupsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';