in datascan/bulk-creation-scripts/dataquality /datascan.py [0:0]
def getDatascan(gcp_project_id, location_id, datascan_id):
"""
Method to get the datascan
"""
try:
# Create a client
client = dataplex_v1.DataScanServiceClient()
# Initialize request argument(s)
request = dataplex_v1.GetDataScanRequest(
name=f"projects/{gcp_project_id}/locations/{location_id}/dataScans/{datascan_id}",
)
# Make the request
response = client.get_data_scan(request=request)
return response
except Exception as error:
print(f'Failed to get DataProfile Id - {gcp_project_id}.{location_id}.{datascan_id}')
print(f'Error: {error}')
return None