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
Successful response
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 Platform Service Account to be used by the BackupVault for taking backups. Specify the email address of the Backup Vault Service Account. |
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. |
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 CloudSQL 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. |
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 . |
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. |
Successful response
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 Platform Service Account to be used by the BackupVault for taking backups. Specify the email address of the Backup Vault Service Account. |
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. |
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 CloudSQL 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. |
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 . |
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 | pageSize , pageToken , filter , orderBy | 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,
createTime,
description,
etag,
labels,
logRetentionDays,
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,
createTime,
description,
etag,
labels,
logRetentionDays,
resourceType,
revisionId,
revisionName,
state,
supportedResourceTypes,
updateTime
FROM google.backupdr.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
Create a BackupPlan
INSERT INTO google.backupdr.backup_plans (
data__description,
data__labels,
data__backupRules,
data__resourceType,
data__etag,
data__backupVault,
data__logRetentionDays,
projectsId,
locationsId,
backupPlanId,
requestId
)
SELECT
'{{ description }}',
'{{ labels }}',
'{{ backupRules }}',
'{{ resourceType }}',
'{{ etag }}',
'{{ backupVault }}',
'{{ logRetentionDays }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ backupPlanId }}',
'{{ requestId }}'
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. 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: labels
value: object
description: >
Optional. This collection of key/value pairs allows for custom labels to be supplied by the user. Example, {"tag": "Weekly"}.
- name: backupRules
value: array
description: >
Optional. The backup rules for this `BackupPlan`.
- name: resourceType
value: string
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: etag
value: string
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: backupVault
value: string
description: >
Required. Resource name of backup vault which will be used as storage location for backups. Format: projects/{project}/locations/{location}/backupVaults/{backupvault}
- name: logRetentionDays
value: string
description: >
Optional. Applicable only for CloudSQL 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: backupPlanId
value: string
- name: requestId
value: string
UPDATE
examples
- patch
Update a BackupPlan.
UPDATE google.backupdr.backup_plans
SET
data__description = '{{ description }}',
data__labels = '{{ labels }}',
data__backupRules = '{{ backupRules }}',
data__resourceType = '{{ resourceType }}',
data__etag = '{{ etag }}',
data__backupVault = '{{ backupVault }}',
data__logRetentionDays = '{{ logRetentionDays }}'
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 }}';