backups
Creates, updates, deletes, gets or lists a backups
resource.
Overview
Name | backups |
Type | Resource |
Id | google.gkebackup.backups |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Output only. The fully qualified name of the Backup. projects/*/locations/*/backupPlans/*/backups/* |
description | string | Optional. User specified descriptive string for this Backup. |
allNamespaces | boolean | Output only. If True, all namespaces were included in the Backup. |
clusterMetadata | object | Information about the GKE cluster from which this Backup was created. |
completeTime | string | Output only. Completion time of the Backup |
configBackupSizeBytes | string | Output only. The size of the config backup in bytes. |
containsSecrets | boolean | Output only. Whether or not the Backup contains Kubernetes Secrets. Controlled by the parent BackupPlan's include_secrets value. |
containsVolumeData | boolean | Output only. Whether or not the Backup contains volume data. Controlled by the parent BackupPlan's include_volume_data value. |
createTime | string | Output only. The timestamp when this Backup resource was created. |
deleteLockDays | integer | 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). |
deleteLockExpireTime | string | Output only. The time at which an existing delete lock will expire for this backup (calculated from create_time + delete_lock_days). |
encryptionKey | object | Defined a customer managed encryption key that will be used to encrypt Backup artifacts. |
etag | string | Output 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. |
labels | object | Optional. A set of custom labels supplied by user. |
manual | boolean | Output 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. |
permissiveMode | boolean | Output 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. |
podCount | integer | Output only. The total number of Kubernetes Pods contained in the Backup. |
resourceCount | integer | Output only. The total number of Kubernetes resources included in the Backup. |
retainDays | integer | 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. |
retainExpireTime | string | Output only. The time at which this Backup will be automatically deleted (calculated from create_time + retain_days). |
selectedApplications | object | A list of namespaced Kubernetes resources. |
selectedNamespaces | object | A list of Kubernetes Namespaces. |
sizeBytes | string | Output only. The total size of the Backup in bytes = config backup size + sum(volume backup sizes) |
state | string | Output only. Current state of the Backup |
stateReason | string | Output only. Human-readable description of why the backup is in the current state . |
uid | string | Output only. Server generated global unique identifier of UUID4 |
updateTime | string | Output only. The timestamp when this Backup resource was last updated. |
volumeCount | integer | Output only. The total number of volume backups contained in the Backup. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | backupPlansId, backupsId, locationsId, projectsId | Retrieve the details of a single Backup. |
list | SELECT | backupPlansId, locationsId, projectsId | Lists the Backups for a given BackupPlan. |
create | INSERT | backupPlansId, locationsId, projectsId | Creates a Backup for the given BackupPlan. |
delete | DELETE | backupPlansId, backupsId, locationsId, projectsId | Deletes an existing Backup. |
patch | UPDATE | backupPlansId, backupsId, locationsId, projectsId | Update a Backup. |
SELECT
examples
Lists the Backups for a given BackupPlan.
SELECT
name,
description,
allNamespaces,
clusterMetadata,
completeTime,
configBackupSizeBytes,
containsSecrets,
containsVolumeData,
createTime,
deleteLockDays,
deleteLockExpireTime,
encryptionKey,
etag,
labels,
manual,
permissiveMode,
podCount,
resourceCount,
retainDays,
retainExpireTime,
selectedApplications,
selectedNamespaces,
sizeBytes,
state,
stateReason,
uid,
updateTime,
volumeCount
FROM google.gkebackup.backups
WHERE backupPlansId = '{{ backupPlansId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new backups
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.gkebackup.backups (
backupPlansId,
locationsId,
projectsId,
labels,
deleteLockDays,
retainDays,
description
)
SELECT
'{{ backupPlansId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ labels }}',
'{{ deleteLockDays }}',
'{{ retainDays }}',
'{{ description }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: uid
value: string
- name: createTime
value: string
- name: updateTime
value: string
- name: manual
value: boolean
- name: labels
value: object
- name: deleteLockDays
value: integer
- name: deleteLockExpireTime
value: string
- name: retainDays
value: integer
- name: retainExpireTime
value: string
- name: encryptionKey
value:
- name: gcpKmsEncryptionKey
value: string
- name: allNamespaces
value: boolean
- name: selectedNamespaces
value:
- name: namespaces
value:
- string
- name: selectedApplications
value:
- name: namespacedNames
value:
- - name: namespace
value: string
- name: name
value: string
- name: containsVolumeData
value: boolean
- name: containsSecrets
value: boolean
- name: clusterMetadata
value:
- name: cluster
value: string
- name: k8sVersion
value: string
- name: backupCrdVersions
value: object
- name: gkeVersion
value: string
- name: anthosVersion
value: string
- name: state
value: string
- name: stateReason
value: string
- name: completeTime
value: string
- name: resourceCount
value: integer
- name: volumeCount
value: integer
- name: sizeBytes
value: string
- name: etag
value: string
- name: description
value: string
- name: podCount
value: integer
- name: configBackupSizeBytes
value: string
- name: permissiveMode
value: boolean
UPDATE
example
Updates a backups
resource.
/*+ update */
UPDATE google.gkebackup.backups
SET
labels = '{{ labels }}',
deleteLockDays = '{{ deleteLockDays }}',
retainDays = '{{ retainDays }}',
description = '{{ description }}'
WHERE
backupPlansId = '{{ backupPlansId }}'
AND backupsId = '{{ backupsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';
DELETE
example
Deletes the specified backups
resource.
/*+ delete */
DELETE FROM google.gkebackup.backups
WHERE backupPlansId = '{{ backupPlansId }}'
AND backupsId = '{{ backupsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';