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

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The full name of the BackupPlan resource. Format: projects/*/locations/*/backupPlans/*
backupChannelstringOutput only. The fully qualified name of the BackupChannel to be used to create a backup. This field is set only if the cluster being backed up is in a different project. projects/*/locations/*/backupChannels/*
backupConfigobjectOptional. Defines the configuration of Backups created via this BackupPlan. (id: BackupConfig)
backupScheduleobjectOptional. Defines a schedule for automatic Backup creation via this BackupPlan. (id: Schedule)
clusterstringRequired. Immutable. The source cluster from which Backups will be created via this BackupPlan. Valid formats: - projects/*/locations/*/clusters/* - projects/*/zones/*/clusters/*
createTimestring (google-datetime)Output 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
descriptionstringOptional. User specified descriptive string for this BackupPlan.
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.
lastSuccessfulBackupTimestring (google-datetime)Output only. Completion time of the last successful Backup. This is sourced from a successful Backup's complete_time field. This field is added to maintain consistency with BackupPlanBinding to display last successful backup time.
protectedPodCountinteger (int32)Output only. The number of Kubernetes Pods backed up in the last successful Backup created via this BackupPlan.
retentionPolicyobjectOptional. RetentionPolicy governs lifecycle of Backups created under this plan. (id: RetentionPolicy)
rpoRiskLevelinteger (int32)Output 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. This field is only meant for human readability and should not be used programmatically as this field is not guaranteed to be consistent.
uidstringOutput only. Server generated global unique identifier of UUID format.
updateTimestring (google-datetime)Output only. The timestamp when this BackupPlan resource was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, backupPlansIdRetrieve the details of a single BackupPlan.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists BackupPlans in a given location.
createinsertprojectsId, locationsIdbackupPlanIdCreates a new BackupPlan in a given location.
patchupdateprojectsId, locationsId, backupPlansIdupdateMaskUpdate a BackupPlan.
deletedeleteprojectsId, locationsId, backupPlansIdetagDeletes an existing BackupPlan.

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
locationsIdstring
projectsIdstring
backupPlanIdstring
etagstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Retrieve the details of a single BackupPlan.

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

INSERT examples

Creates a new BackupPlan in a given location.

INSERT INTO google.gkebackup.backup_plans (
data__description,
data__cluster,
data__retentionPolicy,
data__labels,
data__backupSchedule,
data__deactivated,
data__backupConfig,
projectsId,
locationsId,
backupPlanId
)
SELECT
'{{ description }}',
'{{ cluster }}',
'{{ retentionPolicy }}',
'{{ labels }}',
'{{ backupSchedule }}',
{{ deactivated }},
'{{ backupConfig }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ backupPlanId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Update a BackupPlan.

UPDATE google.gkebackup.backup_plans
SET
data__description = '{{ description }}',
data__cluster = '{{ cluster }}',
data__retentionPolicy = '{{ retentionPolicy }}',
data__labels = '{{ labels }}',
data__backupSchedule = '{{ backupSchedule }}',
data__deactivated = {{ deactivated }},
data__backupConfig = '{{ backupConfig }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupPlansId = '{{ backupPlansId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes an existing BackupPlan.

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