Skip to main content

backups

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

Overview

Namebackups
TypeResource
Idgoogle.alloydb.backups

Fields

NameDatatypeDescription
namestringOutput only. The name of the backup resource with the format: projects/{project}/locations/{region}/backups/{backup_id} where the cluster and backup ID segments should satisfy the regex expression [a-z]([a-z0-9-]{0,61}[a-z0-9])?, e.g. 1-63 characters of lowercase letters, numbers, and dashes, starting with a letter, and ending with a letter or number. For more details see https://google.aip.dev/122. The prefix of the backup resource name is the name of the parent resource: projects/{project}/locations/{region}
descriptionstringUser-provided description of the backup.
annotationsobjectAnnotations to allow client tools to store small amount of arbitrary data. This is distinct from labels. https://google.aip.dev/128
clusterNamestringRequired. The full resource name of the backup source cluster (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
clusterUidstringOutput only. The system-generated UID of the cluster which was used to create this resource.
createTimestringOutput only. Create time stamp
databaseVersionstringOutput only. The database engine major version of the cluster this backup was created from. Any restored cluster created from this backup will have the same database version.
deleteTimestringOutput only. Delete time stamp
displayNamestringUser-settable and human-readable display name for the Backup.
encryptionConfigobjectEncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key).
encryptionInfoobjectEncryptionInfo describes the encryption information of a cluster or a backup.
etagstringFor Resource freshness validation (https://google.aip.dev/154)
expiryQuantityobjectA backup's position in a quantity-based retention queue, of backups with the same source cluster and type, with length, retention, specified by the backup's retention policy. Once the position is greater than the retention, the backup is eligible to be garbage collected. Example: 5 backups from the same source cluster and type with a quantity-based retention of 3 and denoted by backup_id (position, retention). Safe: backup_5 (1, 3), backup_4, (2, 3), backup_3 (3, 3). Awaiting garbage collection: backup_2 (4, 3), backup_1 (5, 3)
expiryTimestringOutput only. The time at which after the backup is eligible to be garbage collected. It is the duration specified by the backup's retention policy, added to the backup's create_time.
labelsobjectLabels as key value pairs
reconcilingbooleanOutput only. Reconciling (https://google.aip.dev/128#reconciliation), if true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance.
satisfiesPzsbooleanOutput only. Reserved for future use.
sizeBytesstringOutput only. The size of the backup in bytes.
statestringOutput only. The current state of the backup.
typestringThe backup type, which suggests the trigger for the backup.
uidstringOutput only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.
updateTimestringOutput only. Update time stamp

Methods

NameAccessible byRequired ParamsDescription
getSELECTbackupsId, locationsId, projectsIdGets details of a single Backup.
listSELECTlocationsId, projectsIdLists Backups in a given project and location.
createINSERTlocationsId, projectsIdCreates a new Backup in a given project and location.
deleteDELETEbackupsId, locationsId, projectsIdDeletes a single Backup.
patchUPDATEbackupsId, locationsId, projectsIdUpdates the parameters of a single Backup.

SELECT examples

Lists Backups in a given project and location.

SELECT
name,
description,
annotations,
clusterName,
clusterUid,
createTime,
databaseVersion,
deleteTime,
displayName,
encryptionConfig,
encryptionInfo,
etag,
expiryQuantity,
expiryTime,
labels,
reconciling,
satisfiesPzs,
sizeBytes,
state,
type,
uid,
updateTime
FROM google.alloydb.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.alloydb.backups (
locationsId,
projectsId,
displayName,
labels,
type,
description,
clusterName,
encryptionConfig,
etag,
annotations
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ displayName }}',
'{{ labels }}',
'{{ type }}',
'{{ description }}',
'{{ clusterName }}',
'{{ encryptionConfig }}',
'{{ etag }}',
'{{ annotations }}'
;

UPDATE example

Updates a backups resource.

/*+ update */
UPDATE google.alloydb.backups
SET
displayName = '{{ displayName }}',
labels = '{{ labels }}',
type = '{{ type }}',
description = '{{ description }}',
clusterName = '{{ clusterName }}',
encryptionConfig = '{{ encryptionConfig }}',
etag = '{{ etag }}',
annotations = '{{ annotations }}'
WHERE
backupsId = '{{ backupsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified backups resource.

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