backup_policies
Creates, updates, deletes, gets or lists a backup_policies
resource.
Overview
Name | backup_policies |
Type | Resource |
Id | google.netapp.backup_policies |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. The resource name of the backup policy. Format: projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id} . |
assignedVolumeCount | integer (int32) | Output only. The total number of volumes assigned by this backup policy. |
createTime | string (google-datetime) | Output only. The time when the backup policy was created. |
dailyBackupLimit | integer (int32) | Number of daily backups to keep. Note that the minimum daily backup limit is 2. |
description | string | Description of the backup policy. |
enabled | boolean | If enabled, make backups automatically according to the schedules. This will be applied to all volumes that have this policy attached and enforced on volume level. If not specified, default is true. |
labels | object | Resource labels to represent user provided metadata. |
monthlyBackupLimit | integer (int32) | Number of monthly backups to keep. Note that the sum of daily, weekly and monthly backups should be greater than 1. |
state | string | Output only. The backup policy state. |
weeklyBackupLimit | integer (int32) | Number of weekly backups to keep. Note that the sum of daily, weekly and monthly backups should be greater than 1. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. The resource name of the backup policy. Format: projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id} . |
assignedVolumeCount | integer (int32) | Output only. The total number of volumes assigned by this backup policy. |
createTime | string (google-datetime) | Output only. The time when the backup policy was created. |
dailyBackupLimit | integer (int32) | Number of daily backups to keep. Note that the minimum daily backup limit is 2. |
description | string | Description of the backup policy. |
enabled | boolean | If enabled, make backups automatically according to the schedules. This will be applied to all volumes that have this policy attached and enforced on volume level. If not specified, default is true. |
labels | object | Resource labels to represent user provided metadata. |
monthlyBackupLimit | integer (int32) | Number of monthly backups to keep. Note that the sum of daily, weekly and monthly backups should be greater than 1. |
state | string | Output only. The backup policy state. |
weeklyBackupLimit | integer (int32) | Number of weekly backups to keep. Note that the sum of daily, weekly and monthly backups should be greater than 1. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , backupPoliciesId | Returns the description of the specified backup policy by backup_policy_id. | |
list | select | projectsId , locationsId | pageSize , pageToken , filter , orderBy | Returns list of all available backup policies. |
create | insert | projectsId , locationsId | backupPolicyId | Creates new backup policy |
patch | update | projectsId , locationsId , backupPoliciesId | updateMask | Updates settings of a specific backup policy. |
delete | delete | projectsId , locationsId , backupPoliciesId | Warning! This operation will permanently delete the backup policy. |
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 |
---|---|---|
backupPoliciesId | string | |
locationsId | string | |
projectsId | string | |
backupPolicyId | string | |
filter | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
Returns the description of the specified backup policy by backup_policy_id.
SELECT
name,
assignedVolumeCount,
createTime,
dailyBackupLimit,
description,
enabled,
labels,
monthlyBackupLimit,
state,
weeklyBackupLimit
FROM google.netapp.backup_policies
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND backupPoliciesId = '{{ backupPoliciesId }}' -- required;
Returns list of all available backup policies.
SELECT
name,
assignedVolumeCount,
createTime,
dailyBackupLimit,
description,
enabled,
labels,
monthlyBackupLimit,
state,
weeklyBackupLimit
FROM google.netapp.backup_policies
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 new backup policy
INSERT INTO google.netapp.backup_policies (
data__name,
data__dailyBackupLimit,
data__weeklyBackupLimit,
data__monthlyBackupLimit,
data__description,
data__enabled,
data__labels,
projectsId,
locationsId,
backupPolicyId
)
SELECT
'{{ name }}',
{{ dailyBackupLimit }},
{{ weeklyBackupLimit }},
{{ monthlyBackupLimit }},
'{{ description }}',
{{ enabled }},
'{{ labels }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ backupPolicyId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: backup_policies
props:
- name: projectsId
value: string
description: Required parameter for the backup_policies resource.
- name: locationsId
value: string
description: Required parameter for the backup_policies resource.
- name: name
value: string
description: >
Identifier. The resource name of the backup policy. Format: `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`.
- name: dailyBackupLimit
value: integer
description: >
Number of daily backups to keep. Note that the minimum daily backup limit is 2.
- name: weeklyBackupLimit
value: integer
description: >
Number of weekly backups to keep. Note that the sum of daily, weekly and monthly backups should be greater than 1.
- name: monthlyBackupLimit
value: integer
description: >
Number of monthly backups to keep. Note that the sum of daily, weekly and monthly backups should be greater than 1.
- name: description
value: string
description: >
Description of the backup policy.
- name: enabled
value: boolean
description: >
If enabled, make backups automatically according to the schedules. This will be applied to all volumes that have this policy attached and enforced on volume level. If not specified, default is true.
- name: labels
value: object
description: >
Resource labels to represent user provided metadata.
- name: backupPolicyId
value: string
UPDATE
examples
- patch
Updates settings of a specific backup policy.
UPDATE google.netapp.backup_policies
SET
data__name = '{{ name }}',
data__dailyBackupLimit = {{ dailyBackupLimit }},
data__weeklyBackupLimit = {{ weeklyBackupLimit }},
data__monthlyBackupLimit = {{ monthlyBackupLimit }},
data__description = '{{ description }}',
data__enabled = {{ enabled }},
data__labels = '{{ labels }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupPoliciesId = '{{ backupPoliciesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;
DELETE
examples
- delete
Warning! This operation will permanently delete the backup policy.
DELETE FROM google.netapp.backup_policies
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupPoliciesId = '{{ backupPoliciesId }}' --required;