jobs
Creates, updates, deletes, gets or lists a jobs
resource.
Overview
Name | jobs |
Type | Resource |
Id | databricks_workspace.workflows.jobs |
Fields
The following fields are returned by SELECT
queries:
- list
- get
Request completed successfully.
Name | Datatype | Description |
---|---|---|
job_id | integer | |
creator_user_name | string | |
created_time | integer | |
has_more | boolean | |
settings | object |
Request completed successfully.
Name | Datatype | Description |
---|---|---|
job_id | integer | |
creator_user_name | string | |
run_as_user_name | string | |
created_time | integer | |
has_more | boolean | |
next_page_token | string | |
settings | object |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list | select | deployment_name | Retrieves a list of jobs. | |
get | select | deployment_name | Retrieves the details for a single job. | |
create | insert | deployment_name | Create a new job. | |
update | update | deployment_name | Add, update, or remove specific settings of an existing job. Use the | |
reset | replace | deployment_name | Overwrite all settings for the given job. Use the | |
delete | delete | deployment_name | Deletes a job. | |
runnow | exec | deployment_name | Run a job and return the | |
submit | exec | deployment_name | Submit 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 |
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
- list
- get
Retrieves a list of jobs.
SELECT
job_id,
creator_user_name,
created_time,
has_more,
settings
FROM databricks_workspace.workflows.jobs
WHERE deployment_name = '{{ deployment_name }}' -- required;
Retrieves the details for a single job.
SELECT
job_id,
creator_user_name,
run_as_user_name,
created_time,
has_more,
next_page_token,
settings
FROM databricks_workspace.workflows.jobs
WHERE deployment_name = '{{ deployment_name }}' -- required;
INSERT
examples
- create
- Manifest
Create a new job.
INSERT INTO databricks_workspace.workflows.jobs (
data__name,
data__description,
data__timeout_seconds,
data__max_concurrent_runs,
data__format,
data__edit_mode,
data__email_notifications,
data__webhook_notifications,
data__notification_settings,
data__health,
data__schedule,
data__trigger,
data__continuous,
data__tasks,
data__job_clusters,
data__git_source,
data__tags,
data__queue,
data__parameters,
data__run_as,
data__deployment,
data__environments,
data__access_control_list,
deployment_name
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ timeout_seconds }}',
'{{ max_concurrent_runs }}',
'{{ format }}',
'{{ edit_mode }}',
'{{ email_notifications }}',
'{{ webhook_notifications }}',
'{{ notification_settings }}',
'{{ health }}',
'{{ schedule }}',
'{{ trigger }}',
'{{ continuous }}',
'{{ tasks }}',
'{{ job_clusters }}',
'{{ git_source }}',
'{{ tags }}',
'{{ queue }}',
'{{ parameters }}',
'{{ run_as }}',
'{{ deployment }}',
'{{ environments }}',
'{{ access_control_list }}',
'{{ deployment_name }}'
RETURNING
job_id
;
# Description fields are for documentation purposes
- name: jobs
props:
- name: deployment_name
value: string
description: Required parameter for the jobs resource.
- name: name
value: string
- name: description
value: string
- name: timeout_seconds
value: int32
- name: max_concurrent_runs
value: int32
- name: format
value: string
- name: edit_mode
value: string
- name: email_notifications
value: object
- name: webhook_notifications
value: object
- name: notification_settings
value: object
- name: health
value: object
- name: schedule
value: object
- name: trigger
value: object
- name: continuous
value: object
- name: tasks
value: Array of object
- name: job_clusters
value: Array of object
- name: git_source
value: object
- name: tags
value: object
- name: queue
value: object
- name: parameters
value: Array of object
- name: run_as
value: object
- name: deployment
value: object
- name: environments
value: Array of object
- name: access_control_list
value: Array of object
UPDATE
examples
- update
Add, update, or remove specific settings of an existing job. Use the
UPDATE databricks_workspace.workflows.jobs
SET
data__job_id = '{{ job_id }}',
data__fields_to_remove = {{ fields_to_remove }},
data__new_settings = '{{ new_settings }}'
WHERE
deployment_name = '{{ deployment_name }}' --required;
REPLACE
examples
- reset
Overwrite all settings for the given job. Use the
REPLACE databricks_workspace.workflows.jobs
SET
data__job_id = '{{ job_id }}',
data__new_settings = '{{ new_settings }}'
WHERE
deployment_name = '{{ deployment_name }}' --required;
DELETE
examples
- delete
Deletes a job.
DELETE FROM databricks_workspace.workflows.jobs
WHERE deployment_name = '{{ deployment_name }}' --required;
Lifecycle Methods
- runnow
- submit
Run a job and return the
EXEC databricks_workspace.workflows.jobs.runnow
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"job_id": "{{ job_id }}",
"idempotency_token": {{ idempotency_token }},
"job_parameters": "{{ job_parameters }}",
"pipeline_params": "{{ pipeline_params }}",
"queue": "{{ queue }}"
}';
Submit 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
EXEC databricks_workspace.workflows.jobs.submit
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"run_name": "{{ run_name }}",
"timeout_seconds": "{{ timeout_seconds }}",
"idempotency_token": "{{ idempotency_token }}",
"health": "{{ health }}",
"tasks": "{{ tasks }}",
"git_source": "{{ git_source }}",
"webhook_notifications": "{{ webhook_notifications }}",
"email_notifications": "{{ email_notifications }}",
"notification_settings": "{{ notification_settings }}",
"environments": "{{ environments }}",
"access_control_list": "{{ access_control_list }}",
"queue": "{{ queue }}",
"run_as": "{{ run_as }}"
}';