backups
Creates, updates, deletes, gets or lists a backups resource.
Overview
| Name | backups |
| Type | Resource |
| Id | google.alloydb.backups |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Output 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} |
annotations | object | Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels. https://google.aip.dev/128 |
clusterName | string | Required. The full resource name of the backup source cluster (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). |
clusterUid | string | Output only. The system-generated UID of the cluster which was used to create this resource. |
createCompletionTime | string (google-datetime) | Output only. Timestamp when the resource finished being created. |
createTime | string (google-datetime) | Output only. Create time stamp |
databaseVersion | string | Output 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. (DATABASE_VERSION_UNSPECIFIED, POSTGRES_13, POSTGRES_14, POSTGRES_15, POSTGRES_16, POSTGRES_17, POSTGRES_18) |
deleteTime | string (google-datetime) | Output only. Delete time stamp |
description | string | User-provided description of the backup. |
displayName | string | User-settable and human-readable display name for the Backup. |
encryptionConfig | object | Optional. 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) |
encryptionInfo | object | Output only. The encryption information for the backup. (id: EncryptionInfo) |
etag | string | For Resource freshness validation (https://google.aip.dev/154) |
expiryQuantity | object | Output 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) |
expiryTime | string (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. |
labels | object | Labels as key value pairs |
reconciling | boolean | Output 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. |
satisfiesPzs | boolean | Output only. Reserved for future use. |
sizeBytes | string (int64) | Output only. The size of the backup in bytes. |
state | string | Output only. The current state of the backup. (STATE_UNSPECIFIED, READY, CREATING, FAILED, DELETING) |
tags | object | Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing" |
type | string | The backup type, which suggests the trigger for the backup. (TYPE_UNSPECIFIED, ON_DEMAND, AUTOMATED, CONTINUOUS) |
uid | string | Output 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. |
updateTime | string (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. |
| Name | Datatype | Description |
|---|---|---|
name | string | Output 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} |
annotations | object | Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels. https://google.aip.dev/128 |
clusterName | string | Required. The full resource name of the backup source cluster (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). |
clusterUid | string | Output only. The system-generated UID of the cluster which was used to create this resource. |
createCompletionTime | string (google-datetime) | Output only. Timestamp when the resource finished being created. |
createTime | string (google-datetime) | Output only. Create time stamp |
databaseVersion | string | Output 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. (DATABASE_VERSION_UNSPECIFIED, POSTGRES_13, POSTGRES_14, POSTGRES_15, POSTGRES_16, POSTGRES_17, POSTGRES_18) |
deleteTime | string (google-datetime) | Output only. Delete time stamp |
description | string | User-provided description of the backup. |
displayName | string | User-settable and human-readable display name for the Backup. |
encryptionConfig | object | Optional. 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) |
encryptionInfo | object | Output only. The encryption information for the backup. (id: EncryptionInfo) |
etag | string | For Resource freshness validation (https://google.aip.dev/154) |
expiryQuantity | object | Output 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) |
expiryTime | string (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. |
labels | object | Labels as key value pairs |
reconciling | boolean | Output 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. |
satisfiesPzs | boolean | Output only. Reserved for future use. |
sizeBytes | string (int64) | Output only. The size of the backup in bytes. |
state | string | Output only. The current state of the backup. (STATE_UNSPECIFIED, READY, CREATING, FAILED, DELETING) |
tags | object | Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing" |
type | string | The backup type, which suggests the trigger for the backup. (TYPE_UNSPECIFIED, ON_DEMAND, AUTOMATED, CONTINUOUS) |
uid | string | Output 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. |
updateTime | string (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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | projectsId, locationsId, backupsId | view | Gets details of a single Backup. |
list | select | projectsId, locationsId | filter, pageSize, view, pageToken, orderBy | Lists Backups in a given project and location. |
create | insert | projectsId, locationsId | requestId, validateOnly, backupId | Creates a new Backup in a given project and location. |
patch | update | projectsId, locationsId, backupsId | allowMissing, requestId, validateOnly, updateMask | Updates the parameters of a single Backup. |
delete | delete | projectsId, locationsId, backupsId | requestId, validateOnly, etag | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
backupsId | string | |
locationsId | string | |
projectsId | string | |
allowMissing | boolean | |
backupId | string | |
etag | string | |
filter | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
requestId | string | |
updateMask | string (google-fieldmask) | |
validateOnly | boolean | |
view | string |
SELECT examples
- get
- list
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
AND view = '{{ view }}'
;
Lists Backups in a given project and location.
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 filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND view = '{{ view }}'
AND pageToken = '{{ pageToken }}'
AND orderBy = '{{ orderBy }}'
;
INSERT examples
- create
- Manifest
Creates a new Backup in a given project and location.
INSERT INTO google.alloydb.backups (
data__tags,
data__description,
data__clusterName,
data__etag,
data__encryptionConfig,
data__displayName,
data__type,
data__annotations,
data__labels,
projectsId,
locationsId,
requestId,
validateOnly,
backupId
)
SELECT
'{{ tags }}',
'{{ description }}',
'{{ clusterName }}',
'{{ etag }}',
'{{ encryptionConfig }}',
'{{ displayName }}',
'{{ type }}',
'{{ annotations }}',
'{{ labels }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ requestId }}',
'{{ validateOnly }}',
'{{ backupId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: backups
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the backups resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the backups resource.
- name: tags
value: "{{ tags }}"
description: |
Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: ``` "123/environment": "production", "123/costCenter": "marketing" ```
- name: description
value: "{{ description }}"
description: |
User-provided description of the backup.
- name: clusterName
value: "{{ clusterName }}"
description: |
Required. The full resource name of the backup source cluster (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
- name: etag
value: "{{ etag }}"
description: |
For Resource freshness validation (https://google.aip.dev/154)
- name: encryptionConfig
description: |
Optional. 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.
value:
kmsKeyName: "{{ kmsKeyName }}"
- name: displayName
value: "{{ displayName }}"
description: |
User-settable and human-readable display name for the Backup.
- name: type
value: "{{ type }}"
description: |
The backup type, which suggests the trigger for the backup.
valid_values: ['TYPE_UNSPECIFIED', 'ON_DEMAND', 'AUTOMATED', 'CONTINUOUS']
- name: annotations
value: "{{ annotations }}"
description: |
Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels. https://google.aip.dev/128
- name: labels
value: "{{ labels }}"
description: |
Labels as key value pairs
- name: requestId
value: "{{ requestId }}"
- name: validateOnly
value: {{ validateOnly }}
- name: backupId
value: "{{ backupId }}"
UPDATE examples
- patch
Updates the parameters of a single Backup.
UPDATE google.alloydb.backups
SET
data__tags = '{{ tags }}',
data__description = '{{ description }}',
data__clusterName = '{{ clusterName }}',
data__etag = '{{ etag }}',
data__encryptionConfig = '{{ encryptionConfig }}',
data__displayName = '{{ displayName }}',
data__type = '{{ type }}',
data__annotations = '{{ annotations }}',
data__labels = '{{ labels }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupsId = '{{ backupsId }}' --required
AND allowMissing = {{ allowMissing}}
AND requestId = '{{ requestId}}'
AND validateOnly = {{ validateOnly}}
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;
DELETE examples
- delete
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 }}'
;