Skip to main content

backup_plans

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

Overview

Namebackup_plans
TypeResource
Idgoogle.gkebackup.backup_plans

Fields

NameDatatypeDescription
namestringOutput only. The full name of the BackupPlan resource. Format: projects/*/locations/*/backupPlans/*
descriptionstringOptional. User specified descriptive string for this BackupPlan.
backupConfigobjectBackupConfig defines the configuration of Backups created via this BackupPlan.
backupScheduleobjectDefines scheduling parameters for automatically creating Backups via this BackupPlan.
clusterstringRequired. Immutable. The source cluster from which Backups will be created via this BackupPlan. Valid formats: - projects/*/locations/*/clusters/* - projects/*/zones/*/clusters/*
createTimestringOutput only. The timestamp when this BackupPlan resource was created.
deactivatedbooleanOptional. This flag indicates whether this BackupPlan has been deactivated. Setting this field to True locks the BackupPlan such that no further updates will be allowed (except deletes), including the deactivated field itself. It also prevents any new Backups from being created via this BackupPlan (including scheduled Backups). Default: False
etagstringOutput only. etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a backup plan from overwriting each other. It is strongly suggested that systems make use of the 'etag' in the read-modify-write cycle to perform BackupPlan updates in order to avoid race conditions: An etag is returned in the response to GetBackupPlan, and systems are expected to put that etag in the request to UpdateBackupPlan or DeleteBackupPlan to ensure that their change will be applied to the same version of the resource.
labelsobjectOptional. A set of custom labels supplied by user.
protectedPodCountintegerOutput only. The number of Kubernetes Pods backed up in the last successful Backup created via this BackupPlan.
retentionPolicyobjectRetentionPolicy defines a Backup retention policy for a BackupPlan.
rpoRiskLevelintegerOutput only. A number that represents the current risk level of this BackupPlan from RPO perspective with 1 being no risk and 5 being highest risk.
rpoRiskReasonstringOutput only. Human-readable description of why the BackupPlan is in the current rpo_risk_level and action items if any.
statestringOutput only. State of the BackupPlan. This State field reflects the various stages a BackupPlan can be in during the Create operation. It will be set to "DEACTIVATED" if the BackupPlan is deactivated on an Update
stateReasonstringOutput only. Human-readable description of why BackupPlan is in the current state
uidstringOutput only. Server generated global unique identifier of UUID format.
updateTimestringOutput only. The timestamp when this BackupPlan resource was last updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECTbackupPlansId, locationsId, projectsIdRetrieve the details of a single BackupPlan.
listSELECTlocationsId, projectsIdLists BackupPlans in a given location.
createINSERTlocationsId, projectsIdCreates a new BackupPlan in a given location.
deleteDELETEbackupPlansId, locationsId, projectsIdDeletes an existing BackupPlan.
patchUPDATEbackupPlansId, locationsId, projectsIdUpdate a BackupPlan.

SELECT examples

Lists BackupPlans in a given location.

SELECT
name,
description,
backupConfig,
backupSchedule,
cluster,
createTime,
deactivated,
etag,
labels,
protectedPodCount,
retentionPolicy,
rpoRiskLevel,
rpoRiskReason,
state,
stateReason,
uid,
updateTime
FROM google.gkebackup.backup_plans
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new backup_plans resource.

/*+ create */
INSERT INTO google.gkebackup.backup_plans (
locationsId,
projectsId,
description,
cluster,
retentionPolicy,
labels,
backupSchedule,
deactivated,
backupConfig
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ description }}',
'{{ cluster }}',
'{{ retentionPolicy }}',
'{{ labels }}',
'{{ backupSchedule }}',
{{ deactivated }},
'{{ backupConfig }}'
;

UPDATE example

Updates a backup_plans resource.

/*+ update */
UPDATE google.gkebackup.backup_plans
SET
description = '{{ description }}',
cluster = '{{ cluster }}',
retentionPolicy = '{{ retentionPolicy }}',
labels = '{{ labels }}',
backupSchedule = '{{ backupSchedule }}',
deactivated = true|false,
backupConfig = '{{ backupConfig }}'
WHERE
backupPlansId = '{{ backupPlansId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified backup_plans resource.

/*+ delete */
DELETE FROM google.gkebackup.backup_plans
WHERE backupPlansId = '{{ backupPlansId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';