Skip to main content

backups

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

Overview

Namebackups
TypeResource
Idgoogle.alloydb.backups

Fields

The following fields are returned by SELECT queries:

Successful response

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}
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.
createCompletionTimestring (google-datetime)Output only. Timestamp when the resource finished being created.
createTimestring (google-datetime)Output 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.
deleteTimestring (google-datetime)Output only. Delete time stamp
descriptionstringUser-provided description of the backup.
displayNamestringUser-settable and human-readable display name for the Backup.
encryptionConfigobjectOptional. The encryption config can be specified to encrypt the backup with a customer-managed encryption key (CMEK). When this field is not specified, the backup will then use default encryption scheme to protect the user data. (id: EncryptionConfig)
encryptionInfoobjectOutput only. The encryption information for the backup. (id: EncryptionInfo)
etagstringFor Resource freshness validation (https://google.aip.dev/154)
expiryQuantityobjectOutput only. The QuantityBasedExpiry of the backup, specified by the backup's retention policy. Once the expiry quantity is over retention, the backup is eligible to be garbage collected. (id: QuantityBasedExpiry)
expiryTimestring (google-datetime)Output 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.
sizeBytesstring (int64)Output only. The size of the backup in bytes.
statestringOutput only. The current state of the backup.
tagsobjectOptional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing"
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.
updateTimestring (google-datetime)Output only. Update time stamp Users should not infer any meaning from this field. Its value is generally unrelated to the timing of the backup creation operation.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, backupsIdGets details of a single Backup.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists Backups in a given project and location.
createinsertprojectsId, locationsIdbackupId, requestId, validateOnlyCreates a new Backup in a given project and location.
patchupdateprojectsId, locationsId, backupsIdupdateMask, requestId, validateOnly, allowMissingUpdates the parameters of a single Backup.
deletedeleteprojectsId, locationsId, backupsIdrequestId, validateOnly, etagDeletes a single 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
allowMissingboolean
backupIdstring
etagstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
updateMaskstring (google-fieldmask)
validateOnlyboolean

SELECT examples

Gets details of a single Backup.

SELECT
name,
annotations,
clusterName,
clusterUid,
createCompletionTime,
createTime,
databaseVersion,
deleteTime,
description,
displayName,
encryptionConfig,
encryptionInfo,
etag,
expiryQuantity,
expiryTime,
labels,
reconciling,
satisfiesPzs,
sizeBytes,
state,
tags,
type,
uid,
updateTime
FROM google.alloydb.backups
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND backupsId = '{{ backupsId }}' -- required;

INSERT examples

Creates a new Backup in a given project and location.

INSERT INTO google.alloydb.backups (
data__displayName,
data__labels,
data__type,
data__description,
data__clusterName,
data__encryptionConfig,
data__etag,
data__annotations,
data__tags,
projectsId,
locationsId,
backupId,
requestId,
validateOnly
)
SELECT
'{{ displayName }}',
'{{ labels }}',
'{{ type }}',
'{{ description }}',
'{{ clusterName }}',
'{{ encryptionConfig }}',
'{{ etag }}',
'{{ annotations }}',
'{{ tags }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ backupId }}',
'{{ requestId }}',
'{{ validateOnly }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the parameters of a single Backup.

UPDATE google.alloydb.backups
SET
data__displayName = '{{ displayName }}',
data__labels = '{{ labels }}',
data__type = '{{ type }}',
data__description = '{{ description }}',
data__clusterName = '{{ clusterName }}',
data__encryptionConfig = '{{ encryptionConfig }}',
data__etag = '{{ etag }}',
data__annotations = '{{ annotations }}',
data__tags = '{{ tags }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupsId = '{{ backupsId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
AND validateOnly = {{ validateOnly}}
AND allowMissing = {{ allowMissing}}
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single Backup.

DELETE FROM google.alloydb.backups
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupsId = '{{ backupsId }}' --required
AND requestId = '{{ requestId }}'
AND validateOnly = '{{ validateOnly }}'
AND etag = '{{ etag }}';