Skip to main content

backup_plan_associations

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

Overview

Namebackup_plan_associations
TypeResource
Idgoogle.backupdr.backup_plan_associations

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Identifier. The resource name of BackupPlanAssociation in below format Format : projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}
backupPlanstringRequired. Resource name of backup plan which needs to be applied on workload. Format: projects/{project}/locations/{location}/backupPlans/{backupPlanId}
backupPlanRevisionIdstringOutput only. The user friendly revision ID of the BackupPlanRevision. Example: v0, v1, v2, etc.
backupPlanRevisionNamestringOutput only. The resource id of the BackupPlanRevision. Format: projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id}
cloudSqlInstanceBackupPlanAssociationPropertiesobjectOutput only. Cloud SQL instance's backup plan association properties. (id: CloudSqlInstanceBackupPlanAssociationProperties)
createTimestring (google-datetime)Output only. The time when the instance was created.
dataSourcestringOutput only. Resource name of data source which will be used as storage location for backups taken. Format : projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}
resourcestringRequired. Immutable. Resource name of workload on which the backup plan is applied. The format can either be the resource name (e.g., "projects/my-project/zones/us-central1-a/instances/my-instance") or the full resource URI (e.g., "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a/instances/my-instance").
resourceTypestringRequired. Immutable. Resource type of workload on which backupplan is applied
rulesConfigInfoarrayOutput only. The config info related to backup rules.
statestringOutput only. The BackupPlanAssociation resource state.
updateTimestring (google-datetime)Output only. The time when the instance was updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, backupPlanAssociationsIdGets details of a single BackupPlanAssociation.
listselectprojectsId, locationsIdpageSize, pageToken, filterLists BackupPlanAssociations in a given project and location.
createinsertprojectsId, locationsIdbackupPlanAssociationId, requestIdCreate a BackupPlanAssociation
patchupdateprojectsId, locationsId, backupPlanAssociationsIdupdateMask, requestIdUpdate a BackupPlanAssociation.
deletedeleteprojectsId, locationsId, backupPlanAssociationsIdrequestIdDeletes a single BackupPlanAssociation.
fetch_for_resource_typeexecprojectsId, locationsIdresourceType, pageSize, pageToken, filter, orderByList BackupPlanAssociations for a given resource type.
trigger_backupexecprojectsId, locationsId, backupPlanAssociationsIdTriggers a new Backup.

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
backupPlanAssociationsIdstring
locationsIdstring
projectsIdstring
backupPlanAssociationIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
resourceTypestring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details of a single BackupPlanAssociation.

SELECT
name,
backupPlan,
backupPlanRevisionId,
backupPlanRevisionName,
cloudSqlInstanceBackupPlanAssociationProperties,
createTime,
dataSource,
resource,
resourceType,
rulesConfigInfo,
state,
updateTime
FROM google.backupdr.backup_plan_associations
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND backupPlanAssociationsId = '{{ backupPlanAssociationsId }}' -- required;

INSERT examples

Create a BackupPlanAssociation

INSERT INTO google.backupdr.backup_plan_associations (
data__resourceType,
data__resource,
data__backupPlan,
projectsId,
locationsId,
backupPlanAssociationId,
requestId
)
SELECT
'{{ resourceType }}',
'{{ resource }}',
'{{ backupPlan }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ backupPlanAssociationId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Update a BackupPlanAssociation.

UPDATE google.backupdr.backup_plan_associations
SET
data__resourceType = '{{ resourceType }}',
data__resource = '{{ resource }}',
data__backupPlan = '{{ backupPlan }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupPlanAssociationsId = '{{ backupPlanAssociationsId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single BackupPlanAssociation.

DELETE FROM google.backupdr.backup_plan_associations
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupPlanAssociationsId = '{{ backupPlanAssociationsId }}' --required
AND requestId = '{{ requestId }}';

Lifecycle Methods

List BackupPlanAssociations for a given resource type.

EXEC google.backupdr.backup_plan_associations.fetch_for_resource_type 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@resourceType='{{ resourceType }}',
@pageSize='{{ pageSize }}',
@pageToken='{{ pageToken }}',
@filter='{{ filter }}',
@orderBy='{{ orderBy }}';