Skip to main content

job_runs

Operations on a job_runs resource.

Overview

Namejob_runs
TypeResource
Iddatabricks_workspace.workflows.job_runs

Fields

NameDatatype
descriptionstring
attempt_numberinteger
cleanup_durationinteger
cluster_instanceobject
cluster_specobject
creator_user_namestring
end_timeinteger
execution_durationinteger
git_sourceobject
has_moreboolean
job_clustersarray
job_idinteger
job_parametersarray
job_run_idinteger
number_in_jobinteger
original_attempt_run_idinteger
overriding_parametersobject
queue_durationinteger
repair_historyarray
run_durationinteger
run_idinteger
run_namestring
run_page_urlstring
run_typestring
scheduleobject
setup_durationinteger
start_timeinteger
stateobject
statusobject
tasksarray
triggerstring
trigger_infoobject

Methods

NameAccessible byRequired ParamsDescription
getrunSELECTrun_id, deployment_nameRetrieves the metadata of a run.
listrunsSELECTdeployment_nameList runs in descending order by start time.
deleterunDELETEdeployment_nameDeletes a non-active run. Returns an error if the run is active.
cancelallrunsEXECdeployment_nameCancels all active runs of a job. The runs are canceled asynchronously, so it doesn't prevent new runs from being started.
cancelrunEXECdeployment_nameCancels a job run or a task run. The run is canceled asynchronously, so it may still be running when this request completes.
exportrunEXECrun_id, deployment_nameExport and retrieve the job run task.
repairrunEXECdeployment_nameRe-run one or more tasks. Tasks are re-run as part of the original job run. They use the current job and task settings, and can be viewed in the history for the original job run.

SELECT examples

SELECT
description,
attempt_number,
cleanup_duration,
cluster_instance,
cluster_spec,
creator_user_name,
end_time,
execution_duration,
git_source,
has_more,
job_clusters,
job_id,
job_parameters,
job_run_id,
number_in_job,
original_attempt_run_id,
overriding_parameters,
queue_duration,
repair_history,
run_duration,
run_id,
run_name,
run_page_url,
run_type,
schedule,
setup_duration,
start_time,
state,
status,
tasks,
trigger,
trigger_info
FROM databricks_workspace.workflows.job_runs
WHERE deployment_name = '{{ deployment_name }}';

DELETE example

Deletes a job_runs resource.

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