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:

Successful response

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.
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.
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, backupVaultsIdpageSize, pageToken, filter, orderByLists DataSources in a given project and location.
patchupdateprojectsId, locationsId, backupVaultsId, dataSourcesIdupdateMask, requestId, allowMissingUpdates 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.
set_internal_statusexecprojectsId, locationsId, backupVaultsId, dataSourcesIdSets the internal status of a DataSource.
initiate_backupexecprojectsId, locationsId, backupVaultsId, dataSourcesIdInternal only. Initiates a backup.
abandon_backupexecprojectsId, locationsId, backupVaultsId, dataSourcesIdInternal only. Abandons a backup.
finalize_backupexecprojectsId, locationsId, backupVaultsId, dataSourcesIdInternal only. Finalize a backup that was started by a call to InitiateBackup.
fetch_access_tokenexecprojectsId, locationsId, backupVaultsId, dataSourcesIdInternal only. Fetch access token for a given data source.

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__labels = '{{ labels }}',
data__backupCount = '{{ backupCount }}',
data__etag = '{{ etag }}',
data__totalStoredBytes = '{{ totalStoredBytes }}',
data__dataSourceGcpResource = '{{ dataSourceGcpResource }}',
data__dataSourceBackupApplianceApplication = '{{ dataSourceBackupApplianceApplication }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backupVaultsId = '{{ backupVaultsId }}' --required
AND dataSourcesId = '{{ dataSourcesId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
AND allowMissing = {{ allowMissing}}
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

Sets the internal status of a DataSource.

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