Skip to main content

backups

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

Overview

Namebackups
TypeResource
Idgoogle.gkebackup.backups

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The fully qualified name of the Backup. projects/*/locations/*/backupPlans/*/backups/*
allNamespacesbooleanOutput only. If True, all namespaces were included in the Backup.
clusterMetadataobjectOutput only. Information about the GKE cluster from which this Backup was created. (id: ClusterMetadata)
completeTimestring (google-datetime)Output only. Completion time of the Backup
configBackupSizeBytesstring (int64)Output only. The size of the config backup in bytes.
containsSecretsbooleanOutput only. Whether or not the Backup contains Kubernetes Secrets. Controlled by the parent BackupPlan's include_secrets value.
containsVolumeDatabooleanOutput only. Whether or not the Backup contains volume data. Controlled by the parent BackupPlan's include_volume_data value.
createTimestring (google-datetime)Output only. The timestamp when this Backup resource was created.
deleteLockDaysinteger (int32)Optional. Minimum age for this Backup (in days). If this field is set to a non-zero value, the Backup will be "locked" against deletion (either manual or automatic deletion) for the number of days provided (measured from the creation time of the Backup). MUST be an integer value between 0-90 (inclusive). Defaults to parent BackupPlan's backup_delete_lock_days setting and may only be increased (either at creation time or in a subsequent update).
deleteLockExpireTimestring (google-datetime)Output only. The time at which an existing delete lock will expire for this backup (calculated from create_time + delete_lock_days).
descriptionstringOptional. User specified descriptive string for this Backup.
encryptionKeyobjectOutput only. The customer managed encryption key that was used to encrypt the Backup's artifacts. Inherited from the parent BackupPlan's encryption_key value. (id: EncryptionKey)
etagstringOutput only. etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a backup from overwriting each other. It is strongly suggested that systems make use of the etag in the read-modify-write cycle to perform backup updates in order to avoid race conditions: An etag is returned in the response to GetBackup, and systems are expected to put that etag in the request to UpdateBackup or DeleteBackup to ensure that their change will be applied to the same version of the resource.
labelsobjectOptional. A set of custom labels supplied by user.
manualbooleanOutput only. This flag indicates whether this Backup resource was created manually by a user or via a schedule in the BackupPlan. A value of True means that the Backup was created manually.
permissiveModebooleanOutput only. If false, Backup will fail when Backup for GKE detects Kubernetes configuration that is non-standard or requires additional setup to restore. Inherited from the parent BackupPlan's permissive_mode value.
podCountinteger (int32)Output only. The total number of Kubernetes Pods contained in the Backup.
resourceCountinteger (int32)Output only. The total number of Kubernetes resources included in the Backup.
retainDaysinteger (int32)Optional. The age (in days) after which this Backup will be automatically deleted. Must be an integer value >= 0: - If 0, no automatic deletion will occur for this Backup. - If not 0, this must be >= delete_lock_days and <= 365. Once a Backup is created, this value may only be increased. Defaults to the parent BackupPlan's backup_retain_days value.
retainExpireTimestring (google-datetime)Output only. The time at which this Backup will be automatically deleted (calculated from create_time + retain_days).
satisfiesPzibooleanOutput only. [Output Only] Reserved for future use.
satisfiesPzsbooleanOutput only. [Output Only] Reserved for future use.
selectedApplicationsobjectOutput only. If set, the list of ProtectedApplications whose resources were included in the Backup. (id: NamespacedNames)
selectedNamespaceLabelsobjectOutput only. If set, the list of labels whose constituent namespaces were included in the Backup. (id: ResourceLabels)
selectedNamespacesobjectOutput only. If set, the list of namespaces that were included in the Backup. (id: Namespaces)
sizeBytesstring (int64)Output only. The total size of the Backup in bytes = config backup size + sum(volume backup sizes)
statestringOutput only. Current state of the Backup
stateReasonstringOutput only. Human-readable description of why the backup is in the current state. This field is only meant for human readability and should not be used programmatically as this field is not guaranteed to be consistent.
troubleshootingInfoobjectOutput only. Information about the troubleshooting steps which will provide debugging information to the end users. (id: TroubleshootingInfo)
uidstringOutput only. Server generated global unique identifier of UUID4
updateTimestring (google-datetime)Output only. The timestamp when this Backup resource was last updated.
volumeCountinteger (int32)Output only. The total number of volume backups contained in the Backup.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, backupPlansId, backupsIdRetrieve the details of a single Backup.
listselectprojectsId, locationsId, backupPlansIdpageSize, pageToken, filter, orderBy, returnPartialSuccessLists the Backups for a given BackupPlan.
createinsertprojectsId, locationsId, backupPlansIdbackupIdCreates a Backup for the given BackupPlan.
patchupdateprojectsId, locationsId, backupPlansId, backupsIdupdateMaskUpdate a Backup.
deletedeleteprojectsId, locationsId, backupPlansId, backupsIdetag, forceDeletes an existing 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
backupPlansIdstring
backupsIdstring
locationsIdstring
projectsIdstring
backupIdstring
etagstring
filterstring
forceboolean
orderBystring
pageSizeinteger (int32)
pageTokenstring
returnPartialSuccessboolean
updateMaskstring (google-fieldmask)

SELECT examples

Retrieve the details of a single Backup.

SELECT
name,
allNamespaces,
clusterMetadata,
completeTime,
configBackupSizeBytes,
containsSecrets,
containsVolumeData,
createTime,
deleteLockDays,
deleteLockExpireTime,
description,
encryptionKey,
etag,
labels,
manual,
permissiveMode,
podCount,
resourceCount,
retainDays,
retainExpireTime,
satisfiesPzi,
satisfiesPzs,
selectedApplications,
selectedNamespaceLabels,
selectedNamespaces,
sizeBytes,
state,
stateReason,
troubleshootingInfo,
uid,
updateTime,
volumeCount
FROM google.gkebackup.backups
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND backupPlansId = '{{ backupPlansId }}' -- required
AND backupsId = '{{ backupsId }}' -- required;

INSERT examples

Creates a Backup for the given BackupPlan.

INSERT INTO google.gkebackup.backups (
data__labels,
data__deleteLockDays,
data__retainDays,
data__description,
projectsId,
locationsId,
backupPlansId,
backupId
)
SELECT
'{{ labels }}',
{{ deleteLockDays }},
{{ retainDays }},
'{{ description }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ backupPlansId }}',
'{{ backupId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Update a Backup.

UPDATE google.gkebackup.backups
SET
data__labels = '{{ labels }}',
data__deleteLockDays = {{ deleteLockDays }},
data__retainDays = {{ retainDays }},
data__description = '{{ description }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupPlansId = '{{ backupPlansId }}' --required
AND backupsId = '{{ backupsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes an existing Backup.

DELETE FROM google.gkebackup.backups
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupPlansId = '{{ backupPlansId }}' --required
AND backupsId = '{{ backupsId }}' --required
AND etag = '{{ etag }}'
AND force = '{{ force }}';