backup_plans
Creates, updates, deletes, gets or lists a backup_plans resource.
Overview
| Name | backup_plans |
| Type | Resource |
| Id | google.backupdr.backup_plans |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Output only. Identifier. The resource name of the BackupPlan. Format: projects/{project}/locations/{location}/backupPlans/{backup_plan} |
backupRules | array | Optional. The backup rules for this BackupPlan. |
backupVault | string | Required. Resource name of backup vault which will be used as storage location for backups. Format: projects/{project}/locations/{location}/backupVaults/{backupvault} |
backupVaultServiceAccount | string | Output only. The Google Cloud service account to be used by the BackupVault for taking backups. Specify the email address of the Backup Vault Service Account. |
computeInstanceBackupPlanProperties | object | Optional. Defines optional properties specific to backups of compute instance-based resources, such as Compute Engine. This includes settings like whether to perform a guest flush. (id: ComputeInstanceBackupPlanProperties) |
createTime | string (google-datetime) | Output only. When the BackupPlan was created. |
description | string | Optional. The description of the BackupPlan resource. The description allows for additional details about BackupPlan and its use cases to be provided. An example description is the following: "This is a backup plan that performs a daily backup at 6pm and retains data for 3 months". The description must be at most 2048 characters. |
diskBackupPlanProperties | object | Optional. Defines optional properties specific to backups of disk-based resources, such as Compute Engine Persistent Disks. This includes settings like whether to perform a guest flush. (id: DiskBackupPlanProperties) |
etag | string | Optional. etag is returned from the service in the response. As a user of the service, you may provide an etag value in this field to prevent stale resources. |
labels | object | Optional. This collection of key/value pairs allows for custom labels to be supplied by the user. Example, {"tag": "Weekly"}. |
logRetentionDays | string (int64) | Optional. Applicable only for Cloud SQL resource_type. Configures how long logs will be stored. It is defined in “days”. This value should be greater than or equal to minimum enforced log retention duration of the backup vault. |
maxCustomOnDemandRetentionDays | integer (int32) | Optional. Optional field to configure the maximum number of days for which a backup can be retained. This field is only applicable for on-demand backups taken with custom retention value. |
resourceType | string | Required. The resource type to which the BackupPlan will be applied. Examples include, "compute.googleapis.com/Instance", "sqladmin.googleapis.com/Instance", "alloydb.googleapis.com/Cluster", "compute.googleapis.com/Disk". |
revisionId | string | Output only. The user friendly revision ID of the BackupPlanRevision. Example: v0, v1, v2, etc. |
revisionName | string | Output only. The resource id of the BackupPlanRevision. Format: projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id} |
state | string | Output only. The State for the BackupPlan. (STATE_UNSPECIFIED, CREATING, ACTIVE, DELETING, INACTIVE, UPDATING) |
supportedResourceTypes | array | Output only. All resource types to which backupPlan can be applied. |
updateTime | string (google-datetime) | Output only. When the BackupPlan was last updated. |
| Name | Datatype | Description |
|---|---|---|
name | string | Output only. Identifier. The resource name of the BackupPlan. Format: projects/{project}/locations/{location}/backupPlans/{backup_plan} |
backupRules | array | Optional. The backup rules for this BackupPlan. |
backupVault | string | Required. Resource name of backup vault which will be used as storage location for backups. Format: projects/{project}/locations/{location}/backupVaults/{backupvault} |
backupVaultServiceAccount | string | Output only. The Google Cloud service account to be used by the BackupVault for taking backups. Specify the email address of the Backup Vault Service Account. |
computeInstanceBackupPlanProperties | object | Optional. Defines optional properties specific to backups of compute instance-based resources, such as Compute Engine. This includes settings like whether to perform a guest flush. (id: ComputeInstanceBackupPlanProperties) |
createTime | string (google-datetime) | Output only. When the BackupPlan was created. |
description | string | Optional. The description of the BackupPlan resource. The description allows for additional details about BackupPlan and its use cases to be provided. An example description is the following: "This is a backup plan that performs a daily backup at 6pm and retains data for 3 months". The description must be at most 2048 characters. |
diskBackupPlanProperties | object | Optional. Defines optional properties specific to backups of disk-based resources, such as Compute Engine Persistent Disks. This includes settings like whether to perform a guest flush. (id: DiskBackupPlanProperties) |
etag | string | Optional. etag is returned from the service in the response. As a user of the service, you may provide an etag value in this field to prevent stale resources. |
labels | object | Optional. This collection of key/value pairs allows for custom labels to be supplied by the user. Example, {"tag": "Weekly"}. |
logRetentionDays | string (int64) | Optional. Applicable only for Cloud SQL resource_type. Configures how long logs will be stored. It is defined in “days”. This value should be greater than or equal to minimum enforced log retention duration of the backup vault. |
maxCustomOnDemandRetentionDays | integer (int32) | Optional. Optional field to configure the maximum number of days for which a backup can be retained. This field is only applicable for on-demand backups taken with custom retention value. |
resourceType | string | Required. The resource type to which the BackupPlan will be applied. Examples include, "compute.googleapis.com/Instance", "sqladmin.googleapis.com/Instance", "alloydb.googleapis.com/Cluster", "compute.googleapis.com/Disk". |
revisionId | string | Output only. The user friendly revision ID of the BackupPlanRevision. Example: v0, v1, v2, etc. |
revisionName | string | Output only. The resource id of the BackupPlanRevision. Format: projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id} |
state | string | Output only. The State for the BackupPlan. (STATE_UNSPECIFIED, CREATING, ACTIVE, DELETING, INACTIVE, UPDATING) |
supportedResourceTypes | array | Output only. All resource types to which backupPlan can be applied. |
updateTime | string (google-datetime) | Output only. When the BackupPlan 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 | Gets details of a single BackupPlan. | |
list | select | projectsId, locationsId | orderBy, pageSize, pageToken, filter | Lists BackupPlans in a given project and location. |
create | insert | projectsId, locationsId | backupPlanId, requestId | Create a BackupPlan |
patch | update | projectsId, locationsId, backupPlansId | updateMask, requestId | Update a BackupPlan. |
delete | delete | projectsId, locationsId, backupPlansId | requestId | Deletes a single 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 | |
filter | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
requestId | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- get
- list
Gets details of a single BackupPlan.
SELECT
name,
backupRules,
backupVault,
backupVaultServiceAccount,
computeInstanceBackupPlanProperties,
createTime,
description,
diskBackupPlanProperties,
etag,
labels,
logRetentionDays,
maxCustomOnDemandRetentionDays,
resourceType,
revisionId,
revisionName,
state,
supportedResourceTypes,
updateTime
FROM google.backupdr.backup_plans
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND backupPlansId = '{{ backupPlansId }}' -- required
;
Lists BackupPlans in a given project and location.
SELECT
name,
backupRules,
backupVault,
backupVaultServiceAccount,
computeInstanceBackupPlanProperties,
createTime,
description,
diskBackupPlanProperties,
etag,
labels,
logRetentionDays,
maxCustomOnDemandRetentionDays,
resourceType,
revisionId,
revisionName,
state,
supportedResourceTypes,
updateTime
FROM google.backupdr.backup_plans
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND orderBy = '{{ orderBy }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
;
INSERT examples
- create
- Manifest
Create a BackupPlan
INSERT INTO google.backupdr.backup_plans (
data__etag,
data__logRetentionDays,
data__description,
data__backupVault,
data__backupRules,
data__labels,
data__maxCustomOnDemandRetentionDays,
data__resourceType,
data__diskBackupPlanProperties,
data__computeInstanceBackupPlanProperties,
projectsId,
locationsId,
backupPlanId,
requestId
)
SELECT
'{{ etag }}',
'{{ logRetentionDays }}',
'{{ description }}',
'{{ backupVault }}',
'{{ backupRules }}',
'{{ labels }}',
{{ maxCustomOnDemandRetentionDays }},
'{{ resourceType }}',
'{{ diskBackupPlanProperties }}',
'{{ computeInstanceBackupPlanProperties }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ backupPlanId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: backup_plans
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the backup_plans resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the backup_plans resource.
- name: etag
value: "{{ etag }}"
description: |
Optional. `etag` is returned from the service in the response. As a user of the service, you may provide an etag value in this field to prevent stale resources.
- name: logRetentionDays
value: "{{ logRetentionDays }}"
description: |
Optional. Applicable only for Cloud SQL resource_type. Configures how long logs will be stored. It is defined in “days”. This value should be greater than or equal to minimum enforced log retention duration of the backup vault.
- name: description
value: "{{ description }}"
description: |
Optional. The description of the `BackupPlan` resource. The description allows for additional details about `BackupPlan` and its use cases to be provided. An example description is the following: "This is a backup plan that performs a daily backup at 6pm and retains data for 3 months". The description must be at most 2048 characters.
- name: backupVault
value: "{{ backupVault }}"
description: |
Required. Resource name of backup vault which will be used as storage location for backups. Format: projects/{project}/locations/{location}/backupVaults/{backupvault}
- name: backupRules
description: |
Optional. The backup rules for this `BackupPlan`.
value:
- ruleId: "{{ ruleId }}"
backupRetentionDays: {{ backupRetentionDays }}
standardSchedule:
backupWindow:
startHourOfDay: {{ startHourOfDay }}
endHourOfDay: {{ endHourOfDay }}
timeZone: "{{ timeZone }}"
weekDayOfMonth:
weekOfMonth: "{{ weekOfMonth }}"
dayOfWeek: "{{ dayOfWeek }}"
recurrenceType: "{{ recurrenceType }}"
daysOfWeek:
- "{{ daysOfWeek }}"
hourlyFrequency: {{ hourlyFrequency }}
months:
- "{{ months }}"
daysOfMonth:
- {{ daysOfMonth }}
- name: labels
value: "{{ labels }}"
description: |
Optional. This collection of key/value pairs allows for custom labels to be supplied by the user. Example, {"tag": "Weekly"}.
- name: maxCustomOnDemandRetentionDays
value: {{ maxCustomOnDemandRetentionDays }}
description: |
Optional. Optional field to configure the maximum number of days for which a backup can be retained. This field is only applicable for on-demand backups taken with custom retention value.
- name: resourceType
value: "{{ resourceType }}"
description: |
Required. The resource type to which the `BackupPlan` will be applied. Examples include, "compute.googleapis.com/Instance", "sqladmin.googleapis.com/Instance", "alloydb.googleapis.com/Cluster", "compute.googleapis.com/Disk".
- name: diskBackupPlanProperties
description: |
Optional. Defines optional properties specific to backups of disk-based resources, such as Compute Engine Persistent Disks. This includes settings like whether to perform a guest flush.
value:
guestFlush: {{ guestFlush }}
- name: computeInstanceBackupPlanProperties
description: |
Optional. Defines optional properties specific to backups of compute instance-based resources, such as Compute Engine. This includes settings like whether to perform a guest flush.
value:
guestFlush: {{ guestFlush }}
- name: backupPlanId
value: "{{ backupPlanId }}"
- name: requestId
value: "{{ requestId }}"
UPDATE examples
- patch
Update a BackupPlan.
UPDATE google.backupdr.backup_plans
SET
data__etag = '{{ etag }}',
data__logRetentionDays = '{{ logRetentionDays }}',
data__description = '{{ description }}',
data__backupVault = '{{ backupVault }}',
data__backupRules = '{{ backupRules }}',
data__labels = '{{ labels }}',
data__maxCustomOnDemandRetentionDays = {{ maxCustomOnDemandRetentionDays }},
data__resourceType = '{{ resourceType }}',
data__diskBackupPlanProperties = '{{ diskBackupPlanProperties }}',
data__computeInstanceBackupPlanProperties = '{{ computeInstanceBackupPlanProperties }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupPlansId = '{{ backupPlansId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;
DELETE examples
- delete
Deletes a single BackupPlan.
DELETE FROM google.backupdr.backup_plans
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupPlansId = '{{ backupPlansId }}' --required
AND requestId = '{{ requestId }}'
;