backup_plans
Creates, updates, deletes, gets or lists a backup_plans
resource.
Overview
Name | backup_plans |
Type | Resource |
Id | google.gkebackup.backup_plans |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Output only. The full name of the BackupPlan resource. Format: projects/*/locations/*/backupPlans/* |
description | string | Optional. User specified descriptive string for this BackupPlan. |
backupConfig | object | BackupConfig defines the configuration of Backups created via this BackupPlan. |
backupSchedule | object | Defines scheduling parameters for automatically creating Backups via this BackupPlan. |
cluster | string | Required. Immutable. The source cluster from which Backups will be created via this BackupPlan. Valid formats: - projects/*/locations/*/clusters/* - projects/*/zones/*/clusters/* |
createTime | string | Output only. The timestamp when this BackupPlan resource was created. |
deactivated | boolean | Optional. 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 |
etag | string | Output 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. |
labels | object | Optional. A set of custom labels supplied by user. |
protectedPodCount | integer | Output only. The number of Kubernetes Pods backed up in the last successful Backup created via this BackupPlan. |
retentionPolicy | object | RetentionPolicy defines a Backup retention policy for a BackupPlan. |
rpoRiskLevel | integer | 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. |
rpoRiskReason | string | Output only. Human-readable description of why the BackupPlan is in the current rpo_risk_level and action items if any. |
state | string | Output 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 |
stateReason | string | Output only. Human-readable description of why BackupPlan is in the current state |
uid | string | Output only. Server generated global unique identifier of UUID format. |
updateTime | string | Output only. The timestamp when this BackupPlan resource was last updated. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | backupPlansId, locationsId, projectsId | Retrieve the details of a single BackupPlan. |
list | SELECT | locationsId, projectsId | Lists BackupPlans in a given location. |
create | INSERT | locationsId, projectsId | Creates a new BackupPlan in a given location. |
delete | DELETE | backupPlansId, locationsId, projectsId | Deletes an existing BackupPlan. |
patch | UPDATE | backupPlansId, locationsId, projectsId | Update 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.
- All Properties
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: uid
value: string
- name: createTime
value: string
- name: updateTime
value: string
- name: description
value: string
- name: cluster
value: string
- name: retentionPolicy
value:
- name: backupDeleteLockDays
value: integer
- name: backupRetainDays
value: integer
- name: locked
value: boolean
- name: labels
value: object
- name: backupSchedule
value:
- name: cronSchedule
value: string
- name: paused
value: boolean
- name: rpoConfig
value:
- name: targetRpoMinutes
value: integer
- name: exclusionWindows
value:
- - name: startTime
value:
- name: hours
value: integer
- name: minutes
value: integer
- name: seconds
value: integer
- name: nanos
value: integer
- name: duration
value: string
- name: singleOccurrenceDate
value:
- name: year
value: integer
- name: month
value: integer
- name: day
value: integer
- name: daily
value: boolean
- name: daysOfWeek
value:
- name: daysOfWeek
value:
- string
- name: nextScheduledBackupTime
value: string
- name: etag
value: string
- name: deactivated
value: boolean
- name: backupConfig
value:
- 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: includeVolumeData
value: boolean
- name: includeSecrets
value: boolean
- name: encryptionKey
value:
- name: gcpKmsEncryptionKey
value: string
- name: permissiveMode
value: boolean
- name: protectedPodCount
value: integer
- name: state
value: string
- name: stateReason
value: string
- name: rpoRiskLevel
value: integer
- name: rpoRiskReason
value: string
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 }}';