job_runs
Creates, updates, deletes, gets or lists a job_runs
resource.
Overview
Name | job_runs |
Type | Resource |
Id | databricks_workspace.workflows.job_runs |
Fields
The following fields are returned by SELECT
queries:
- listruns
- getrun
Request completed successfully.
Name | Datatype | Description |
---|---|---|
job_id | integer | |
job_run_id | integer | |
original_attempt_run_id | integer | |
run_id | integer | |
creator_user_name | string | |
run_name | string | |
attempt_number | integer | |
cleanup_duration | integer | |
cluster_instance | object | |
cluster_spec | object | |
description | string | |
end_time | integer | |
execution_duration | integer | |
git_source | object | |
has_more | boolean | |
job_clusters | array | |
job_parameters | array | |
number_in_job | integer | |
overriding_parameters | object | |
queue_duration | integer | |
repair_history | array | |
run_duration | integer | |
run_page_url | string | |
run_type | string | |
schedule | object | |
setup_duration | integer | |
start_time | integer | |
state | object | |
status | object | |
tasks | array | |
trigger | string | |
trigger_info | object |
Request completed successfully.
Name | Datatype | Description |
---|---|---|
job_id | integer | |
job_run_id | integer | |
original_attempt_run_id | integer | |
run_id | integer | |
creator_user_name | string | |
run_name | string | |
attempt_number | integer | |
cleanup_duration | integer | |
cluster_instance | object | |
cluster_spec | object | |
description | string | |
end_time | integer | |
execution_duration | integer | |
git_source | object | |
has_more | boolean | |
job_clusters | array | |
job_parameters | array | |
next_page_token | string | |
number_in_job | integer | |
overriding_parameters | object | |
queue_duration | integer | |
repair_history | array | |
run_duration | integer | |
run_page_url | string | |
run_type | string | |
schedule | object | |
setup_duration | integer | |
start_time | integer | |
state | object | |
status | object | |
tasks | array | |
trigger | string | |
trigger_info | object |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
listruns | select | deployment_name | List runs in descending order by start time. | |
getrun | select | deployment_name | Retrieves the metadata of a run. | |
deleterun | delete | deployment_name | Deletes a non-active run. Returns an error if the run is active. | |
cancelallruns | exec | deployment_name | Cancels all active runs of a job. The runs are canceled asynchronously, so it doesn't prevent new runs from being started. | |
cancelrun | exec | deployment_name | Cancels a job run or a task run. The run is canceled asynchronously, so it may still be running when this request completes. | |
exportrun | exec | deployment_name | Export and retrieve the job run task. | |
repairrun | exec | deployment_name | Re-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. |
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.
Name | Datatype | Description |
---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
SELECT
examples
- listruns
- getrun
List runs in descending order by start time.
SELECT
job_id,
job_run_id,
original_attempt_run_id,
run_id,
creator_user_name,
run_name,
attempt_number,
cleanup_duration,
cluster_instance,
cluster_spec,
description,
end_time,
execution_duration,
git_source,
has_more,
job_clusters,
job_parameters,
number_in_job,
overriding_parameters,
queue_duration,
repair_history,
run_duration,
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 }}' -- required;
Retrieves the metadata of a run.
SELECT
job_id,
job_run_id,
original_attempt_run_id,
run_id,
creator_user_name,
run_name,
attempt_number,
cleanup_duration,
cluster_instance,
cluster_spec,
description,
end_time,
execution_duration,
git_source,
has_more,
job_clusters,
job_parameters,
next_page_token,
number_in_job,
overriding_parameters,
queue_duration,
repair_history,
run_duration,
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 }}' -- required;
DELETE
examples
- deleterun
Deletes a non-active run. Returns an error if the run is active.
DELETE FROM databricks_workspace.workflows.job_runs
WHERE deployment_name = '{{ deployment_name }}' --required;
Lifecycle Methods
- cancelallruns
- cancelrun
- exportrun
- repairrun
Cancels all active runs of a job. The runs are canceled asynchronously, so it doesn't prevent new runs from being started.
EXEC databricks_workspace.workflows.job_runs.cancelallruns
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"job_id": {{ job_id }},
"all_queued_runs": {{ all_queued_runs }}
}';
Cancels a job run or a task run. The run is canceled asynchronously, so it may still be running when this request completes.
EXEC databricks_workspace.workflows.job_runs.cancelrun
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"run_id": "{{ run_id }}"
}';
Export and retrieve the job run task.
EXEC databricks_workspace.workflows.job_runs.exportrun
@deployment_name='{{ deployment_name }}' --required;
Re-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.
EXEC databricks_workspace.workflows.job_runs.repairrun
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"run_id": "{{ run_id }}",
"latest_repair_id": {{ latest_repair_id }},
"rerun_tasks": {{ rerun_tasks }},
"rerun_all_failed_tasks": "{{ rerun_all_failed_tasks }}",
"rerun_dependent_tasks": {{ rerun_dependent_tasks }},
"job_parameters": "{{ job_parameters }}",
"pipeline_params": "{{ pipeline_params }}"
}';