Skip to main content

backup_policies

Creates, updates, deletes, gets or lists a backup_policies resource.

Overview

Namebackup_policies
TypeResource
Idgoogle.netapp.backup_policies

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. The resource name of the backup policy. Format: projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}.
assignedVolumeCountinteger (int32)Output only. The total number of volumes assigned by this backup policy.
createTimestring (google-datetime)Output only. The time when the backup policy was created.
dailyBackupLimitinteger (int32)Number of daily backups to keep. Note that the minimum daily backup limit is 2.
descriptionstringDescription of the backup policy.
enabledbooleanIf 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.
labelsobjectResource labels to represent user provided metadata.
monthlyBackupLimitinteger (int32)Number of monthly backups to keep. Note that the sum of daily, weekly and monthly backups should be greater than 1.
statestringOutput only. The backup policy state.
weeklyBackupLimitinteger (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:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, backupPoliciesIdReturns the description of the specified backup policy by backup_policy_id.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByReturns list of all available backup policies.
createinsertprojectsId, locationsIdbackupPolicyIdCreates new backup policy
patchupdateprojectsId, locationsId, backupPoliciesIdupdateMaskUpdates settings of a specific backup policy.
deletedeleteprojectsId, locationsId, backupPoliciesIdWarning! 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.

NameDatatypeDescription
backupPoliciesIdstring
locationsIdstring
projectsIdstring
backupPolicyIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

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;

INSERT examples

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
;

UPDATE examples

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

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;