Skip to main content

data_sources

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

Overview​

Namedata_sources
TypeResource
Idgoogle.backupdr.data_sources

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringOutput only. Identifier. Name of the datasource to create. It must have the format"projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}". {datasource} cannot be changed after creation. It must be between 3-63 characters long and must be unique within the backup vault.
backupBlockedByVaultAccessRestrictionbooleanOutput only. This field is set to true if the backup is blocked by vault access restriction.
backupConfigInfoobjectOutput only. Details of how the resource is configured for backup. (id: BackupConfigInfo)
backupCountstring (int64)Number of backups in the data source.
configStatestringOutput only. The backup configuration state. (BACKUP_CONFIG_STATE_UNSPECIFIED, ACTIVE, PASSIVE)
createTimestring (google-datetime)Output only. The time when the instance was created.
dataSourceBackupApplianceApplicationobjectThe backed up resource is a backup appliance application. (id: DataSourceBackupApplianceApplication)
dataSourceGcpResourceobjectThe backed up resource is a Google Cloud resource. The word 'DataSource' was included in the names to indicate that this is the representation of the Google Cloud resource used within the DataSource object. (id: DataSourceGcpResource)
etagstringServer specified ETag for the ManagementServer resource to prevent simultaneous updates from overwiting each other.
labelsobjectOptional. Resource labels to represent user provided metadata. No labels currently defined:
statestringOutput only. The DataSource resource instance state. (STATE_UNSPECIFIED, CREATING, ACTIVE, DELETING, ERROR)
totalStoredBytesstring (int64)The number of bytes (metadata and data) stored in this datasource.
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, backupVaultsId, dataSourcesIdGets details of a DataSource.
listselectprojectsId, locationsId, backupVaultsIdfilter, orderBy, pageSize, pageTokenLists DataSources in a given project and location.
patchupdateprojectsId, locationsId, backupVaultsId, dataSourcesIdallowMissing, requestId, updateMaskUpdates the settings of a DataSource.
removedeleteprojectsId, locationsId, backupVaultsId, dataSourcesIdDeletes a DataSource. This is a custom method instead of a standard delete method because external clients will not delete DataSources except for BackupDR backup appliances.
abandon_backupexecprojectsId, locationsId, backupVaultsId, dataSourcesIdInternal only. Abandons a backup.
fetch_access_tokenexecprojectsId, locationsId, backupVaultsId, dataSourcesIdInternal only. Fetch access token for a given data source.
finalize_backupexecprojectsId, locationsId, backupVaultsId, dataSourcesIdInternal only. Finalize a backup that was started by a call to InitiateBackup.
initiate_backupexecprojectsId, locationsId, backupVaultsId, dataSourcesIdInternal only. Initiates a backup.
set_internal_statusexecprojectsId, locationsId, backupVaultsId, dataSourcesIdSets the internal status of a DataSource.

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
backupVaultsIdstring
dataSourcesIdstring
locationsIdstring
projectsIdstring
allowMissingboolean
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
updateMaskstring (google-fieldmask)

SELECT examples​

Gets details of a DataSource.

SELECT
name,
backupBlockedByVaultAccessRestriction,
backupConfigInfo,
backupCount,
configState,
createTime,
dataSourceBackupApplianceApplication,
dataSourceGcpResource,
etag,
labels,
state,
totalStoredBytes,
updateTime
FROM google.backupdr.data_sources
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND backupVaultsId = '{{ backupVaultsId }}' -- required
AND dataSourcesId = '{{ dataSourcesId }}' -- required
;

UPDATE examples​

Updates the settings of a DataSource.

UPDATE google.backupdr.data_sources
SET
data__backupCount = '{{ backupCount }}',
data__dataSourceBackupApplianceApplication = '{{ dataSourceBackupApplianceApplication }}',
data__dataSourceGcpResource = '{{ dataSourceGcpResource }}',
data__etag = '{{ etag }}',
data__labels = '{{ labels }}',
data__totalStoredBytes = '{{ totalStoredBytes }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupVaultsId = '{{ backupVaultsId }}' --required
AND dataSourcesId = '{{ dataSourcesId }}' --required
AND allowMissing = {{ allowMissing}}
AND requestId = '{{ requestId}}'
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples​

Deletes a DataSource. This is a custom method instead of a standard delete method because external clients will not delete DataSources except for BackupDR backup appliances.

DELETE FROM google.backupdr.data_sources
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupVaultsId = '{{ backupVaultsId }}' --required
AND dataSourcesId = '{{ dataSourcesId }}' --required
;

Lifecycle Methods​

Internal only. Abandons a backup.

EXEC google.backupdr.data_sources.abandon_backup
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@backupVaultsId='{{ backupVaultsId }}' --required,
@dataSourcesId='{{ dataSourcesId }}' --required
@@json=
'{
"requestId": "{{ requestId }}"
}'
;