data_sources
Creates, updates, deletes, gets or lists a data_sources
resource.
Overview
Name | data_sources |
Type | Resource |
Id | google.backupdr.data_sources |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output 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. |
backupBlockedByVaultAccessRestriction | boolean | Output only. This field is set to true if the backup is blocked by vault access restriction. |
backupConfigInfo | object | Output only. Details of how the resource is configured for backup. (id: BackupConfigInfo) |
backupCount | string (int64) | Number of backups in the data source. |
configState | string | Output only. The backup configuration state. |
createTime | string (google-datetime) | Output only. The time when the instance was created. |
dataSourceBackupApplianceApplication | object | The backed up resource is a backup appliance application. (id: DataSourceBackupApplianceApplication) |
dataSourceGcpResource | object | The 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) |
etag | string | Server specified ETag for the ManagementServer resource to prevent simultaneous updates from overwiting each other. |
labels | object | Optional. Resource labels to represent user provided metadata. No labels currently defined: |
state | string | Output only. The DataSource resource instance state. |
totalStoredBytes | string (int64) | The number of bytes (metadata and data) stored in this datasource. |
updateTime | string (google-datetime) | Output only. The time when the instance was updated. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output 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. |
backupBlockedByVaultAccessRestriction | boolean | Output only. This field is set to true if the backup is blocked by vault access restriction. |
backupConfigInfo | object | Output only. Details of how the resource is configured for backup. (id: BackupConfigInfo) |
backupCount | string (int64) | Number of backups in the data source. |
configState | string | Output only. The backup configuration state. |
createTime | string (google-datetime) | Output only. The time when the instance was created. |
dataSourceBackupApplianceApplication | object | The backed up resource is a backup appliance application. (id: DataSourceBackupApplianceApplication) |
dataSourceGcpResource | object | The 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) |
etag | string | Server specified ETag for the ManagementServer resource to prevent simultaneous updates from overwiting each other. |
labels | object | Optional. Resource labels to represent user provided metadata. No labels currently defined: |
state | string | Output only. The DataSource resource instance state. |
totalStoredBytes | string (int64) | The number of bytes (metadata and data) stored in this datasource. |
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 , backupVaultsId , dataSourcesId | Gets details of a DataSource. | |
list | select | projectsId , locationsId , backupVaultsId | pageSize , pageToken , filter , orderBy | Lists DataSources in a given project and location. |
patch | update | projectsId , locationsId , backupVaultsId , dataSourcesId | updateMask , requestId , allowMissing | Updates the settings of a DataSource. |
remove | delete | projectsId , locationsId , backupVaultsId , dataSourcesId | 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. | |
set_internal_status | exec | projectsId , locationsId , backupVaultsId , dataSourcesId | Sets the internal status of a DataSource. | |
initiate_backup | exec | projectsId , locationsId , backupVaultsId , dataSourcesId | Internal only. Initiates a backup. | |
abandon_backup | exec | projectsId , locationsId , backupVaultsId , dataSourcesId | Internal only. Abandons a backup. | |
finalize_backup | exec | projectsId , locationsId , backupVaultsId , dataSourcesId | Internal only. Finalize a backup that was started by a call to InitiateBackup. | |
fetch_access_token | exec | projectsId , locationsId , backupVaultsId , dataSourcesId | Internal 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.
Name | Datatype | Description |
---|---|---|
backupVaultsId | string | |
dataSourcesId | string | |
locationsId | string | |
projectsId | string | |
allowMissing | boolean | |
filter | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
requestId | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
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;
Lists DataSources in a given project and location.
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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}';
UPDATE
examples
- patch
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
- remove
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
- set_internal_status
- initiate_backup
- abandon_backup
- finalize_backup
- fetch_access_token
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 }}"
}';
Internal only. Initiates a backup.
EXEC google.backupdr.data_sources.initiate_backup
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@backupVaultsId='{{ backupVaultsId }}' --required,
@dataSourcesId='{{ dataSourcesId }}' --required
@@json=
'{
"requestId": "{{ requestId }}",
"backupId": "{{ backupId }}"
}';
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 }}"
}';
Internal only. Finalize a backup that was started by a call to InitiateBackup.
EXEC google.backupdr.data_sources.finalize_backup
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@backupVaultsId='{{ backupVaultsId }}' --required,
@dataSourcesId='{{ dataSourcesId }}' --required
@@json=
'{
"description": "{{ description }}",
"consistencyTime": "{{ consistencyTime }}",
"requestId": "{{ requestId }}",
"backupId": "{{ backupId }}",
"recoveryRangeStartTime": "{{ recoveryRangeStartTime }}",
"recoveryRangeEndTime": "{{ recoveryRangeEndTime }}",
"retentionDuration": "{{ retentionDuration }}"
}';
Internal only. Fetch access token for a given data source.
EXEC google.backupdr.data_sources.fetch_access_token
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@backupVaultsId='{{ backupVaultsId }}' --required,
@dataSourcesId='{{ dataSourcesId }}' --required
@@json=
'{
"generationId": {{ generationId }}
}';