Skip to main content

data_scans

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

Overview

Namedata_scans
TypeResource
Idgoogle.dataplex.data_scans

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Identifier. The relative resource name of the scan, of the form: projects/{project}/locations/{location_id}/dataScans/{datascan_id}, where project refers to a project_id or project_number and location_id refers to a Google Cloud region.
createTimestring (google-datetime)Output only. The time when the scan was created.
dataobjectRequired. The data source for DataScan. (id: GoogleCloudDataplexV1DataSource)
dataDiscoveryResultobjectOutput only. The result of a data discovery scan. (id: GoogleCloudDataplexV1DataDiscoveryResult)
dataDiscoverySpecobjectSettings for a data discovery scan. (id: GoogleCloudDataplexV1DataDiscoverySpec)
dataProfileResultobjectOutput only. The result of a data profile scan. (id: GoogleCloudDataplexV1DataProfileResult)
dataProfileSpecobjectSettings for a data profile scan. (id: GoogleCloudDataplexV1DataProfileSpec)
dataQualityResultobjectOutput only. The result of a data quality scan. (id: GoogleCloudDataplexV1DataQualityResult)
dataQualitySpecobjectSettings for a data quality scan. (id: GoogleCloudDataplexV1DataQualitySpec)
descriptionstringOptional. Description of the scan. Must be between 1-1024 characters.
displayNamestringOptional. User friendly display name. Must be between 1-256 characters.
executionSpecobjectOptional. DataScan execution settings.If not specified, the fields in it will use their default values. (id: GoogleCloudDataplexV1DataScanExecutionSpec)
executionStatusobjectOutput only. Status of the data scan execution. (id: GoogleCloudDataplexV1DataScanExecutionStatus)
labelsobjectOptional. User-defined labels for the scan.
statestringOutput only. Current state of the DataScan.
typestringOutput only. The type of DataScan.
uidstringOutput only. System generated globally unique ID for the scan. This ID will be different if the scan is deleted and re-created with the same name.
updateTimestring (google-datetime)Output only. The time when the scan was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_data_scans_getselectprojectsId, locationsId, dataScansIdviewGets a DataScan resource.
projects_locations_data_scans_listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists DataScans.
projects_locations_data_scans_createinsertprojectsId, locationsIddataScanId, validateOnlyCreates a DataScan resource.
projects_locations_data_scans_patchupdateprojectsId, locationsId, dataScansIdupdateMask, validateOnlyUpdates a DataScan resource.
projects_locations_data_scans_deletedeleteprojectsId, locationsId, dataScansIdforceDeletes a DataScan resource.
projects_locations_data_scans_runexecprojectsId, locationsId, dataScansIdRuns an on-demand execution of a DataScan
projects_locations_data_scans_generate_data_quality_rulesexecprojectsId, locationsId, dataScansIdGenerates recommended data quality rules based on the results of a data profiling scan.Use the recommendations to build rules for a data quality scan.

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
dataScansIdstring
locationsIdstring
projectsIdstring
dataScanIdstring
filterstring
forceboolean
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)
validateOnlyboolean
viewstring

SELECT examples

Gets a DataScan resource.

SELECT
name,
createTime,
data,
dataDiscoveryResult,
dataDiscoverySpec,
dataProfileResult,
dataProfileSpec,
dataQualityResult,
dataQualitySpec,
description,
displayName,
executionSpec,
executionStatus,
labels,
state,
type,
uid,
updateTime
FROM google.dataplex.data_scans
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND dataScansId = '{{ dataScansId }}' -- required
AND view = '{{ view }}';

INSERT examples

Creates a DataScan resource.

INSERT INTO google.dataplex.data_scans (
data__description,
data__displayName,
data__labels,
data__data,
data__executionSpec,
data__dataQualitySpec,
data__dataProfileSpec,
data__dataDiscoverySpec,
projectsId,
locationsId,
dataScanId,
validateOnly
)
SELECT
'{{ description }}',
'{{ displayName }}',
'{{ labels }}',
'{{ data }}',
'{{ executionSpec }}',
'{{ dataQualitySpec }}',
'{{ dataProfileSpec }}',
'{{ dataDiscoverySpec }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ dataScanId }}',
'{{ validateOnly }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates a DataScan resource.

UPDATE google.dataplex.data_scans
SET
data__description = '{{ description }}',
data__displayName = '{{ displayName }}',
data__labels = '{{ labels }}',
data__data = '{{ data }}',
data__executionSpec = '{{ executionSpec }}',
data__dataQualitySpec = '{{ dataQualitySpec }}',
data__dataProfileSpec = '{{ dataProfileSpec }}',
data__dataDiscoverySpec = '{{ dataDiscoverySpec }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND dataScansId = '{{ dataScansId }}' --required
AND updateMask = '{{ updateMask}}'
AND validateOnly = {{ validateOnly}}
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a DataScan resource.

DELETE FROM google.dataplex.data_scans
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND dataScansId = '{{ dataScansId }}' --required
AND force = '{{ force }}';

Lifecycle Methods

Runs an on-demand execution of a DataScan

EXEC google.dataplex.data_scans.projects_locations_data_scans_run 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@dataScansId='{{ dataScansId }}' --required;