backup_plan_associations
Creates, updates, deletes, gets or lists a backup_plan_associations
resource.
Overview
Name | backup_plan_associations |
Type | Resource |
Id | google.backupdr.backup_plan_associations |
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 BackupPlanAssociation in below format Format : projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId} |
backupPlan | string | Required. Resource name of backup plan which needs to be applied on workload. Format: projects/{project}/locations/{location}/backupPlans/{backupPlanId} |
backupPlanRevisionId | string | Output only. The user friendly revision ID of the BackupPlanRevision . Example: v0, v1, v2, etc. |
backupPlanRevisionName | string | Output only. The resource id of the BackupPlanRevision . Format: projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id} |
cloudSqlInstanceBackupPlanAssociationProperties | object | Output only. Cloud SQL instance's backup plan association properties. (id: CloudSqlInstanceBackupPlanAssociationProperties) |
createTime | string (google-datetime) | Output only. The time when the instance was created. |
dataSource | string | Output 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} |
resource | string | Required. 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"). |
resourceType | string | Required. Immutable. Resource type of workload on which backupplan is applied |
rulesConfigInfo | array | Output only. The config info related to backup rules. |
state | string | Output only. The BackupPlanAssociation resource state. |
updateTime | string (google-datetime) | Output only. The time when the instance was updated. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Identifier. The resource name of BackupPlanAssociation in below format Format : projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId} |
backupPlan | string | Required. Resource name of backup plan which needs to be applied on workload. Format: projects/{project}/locations/{location}/backupPlans/{backupPlanId} |
backupPlanRevisionId | string | Output only. The user friendly revision ID of the BackupPlanRevision . Example: v0, v1, v2, etc. |
backupPlanRevisionName | string | Output only. The resource id of the BackupPlanRevision . Format: projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id} |
cloudSqlInstanceBackupPlanAssociationProperties | object | Output only. Cloud SQL instance's backup plan association properties. (id: CloudSqlInstanceBackupPlanAssociationProperties) |
createTime | string (google-datetime) | Output only. The time when the instance was created. |
dataSource | string | Output 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} |
resource | string | Required. 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"). |
resourceType | string | Required. Immutable. Resource type of workload on which backupplan is applied |
rulesConfigInfo | array | Output only. The config info related to backup rules. |
state | string | Output only. The BackupPlanAssociation resource state. |
updateTime | string (google-datetime) | Output only. The time when the instance was updated. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , backupPlanAssociationsId | Gets details of a single BackupPlanAssociation. | |
list | select | projectsId , locationsId | pageSize , pageToken , filter | Lists BackupPlanAssociations in a given project and location. |
create | insert | projectsId , locationsId | backupPlanAssociationId , requestId | Create a BackupPlanAssociation |
patch | update | projectsId , locationsId , backupPlanAssociationsId | updateMask , requestId | Update a BackupPlanAssociation. |
delete | delete | projectsId , locationsId , backupPlanAssociationsId | requestId | Deletes a single BackupPlanAssociation. |
fetch_for_resource_type | exec | projectsId , locationsId | resourceType , pageSize , pageToken , filter , orderBy | List BackupPlanAssociations for a given resource type. |
trigger_backup | exec | projectsId , locationsId , backupPlanAssociationsId | Triggers 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.
Name | Datatype | Description |
---|---|---|
backupPlanAssociationsId | string | |
locationsId | string | |
projectsId | string | |
backupPlanAssociationId | string | |
filter | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
requestId | string | |
resourceType | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
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;
Lists BackupPlanAssociations in a given project and location.
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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}';
INSERT
examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: backup_plan_associations
props:
- name: projectsId
value: string
description: Required parameter for the backup_plan_associations resource.
- name: locationsId
value: string
description: Required parameter for the backup_plan_associations resource.
- name: resourceType
value: string
description: >
Required. Immutable. Resource type of workload on which backupplan is applied
- name: resource
value: string
description: >
Required. 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").
- name: backupPlan
value: string
description: >
Required. Resource name of backup plan which needs to be applied on workload. Format: projects/{project}/locations/{location}/backupPlans/{backupPlanId}
- name: backupPlanAssociationId
value: string
- name: requestId
value: string
UPDATE
examples
- patch
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
- delete
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
- fetch_for_resource_type
- trigger_backup
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 }}';
Triggers a new Backup.
EXEC google.backupdr.backup_plan_associations.trigger_backup
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@backupPlanAssociationsId='{{ backupPlanAssociationsId }}' --required
@@json=
'{
"ruleId": "{{ ruleId }}",
"requestId": "{{ requestId }}"
}';