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:

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)
dataDocumentationResultobjectOutput only. The result of a data documentation scan. (id: GoogleCloudDataplexV1DataDocumentationResult)
dataDocumentationSpecobjectSettings for a data documentation scan. (id: GoogleCloudDataplexV1DataDocumentationSpec)
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.
executionIdentityobjectOptional. Immutable. The identity to run the datascan. If not specified, defaults to the Dataplex Service Agent. (id: GoogleCloudDataplexV1ExecutionIdentity)
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. (STATE_UNSPECIFIED, ACTIVE, CREATING, DELETING, ACTION_REQUIRED)
typestringOutput only. The type of DataScan. (DATA_SCAN_TYPE_UNSPECIFIED, DATA_QUALITY, DATA_PROFILE, DATA_DISCOVERY, DATA_DOCUMENTATION, UNSTRUCTURED_DATA_PROFILE)
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.
unstructuredDataProfileResultobjectOutput only. The result of an unstructured data profile scan. (id: GoogleCloudDataplexV1UnstructuredDataProfileResult)
unstructuredDataProfileSpecobjectOptional. Settings for an unstructured data profile scan. (id: GoogleCloudDataplexV1UnstructuredDataProfileSpec)
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, locationsIdfilter, pageSize, orderBy, pageTokenLists 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_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.
projects_locations_data_scans_runexecprojectsId, locationsId, dataScansIdRuns an on-demand execution of a DataScan

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,
dataDocumentationResult,
dataDocumentationSpec,
dataProfileResult,
dataProfileSpec,
dataQualityResult,
dataQualitySpec,
description,
displayName,
executionIdentity,
executionSpec,
executionStatus,
labels,
state,
type,
uid,
unstructuredDataProfileResult,
unstructuredDataProfileSpec,
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__unstructuredDataProfileSpec,
data__description,
data__dataDocumentationSpec,
data__dataDiscoverySpec,
data__executionIdentity,
data__dataProfileSpec,
data__labels,
data__dataQualitySpec,
data__executionSpec,
data__data,
data__displayName,
projectsId,
locationsId,
dataScanId,
validateOnly
)
SELECT
'{{ unstructuredDataProfileSpec }}',
'{{ description }}',
'{{ dataDocumentationSpec }}',
'{{ dataDiscoverySpec }}',
'{{ executionIdentity }}',
'{{ dataProfileSpec }}',
'{{ labels }}',
'{{ dataQualitySpec }}',
'{{ executionSpec }}',
'{{ data }}',
'{{ displayName }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ dataScanId }}',
'{{ validateOnly }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates a DataScan resource.

UPDATE google.dataplex.data_scans
SET
data__unstructuredDataProfileSpec = '{{ unstructuredDataProfileSpec }}',
data__description = '{{ description }}',
data__dataDocumentationSpec = '{{ dataDocumentationSpec }}',
data__dataDiscoverySpec = '{{ dataDiscoverySpec }}',
data__executionIdentity = '{{ executionIdentity }}',
data__dataProfileSpec = '{{ dataProfileSpec }}',
data__labels = '{{ labels }}',
data__dataQualitySpec = '{{ dataQualitySpec }}',
data__executionSpec = '{{ executionSpec }}',
data__data = '{{ data }}',
data__displayName = '{{ displayName }}'
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

Generates recommended data quality rules based on the results of a data profiling scan.Use the recommendations to build rules for a data quality scan.

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