Skip to main content

tasks

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

Overview

Nametasks
TypeResource
Idgoogle.dataplex.tasks

Fields

NameDatatypeDescription
namestringOutput only. The relative resource name of the task, of the form: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/ tasks/{task_id}.
descriptionstringOptional. Description of the task.
createTimestringOutput only. The time when the task was created.
displayNamestringOptional. User friendly display name.
executionSpecobjectExecution related settings, like retry and service_account.
executionStatusobjectStatus of the task execution (e.g. Jobs).
labelsobjectOptional. User-defined labels for the task.
notebookobjectConfig for running scheduled notebooks.
sparkobjectUser-specified config for running a Spark task.
statestringOutput only. Current state of the task.
triggerSpecobjectTask scheduling and trigger settings.
uidstringOutput only. System generated globally unique ID for the task. This ID will be different if the task is deleted and re-created with the same name.
updateTimestringOutput only. The time when the task was last updated.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_lakes_tasks_getSELECTlakesId, locationsId, projectsId, tasksIdGet task resource.
projects_locations_lakes_tasks_listSELECTlakesId, locationsId, projectsIdLists tasks under the given lake.
projects_locations_lakes_tasks_createINSERTlakesId, locationsId, projectsIdCreates a task resource within a lake.
projects_locations_lakes_tasks_deleteDELETElakesId, locationsId, projectsId, tasksIdDelete the task resource.
projects_locations_lakes_tasks_patchUPDATElakesId, locationsId, projectsId, tasksIdUpdate the task resource.
projects_locations_lakes_tasks_runEXEClakesId, locationsId, projectsId, tasksIdRun an on demand execution of a Task.

SELECT examples

Lists tasks under the given lake.

SELECT
name,
description,
createTime,
displayName,
executionSpec,
executionStatus,
labels,
notebook,
spark,
state,
triggerSpec,
uid,
updateTime
FROM google.dataplex.tasks
WHERE lakesId = '{{ lakesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new tasks resource.

/*+ create */
INSERT INTO google.dataplex.tasks (
lakesId,
locationsId,
projectsId,
description,
displayName,
labels,
triggerSpec,
executionSpec,
spark,
notebook
)
SELECT
'{{ lakesId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ description }}',
'{{ displayName }}',
'{{ labels }}',
'{{ triggerSpec }}',
'{{ executionSpec }}',
'{{ spark }}',
'{{ notebook }}'
;

UPDATE example

Updates a tasks resource.

/*+ update */
UPDATE google.dataplex.tasks
SET
description = '{{ description }}',
displayName = '{{ displayName }}',
labels = '{{ labels }}',
triggerSpec = '{{ triggerSpec }}',
executionSpec = '{{ executionSpec }}',
spark = '{{ spark }}',
notebook = '{{ notebook }}'
WHERE
lakesId = '{{ lakesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND tasksId = '{{ tasksId }}';

DELETE example

Deletes the specified tasks resource.

/*+ delete */
DELETE FROM google.dataplex.tasks
WHERE lakesId = '{{ lakesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND tasksId = '{{ tasksId }}';