backup_plans
Creates, updates, deletes, gets or lists a backup_plans
resource.
Overview
Name | backup_plans |
Type | Resource |
Id | google.gkebackup.backup_plans |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. The full name of the BackupPlan resource. Format: projects/*/locations/*/backupPlans/* |
backupChannel | string | Output 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/* |
backupConfig | object | Optional. Defines the configuration of Backups created via this BackupPlan. (id: BackupConfig) |
backupSchedule | object | Optional. Defines a schedule for automatic Backup creation via this BackupPlan. (id: Schedule) |
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 (google-datetime) | 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 |
description | string | Optional. User specified descriptive string for this BackupPlan. |
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. |
lastSuccessfulBackupTime | string (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. |
protectedPodCount | integer (int32) | Output only. The number of Kubernetes Pods backed up in the last successful Backup created via this BackupPlan. |
retentionPolicy | object | Optional. RetentionPolicy governs lifecycle of Backups created under this plan. (id: RetentionPolicy) |
rpoRiskLevel | integer (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. |
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 . This field is only meant for human readability and should not be used programmatically as this field is not guaranteed to be consistent. |
uid | string | Output only. Server generated global unique identifier of UUID format. |
updateTime | string (google-datetime) | Output only. The timestamp when this BackupPlan resource was last updated. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. The full name of the BackupPlan resource. Format: projects/*/locations/*/backupPlans/* |
backupChannel | string | Output 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/* |
backupConfig | object | Optional. Defines the configuration of Backups created via this BackupPlan. (id: BackupConfig) |
backupSchedule | object | Optional. Defines a schedule for automatic Backup creation via this BackupPlan. (id: Schedule) |
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 (google-datetime) | 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 |
description | string | Optional. User specified descriptive string for this BackupPlan. |
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. |
lastSuccessfulBackupTime | string (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. |
protectedPodCount | integer (int32) | Output only. The number of Kubernetes Pods backed up in the last successful Backup created via this BackupPlan. |
retentionPolicy | object | Optional. RetentionPolicy governs lifecycle of Backups created under this plan. (id: RetentionPolicy) |
rpoRiskLevel | integer (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. |
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 . This field is only meant for human readability and should not be used programmatically as this field is not guaranteed to be consistent. |
uid | string | Output only. Server generated global unique identifier of UUID format. |
updateTime | string (google-datetime) | Output only. The timestamp when this BackupPlan resource was last updated. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , backupPlansId | Retrieve the details of a single BackupPlan. | |
list | select | projectsId , locationsId | pageSize , pageToken , filter , orderBy | Lists BackupPlans in a given location. |
create | insert | projectsId , locationsId | backupPlanId | Creates a new BackupPlan in a given location. |
patch | update | projectsId , locationsId , backupPlansId | updateMask | Update a BackupPlan. |
delete | delete | projectsId , locationsId , backupPlansId | etag | Deletes 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.
Name | Datatype | Description |
---|---|---|
backupPlansId | string | |
locationsId | string | |
projectsId | string | |
backupPlanId | string | |
etag | string | |
filter | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
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;
Lists BackupPlans in a given location.
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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}';
INSERT
examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: backup_plans
props:
- name: projectsId
value: string
description: Required parameter for the backup_plans resource.
- name: locationsId
value: string
description: Required parameter for the backup_plans resource.
- name: description
value: string
description: >
Optional. User specified descriptive string for this BackupPlan.
- name: cluster
value: string
description: >
Required. Immutable. The source cluster from which Backups will be created via this BackupPlan. Valid formats: - `projects/*/locations/*/clusters/*` - `projects/*/zones/*/clusters/*`
- name: retentionPolicy
value: object
description: >
Optional. RetentionPolicy governs lifecycle of Backups created under this plan.
- name: labels
value: object
description: >
Optional. A set of custom labels supplied by user.
- name: backupSchedule
value: object
description: >
Optional. Defines a schedule for automatic Backup creation via this BackupPlan.
- name: deactivated
value: boolean
description: >
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
- name: backupConfig
value: object
description: >
Optional. Defines the configuration of Backups created via this BackupPlan.
- name: backupPlanId
value: string
UPDATE
examples
- patch
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
- delete
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 }}';