Skip to main content

tasks

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

Overview

Nametasks
TypeResource
Idgoogle.dataplex.tasks

Fields

The following fields are returned by SELECT queries:

Successful response

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}.
createTimestring (google-datetime)Output only. The time when the task was created.
descriptionstringOptional. Description of the task.
displayNamestringOptional. User friendly display name.
executionSpecobjectRequired. Spec related to how a task is executed. (id: GoogleCloudDataplexV1TaskExecutionSpec)
executionStatusobjectOutput only. Status of the latest task executions. (id: GoogleCloudDataplexV1TaskExecutionStatus)
labelsobjectOptional. User-defined labels for the task.
notebookobjectConfig related to running scheduled Notebooks. (id: GoogleCloudDataplexV1TaskNotebookTaskConfig)
sparkobjectConfig related to running custom Spark tasks. (id: GoogleCloudDataplexV1TaskSparkTaskConfig)
statestringOutput only. Current state of the task.
triggerSpecobjectRequired. Spec related to how often and when a task should be triggered. (id: GoogleCloudDataplexV1TaskTriggerSpec)
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.
updateTimestring (google-datetime)Output only. The time when the task was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_lakes_tasks_getselectprojectsId, locationsId, lakesId, tasksIdGet task resource.
projects_locations_lakes_tasks_listselectprojectsId, locationsId, lakesIdpageSize, pageToken, filter, orderByLists tasks under the given lake.
projects_locations_lakes_tasks_createinsertprojectsId, locationsId, lakesIdtaskId, validateOnlyCreates a task resource within a lake.
projects_locations_lakes_tasks_patchupdateprojectsId, locationsId, lakesId, tasksIdupdateMask, validateOnlyUpdate the task resource.
projects_locations_lakes_tasks_deletedeleteprojectsId, locationsId, lakesId, tasksIdDelete the task resource.
projects_locations_lakes_tasks_runexecprojectsId, locationsId, lakesId, tasksIdRun an on demand execution of a Task.

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
lakesIdstring
locationsIdstring
projectsIdstring
tasksIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
taskIdstring
updateMaskstring (google-fieldmask)
validateOnlyboolean

SELECT examples

Get task resource.

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

INSERT examples

Creates a task resource within a lake.

INSERT INTO google.dataplex.tasks (
data__description,
data__displayName,
data__labels,
data__triggerSpec,
data__executionSpec,
data__spark,
data__notebook,
projectsId,
locationsId,
lakesId,
taskId,
validateOnly
)
SELECT
'{{ description }}',
'{{ displayName }}',
'{{ labels }}',
'{{ triggerSpec }}',
'{{ executionSpec }}',
'{{ spark }}',
'{{ notebook }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ lakesId }}',
'{{ taskId }}',
'{{ validateOnly }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Update the task resource.

UPDATE google.dataplex.tasks
SET
data__description = '{{ description }}',
data__displayName = '{{ displayName }}',
data__labels = '{{ labels }}',
data__triggerSpec = '{{ triggerSpec }}',
data__executionSpec = '{{ executionSpec }}',
data__spark = '{{ spark }}',
data__notebook = '{{ notebook }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND lakesId = '{{ lakesId }}' --required
AND tasksId = '{{ tasksId }}' --required
AND updateMask = '{{ updateMask}}'
AND validateOnly = {{ validateOnly}}
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Delete the task resource.

DELETE FROM google.dataplex.tasks
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND lakesId = '{{ lakesId }}' --required
AND tasksId = '{{ tasksId }}' --required;

Lifecycle Methods

Run an on demand execution of a Task.

EXEC google.dataplex.tasks.projects_locations_lakes_tasks_run 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@lakesId='{{ lakesId }}' --required,
@tasksId='{{ tasksId }}' --required
@@json=
'{
"labels": "{{ labels }}",
"args": "{{ args }}"
}';