Skip to main content

jobs

Operations on a jobs resource.

Overview

Namejobs
TypeResource
Iddatabricks_workspace.workflows.jobs

Fields

NameDatatype
created_timeinteger
creator_user_namestring
has_moreboolean
job_idinteger
settingsobject

Methods

NameAccessible byRequired ParamsDescription
getSELECTjob_id, deployment_nameRetrieves the details for a single job.
listSELECTdeployment_nameRetrieves a list of jobs.
createINSERTdeployment_nameCreate a new job.
deleteDELETEdeployment_nameDeletes a job.
updateUPDATEdeployment_nameAdd, update, or remove specific settings of an existing job. Use the
resetREPLACEdeployment_nameOverwrite all settings for the given job. Use the
runnowEXECdeployment_nameRun a job and return the
submitEXECdeployment_nameSubmit a one-time run. This endpoint allows you to submit a workload directly without creating a job. Runs submitted using this endpoint don’t display in the UI. Use the

SELECT examples

SELECT
created_time,
creator_user_name,
has_more,
job_id,
settings
FROM databricks_workspace.workflows.jobs
WHERE deployment_name = '{{ deployment_name }}';

INSERT example

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

/*+ create */
INSERT INTO databricks_workspace.workflows.jobs (
deployment_name,
data__name,
data__description,
data__email_notifications,
data__webhook_notifications,
data__notification_settings,
data__timeout_seconds,
data__health,
data__schedule,
data__trigger,
data__continuous,
data__max_concurrent_runs,
data__tasks,
data__job_clusters,
data__git_source,
data__tags,
data__format,
data__queue,
data__parameters,
data__run_as,
data__edit_mode,
data__deployment,
data__environments,
data__access_control_list
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ description }}',
'{{ email_notifications }}',
'{{ webhook_notifications }}',
'{{ notification_settings }}',
'{{ timeout_seconds }}',
'{{ health }}',
'{{ schedule }}',
'{{ trigger }}',
'{{ continuous }}',
'{{ max_concurrent_runs }}',
'{{ tasks }}',
'{{ job_clusters }}',
'{{ git_source }}',
'{{ tags }}',
'{{ format }}',
'{{ queue }}',
'{{ parameters }}',
'{{ run_as }}',
'{{ edit_mode }}',
'{{ deployment }}',
'{{ environments }}',
'{{ access_control_list }}'
;

UPDATE example

Updates a jobs resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.workflows.jobs
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE deployment_name = '{{ deployment_name }}';

REPLACE example

Replaces a jobs resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
REPLACE databricks_workspace.workflows.jobs
SET field1 = '{ value1 }',
field2 = '{ value2 }', ...
WHERE deployment_name = '{{ deployment_name }}';

DELETE example

Deletes a jobs resource.

/*+ delete */
DELETE FROM databricks_workspace.workflows.jobs
WHERE deployment_name = '{{ deployment_name }}';