Jobs

These dataclasses are used in the SDK to represent API requests and responses for services in the databricks.sdk.service.jobs module.

class databricks.sdk.service.jobs.BaseJob
created_time: int | None = None

The time at which this job was created in epoch milliseconds (milliseconds since 1/1/1970 UTC).

creator_user_name: str | None = None

The creator user name. This field won’t be included in the response if the user has already been deleted.

job_id: int | None = None

The canonical identifier for this job.

settings: JobSettings | None = None

Settings for this job and all of its runs. These settings can be updated using the resetJob method.

as_dict() dict

Serializes the BaseJob into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) BaseJob

Deserializes the BaseJob from a dictionary.

class databricks.sdk.service.jobs.BaseRun
attempt_number: int | None = None

The sequence number of this run attempt for a triggered job run. The initial attempt of a run has an attempt_number of 0. If the initial run attempt fails, and the job has a retry policy (max_retries > 0), subsequent runs are created with an original_attempt_run_id of the original attempt’s ID and an incrementing attempt_number. Runs are retried only until they succeed, and the maximum attempt_number is the same as the max_retries value for the job.

cleanup_duration: int | None = None

The time in milliseconds it took to terminate the cluster and clean up any associated artifacts. The duration of a task run is the sum of the setup_duration, execution_duration, and the cleanup_duration. The cleanup_duration field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the run_duration field.

cluster_instance: ClusterInstance | None = None

The cluster used for this run. If the run is specified to use a new cluster, this field is set once the Jobs service has requested a cluster for the run.

cluster_spec: ClusterSpec | None = None

A snapshot of the job’s cluster specification when this run was created.

creator_user_name: str | None = None

The creator user name. This field won’t be included in the response if the user has already been deleted.

description: str | None = None

Description of the run

end_time: int | None = None

The time at which this run ended in epoch milliseconds (milliseconds since 1/1/1970 UTC). This field is set to 0 if the job is still running.

execution_duration: int | None = None

The time in milliseconds it took to execute the commands in the JAR or notebook until they completed, failed, timed out, were cancelled, or encountered an unexpected error. The duration of a task run is the sum of the setup_duration, execution_duration, and the cleanup_duration. The execution_duration field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the run_duration field.

git_source: GitSource | None = None

An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks.

If git_source is set, these tasks retrieve the file from the remote repository by default. However, this behavior can be overridden by setting source to WORKSPACE on the task.

Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, git_source must be defined on the job.

job_clusters: List[JobCluster] | None = None

A list of job cluster specifications that can be shared and reused by tasks of this job. Libraries cannot be declared in a shared job cluster. You must declare dependent libraries in task settings.

job_id: int | None = None

The canonical identifier of the job that contains this run.

job_parameters: List[JobParameter] | None = None

Job-level parameters used in the run

number_in_job: int | None = None

A unique identifier for this job run. This is set to the same value as run_id.

original_attempt_run_id: int | None = None

If this run is a retry of a prior run attempt, this field contains the run_id of the original attempt; otherwise, it is the same as the run_id.

overriding_parameters: RunParameters | None = None

The parameters used for this run.

queue_duration: int | None = None

The time in milliseconds that the run has spent in the queue.

repair_history: List[RepairHistoryItem] | None = None

The repair history of the run.

run_duration: int | None = None

The time in milliseconds it took the job run and all of its repairs to finish.

run_id: int | None = None

The canonical identifier of the run. This ID is unique across all runs of all jobs.

run_name: str | None = None

An optional name for the run. The maximum length is 4096 bytes in UTF-8 encoding.

run_page_url: str | None = None

The URL to the detail page of the run.

run_type: RunType | None = None

The type of a run. * JOB_RUN: Normal job run. A run created with :method:jobs/runNow. * WORKFLOW_RUN: Workflow run. A run created with [dbutils.notebook.run]. * SUBMIT_RUN: Submit run. A run created with :method:jobs/submit.

[dbutils.notebook.run]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-workflow

schedule: CronSchedule | None = None

The cron schedule that triggered this run if it was triggered by the periodic scheduler.

setup_duration: int | None = None

The time in milliseconds it took to set up the cluster. For runs that run on new clusters this is the cluster creation time, for runs that run on existing clusters this time should be very short. The duration of a task run is the sum of the setup_duration, execution_duration, and the cleanup_duration. The setup_duration field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the run_duration field.

start_time: int | None = None

The time at which this run was started in epoch milliseconds (milliseconds since 1/1/1970 UTC). This may not be the time when the job task starts executing, for example, if the job is scheduled to run on a new cluster, this is the time the cluster creation call is issued.

state: RunState | None = None

The current state of the run.

tasks: List[RunTask] | None = None

The list of tasks performed by the run. Each task has its own run_id which you can use to call JobsGetOutput to retrieve the run resutls.

trigger: TriggerType | None = None

The type of trigger that fired this run.

  • PERIODIC: Schedules that periodically trigger runs, such as a cron scheduler. * ONE_TIME:

One time triggers that fire a single run. This occurs you triggered a single run on demand through the UI or the API. * RETRY: Indicates a run that is triggered as a retry of a previously failed run. This occurs when you request to re-run the job in case of failures. * RUN_JOB_TASK: Indicates a run that is triggered using a Run Job task. * FILE_ARRIVAL: Indicates a run that is triggered by a file arrival. * TABLE: Indicates a run that is triggered by a table update.

trigger_info: TriggerInfo | None = None

Additional details about what triggered the run

as_dict() dict

Serializes the BaseRun into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) BaseRun

Deserializes the BaseRun from a dictionary.

class databricks.sdk.service.jobs.CancelAllRuns
all_queued_runs: bool | None = None

Optional boolean parameter to cancel all queued runs. If no job_id is provided, all queued runs in the workspace are canceled.

job_id: int | None = None

The canonical identifier of the job to cancel all runs of.

as_dict() dict

Serializes the CancelAllRuns into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) CancelAllRuns

Deserializes the CancelAllRuns from a dictionary.

class databricks.sdk.service.jobs.CancelAllRunsResponse
as_dict() dict

Serializes the CancelAllRunsResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) CancelAllRunsResponse

Deserializes the CancelAllRunsResponse from a dictionary.

class databricks.sdk.service.jobs.CancelRun
run_id: int

This field is required.

as_dict() dict

Serializes the CancelRun into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) CancelRun

Deserializes the CancelRun from a dictionary.

class databricks.sdk.service.jobs.CancelRunResponse
as_dict() dict

Serializes the CancelRunResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) CancelRunResponse

Deserializes the CancelRunResponse from a dictionary.

class databricks.sdk.service.jobs.ClusterInstance
cluster_id: str | None = None

The canonical identifier for the cluster used by a run. This field is always available for runs on existing clusters. For runs on new clusters, it becomes available once the cluster is created. This value can be used to view logs by browsing to /#setting/sparkui/$cluster_id/driver-logs. The logs continue to be available after the run completes.

The response won’t include this field if the identifier is not available yet.

spark_context_id: str | None = None

The canonical identifier for the Spark context used by a run. This field is filled in once the run begins execution. This value can be used to view the Spark UI by browsing to /#setting/sparkui/$cluster_id/$spark_context_id. The Spark UI continues to be available after the run has completed.

The response won’t include this field if the identifier is not available yet.

as_dict() dict

Serializes the ClusterInstance into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ClusterInstance

Deserializes the ClusterInstance from a dictionary.

class databricks.sdk.service.jobs.ClusterSpec
existing_cluster_id: str | None = None

If existing_cluster_id, the ID of an existing cluster that is used for all runs. When running jobs or tasks on an existing cluster, you may need to manually restart the cluster if it stops responding. We suggest running jobs and tasks on new clusters for greater reliability

job_cluster_key: str | None = None

If job_cluster_key, this task is executed reusing the cluster specified in job.settings.job_clusters.

libraries: List[Library] | None = None

An optional list of libraries to be installed on the cluster. The default value is an empty list.

new_cluster: ClusterSpec | None = None

If new_cluster, a description of a new cluster that is created for each run.

as_dict() dict

Serializes the ClusterSpec into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ClusterSpec

Deserializes the ClusterSpec from a dictionary.

class databricks.sdk.service.jobs.Condition
ALL_UPDATED = "ALL_UPDATED"
ANY_UPDATED = "ANY_UPDATED"
class databricks.sdk.service.jobs.ConditionTask
op: ConditionTaskOp
  • EQUAL_TO, NOT_EQUAL operators perform string comparison of their operands. This means that

“12.0” == “12” will evaluate to false. * GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL operators perform numeric comparison of their operands. “12.0” >= “12” will evaluate to true, “10.0” >= “12” will evaluate to false.

The boolean comparison to task values can be implemented with operators EQUAL_TO, NOT_EQUAL. If a task value was set to a boolean value, it will be serialized to “true” or “false” for the comparison.

left: str

The left operand of the condition task. Can be either a string value or a job state or parameter reference.

right: str

The right operand of the condition task. Can be either a string value or a job state or parameter reference.

as_dict() dict

Serializes the ConditionTask into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ConditionTask

Deserializes the ConditionTask from a dictionary.

class databricks.sdk.service.jobs.ConditionTaskOp
  • EQUAL_TO, NOT_EQUAL operators perform string comparison of their operands. This means that “12.0” == “12” will evaluate to false. * GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL operators perform numeric comparison of their operands. “12.0” >= “12” will evaluate to true, “10.0” >= “12” will evaluate to false.

The boolean comparison to task values can be implemented with operators EQUAL_TO, NOT_EQUAL. If a task value was set to a boolean value, it will be serialized to “true” or “false” for the comparison.

EQUAL_TO = "EQUAL_TO"
GREATER_THAN = "GREATER_THAN"
GREATER_THAN_OR_EQUAL = "GREATER_THAN_OR_EQUAL"
LESS_THAN = "LESS_THAN"
LESS_THAN_OR_EQUAL = "LESS_THAN_OR_EQUAL"
NOT_EQUAL = "NOT_EQUAL"
class databricks.sdk.service.jobs.Continuous
pause_status: PauseStatus | None = None

Indicate whether the continuous execution of the job is paused or not. Defaults to UNPAUSED.

as_dict() dict

Serializes the Continuous into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) Continuous

Deserializes the Continuous from a dictionary.

class databricks.sdk.service.jobs.CreateJob
access_control_list: List[AccessControlRequest] | None = None

List of permissions to set on the job.

continuous: Continuous | None = None

An optional continuous property for this job. The continuous property will ensure that there is always one run executing. Only one of schedule and continuous can be used.

deployment: JobDeployment | None = None

Deployment information for jobs managed by external sources.

description: str | None = None

An optional description for the job. The maximum length is 1024 characters in UTF-8 encoding.

edit_mode: JobEditMode | None = None

Edit mode of the job.

  • UI_LOCKED: The job is in a locked UI state and cannot be modified. * EDITABLE: The job is

in an editable state and can be modified.

email_notifications: JobEmailNotifications | None = None

An optional set of email addresses that is notified when runs of this job begin or complete as well as when this job is deleted.

environments: List[JobEnvironment] | None = None

A list of task execution environment specifications that can be referenced by tasks of this job.

format: Format | None = None

Used to tell what is the format of the job. This field is ignored in Create/Update/Reset calls. When using the Jobs API 2.1 this value is always set to “MULTI_TASK”.

git_source: GitSource | None = None

An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks.

If git_source is set, these tasks retrieve the file from the remote repository by default. However, this behavior can be overridden by setting source to WORKSPACE on the task.

Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, git_source must be defined on the job.

health: JobsHealthRules | None = None

An optional set of health rules that can be defined for this job.

job_clusters: List[JobCluster] | None = None

A list of job cluster specifications that can be shared and reused by tasks of this job. Libraries cannot be declared in a shared job cluster. You must declare dependent libraries in task settings.

max_concurrent_runs: int | None = None

An optional maximum allowed number of concurrent runs of the job. Set this value if you want to be able to execute multiple runs of the same job concurrently. This is useful for example if you trigger your job on a frequent schedule and want to allow consecutive runs to overlap with each other, or if you want to trigger multiple runs which differ by their input parameters. This setting affects only new runs. For example, suppose the job’s concurrency is 4 and there are 4 concurrent active runs. Then setting the concurrency to 3 won’t kill any of the active runs. However, from then on, new runs are skipped unless there are fewer than 3 active runs. This value cannot exceed 1000. Setting this value to 0 causes all new runs to be skipped.

name: str | None = None

An optional name for the job. The maximum length is 4096 bytes in UTF-8 encoding.

notification_settings: JobNotificationSettings | None = None

Optional notification settings that are used when sending notifications to each of the email_notifications and webhook_notifications for this job.

parameters: List[JobParameterDefinition] | None = None

Job-level parameter definitions

queue: QueueSettings | None = None

The queue settings of the job.

run_as: JobRunAs | None = None

Write-only setting, available only in Create/Update/Reset and Submit calls. Specifies the user or service principal that the job runs as. If not specified, the job runs as the user who created the job.

Only user_name or service_principal_name can be specified. If both are specified, an error is thrown.

schedule: CronSchedule | None = None

An optional periodic schedule for this job. The default behavior is that the job only runs when triggered by clicking “Run Now” in the Jobs UI or sending an API request to runNow.

tags: Dict[str, str] | None = None

A map of tags associated with the job. These are forwarded to the cluster as cluster tags for jobs clusters, and are subject to the same limitations as cluster tags. A maximum of 25 tags can be added to the job.

tasks: List[Task] | None = None

A list of task specifications to be executed by this job.

timeout_seconds: int | None = None

An optional timeout applied to each run of this job. A value of 0 means no timeout.

trigger: TriggerSettings | None = None

A configuration to trigger a run when certain conditions are met. The default behavior is that the job runs only when triggered by clicking “Run Now” in the Jobs UI or sending an API request to runNow.

webhook_notifications: WebhookNotifications | None = None

A collection of system notification IDs to notify when runs of this job begin or complete.

as_dict() dict

Serializes the CreateJob into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) CreateJob

Deserializes the CreateJob from a dictionary.

class databricks.sdk.service.jobs.CreateResponse

Job was created successfully

job_id: int | None = None

The canonical identifier for the newly created job.

as_dict() dict

Serializes the CreateResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) CreateResponse

Deserializes the CreateResponse from a dictionary.

class databricks.sdk.service.jobs.CronSchedule
quartz_cron_expression: str

A Cron expression using Quartz syntax that describes the schedule for a job. See [Cron Trigger] for details. This field is required.

[Cron Trigger]: http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html

timezone_id: str

A Java timezone ID. The schedule for a job is resolved with respect to this timezone. See [Java TimeZone] for details. This field is required.

[Java TimeZone]: https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html

pause_status: PauseStatus | None = None

Indicate whether this schedule is paused or not.

as_dict() dict

Serializes the CronSchedule into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) CronSchedule

Deserializes the CronSchedule from a dictionary.

class databricks.sdk.service.jobs.DbtOutput
artifacts_headers: Dict[str, str] | None = None

An optional map of headers to send when retrieving the artifact from the artifacts_link.

A pre-signed URL to download the (compressed) dbt artifacts. This link is valid for a limited time (30 minutes). This information is only available after the run has finished.

as_dict() dict

Serializes the DbtOutput into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) DbtOutput

Deserializes the DbtOutput from a dictionary.

class databricks.sdk.service.jobs.DbtTask
commands: List[str]

A list of dbt commands to execute. All commands must start with dbt. This parameter must not be empty. A maximum of up to 10 commands can be provided.

catalog: str | None = None

Optional name of the catalog to use. The value is the top level in the 3-level namespace of Unity Catalog (catalog / schema / relation). The catalog value can only be specified if a warehouse_id is specified. Requires dbt-databricks >= 1.1.1.

profiles_directory: str | None = None

Optional (relative) path to the profiles directory. Can only be specified if no warehouse_id is specified. If no warehouse_id is specified and this folder is unset, the root directory is used.

project_directory: str | None = None

Path to the project directory. Optional for Git sourced tasks, in which case if no value is provided, the root of the Git repository is used.

schema: str | None = None

Optional schema to write to. This parameter is only used when a warehouse_id is also provided. If not provided, the default schema is used.

source: Source | None = None

Optional location type of the project directory. When set to WORKSPACE, the project will be retrieved from the local Databricks workspace. When set to GIT, the project will be retrieved from a Git repository defined in git_source. If the value is empty, the task will use GIT if git_source is defined and WORKSPACE otherwise.

  • WORKSPACE: Project is located in Databricks workspace. * GIT: Project is located in cloud

Git provider.

warehouse_id: str | None = None

ID of the SQL warehouse to connect to. If provided, we automatically generate and provide the profile and connection details to dbt. It can be overridden on a per-command basis by using the –profiles-dir command line argument.

as_dict() dict

Serializes the DbtTask into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) DbtTask

Deserializes the DbtTask from a dictionary.

class databricks.sdk.service.jobs.DeleteJob
job_id: int

The canonical identifier of the job to delete. This field is required.

as_dict() dict

Serializes the DeleteJob into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) DeleteJob

Deserializes the DeleteJob from a dictionary.

class databricks.sdk.service.jobs.DeleteResponse
as_dict() dict

Serializes the DeleteResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) DeleteResponse

Deserializes the DeleteResponse from a dictionary.

class databricks.sdk.service.jobs.DeleteRun
run_id: int

ID of the run to delete.

as_dict() dict

Serializes the DeleteRun into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) DeleteRun

Deserializes the DeleteRun from a dictionary.

class databricks.sdk.service.jobs.DeleteRunResponse
as_dict() dict

Serializes the DeleteRunResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) DeleteRunResponse

Deserializes the DeleteRunResponse from a dictionary.

class databricks.sdk.service.jobs.ExportRunOutput

Run was exported successfully.

views: List[ViewItem] | None = None

The exported content in HTML format (one for every view item). To extract the HTML notebook from the JSON response, download and run this [Python script].

[Python script]: https://docs.databricks.com/en/_static/examples/extract.py

as_dict() dict

Serializes the ExportRunOutput into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ExportRunOutput

Deserializes the ExportRunOutput from a dictionary.

class databricks.sdk.service.jobs.FileArrivalTriggerConfiguration
url: str

URL to be monitored for file arrivals. The path must point to the root or a subpath of the external location.

min_time_between_triggers_seconds: int | None = None

If set, the trigger starts a run only after the specified amount of time passed since the last time the trigger fired. The minimum allowed value is 60 seconds

wait_after_last_change_seconds: int | None = None

If set, the trigger starts a run only after no file activity has occurred for the specified amount of time. This makes it possible to wait for a batch of incoming files to arrive before triggering a run. The minimum allowed value is 60 seconds.

as_dict() dict

Serializes the FileArrivalTriggerConfiguration into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) FileArrivalTriggerConfiguration

Deserializes the FileArrivalTriggerConfiguration from a dictionary.

class databricks.sdk.service.jobs.ForEachStats
error_message_stats: List[ForEachTaskErrorMessageStats] | None = None

Sample of 3 most common error messages occurred during the iteration.

task_run_stats: ForEachTaskTaskRunStats | None = None

Describes stats of the iteration. Only latest retries are considered.

as_dict() dict

Serializes the ForEachStats into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ForEachStats

Deserializes the ForEachStats from a dictionary.

class databricks.sdk.service.jobs.ForEachTask
inputs: str

Array for task to iterate on. This can be a JSON string or a reference to an array parameter.

task: Task

Configuration for the task that will be run for each element in the array

concurrency: int | None = None

Controls the number of active iterations task runs. Default is 20, maximum allowed is 100.

as_dict() dict

Serializes the ForEachTask into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ForEachTask

Deserializes the ForEachTask from a dictionary.

class databricks.sdk.service.jobs.ForEachTaskErrorMessageStats
count: int | None = None

Describes the count of such error message encountered during the iterations.

error_message: str | None = None

Describes the error message occured during the iterations.

as_dict() dict

Serializes the ForEachTaskErrorMessageStats into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ForEachTaskErrorMessageStats

Deserializes the ForEachTaskErrorMessageStats from a dictionary.

class databricks.sdk.service.jobs.ForEachTaskTaskRunStats
active_iterations: int | None = None

Describes the iteration runs having an active lifecycle state or an active run sub state.

completed_iterations: int | None = None

Describes the number of failed and succeeded iteration runs.

failed_iterations: int | None = None

Describes the number of failed iteration runs.

scheduled_iterations: int | None = None

Describes the number of iteration runs that have been scheduled.

succeeded_iterations: int | None = None

Describes the number of succeeded iteration runs.

total_iterations: int | None = None

Describes the length of the list of items to iterate over.

as_dict() dict

Serializes the ForEachTaskTaskRunStats into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ForEachTaskTaskRunStats

Deserializes the ForEachTaskTaskRunStats from a dictionary.

class databricks.sdk.service.jobs.Format
MULTI_TASK = "MULTI_TASK"
SINGLE_TASK = "SINGLE_TASK"
class databricks.sdk.service.jobs.GetJobPermissionLevelsResponse
permission_levels: List[JobPermissionsDescription] | None = None

Specific permission levels

as_dict() dict

Serializes the GetJobPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) GetJobPermissionLevelsResponse

Deserializes the GetJobPermissionLevelsResponse from a dictionary.

class databricks.sdk.service.jobs.GitProvider
AWS_CODE_COMMIT = "AWS_CODE_COMMIT"
AZURE_DEV_OPS_SERVICES = "AZURE_DEV_OPS_SERVICES"
BITBUCKET_CLOUD = "BITBUCKET_CLOUD"
BITBUCKET_SERVER = "BITBUCKET_SERVER"
GIT_HUB = "GIT_HUB"
GIT_HUB_ENTERPRISE = "GIT_HUB_ENTERPRISE"
GIT_LAB = "GIT_LAB"
GIT_LAB_ENTERPRISE_EDITION = "GIT_LAB_ENTERPRISE_EDITION"
class databricks.sdk.service.jobs.GitSnapshot

Read-only state of the remote repository at the time the job was run. This field is only included on job runs.

used_commit: str | None = None

Commit that was used to execute the run. If git_branch was specified, this points to the HEAD of the branch at the time of the run; if git_tag was specified, this points to the commit the tag points to.

as_dict() dict

Serializes the GitSnapshot into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) GitSnapshot

Deserializes the GitSnapshot from a dictionary.

class databricks.sdk.service.jobs.GitSource

An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks.

If git_source is set, these tasks retrieve the file from the remote repository by default. However, this behavior can be overridden by setting source to WORKSPACE on the task.

Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, git_source must be defined on the job.

git_url: str

URL of the repository to be cloned by this job.

git_provider: GitProvider

Unique identifier of the service used to host the Git repository. The value is case insensitive.

git_branch: str | None = None

Name of the branch to be checked out and used by this job. This field cannot be specified in conjunction with git_tag or git_commit.

git_commit: str | None = None

Commit to be checked out and used by this job. This field cannot be specified in conjunction with git_branch or git_tag.

git_snapshot: GitSnapshot | None = None

Read-only state of the remote repository at the time the job was run. This field is only included on job runs.

git_tag: str | None = None

Name of the tag to be checked out and used by this job. This field cannot be specified in conjunction with git_branch or git_commit.

job_source: JobSource | None = None

The source of the job specification in the remote repository when the job is source controlled.

as_dict() dict

Serializes the GitSource into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) GitSource

Deserializes the GitSource from a dictionary.

class databricks.sdk.service.jobs.Job

Job was retrieved successfully.

created_time: int | None = None

The time at which this job was created in epoch milliseconds (milliseconds since 1/1/1970 UTC).

creator_user_name: str | None = None

The creator user name. This field won’t be included in the response if the user has already been deleted.

job_id: int | None = None

The canonical identifier for this job.

run_as_user_name: str | None = None

The email of an active workspace user or the application ID of a service principal that the job runs as. This value can be changed by setting the run_as field when creating or updating a job.

By default, run_as_user_name is based on the current job settings and is set to the creator of the job if job access control is disabled or to the user with the is_owner permission if job access control is enabled.

settings: JobSettings | None = None

Settings for this job and all of its runs. These settings can be updated using the resetJob method.

as_dict() dict

Serializes the Job into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) Job

Deserializes the Job from a dictionary.

class databricks.sdk.service.jobs.JobAccessControlRequest
group_name: str | None = None

name of the group

permission_level: JobPermissionLevel | None = None

Permission level

service_principal_name: str | None = None

application ID of a service principal

user_name: str | None = None

name of the user

as_dict() dict

Serializes the JobAccessControlRequest into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobAccessControlRequest

Deserializes the JobAccessControlRequest from a dictionary.

class databricks.sdk.service.jobs.JobAccessControlResponse
all_permissions: List[JobPermission] | None = None

All permissions.

display_name: str | None = None

Display name of the user or service principal.

group_name: str | None = None

name of the group

service_principal_name: str | None = None

Name of the service principal.

user_name: str | None = None

name of the user

as_dict() dict

Serializes the JobAccessControlResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobAccessControlResponse

Deserializes the JobAccessControlResponse from a dictionary.

class databricks.sdk.service.jobs.JobCluster
job_cluster_key: str

A unique name for the job cluster. This field is required and must be unique within the job. JobTaskSettings may refer to this field to determine which cluster to launch for the task execution.

new_cluster: ClusterSpec

If new_cluster, a description of a cluster that is created for each task.

as_dict() dict

Serializes the JobCluster into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobCluster

Deserializes the JobCluster from a dictionary.

class databricks.sdk.service.jobs.JobDeployment
kind: JobDeploymentKind

The kind of deployment that manages the job.

  • BUNDLE: The job is managed by Databricks Asset Bundle.

metadata_file_path: str | None = None

Path of the file that contains deployment metadata.

as_dict() dict

Serializes the JobDeployment into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobDeployment

Deserializes the JobDeployment from a dictionary.

class databricks.sdk.service.jobs.JobDeploymentKind
  • BUNDLE: The job is managed by Databricks Asset Bundle.

BUNDLE = "BUNDLE"
class databricks.sdk.service.jobs.JobEditMode

Edit mode of the job. * UI_LOCKED: The job is in a locked UI state and cannot be modified. * EDITABLE: The job is in an editable state and can be modified.

EDITABLE = "EDITABLE"
UI_LOCKED = "UI_LOCKED"
class databricks.sdk.service.jobs.JobEmailNotifications
no_alert_for_skipped_runs: bool | None = None

If true, do not send email to recipients specified in on_failure if the run is skipped.

on_duration_warning_threshold_exceeded: List[str] | None = None

A list of email addresses to be notified when the duration of a run exceeds the threshold specified for the RUN_DURATION_SECONDS metric in the health field. If no rule for the RUN_DURATION_SECONDS metric is specified in the health field for the job, notifications are not sent.

on_failure: List[str] | None = None

A list of email addresses to be notified when a run unsuccessfully completes. A run is considered to have completed unsuccessfully if it ends with an INTERNAL_ERROR life_cycle_state or a FAILED, or TIMED_OUT result_state. If this is not specified on job creation, reset, or update the list is empty, and notifications are not sent.

on_start: List[str] | None = None

A list of email addresses to be notified when a run begins. If not specified on job creation, reset, or update, the list is empty, and notifications are not sent.

on_success: List[str] | None = None

A list of email addresses to be notified when a run successfully completes. A run is considered to have completed successfully if it ends with a TERMINATED life_cycle_state and a SUCCESS result_state. If not specified on job creation, reset, or update, the list is empty, and notifications are not sent.

as_dict() dict

Serializes the JobEmailNotifications into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobEmailNotifications

Deserializes the JobEmailNotifications from a dictionary.

class databricks.sdk.service.jobs.JobEnvironment
environment_key: str

The key of an environment. It has to be unique within a job.

spec: Environment | None = None

The a environment entity used to preserve serverless environment side panel and jobs’ environment for non-notebook task. In this minimal environment spec, only pip dependencies are supported. Next ID: 5

as_dict() dict

Serializes the JobEnvironment into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobEnvironment

Deserializes the JobEnvironment from a dictionary.

class databricks.sdk.service.jobs.JobNotificationSettings
no_alert_for_canceled_runs: bool | None = None

If true, do not send notifications to recipients specified in on_failure if the run is canceled.

no_alert_for_skipped_runs: bool | None = None

If true, do not send notifications to recipients specified in on_failure if the run is skipped.

as_dict() dict

Serializes the JobNotificationSettings into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobNotificationSettings

Deserializes the JobNotificationSettings from a dictionary.

class databricks.sdk.service.jobs.JobParameter
default: str | None = None

The optional default value of the parameter

name: str | None = None

The name of the parameter

value: str | None = None

The value used in the run

as_dict() dict

Serializes the JobParameter into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobParameter

Deserializes the JobParameter from a dictionary.

class databricks.sdk.service.jobs.JobParameterDefinition
name: str

The name of the defined parameter. May only contain alphanumeric characters, _, -, and .

default: str

Default value of the parameter.

as_dict() dict

Serializes the JobParameterDefinition into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobParameterDefinition

Deserializes the JobParameterDefinition from a dictionary.

class databricks.sdk.service.jobs.JobPermission
inherited: bool | None = None
inherited_from_object: List[str] | None = None
permission_level: JobPermissionLevel | None = None

Permission level

as_dict() dict

Serializes the JobPermission into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobPermission

Deserializes the JobPermission from a dictionary.

class databricks.sdk.service.jobs.JobPermissionLevel

Permission level

CAN_MANAGE = "CAN_MANAGE"
CAN_MANAGE_RUN = "CAN_MANAGE_RUN"
CAN_VIEW = "CAN_VIEW"
IS_OWNER = "IS_OWNER"
class databricks.sdk.service.jobs.JobPermissions
access_control_list: List[JobAccessControlResponse] | None = None
object_id: str | None = None
object_type: str | None = None
as_dict() dict

Serializes the JobPermissions into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobPermissions

Deserializes the JobPermissions from a dictionary.

class databricks.sdk.service.jobs.JobPermissionsDescription
description: str | None = None
permission_level: JobPermissionLevel | None = None

Permission level

as_dict() dict

Serializes the JobPermissionsDescription into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobPermissionsDescription

Deserializes the JobPermissionsDescription from a dictionary.

class databricks.sdk.service.jobs.JobPermissionsRequest
access_control_list: List[JobAccessControlRequest] | None = None
job_id: str | None = None

The job for which to get or manage permissions.

as_dict() dict

Serializes the JobPermissionsRequest into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobPermissionsRequest

Deserializes the JobPermissionsRequest from a dictionary.

class databricks.sdk.service.jobs.JobRunAs

Write-only setting, available only in Create/Update/Reset and Submit calls. Specifies the user or service principal that the job runs as. If not specified, the job runs as the user who created the job.

Only user_name or service_principal_name can be specified. If both are specified, an error is thrown.

service_principal_name: str | None = None

Application ID of an active service principal. Setting this field requires the servicePrincipal/user role.

user_name: str | None = None

The email of an active workspace user. Non-admin users can only set this field to their own email.

as_dict() dict

Serializes the JobRunAs into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobRunAs

Deserializes the JobRunAs from a dictionary.

class databricks.sdk.service.jobs.JobSettings
continuous: Continuous | None = None

An optional continuous property for this job. The continuous property will ensure that there is always one run executing. Only one of schedule and continuous can be used.

deployment: JobDeployment | None = None

Deployment information for jobs managed by external sources.

description: str | None = None

An optional description for the job. The maximum length is 1024 characters in UTF-8 encoding.

edit_mode: JobEditMode | None = None

Edit mode of the job.

  • UI_LOCKED: The job is in a locked UI state and cannot be modified. * EDITABLE: The job is

in an editable state and can be modified.

email_notifications: JobEmailNotifications | None = None

An optional set of email addresses that is notified when runs of this job begin or complete as well as when this job is deleted.

environments: List[JobEnvironment] | None = None

A list of task execution environment specifications that can be referenced by tasks of this job.

format: Format | None = None

Used to tell what is the format of the job. This field is ignored in Create/Update/Reset calls. When using the Jobs API 2.1 this value is always set to “MULTI_TASK”.

git_source: GitSource | None = None

An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks.

If git_source is set, these tasks retrieve the file from the remote repository by default. However, this behavior can be overridden by setting source to WORKSPACE on the task.

Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, git_source must be defined on the job.

health: JobsHealthRules | None = None

An optional set of health rules that can be defined for this job.

job_clusters: List[JobCluster] | None = None

A list of job cluster specifications that can be shared and reused by tasks of this job. Libraries cannot be declared in a shared job cluster. You must declare dependent libraries in task settings.

max_concurrent_runs: int | None = None

An optional maximum allowed number of concurrent runs of the job. Set this value if you want to be able to execute multiple runs of the same job concurrently. This is useful for example if you trigger your job on a frequent schedule and want to allow consecutive runs to overlap with each other, or if you want to trigger multiple runs which differ by their input parameters. This setting affects only new runs. For example, suppose the job’s concurrency is 4 and there are 4 concurrent active runs. Then setting the concurrency to 3 won’t kill any of the active runs. However, from then on, new runs are skipped unless there are fewer than 3 active runs. This value cannot exceed 1000. Setting this value to 0 causes all new runs to be skipped.

name: str | None = None

An optional name for the job. The maximum length is 4096 bytes in UTF-8 encoding.

notification_settings: JobNotificationSettings | None = None

Optional notification settings that are used when sending notifications to each of the email_notifications and webhook_notifications for this job.

parameters: List[JobParameterDefinition] | None = None

Job-level parameter definitions

queue: QueueSettings | None = None

The queue settings of the job.

run_as: JobRunAs | None = None

Write-only setting, available only in Create/Update/Reset and Submit calls. Specifies the user or service principal that the job runs as. If not specified, the job runs as the user who created the job.

Only user_name or service_principal_name can be specified. If both are specified, an error is thrown.

schedule: CronSchedule | None = None

An optional periodic schedule for this job. The default behavior is that the job only runs when triggered by clicking “Run Now” in the Jobs UI or sending an API request to runNow.

tags: Dict[str, str] | None = None

A map of tags associated with the job. These are forwarded to the cluster as cluster tags for jobs clusters, and are subject to the same limitations as cluster tags. A maximum of 25 tags can be added to the job.

tasks: List[Task] | None = None

A list of task specifications to be executed by this job.

timeout_seconds: int | None = None

An optional timeout applied to each run of this job. A value of 0 means no timeout.

trigger: TriggerSettings | None = None

A configuration to trigger a run when certain conditions are met. The default behavior is that the job runs only when triggered by clicking “Run Now” in the Jobs UI or sending an API request to runNow.

webhook_notifications: WebhookNotifications | None = None

A collection of system notification IDs to notify when runs of this job begin or complete.

as_dict() dict

Serializes the JobSettings into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobSettings

Deserializes the JobSettings from a dictionary.

class databricks.sdk.service.jobs.JobSource

The source of the job specification in the remote repository when the job is source controlled.

job_config_path: str

Path of the job YAML file that contains the job specification.

import_from_git_branch: str

Name of the branch which the job is imported from.

dirty_state: JobSourceDirtyState | None = None

Dirty state indicates the job is not fully synced with the job specification in the remote repository.

Possible values are: * NOT_SYNCED: The job is not yet synced with the remote job specification. Import the remote job specification from UI to make the job fully synced. * DISCONNECTED: The job is temporary disconnected from the remote job specification and is allowed for live edit. Import the remote job specification again from UI to make the job fully synced.

as_dict() dict

Serializes the JobSource into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobSource

Deserializes the JobSource from a dictionary.

class databricks.sdk.service.jobs.JobSourceDirtyState

Dirty state indicates the job is not fully synced with the job specification in the remote repository. Possible values are: * NOT_SYNCED: The job is not yet synced with the remote job specification. Import the remote job specification from UI to make the job fully synced. * DISCONNECTED: The job is temporary disconnected from the remote job specification and is allowed for live edit. Import the remote job specification again from UI to make the job fully synced.

DISCONNECTED = "DISCONNECTED"
NOT_SYNCED = "NOT_SYNCED"
class databricks.sdk.service.jobs.JobsHealthMetric

Specifies the health metric that is being evaluated for a particular health rule.

RUN_DURATION_SECONDS = "RUN_DURATION_SECONDS"
class databricks.sdk.service.jobs.JobsHealthOperator

Specifies the operator used to compare the health metric value with the specified threshold.

GREATER_THAN = "GREATER_THAN"
class databricks.sdk.service.jobs.JobsHealthRule
metric: JobsHealthMetric

Specifies the health metric that is being evaluated for a particular health rule.

op: JobsHealthOperator

Specifies the operator used to compare the health metric value with the specified threshold.

value: int

Specifies the threshold value that the health metric should obey to satisfy the health rule.

as_dict() dict

Serializes the JobsHealthRule into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobsHealthRule

Deserializes the JobsHealthRule from a dictionary.

class databricks.sdk.service.jobs.JobsHealthRules

An optional set of health rules that can be defined for this job.

rules: List[JobsHealthRule] | None = None
as_dict() dict

Serializes the JobsHealthRules into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) JobsHealthRules

Deserializes the JobsHealthRules from a dictionary.

class databricks.sdk.service.jobs.ListJobsResponse

List of jobs was retrieved successfully.

has_more: bool | None = None

If true, additional jobs matching the provided filter are available for listing.

jobs: List[BaseJob] | None = None

The list of jobs. Only included in the response if there are jobs to list.

next_page_token: str | None = None

A token that can be used to list the next page of jobs (if applicable).

prev_page_token: str | None = None

A token that can be used to list the previous page of jobs (if applicable).

as_dict() dict

Serializes the ListJobsResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ListJobsResponse

Deserializes the ListJobsResponse from a dictionary.

class databricks.sdk.service.jobs.ListRunsResponse

List of runs was retrieved successfully.

has_more: bool | None = None

If true, additional runs matching the provided filter are available for listing.

next_page_token: str | None = None

A token that can be used to list the next page of runs (if applicable).

prev_page_token: str | None = None

A token that can be used to list the previous page of runs (if applicable).

runs: List[BaseRun] | None = None

A list of runs, from most recently started to least. Only included in the response if there are runs to list.

as_dict() dict

Serializes the ListRunsResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ListRunsResponse

Deserializes the ListRunsResponse from a dictionary.

class databricks.sdk.service.jobs.NotebookOutput
result: str | None = None

The value passed to [dbutils.notebook.exit()](/notebooks/notebook-workflows.html#notebook-workflows-exit). Databricks restricts this API to return the first 5 MB of the value. For a larger result, your job can store the results in a cloud storage service. This field is absent if dbutils.notebook.exit() was never called.

truncated: bool | None = None

Whether or not the result was truncated.

as_dict() dict

Serializes the NotebookOutput into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) NotebookOutput

Deserializes the NotebookOutput from a dictionary.

class databricks.sdk.service.jobs.NotebookTask
notebook_path: str

The path of the notebook to be run in the Databricks workspace or remote repository. For notebooks stored in the Databricks workspace, the path must be absolute and begin with a slash. For notebooks stored in a remote repository, the path must be relative. This field is required.

base_parameters: Dict[str, str] | None = None

Base parameters to be used for each run of this job. If the run is initiated by a call to :method:jobs/run Now with parameters specified, the two parameters maps are merged. If the same key is specified in base_parameters and in run-now, the value from run-now is used. Use [Task parameter variables] to set parameters containing information about job runs.

If the notebook takes a parameter that is not specified in the job’s base_parameters or the run-now override parameters, the default value from the notebook is used.

Retrieve these parameters in a notebook using [dbutils.widgets.get].

The JSON representation of this field cannot exceed 1MB.

[Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-widgets

source: Source | None = None

Optional location type of the notebook. When set to WORKSPACE, the notebook will be retrieved from the local Databricks workspace. When set to GIT, the notebook will be retrieved from a Git repository defined in git_source. If the value is empty, the task will use GIT if git_source is defined and WORKSPACE otherwise. * WORKSPACE: Notebook is located in Databricks workspace. * GIT: Notebook is located in cloud Git provider.

warehouse_id: str | None = None

Optional warehouse_id to run the notebook on a SQL warehouse. Classic SQL warehouses are NOT supported, please use serverless or pro SQL warehouses.

Note that SQL warehouses only support SQL cells; if the notebook contains non-SQL cells, the run will fail.

as_dict() dict

Serializes the NotebookTask into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) NotebookTask

Deserializes the NotebookTask from a dictionary.

class databricks.sdk.service.jobs.PauseStatus
PAUSED = "PAUSED"
UNPAUSED = "UNPAUSED"
class databricks.sdk.service.jobs.PipelineParams
full_refresh: bool | None = None

If true, triggers a full refresh on the delta live table.

as_dict() dict

Serializes the PipelineParams into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) PipelineParams

Deserializes the PipelineParams from a dictionary.

class databricks.sdk.service.jobs.PipelineTask
pipeline_id: str

The full name of the pipeline task to execute.

full_refresh: bool | None = None

If true, triggers a full refresh on the delta live table.

as_dict() dict

Serializes the PipelineTask into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) PipelineTask

Deserializes the PipelineTask from a dictionary.

class databricks.sdk.service.jobs.PythonWheelTask
package_name: str

Name of the package to execute

entry_point: str

Named entry point to use, if it does not exist in the metadata of the package it executes the function from the package directly using $packageName.$entryPoint()

named_parameters: Dict[str, str] | None = None

Command-line parameters passed to Python wheel task in the form of [”–name=task”, “–data=dbfs:/path/to/data.json”]. Leave it empty if parameters is not null.

parameters: List[str] | None = None

Command-line parameters passed to Python wheel task. Leave it empty if named_parameters is not null.

as_dict() dict

Serializes the PythonWheelTask into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) PythonWheelTask

Deserializes the PythonWheelTask from a dictionary.

class databricks.sdk.service.jobs.QueueSettings
enabled: bool

If true, enable queueing for the job. This is a required field.

as_dict() dict

Serializes the QueueSettings into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) QueueSettings

Deserializes the QueueSettings from a dictionary.

class databricks.sdk.service.jobs.RepairHistoryItem
end_time: int | None = None

The end time of the (repaired) run.

id: int | None = None

The ID of the repair. Only returned for the items that represent a repair in repair_history.

start_time: int | None = None

The start time of the (repaired) run.

state: RunState | None = None

The current state of the run.

task_run_ids: List[int] | None = None

The run IDs of the task runs that ran as part of this repair history item.

type: RepairHistoryItemType | None = None

The repair history item type. Indicates whether a run is the original run or a repair run.

as_dict() dict

Serializes the RepairHistoryItem into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) RepairHistoryItem

Deserializes the RepairHistoryItem from a dictionary.

class databricks.sdk.service.jobs.RepairHistoryItemType

The repair history item type. Indicates whether a run is the original run or a repair run.

ORIGINAL = "ORIGINAL"
REPAIR = "REPAIR"
class databricks.sdk.service.jobs.RepairRun
run_id: int

The job run ID of the run to repair. The run must not be in progress.

dbt_commands: List[str] | None = None

An array of commands to execute for jobs with the dbt task, for example “dbt_commands”: [“dbt deps”, “dbt seed”, “dbt deps”, “dbt seed”, “dbt run”]

jar_params: List[str] | None = None

A list of parameters for jobs with Spark JAR tasks, for example “jar_params”: [“john doe”, “35”]. The parameters are used to invoke the main function of the main class specified in the Spark JAR task. If not specified upon run-now, it defaults to an empty list. jar_params cannot be specified in conjunction with notebook_params. The JSON representation of this field (for example {“jar_params”:[“john doe”,”35”]}) cannot exceed 10,000 bytes.

Use [Task parameter variables](/jobs.html”#parameter-variables”) to set parameters containing information about job runs.

job_parameters: Dict[str, str] | None = None

Job-level parameters used in the run. for example “param”: “overriding_val”

latest_repair_id: int | None = None

The ID of the latest repair. This parameter is not required when repairing a run for the first time, but must be provided on subsequent requests to repair the same run.

notebook_params: Dict[str, str] | None = None

A map from keys to values for jobs with notebook task, for example “notebook_params”: {“name”: “john doe”, “age”: “35”}. The map is passed to the notebook and is accessible through the [dbutils.widgets.get] function.

If not specified upon run-now, the triggered run uses the job’s base parameters.

notebook_params cannot be specified in conjunction with jar_params.

Use [Task parameter variables] to set parameters containing information about job runs.

The JSON representation of this field (for example {“notebook_params”:{“name”:”john doe”,”age”:”35”}}) cannot exceed 10,000 bytes.

[Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html

pipeline_params: PipelineParams | None = None
python_named_params: Dict[str, str] | None = None

A map from keys to values for jobs with Python wheel task, for example “python_named_params”: {“name”: “task”, “data”: “dbfs:/path/to/data.json”}.

python_params: List[str] | None = None

A list of parameters for jobs with Python tasks, for example “python_params”: [“john doe”, “35”]. The parameters are passed to Python file as command-line parameters. If specified upon run-now, it would overwrite the parameters specified in job setting. The JSON representation of this field (for example {“python_params”:[“john doe”,”35”]}) cannot exceed 10,000 bytes.

Use [Task parameter variables] to set parameters containing information about job runs.

Important

These parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error. Examples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis.

[Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables

rerun_all_failed_tasks: bool | None = None

If true, repair all failed tasks. Only one of rerun_tasks or rerun_all_failed_tasks can be used.

rerun_dependent_tasks: bool | None = None

If true, repair all tasks that depend on the tasks in rerun_tasks, even if they were previously successful. Can be also used in combination with rerun_all_failed_tasks.

rerun_tasks: List[str] | None = None

The task keys of the task runs to repair.

spark_submit_params: List[str] | None = None

A list of parameters for jobs with spark submit task, for example “spark_submit_params”: [”–class”, “org.apache.spark.examples.SparkPi”]. The parameters are passed to spark-submit script as command-line parameters. If specified upon run-now, it would overwrite the parameters specified in job setting. The JSON representation of this field (for example {“python_params”:[“john doe”,”35”]}) cannot exceed 10,000 bytes.

Use [Task parameter variables] to set parameters containing information about job runs

Important

These parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error. Examples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis.

[Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables

sql_params: Dict[str, str] | None = None

A map from keys to values for jobs with SQL task, for example “sql_params”: {“name”: “john doe”, “age”: “35”}. The SQL alert task does not support custom parameters.

as_dict() dict

Serializes the RepairRun into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) RepairRun

Deserializes the RepairRun from a dictionary.

class databricks.sdk.service.jobs.RepairRunResponse

Run repair was initiated.

repair_id: int | None = None

The ID of the repair. Must be provided in subsequent repairs using the latest_repair_id field to ensure sequential repairs.

as_dict() dict

Serializes the RepairRunResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) RepairRunResponse

Deserializes the RepairRunResponse from a dictionary.

class databricks.sdk.service.jobs.ResetJob
job_id: int

The canonical identifier of the job to reset. This field is required.

new_settings: JobSettings

The new settings of the job. These settings completely replace the old settings.

Changes to the field JobBaseSettings.timeout_seconds are applied to active runs. Changes to other fields are applied to future runs only.

as_dict() dict

Serializes the ResetJob into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ResetJob

Deserializes the ResetJob from a dictionary.

class databricks.sdk.service.jobs.ResetResponse
as_dict() dict

Serializes the ResetResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ResetResponse

Deserializes the ResetResponse from a dictionary.

class databricks.sdk.service.jobs.ResolvedConditionTaskValues
left: str | None = None
right: str | None = None
as_dict() dict

Serializes the ResolvedConditionTaskValues into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ResolvedConditionTaskValues

Deserializes the ResolvedConditionTaskValues from a dictionary.

class databricks.sdk.service.jobs.ResolvedDbtTaskValues
commands: List[str] | None = None
as_dict() dict

Serializes the ResolvedDbtTaskValues into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ResolvedDbtTaskValues

Deserializes the ResolvedDbtTaskValues from a dictionary.

class databricks.sdk.service.jobs.ResolvedNotebookTaskValues
base_parameters: Dict[str, str] | None = None
as_dict() dict

Serializes the ResolvedNotebookTaskValues into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ResolvedNotebookTaskValues

Deserializes the ResolvedNotebookTaskValues from a dictionary.

class databricks.sdk.service.jobs.ResolvedParamPairValues
parameters: Dict[str, str] | None = None
as_dict() dict

Serializes the ResolvedParamPairValues into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ResolvedParamPairValues

Deserializes the ResolvedParamPairValues from a dictionary.

class databricks.sdk.service.jobs.ResolvedPythonWheelTaskValues
named_parameters: Dict[str, str] | None = None
parameters: List[str] | None = None
as_dict() dict

Serializes the ResolvedPythonWheelTaskValues into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ResolvedPythonWheelTaskValues

Deserializes the ResolvedPythonWheelTaskValues from a dictionary.

class databricks.sdk.service.jobs.ResolvedRunJobTaskValues
job_parameters: Dict[str, str] | None = None
parameters: Dict[str, str] | None = None
as_dict() dict

Serializes the ResolvedRunJobTaskValues into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ResolvedRunJobTaskValues

Deserializes the ResolvedRunJobTaskValues from a dictionary.

class databricks.sdk.service.jobs.ResolvedStringParamsValues
parameters: List[str] | None = None
as_dict() dict

Serializes the ResolvedStringParamsValues into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ResolvedStringParamsValues

Deserializes the ResolvedStringParamsValues from a dictionary.

class databricks.sdk.service.jobs.ResolvedValues
condition_task: ResolvedConditionTaskValues | None = None
dbt_task: ResolvedDbtTaskValues | None = None
notebook_task: ResolvedNotebookTaskValues | None = None
python_wheel_task: ResolvedPythonWheelTaskValues | None = None
run_job_task: ResolvedRunJobTaskValues | None = None
simulation_task: ResolvedParamPairValues | None = None
spark_jar_task: ResolvedStringParamsValues | None = None
spark_python_task: ResolvedStringParamsValues | None = None
spark_submit_task: ResolvedStringParamsValues | None = None
sql_task: ResolvedParamPairValues | None = None
as_dict() dict

Serializes the ResolvedValues into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ResolvedValues

Deserializes the ResolvedValues from a dictionary.

class databricks.sdk.service.jobs.Run

Run was retrieved successfully

attempt_number: int | None = None

The sequence number of this run attempt for a triggered job run. The initial attempt of a run has an attempt_number of 0. If the initial run attempt fails, and the job has a retry policy (max_retries > 0), subsequent runs are created with an original_attempt_run_id of the original attempt’s ID and an incrementing attempt_number. Runs are retried only until they succeed, and the maximum attempt_number is the same as the max_retries value for the job.

cleanup_duration: int | None = None

The time in milliseconds it took to terminate the cluster and clean up any associated artifacts. The duration of a task run is the sum of the setup_duration, execution_duration, and the cleanup_duration. The cleanup_duration field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the run_duration field.

cluster_instance: ClusterInstance | None = None

The cluster used for this run. If the run is specified to use a new cluster, this field is set once the Jobs service has requested a cluster for the run.

cluster_spec: ClusterSpec | None = None

A snapshot of the job’s cluster specification when this run was created.

creator_user_name: str | None = None

The creator user name. This field won’t be included in the response if the user has already been deleted.

description: str | None = None

Description of the run

end_time: int | None = None

The time at which this run ended in epoch milliseconds (milliseconds since 1/1/1970 UTC). This field is set to 0 if the job is still running.

execution_duration: int | None = None

The time in milliseconds it took to execute the commands in the JAR or notebook until they completed, failed, timed out, were cancelled, or encountered an unexpected error. The duration of a task run is the sum of the setup_duration, execution_duration, and the cleanup_duration. The execution_duration field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the run_duration field.

git_source: GitSource | None = None

An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks.

If git_source is set, these tasks retrieve the file from the remote repository by default. However, this behavior can be overridden by setting source to WORKSPACE on the task.

Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, git_source must be defined on the job.

job_clusters: List[JobCluster] | None = None

A list of job cluster specifications that can be shared and reused by tasks of this job. Libraries cannot be declared in a shared job cluster. You must declare dependent libraries in task settings.

job_id: int | None = None

The canonical identifier of the job that contains this run.

job_parameters: List[JobParameter] | None = None

Job-level parameters used in the run

number_in_job: int | None = None

A unique identifier for this job run. This is set to the same value as run_id.

original_attempt_run_id: int | None = None

If this run is a retry of a prior run attempt, this field contains the run_id of the original attempt; otherwise, it is the same as the run_id.

overriding_parameters: RunParameters | None = None

The parameters used for this run.

queue_duration: int | None = None

The time in milliseconds that the run has spent in the queue.

repair_history: List[RepairHistoryItem] | None = None

The repair history of the run.

run_duration: int | None = None

The time in milliseconds it took the job run and all of its repairs to finish.

run_id: int | None = None

The canonical identifier of the run. This ID is unique across all runs of all jobs.

run_name: str | None = None

An optional name for the run. The maximum length is 4096 bytes in UTF-8 encoding.

run_page_url: str | None = None

The URL to the detail page of the run.

run_type: RunType | None = None

The type of a run. * JOB_RUN: Normal job run. A run created with :method:jobs/runNow. * WORKFLOW_RUN: Workflow run. A run created with [dbutils.notebook.run]. * SUBMIT_RUN: Submit run. A run created with :method:jobs/submit.

[dbutils.notebook.run]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-workflow

schedule: CronSchedule | None = None

The cron schedule that triggered this run if it was triggered by the periodic scheduler.

setup_duration: int | None = None

The time in milliseconds it took to set up the cluster. For runs that run on new clusters this is the cluster creation time, for runs that run on existing clusters this time should be very short. The duration of a task run is the sum of the setup_duration, execution_duration, and the cleanup_duration. The setup_duration field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the run_duration field.

start_time: int | None = None

The time at which this run was started in epoch milliseconds (milliseconds since 1/1/1970 UTC). This may not be the time when the job task starts executing, for example, if the job is scheduled to run on a new cluster, this is the time the cluster creation call is issued.

state: RunState | None = None

The current state of the run.

tasks: List[RunTask] | None = None

The list of tasks performed by the run. Each task has its own run_id which you can use to call JobsGetOutput to retrieve the run resutls.

trigger: TriggerType | None = None

The type of trigger that fired this run.

  • PERIODIC: Schedules that periodically trigger runs, such as a cron scheduler. * ONE_TIME:

One time triggers that fire a single run. This occurs you triggered a single run on demand through the UI or the API. * RETRY: Indicates a run that is triggered as a retry of a previously failed run. This occurs when you request to re-run the job in case of failures. * RUN_JOB_TASK: Indicates a run that is triggered using a Run Job task. * FILE_ARRIVAL: Indicates a run that is triggered by a file arrival. * TABLE: Indicates a run that is triggered by a table update.

trigger_info: TriggerInfo | None = None

Additional details about what triggered the run

as_dict() dict

Serializes the Run into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) Run

Deserializes the Run from a dictionary.

class databricks.sdk.service.jobs.RunConditionTask
op: ConditionTaskOp
  • EQUAL_TO, NOT_EQUAL operators perform string comparison of their operands. This means that

“12.0” == “12” will evaluate to false. * GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL operators perform numeric comparison of their operands. “12.0” >= “12” will evaluate to true, “10.0” >= “12” will evaluate to false.

The boolean comparison to task values can be implemented with operators EQUAL_TO, NOT_EQUAL. If a task value was set to a boolean value, it will be serialized to “true” or “false” for the comparison.

left: str

The left operand of the condition task. Can be either a string value or a job state or parameter reference.

right: str

The right operand of the condition task. Can be either a string value or a job state or parameter reference.

outcome: str | None = None

The condition expression evaluation result. Filled in if the task was successfully completed. Can be “true” or “false”

as_dict() dict

Serializes the RunConditionTask into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) RunConditionTask

Deserializes the RunConditionTask from a dictionary.

class databricks.sdk.service.jobs.RunForEachTask
inputs: str

Array for task to iterate on. This can be a JSON string or a reference to an array parameter.

task: Task

Configuration for the task that will be run for each element in the array

concurrency: int | None = None

Controls the number of active iterations task runs. Default is 20, maximum allowed is 100.

stats: ForEachStats | None = None

Read only field. Populated for GetRun and ListRuns RPC calls and stores the execution stats of an For each task

as_dict() dict

Serializes the RunForEachTask into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) RunForEachTask

Deserializes the RunForEachTask from a dictionary.

class databricks.sdk.service.jobs.RunIf

An optional value indicating the condition that determines whether the task should be run once its dependencies have been completed. When omitted, defaults to ALL_SUCCESS. Possible values are: * ALL_SUCCESS: All dependencies have executed and succeeded * AT_LEAST_ONE_SUCCESS: At least one dependency has succeeded * NONE_FAILED: None of the dependencies have failed and at least one was executed * ALL_DONE: All dependencies have been completed * AT_LEAST_ONE_FAILED: At least one dependency failed * ALL_FAILED: ALl dependencies have failed

ALL_DONE = "ALL_DONE"
ALL_FAILED = "ALL_FAILED"
ALL_SUCCESS = "ALL_SUCCESS"
AT_LEAST_ONE_FAILED = "AT_LEAST_ONE_FAILED"
AT_LEAST_ONE_SUCCESS = "AT_LEAST_ONE_SUCCESS"
NONE_FAILED = "NONE_FAILED"
class databricks.sdk.service.jobs.RunJobOutput
run_id: int | None = None

The run id of the triggered job run

as_dict() dict

Serializes the RunJobOutput into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) RunJobOutput

Deserializes the RunJobOutput from a dictionary.

class databricks.sdk.service.jobs.RunJobTask
job_id: int

ID of the job to trigger.

dbt_commands: List[str] | None = None

An array of commands to execute for jobs with the dbt task, for example “dbt_commands”: [“dbt deps”, “dbt seed”, “dbt deps”, “dbt seed”, “dbt run”]

jar_params: List[str] | None = None

A list of parameters for jobs with Spark JAR tasks, for example “jar_params”: [“john doe”, “35”]. The parameters are used to invoke the main function of the main class specified in the Spark JAR task. If not specified upon run-now, it defaults to an empty list. jar_params cannot be specified in conjunction with notebook_params. The JSON representation of this field (for example {“jar_params”:[“john doe”,”35”]}) cannot exceed 10,000 bytes.

Use [Task parameter variables](/jobs.html”#parameter-variables”) to set parameters containing information about job runs.

job_parameters: Dict[str, str] | None = None

Job-level parameters used to trigger the job.

notebook_params: Dict[str, str] | None = None

A map from keys to values for jobs with notebook task, for example “notebook_params”: {“name”: “john doe”, “age”: “35”}. The map is passed to the notebook and is accessible through the [dbutils.widgets.get] function.

If not specified upon run-now, the triggered run uses the job’s base parameters.

notebook_params cannot be specified in conjunction with jar_params.

Use [Task parameter variables] to set parameters containing information about job runs.

The JSON representation of this field (for example {“notebook_params”:{“name”:”john doe”,”age”:”35”}}) cannot exceed 10,000 bytes.

[Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html

pipeline_params: PipelineParams | None = None
python_named_params: Dict[str, str] | None = None

A map from keys to values for jobs with Python wheel task, for example “python_named_params”: {“name”: “task”, “data”: “dbfs:/path/to/data.json”}.

python_params: List[str] | None = None

A list of parameters for jobs with Python tasks, for example “python_params”: [“john doe”, “35”]. The parameters are passed to Python file as command-line parameters. If specified upon run-now, it would overwrite the parameters specified in job setting. The JSON representation of this field (for example {“python_params”:[“john doe”,”35”]}) cannot exceed 10,000 bytes.

Use [Task parameter variables] to set parameters containing information about job runs.

Important

These parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error. Examples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis.

[Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables

spark_submit_params: List[str] | None = None

A list of parameters for jobs with spark submit task, for example “spark_submit_params”: [”–class”, “org.apache.spark.examples.SparkPi”]. The parameters are passed to spark-submit script as command-line parameters. If specified upon run-now, it would overwrite the parameters specified in job setting. The JSON representation of this field (for example {“python_params”:[“john doe”,”35”]}) cannot exceed 10,000 bytes.

Use [Task parameter variables] to set parameters containing information about job runs

Important

These parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error. Examples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis.

[Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables

sql_params: Dict[str, str] | None = None

A map from keys to values for jobs with SQL task, for example “sql_params”: {“name”: “john doe”, “age”: “35”}. The SQL alert task does not support custom parameters.

as_dict() dict

Serializes the RunJobTask into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) RunJobTask

Deserializes the RunJobTask from a dictionary.

class databricks.sdk.service.jobs.RunLifeCycleState

A value indicating the run’s lifecycle state. The possible values are: * QUEUED: The run is queued. * PENDING: The run is waiting to be executed while the cluster and execution context are being prepared. * RUNNING: The task of this run is being executed. * TERMINATING: The task of this run has completed, and the cluster and execution context are being cleaned up. * TERMINATED: The task of this run has completed, and the cluster and execution context have been cleaned up. This state is terminal. * SKIPPED: This run was aborted because a previous run of the same job was already active. This state is terminal. * INTERNAL_ERROR: An exceptional state that indicates a failure in the Jobs service, such as network failure over a long period. If a run on a new cluster ends in the INTERNAL_ERROR state, the Jobs service terminates the cluster as soon as possible. This state is terminal. * BLOCKED: The run is blocked on an upstream dependency. * WAITING_FOR_RETRY: The run is waiting for a retry.

BLOCKED = "BLOCKED"
INTERNAL_ERROR = "INTERNAL_ERROR"
PENDING = "PENDING"
QUEUED = "QUEUED"
RUNNING = "RUNNING"
SKIPPED = "SKIPPED"
TERMINATED = "TERMINATED"
TERMINATING = "TERMINATING"
WAITING_FOR_RETRY = "WAITING_FOR_RETRY"
class databricks.sdk.service.jobs.RunNow
job_id: int

The ID of the job to be executed

dbt_commands: List[str] | None = None

An array of commands to execute for jobs with the dbt task, for example “dbt_commands”: [“dbt deps”, “dbt seed”, “dbt deps”, “dbt seed”, “dbt run”]

idempotency_token: str | None = None

An optional token to guarantee the idempotency of job run requests. If a run with the provided token already exists, the request does not create a new run but returns the ID of the existing run instead. If a run with the provided token is deleted, an error is returned.

If you specify the idempotency token, upon failure you can retry until the request succeeds. Databricks guarantees that exactly one run is launched with that idempotency token.

This token must have at most 64 characters.

For more information, see [How to ensure idempotency for jobs].

[How to ensure idempotency for jobs]: https://kb.databricks.com/jobs/jobs-idempotency.html

jar_params: List[str] | None = None

A list of parameters for jobs with Spark JAR tasks, for example “jar_params”: [“john doe”, “35”]. The parameters are used to invoke the main function of the main class specified in the Spark JAR task. If not specified upon run-now, it defaults to an empty list. jar_params cannot be specified in conjunction with notebook_params. The JSON representation of this field (for example {“jar_params”:[“john doe”,”35”]}) cannot exceed 10,000 bytes.

Use [Task parameter variables](/jobs.html”#parameter-variables”) to set parameters containing information about job runs.

job_parameters: Dict[str, str] | None = None

Job-level parameters used in the run. for example “param”: “overriding_val”

notebook_params: Dict[str, str] | None = None

A map from keys to values for jobs with notebook task, for example “notebook_params”: {“name”: “john doe”, “age”: “35”}. The map is passed to the notebook and is accessible through the [dbutils.widgets.get] function.

If not specified upon run-now, the triggered run uses the job’s base parameters.

notebook_params cannot be specified in conjunction with jar_params.

Use [Task parameter variables] to set parameters containing information about job runs.

The JSON representation of this field (for example {“notebook_params”:{“name”:”john doe”,”age”:”35”}}) cannot exceed 10,000 bytes.

[Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html

pipeline_params: PipelineParams | None = None
python_named_params: Dict[str, str] | None = None

A map from keys to values for jobs with Python wheel task, for example “python_named_params”: {“name”: “task”, “data”: “dbfs:/path/to/data.json”}.

python_params: List[str] | None = None

A list of parameters for jobs with Python tasks, for example “python_params”: [“john doe”, “35”]. The parameters are passed to Python file as command-line parameters. If specified upon run-now, it would overwrite the parameters specified in job setting. The JSON representation of this field (for example {“python_params”:[“john doe”,”35”]}) cannot exceed 10,000 bytes.

Use [Task parameter variables] to set parameters containing information about job runs.

Important

These parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error. Examples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis.

[Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables

queue: QueueSettings | None = None

The queue settings of the run.

spark_submit_params: List[str] | None = None

A list of parameters for jobs with spark submit task, for example “spark_submit_params”: [”–class”, “org.apache.spark.examples.SparkPi”]. The parameters are passed to spark-submit script as command-line parameters. If specified upon run-now, it would overwrite the parameters specified in job setting. The JSON representation of this field (for example {“python_params”:[“john doe”,”35”]}) cannot exceed 10,000 bytes.

Use [Task parameter variables] to set parameters containing information about job runs

Important

These parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error. Examples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis.

[Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables

sql_params: Dict[str, str] | None = None

A map from keys to values for jobs with SQL task, for example “sql_params”: {“name”: “john doe”, “age”: “35”}. The SQL alert task does not support custom parameters.

as_dict() dict

Serializes the RunNow into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) RunNow

Deserializes the RunNow from a dictionary.

class databricks.sdk.service.jobs.RunNowResponse

Run was started successfully.

number_in_job: int | None = None

A unique identifier for this job run. This is set to the same value as run_id.

run_id: int | None = None

The globally unique ID of the newly triggered run.

as_dict() dict

Serializes the RunNowResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) RunNowResponse

Deserializes the RunNowResponse from a dictionary.

class databricks.sdk.service.jobs.RunOutput

Run output was retrieved successfully.

dbt_output: DbtOutput | None = None

The output of a dbt task, if available.

error: str | None = None

An error message indicating why a task failed or why output is not available. The message is unstructured, and its exact format is subject to change.

error_trace: str | None = None

If there was an error executing the run, this field contains any available stack traces.

info: str | None = None
logs: str | None = None

The output from tasks that write to standard streams (stdout/stderr) such as spark_jar_task, spark_python_task, python_wheel_task.

It’s not supported for the notebook_task, pipeline_task or spark_submit_task.

Databricks restricts this API to return the last 5 MB of these logs.

logs_truncated: bool | None = None

Whether the logs are truncated.

metadata: Run | None = None

All details of the run except for its output.

notebook_output: NotebookOutput | None = None

The output of a notebook task, if available. A notebook task that terminates (either successfully or with a failure) without calling dbutils.notebook.exit() is considered to have an empty output. This field is set but its result value is empty. Databricks restricts this API to return the first 5 MB of the output. To return a larger result, use the [ClusterLogConf] field to configure log storage for the job cluster.

[ClusterLogConf]: https://docs.databricks.com/dev-tools/api/latest/clusters.html#clusterlogconf

run_job_output: RunJobOutput | None = None

The output of a run job task, if available

sql_output: SqlOutput | None = None

The output of a SQL task, if available.

as_dict() dict

Serializes the RunOutput into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) RunOutput

Deserializes the RunOutput from a dictionary.

class databricks.sdk.service.jobs.RunParameters
dbt_commands: List[str] | None = None

An array of commands to execute for jobs with the dbt task, for example “dbt_commands”: [“dbt deps”, “dbt seed”, “dbt deps”, “dbt seed”, “dbt run”]

jar_params: List[str] | None = None

A list of parameters for jobs with Spark JAR tasks, for example “jar_params”: [“john doe”, “35”]. The parameters are used to invoke the main function of the main class specified in the Spark JAR task. If not specified upon run-now, it defaults to an empty list. jar_params cannot be specified in conjunction with notebook_params. The JSON representation of this field (for example {“jar_params”:[“john doe”,”35”]}) cannot exceed 10,000 bytes.

Use [Task parameter variables](/jobs.html”#parameter-variables”) to set parameters containing information about job runs.

notebook_params: Dict[str, str] | None = None

A map from keys to values for jobs with notebook task, for example “notebook_params”: {“name”: “john doe”, “age”: “35”}. The map is passed to the notebook and is accessible through the [dbutils.widgets.get] function.

If not specified upon run-now, the triggered run uses the job’s base parameters.

notebook_params cannot be specified in conjunction with jar_params.

Use [Task parameter variables] to set parameters containing information about job runs.

The JSON representation of this field (for example {“notebook_params”:{“name”:”john doe”,”age”:”35”}}) cannot exceed 10,000 bytes.

[Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html

pipeline_params: PipelineParams | None = None
python_named_params: Dict[str, str] | None = None

A map from keys to values for jobs with Python wheel task, for example “python_named_params”: {“name”: “task”, “data”: “dbfs:/path/to/data.json”}.

python_params: List[str] | None = None

A list of parameters for jobs with Python tasks, for example “python_params”: [“john doe”, “35”]. The parameters are passed to Python file as command-line parameters. If specified upon run-now, it would overwrite the parameters specified in job setting. The JSON representation of this field (for example {“python_params”:[“john doe”,”35”]}) cannot exceed 10,000 bytes.

Use [Task parameter variables] to set parameters containing information about job runs.

Important

These parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error. Examples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis.

[Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables

spark_submit_params: List[str] | None = None

A list of parameters for jobs with spark submit task, for example “spark_submit_params”: [”–class”, “org.apache.spark.examples.SparkPi”]. The parameters are passed to spark-submit script as command-line parameters. If specified upon run-now, it would overwrite the parameters specified in job setting. The JSON representation of this field (for example {“python_params”:[“john doe”,”35”]}) cannot exceed 10,000 bytes.

Use [Task parameter variables] to set parameters containing information about job runs

Important

These parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error. Examples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis.

[Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables

sql_params: Dict[str, str] | None = None

A map from keys to values for jobs with SQL task, for example “sql_params”: {“name”: “john doe”, “age”: “35”}. The SQL alert task does not support custom parameters.

as_dict() dict

Serializes the RunParameters into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) RunParameters

Deserializes the RunParameters from a dictionary.

class databricks.sdk.service.jobs.RunResultState

A value indicating the run’s result. The possible values are: * SUCCESS: The task completed successfully. * FAILED: The task completed with an error. * TIMEDOUT: The run was stopped after reaching the timeout. * CANCELED: The run was canceled at user request. * MAXIMUM_CONCURRENT_RUNS_REACHED: The run was skipped because the maximum concurrent runs were reached. * EXCLUDED: The run was skipped because the necessary conditions were not met. * SUCCESS_WITH_FAILURES: The job run completed successfully with some failures; leaf tasks were successful. * UPSTREAM_FAILED: The run was skipped because of an upstream failure. * UPSTREAM_CANCELED: The run was skipped because an upstream task was canceled.

CANCELED = "CANCELED"
EXCLUDED = "EXCLUDED"
FAILED = "FAILED"
MAXIMUM_CONCURRENT_RUNS_REACHED = "MAXIMUM_CONCURRENT_RUNS_REACHED"
SUCCESS = "SUCCESS"
SUCCESS_WITH_FAILURES = "SUCCESS_WITH_FAILURES"
TIMEDOUT = "TIMEDOUT"
UPSTREAM_CANCELED = "UPSTREAM_CANCELED"
UPSTREAM_FAILED = "UPSTREAM_FAILED"
class databricks.sdk.service.jobs.RunState

The current state of the run.

life_cycle_state: RunLifeCycleState | None = None

A value indicating the run’s current lifecycle state. This field is always available in the response.

queue_reason: str | None = None

The reason indicating why the run was queued.

result_state: RunResultState | None = None

A value indicating the run’s result. This field is only available for terminal lifecycle states.

state_message: str | None = None

A descriptive message for the current state. This field is unstructured, and its exact format is subject to change.

user_cancelled_or_timedout: bool | None = None

A value indicating whether a run was canceled manually by a user or by the scheduler because the run timed out.

as_dict() dict

Serializes the RunState into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) RunState

Deserializes the RunState from a dictionary.

class databricks.sdk.service.jobs.RunTask

Used when outputting a child run, in GetRun or ListRuns.

task_key: str

A unique name for the task. This field is used to refer to this task from other tasks. This field is required and must be unique within its parent job. On Update or Reset, this field is used to reference the tasks to be updated or reset.

attempt_number: int | None = None

The sequence number of this run attempt for a triggered job run. The initial attempt of a run has an attempt_number of 0. If the initial run attempt fails, and the job has a retry policy (max_retries > 0), subsequent runs are created with an original_attempt_run_id of the original attempt’s ID and an incrementing attempt_number. Runs are retried only until they succeed, and the maximum attempt_number is the same as the max_retries value for the job.

cleanup_duration: int | None = None

The time in milliseconds it took to terminate the cluster and clean up any associated artifacts. The duration of a task run is the sum of the setup_duration, execution_duration, and the cleanup_duration. The cleanup_duration field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the run_duration field.

cluster_instance: ClusterInstance | None = None

The cluster used for this run. If the run is specified to use a new cluster, this field is set once the Jobs service has requested a cluster for the run.

condition_task: RunConditionTask | None = None

If condition_task, specifies a condition with an outcome that can be used to control the execution of other tasks. Does not require a cluster to execute and does not support retries or notifications.

dbt_task: DbtTask | None = None

If dbt_task, indicates that this must execute a dbt task. It requires both Databricks SQL and the ability to use a serverless or a pro SQL warehouse.

depends_on: List[TaskDependency] | None = None

An optional array of objects specifying the dependency graph of the task. All tasks specified in this field must complete successfully before executing this task. The key is task_key, and the value is the name assigned to the dependent task.

description: str | None = None

An optional description for this task.

email_notifications: JobEmailNotifications | None = None

An optional set of email addresses notified when the task run begins or completes. The default behavior is to not send any emails.

end_time: int | None = None

The time at which this run ended in epoch milliseconds (milliseconds since 1/1/1970 UTC). This field is set to 0 if the job is still running.

execution_duration: int | None = None

The time in milliseconds it took to execute the commands in the JAR or notebook until they completed, failed, timed out, were cancelled, or encountered an unexpected error. The duration of a task run is the sum of the setup_duration, execution_duration, and the cleanup_duration. The execution_duration field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the run_duration field.

existing_cluster_id: str | None = None

If existing_cluster_id, the ID of an existing cluster that is used for all runs. When running jobs or tasks on an existing cluster, you may need to manually restart the cluster if it stops responding. We suggest running jobs and tasks on new clusters for greater reliability

for_each_task: RunForEachTask | None = None

If for_each_task, indicates that this task must execute the nested task within it.

git_source: GitSource | None = None

An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks. If git_source is set, these tasks retrieve the file from the remote repository by default. However, this behavior can be overridden by setting source to WORKSPACE on the task. Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, git_source must be defined on the job.

job_cluster_key: str | None = None

If job_cluster_key, this task is executed reusing the cluster specified in job.settings.job_clusters.

libraries: List[Library] | None = None

An optional list of libraries to be installed on the cluster. The default value is an empty list.

new_cluster: ClusterSpec | None = None

If new_cluster, a description of a new cluster that is created for each run.

notebook_task: NotebookTask | None = None

If notebook_task, indicates that this task must run a notebook. This field may not be specified in conjunction with spark_jar_task.

notification_settings: TaskNotificationSettings | None = None

Optional notification settings that are used when sending notifications to each of the email_notifications and webhook_notifications for this task run.

pipeline_task: PipelineTask | None = None

If pipeline_task, indicates that this task must execute a Pipeline.

python_wheel_task: PythonWheelTask | None = None

If python_wheel_task, indicates that this job must execute a PythonWheel.

queue_duration: int | None = None

The time in milliseconds that the run has spent in the queue.

resolved_values: ResolvedValues | None = None

Parameter values including resolved references

run_duration: int | None = None

The time in milliseconds it took the job run and all of its repairs to finish.

run_id: int | None = None

The ID of the task run.

run_if: RunIf | None = None

An optional value indicating the condition that determines whether the task should be run once its dependencies have been completed. When omitted, defaults to ALL_SUCCESS. See :method:jobs/create for a list of possible values.

run_job_task: RunJobTask | None = None

If run_job_task, indicates that this task must execute another job.

run_page_url: str | None = None
setup_duration: int | None = None

The time in milliseconds it took to set up the cluster. For runs that run on new clusters this is the cluster creation time, for runs that run on existing clusters this time should be very short. The duration of a task run is the sum of the setup_duration, execution_duration, and the cleanup_duration. The setup_duration field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the run_duration field.

spark_jar_task: SparkJarTask | None = None

If spark_jar_task, indicates that this task must run a JAR.

spark_python_task: SparkPythonTask | None = None

If spark_python_task, indicates that this task must run a Python file.

spark_submit_task: SparkSubmitTask | None = None

If spark_submit_task, indicates that this task must be launched by the spark submit script. This task can run only on new clusters.

In the new_cluster specification, libraries and spark_conf are not supported. Instead, use –jars and –py-files to add Java and Python libraries and –conf to set the Spark configurations.

master, deploy-mode, and executor-cores are automatically configured by Databricks; you _cannot_ specify them in parameters.

By default, the Spark submit job uses all available memory (excluding reserved memory for Databricks services). You can set –driver-memory, and –executor-memory to a smaller value to leave some room for off-heap usage.

The –jars, –py-files, –files arguments support DBFS and S3 paths.

sql_task: SqlTask | None = None

If sql_task, indicates that this job must execute a SQL task.

start_time: int | None = None

The time at which this run was started in epoch milliseconds (milliseconds since 1/1/1970 UTC). This may not be the time when the job task starts executing, for example, if the job is scheduled to run on a new cluster, this is the time the cluster creation call is issued.

state: RunState | None = None

The current state of the run.

timeout_seconds: int | None = None

An optional timeout applied to each run of this job task. A value of 0 means no timeout.

webhook_notifications: WebhookNotifications | None = None

A collection of system notification IDs to notify when the run begins or completes. The default behavior is to not send any system notifications. Task webhooks respect the task notification settings.

as_dict() dict

Serializes the RunTask into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) RunTask

Deserializes the RunTask from a dictionary.

class databricks.sdk.service.jobs.RunType

The type of a run. * JOB_RUN: Normal job run. A run created with :method:jobs/runNow. * WORKFLOW_RUN: Workflow run. A run created with [dbutils.notebook.run]. * SUBMIT_RUN: Submit run. A run created with :method:jobs/submit. [dbutils.notebook.run]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-workflow

JOB_RUN = "JOB_RUN"
SUBMIT_RUN = "SUBMIT_RUN"
WORKFLOW_RUN = "WORKFLOW_RUN"
class databricks.sdk.service.jobs.Source

Optional location type of the SQL file. When set to WORKSPACE, the SQL file will be retrieved from the local Databricks workspace. When set to GIT, the SQL file will be retrieved from a Git repository defined in git_source. If the value is empty, the task will use GIT if git_source is defined and WORKSPACE otherwise. * WORKSPACE: SQL file is located in Databricks workspace. * GIT: SQL file is located in cloud Git provider.

GIT = "GIT"
WORKSPACE = "WORKSPACE"
class databricks.sdk.service.jobs.SparkJarTask
jar_uri: str | None = None

Deprecated since 04/2016. Provide a jar through the libraries field instead. For an example, see :method:jobs/create.

main_class_name: str | None = None

The full name of the class containing the main method to be executed. This class must be contained in a JAR provided as a library.

The code must use SparkContext.getOrCreate to obtain a Spark context; otherwise, runs of the job fail.

parameters: List[str] | None = None

Parameters passed to the main method.

Use [Task parameter variables] to set parameters containing information about job runs.

[Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables

as_dict() dict

Serializes the SparkJarTask into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SparkJarTask

Deserializes the SparkJarTask from a dictionary.

class databricks.sdk.service.jobs.SparkPythonTask
python_file: str

The Python file to be executed. Cloud file URIs (such as dbfs:/, s3:/, adls:/, gcs:/) and workspace paths are supported. For python files stored in the Databricks workspace, the path must be absolute and begin with /. For files stored in a remote repository, the path must be relative. This field is required.

parameters: List[str] | None = None

Command line parameters passed to the Python file.

Use [Task parameter variables] to set parameters containing information about job runs.

[Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables

source: Source | None = None

Optional location type of the Python file. When set to WORKSPACE or not specified, the file will be retrieved from the local Databricks workspace or cloud location (if the python_file has a URI format). When set to GIT, the Python file will be retrieved from a Git repository defined in git_source.

  • WORKSPACE: The Python file is located in a Databricks workspace or at a cloud filesystem

URI. * GIT: The Python file is located in a remote Git repository.

as_dict() dict

Serializes the SparkPythonTask into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SparkPythonTask

Deserializes the SparkPythonTask from a dictionary.

class databricks.sdk.service.jobs.SparkSubmitTask
parameters: List[str] | None = None

Command-line parameters passed to spark submit.

Use [Task parameter variables] to set parameters containing information about job runs.

[Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables

as_dict() dict

Serializes the SparkSubmitTask into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SparkSubmitTask

Deserializes the SparkSubmitTask from a dictionary.

class databricks.sdk.service.jobs.SqlAlertOutput
alert_state: SqlAlertState | None = None

The state of the SQL alert.

  • UNKNOWN: alert yet to be evaluated * OK: alert evaluated and did not fulfill trigger

conditions * TRIGGERED: alert evaluated and fulfilled trigger conditions

The link to find the output results.

query_text: str | None = None

The text of the SQL query. Can Run permission of the SQL query associated with the SQL alert is required to view this field.

sql_statements: List[SqlStatementOutput] | None = None

Information about SQL statements executed in the run.

warehouse_id: str | None = None

The canonical identifier of the SQL warehouse.

as_dict() dict

Serializes the SqlAlertOutput into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SqlAlertOutput

Deserializes the SqlAlertOutput from a dictionary.

class databricks.sdk.service.jobs.SqlAlertState

The state of the SQL alert. * UNKNOWN: alert yet to be evaluated * OK: alert evaluated and did not fulfill trigger conditions * TRIGGERED: alert evaluated and fulfilled trigger conditions

OK = "OK"
TRIGGERED = "TRIGGERED"
UNKNOWN = "UNKNOWN"
class databricks.sdk.service.jobs.SqlDashboardOutput
warehouse_id: str | None = None

The canonical identifier of the SQL warehouse.

widgets: List[SqlDashboardWidgetOutput] | None = None

Widgets executed in the run. Only SQL query based widgets are listed.

as_dict() dict

Serializes the SqlDashboardOutput into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SqlDashboardOutput

Deserializes the SqlDashboardOutput from a dictionary.

class databricks.sdk.service.jobs.SqlDashboardWidgetOutput
end_time: int | None = None

Time (in epoch milliseconds) when execution of the SQL widget ends.

error: SqlOutputError | None = None

The information about the error when execution fails.

The link to find the output results.

start_time: int | None = None

Time (in epoch milliseconds) when execution of the SQL widget starts.

status: SqlDashboardWidgetOutputStatus | None = None

The execution status of the SQL widget.

widget_id: str | None = None

The canonical identifier of the SQL widget.

widget_title: str | None = None

The title of the SQL widget.

as_dict() dict

Serializes the SqlDashboardWidgetOutput into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SqlDashboardWidgetOutput

Deserializes the SqlDashboardWidgetOutput from a dictionary.

class databricks.sdk.service.jobs.SqlDashboardWidgetOutputStatus
CANCELLED = "CANCELLED"
FAILED = "FAILED"
PENDING = "PENDING"
RUNNING = "RUNNING"
SUCCESS = "SUCCESS"
class databricks.sdk.service.jobs.SqlOutput
alert_output: SqlAlertOutput | None = None

The output of a SQL alert task, if available.

dashboard_output: SqlDashboardOutput | None = None

The output of a SQL dashboard task, if available.

query_output: SqlQueryOutput | None = None

The output of a SQL query task, if available.

as_dict() dict

Serializes the SqlOutput into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SqlOutput

Deserializes the SqlOutput from a dictionary.

class databricks.sdk.service.jobs.SqlOutputError
message: str | None = None

The error message when execution fails.

as_dict() dict

Serializes the SqlOutputError into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SqlOutputError

Deserializes the SqlOutputError from a dictionary.

class databricks.sdk.service.jobs.SqlQueryOutput
endpoint_id: str | None = None

The link to find the output results.

query_text: str | None = None

The text of the SQL query. Can Run permission of the SQL query is required to view this field.

sql_statements: List[SqlStatementOutput] | None = None

Information about SQL statements executed in the run.

warehouse_id: str | None = None

The canonical identifier of the SQL warehouse.

as_dict() dict

Serializes the SqlQueryOutput into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SqlQueryOutput

Deserializes the SqlQueryOutput from a dictionary.

class databricks.sdk.service.jobs.SqlStatementOutput
lookup_key: str | None = None

A key that can be used to look up query details.

as_dict() dict

Serializes the SqlStatementOutput into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SqlStatementOutput

Deserializes the SqlStatementOutput from a dictionary.

class databricks.sdk.service.jobs.SqlTask
warehouse_id: str

The canonical identifier of the SQL warehouse. Recommended to use with serverless or pro SQL warehouses. Classic SQL warehouses are only supported for SQL alert, dashboard and query tasks and are limited to scheduled single-task jobs.

alert: SqlTaskAlert | None = None

If alert, indicates that this job must refresh a SQL alert.

dashboard: SqlTaskDashboard | None = None

If dashboard, indicates that this job must refresh a SQL dashboard.

file: SqlTaskFile | None = None

If file, indicates that this job runs a SQL file in a remote Git repository.

parameters: Dict[str, str] | None = None

Parameters to be used for each run of this job. The SQL alert task does not support custom parameters.

query: SqlTaskQuery | None = None

If query, indicates that this job must execute a SQL query.

as_dict() dict

Serializes the SqlTask into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SqlTask

Deserializes the SqlTask from a dictionary.

class databricks.sdk.service.jobs.SqlTaskAlert
alert_id: str

The canonical identifier of the SQL alert.

pause_subscriptions: bool | None = None

If true, the alert notifications are not sent to subscribers.

subscriptions: List[SqlTaskSubscription] | None = None

If specified, alert notifications are sent to subscribers.

as_dict() dict

Serializes the SqlTaskAlert into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SqlTaskAlert

Deserializes the SqlTaskAlert from a dictionary.

class databricks.sdk.service.jobs.SqlTaskDashboard
dashboard_id: str

The canonical identifier of the SQL dashboard.

custom_subject: str | None = None

Subject of the email sent to subscribers of this task.

pause_subscriptions: bool | None = None

If true, the dashboard snapshot is not taken, and emails are not sent to subscribers.

subscriptions: List[SqlTaskSubscription] | None = None

If specified, dashboard snapshots are sent to subscriptions.

as_dict() dict

Serializes the SqlTaskDashboard into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SqlTaskDashboard

Deserializes the SqlTaskDashboard from a dictionary.

class databricks.sdk.service.jobs.SqlTaskFile
path: str

Path of the SQL file. Must be relative if the source is a remote Git repository and absolute for workspace paths.

source: Source | None = None

Optional location type of the SQL file. When set to WORKSPACE, the SQL file will be retrieved from the local Databricks workspace. When set to GIT, the SQL file will be retrieved from a Git repository defined in git_source. If the value is empty, the task will use GIT if git_source is defined and WORKSPACE otherwise.

  • WORKSPACE: SQL file is located in Databricks workspace. * GIT: SQL file is located in

cloud Git provider.

as_dict() dict

Serializes the SqlTaskFile into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SqlTaskFile

Deserializes the SqlTaskFile from a dictionary.

class databricks.sdk.service.jobs.SqlTaskQuery
query_id: str

The canonical identifier of the SQL query.

as_dict() dict

Serializes the SqlTaskQuery into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SqlTaskQuery

Deserializes the SqlTaskQuery from a dictionary.

class databricks.sdk.service.jobs.SqlTaskSubscription
destination_id: str | None = None

The canonical identifier of the destination to receive email notification. This parameter is mutually exclusive with user_name. You cannot set both destination_id and user_name for subscription notifications.

user_name: str | None = None

The user name to receive the subscription email. This parameter is mutually exclusive with destination_id. You cannot set both destination_id and user_name for subscription notifications.

as_dict() dict

Serializes the SqlTaskSubscription into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SqlTaskSubscription

Deserializes the SqlTaskSubscription from a dictionary.

class databricks.sdk.service.jobs.SubmitRun
access_control_list: List[AccessControlRequest] | None = None

List of permissions to set on the job.

condition_task: ConditionTask | None = None

If condition_task, specifies a condition with an outcome that can be used to control the execution of other tasks. Does not require a cluster to execute and does not support retries or notifications.

dbt_task: DbtTask | None = None

If dbt_task, indicates that this must execute a dbt task. It requires both Databricks SQL and the ability to use a serverless or a pro SQL warehouse.

email_notifications: JobEmailNotifications | None = None

An optional set of email addresses notified when the run begins or completes.

git_source: GitSource | None = None

An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks.

If git_source is set, these tasks retrieve the file from the remote repository by default. However, this behavior can be overridden by setting source to WORKSPACE on the task.

Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, git_source must be defined on the job.

health: JobsHealthRules | None = None

An optional set of health rules that can be defined for this job.

idempotency_token: str | None = None

An optional token that can be used to guarantee the idempotency of job run requests. If a run with the provided token already exists, the request does not create a new run but returns the ID of the existing run instead. If a run with the provided token is deleted, an error is returned.

If you specify the idempotency token, upon failure you can retry until the request succeeds. Databricks guarantees that exactly one run is launched with that idempotency token.

This token must have at most 64 characters.

For more information, see [How to ensure idempotency for jobs].

[How to ensure idempotency for jobs]: https://kb.databricks.com/jobs/jobs-idempotency.html

notebook_task: NotebookTask | None = None

If notebook_task, indicates that this task must run a notebook. This field may not be specified in conjunction with spark_jar_task.

notification_settings: JobNotificationSettings | None = None

Optional notification settings that are used when sending notifications to each of the email_notifications and webhook_notifications for this run.

pipeline_task: PipelineTask | None = None

If pipeline_task, indicates that this task must execute a Pipeline.

python_wheel_task: PythonWheelTask | None = None

If python_wheel_task, indicates that this job must execute a PythonWheel.

queue: QueueSettings | None = None

The queue settings of the one-time run.

run_as: JobRunAs | None = None

Specifies the user or service principal that the job runs as. If not specified, the job runs as the user who submits the request.

run_job_task: RunJobTask | None = None

If run_job_task, indicates that this task must execute another job.

run_name: str | None = None

An optional name for the run. The default value is Untitled.

spark_jar_task: SparkJarTask | None = None

If spark_jar_task, indicates that this task must run a JAR.

spark_python_task: SparkPythonTask | None = None

If spark_python_task, indicates that this task must run a Python file.

spark_submit_task: SparkSubmitTask | None = None

If spark_submit_task, indicates that this task must be launched by the spark submit script. This task can run only on new clusters.

In the new_cluster specification, libraries and spark_conf are not supported. Instead, use –jars and –py-files to add Java and Python libraries and –conf to set the Spark configurations.

master, deploy-mode, and executor-cores are automatically configured by Databricks; you _cannot_ specify them in parameters.

By default, the Spark submit job uses all available memory (excluding reserved memory for Databricks services). You can set –driver-memory, and –executor-memory to a smaller value to leave some room for off-heap usage.

The –jars, –py-files, –files arguments support DBFS and S3 paths.

sql_task: SqlTask | None = None

If sql_task, indicates that this job must execute a SQL task.

tasks: List[SubmitTask] | None = None
timeout_seconds: int | None = None

An optional timeout applied to each run of this job. A value of 0 means no timeout.

webhook_notifications: WebhookNotifications | None = None

A collection of system notification IDs to notify when the run begins or completes.

as_dict() dict

Serializes the SubmitRun into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SubmitRun

Deserializes the SubmitRun from a dictionary.

class databricks.sdk.service.jobs.SubmitRunResponse

Run was created and started successfully.

run_id: int | None = None

The canonical identifier for the newly submitted run.

as_dict() dict

Serializes the SubmitRunResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SubmitRunResponse

Deserializes the SubmitRunResponse from a dictionary.

class databricks.sdk.service.jobs.SubmitTask
task_key: str

A unique name for the task. This field is used to refer to this task from other tasks. This field is required and must be unique within its parent job. On Update or Reset, this field is used to reference the tasks to be updated or reset.

condition_task: ConditionTask | None = None

If condition_task, specifies a condition with an outcome that can be used to control the execution of other tasks. Does not require a cluster to execute and does not support retries or notifications.

depends_on: List[TaskDependency] | None = None

An optional array of objects specifying the dependency graph of the task. All tasks specified in this field must complete successfully before executing this task. The key is task_key, and the value is the name assigned to the dependent task.

description: str | None = None

An optional description for this task.

email_notifications: JobEmailNotifications | None = None

An optional set of email addresses notified when the task run begins or completes. The default behavior is to not send any emails.

existing_cluster_id: str | None = None

If existing_cluster_id, the ID of an existing cluster that is used for all runs. When running jobs or tasks on an existing cluster, you may need to manually restart the cluster if it stops responding. We suggest running jobs and tasks on new clusters for greater reliability

for_each_task: ForEachTask | None = None

If for_each_task, indicates that this task must execute the nested task within it.

health: JobsHealthRules | None = None

An optional set of health rules that can be defined for this job.

libraries: List[Library] | None = None

An optional list of libraries to be installed on the cluster. The default value is an empty list.

new_cluster: ClusterSpec | None = None

If new_cluster, a description of a new cluster that is created for each run.

notebook_task: NotebookTask | None = None

If notebook_task, indicates that this task must run a notebook. This field may not be specified in conjunction with spark_jar_task.

notification_settings: TaskNotificationSettings | None = None

Optional notification settings that are used when sending notifications to each of the email_notifications and webhook_notifications for this task run.

pipeline_task: PipelineTask | None = None

If pipeline_task, indicates that this task must execute a Pipeline.

python_wheel_task: PythonWheelTask | None = None

If python_wheel_task, indicates that this job must execute a PythonWheel.

run_if: RunIf | None = None

An optional value indicating the condition that determines whether the task should be run once its dependencies have been completed. When omitted, defaults to ALL_SUCCESS. See :method:jobs/create for a list of possible values.

run_job_task: RunJobTask | None = None

If run_job_task, indicates that this task must execute another job.

spark_jar_task: SparkJarTask | None = None

If spark_jar_task, indicates that this task must run a JAR.

spark_python_task: SparkPythonTask | None = None

If spark_python_task, indicates that this task must run a Python file.

spark_submit_task: SparkSubmitTask | None = None

If spark_submit_task, indicates that this task must be launched by the spark submit script. This task can run only on new clusters.

In the new_cluster specification, libraries and spark_conf are not supported. Instead, use –jars and –py-files to add Java and Python libraries and –conf to set the Spark configurations.

master, deploy-mode, and executor-cores are automatically configured by Databricks; you _cannot_ specify them in parameters.

By default, the Spark submit job uses all available memory (excluding reserved memory for Databricks services). You can set –driver-memory, and –executor-memory to a smaller value to leave some room for off-heap usage.

The –jars, –py-files, –files arguments support DBFS and S3 paths.

sql_task: SqlTask | None = None

If sql_task, indicates that this job must execute a SQL task.

timeout_seconds: int | None = None

An optional timeout applied to each run of this job task. A value of 0 means no timeout.

webhook_notifications: WebhookNotifications | None = None

A collection of system notification IDs to notify when the run begins or completes. The default behavior is to not send any system notifications. Task webhooks respect the task notification settings.

as_dict() dict

Serializes the SubmitTask into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) SubmitTask

Deserializes the SubmitTask from a dictionary.

class databricks.sdk.service.jobs.TableUpdateTriggerConfiguration
condition: Condition | None = None

The table(s) condition based on which to trigger a job run.

min_time_between_triggers_seconds: int | None = None

If set, the trigger starts a run only after the specified amount of time has passed since the last time the trigger fired. The minimum allowed value is 60 seconds.

table_names: List[str] | None = None

A list of Delta tables to monitor for changes. The table name must be in the format catalog_name.schema_name.table_name.

wait_after_last_change_seconds: int | None = None

If set, the trigger starts a run only after no table updates have occurred for the specified time and can be used to wait for a series of table updates before triggering a run. The minimum allowed value is 60 seconds.

as_dict() dict

Serializes the TableUpdateTriggerConfiguration into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) TableUpdateTriggerConfiguration

Deserializes the TableUpdateTriggerConfiguration from a dictionary.

class databricks.sdk.service.jobs.Task
task_key: str

A unique name for the task. This field is used to refer to this task from other tasks. This field is required and must be unique within its parent job. On Update or Reset, this field is used to reference the tasks to be updated or reset.

condition_task: ConditionTask | None = None

If condition_task, specifies a condition with an outcome that can be used to control the execution of other tasks. Does not require a cluster to execute and does not support retries or notifications.

dbt_task: DbtTask | None = None

If dbt_task, indicates that this must execute a dbt task. It requires both Databricks SQL and the ability to use a serverless or a pro SQL warehouse.

depends_on: List[TaskDependency] | None = None

An optional array of objects specifying the dependency graph of the task. All tasks specified in this field must complete before executing this task. The task will run only if the run_if condition is true. The key is task_key, and the value is the name assigned to the dependent task.

description: str | None = None

An optional description for this task.

disable_auto_optimization: bool | None = None

An option to disable auto optimization in serverless

email_notifications: TaskEmailNotifications | None = None

An optional set of email addresses that is notified when runs of this task begin or complete as well as when this task is deleted. The default behavior is to not send any emails.

environment_key: str | None = None

The key that references an environment spec in a job. This field is required for Python script, Python wheel and dbt tasks when using serverless compute.

existing_cluster_id: str | None = None

If existing_cluster_id, the ID of an existing cluster that is used for all runs. When running jobs or tasks on an existing cluster, you may need to manually restart the cluster if it stops responding. We suggest running jobs and tasks on new clusters for greater reliability

for_each_task: ForEachTask | None = None

If for_each_task, indicates that this task must execute the nested task within it.

health: JobsHealthRules | None = None

An optional set of health rules that can be defined for this job.

job_cluster_key: str | None = None

If job_cluster_key, this task is executed reusing the cluster specified in job.settings.job_clusters.

libraries: List[Library] | None = None

An optional list of libraries to be installed on the cluster. The default value is an empty list.

max_retries: int | None = None

An optional maximum number of times to retry an unsuccessful run. A run is considered to be unsuccessful if it completes with the FAILED result_state or INTERNAL_ERROR life_cycle_state. The value -1 means to retry indefinitely and the value 0 means to never retry.

min_retry_interval_millis: int | None = None

An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried.

new_cluster: ClusterSpec | None = None

If new_cluster, a description of a new cluster that is created for each run.

notebook_task: NotebookTask | None = None

If notebook_task, indicates that this task must run a notebook. This field may not be specified in conjunction with spark_jar_task.

notification_settings: TaskNotificationSettings | None = None

Optional notification settings that are used when sending notifications to each of the email_notifications and webhook_notifications for this task.

pipeline_task: PipelineTask | None = None

If pipeline_task, indicates that this task must execute a Pipeline.

python_wheel_task: PythonWheelTask | None = None

If python_wheel_task, indicates that this job must execute a PythonWheel.

retry_on_timeout: bool | None = None

An optional policy to specify whether to retry a job when it times out. The default behavior is to not retry on timeout.

run_if: RunIf | None = None

An optional value specifying the condition determining whether the task is run once its dependencies have been completed.

  • ALL_SUCCESS: All dependencies have executed and succeeded * AT_LEAST_ONE_SUCCESS: At least

one dependency has succeeded * NONE_FAILED: None of the dependencies have failed and at least one was executed * ALL_DONE: All dependencies have been completed * AT_LEAST_ONE_FAILED: At least one dependency failed * ALL_FAILED: ALl dependencies have failed

run_job_task: RunJobTask | None = None

If run_job_task, indicates that this task must execute another job.

spark_jar_task: SparkJarTask | None = None

If spark_jar_task, indicates that this task must run a JAR.

spark_python_task: SparkPythonTask | None = None

If spark_python_task, indicates that this task must run a Python file.

spark_submit_task: SparkSubmitTask | None = None

If spark_submit_task, indicates that this task must be launched by the spark submit script. This task can run only on new clusters.

In the new_cluster specification, libraries and spark_conf are not supported. Instead, use –jars and –py-files to add Java and Python libraries and –conf to set the Spark configurations.

master, deploy-mode, and executor-cores are automatically configured by Databricks; you _cannot_ specify them in parameters.

By default, the Spark submit job uses all available memory (excluding reserved memory for Databricks services). You can set –driver-memory, and –executor-memory to a smaller value to leave some room for off-heap usage.

The –jars, –py-files, –files arguments support DBFS and S3 paths.

sql_task: SqlTask | None = None

If sql_task, indicates that this job must execute a SQL task.

timeout_seconds: int | None = None

An optional timeout applied to each run of this job task. A value of 0 means no timeout.

webhook_notifications: WebhookNotifications | None = None

A collection of system notification IDs to notify when runs of this task begin or complete. The default behavior is to not send any system notifications.

as_dict() dict

Serializes the Task into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) Task

Deserializes the Task from a dictionary.

class databricks.sdk.service.jobs.TaskDependency
task_key: str

The name of the task this task depends on.

outcome: str | None = None

Can only be specified on condition task dependencies. The outcome of the dependent task that must be met for this task to run.

as_dict() dict

Serializes the TaskDependency into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) TaskDependency

Deserializes the TaskDependency from a dictionary.

class databricks.sdk.service.jobs.TaskEmailNotifications
no_alert_for_skipped_runs: bool | None = None

If true, do not send email to recipients specified in on_failure if the run is skipped.

on_duration_warning_threshold_exceeded: List[str] | None = None

A list of email addresses to be notified when the duration of a run exceeds the threshold specified for the RUN_DURATION_SECONDS metric in the health field. If no rule for the RUN_DURATION_SECONDS metric is specified in the health field for the job, notifications are not sent.

on_failure: List[str] | None = None

A list of email addresses to be notified when a run unsuccessfully completes. A run is considered to have completed unsuccessfully if it ends with an INTERNAL_ERROR life_cycle_state or a FAILED, or TIMED_OUT result_state. If this is not specified on job creation, reset, or update the list is empty, and notifications are not sent.

on_start: List[str] | None = None

A list of email addresses to be notified when a run begins. If not specified on job creation, reset, or update, the list is empty, and notifications are not sent.

on_success: List[str] | None = None

A list of email addresses to be notified when a run successfully completes. A run is considered to have completed successfully if it ends with a TERMINATED life_cycle_state and a SUCCESS result_state. If not specified on job creation, reset, or update, the list is empty, and notifications are not sent.

as_dict() dict

Serializes the TaskEmailNotifications into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) TaskEmailNotifications

Deserializes the TaskEmailNotifications from a dictionary.

class databricks.sdk.service.jobs.TaskNotificationSettings
alert_on_last_attempt: bool | None = None

If true, do not send notifications to recipients specified in on_start for the retried runs and do not send notifications to recipients specified in on_failure until the last retry of the run.

no_alert_for_canceled_runs: bool | None = None

If true, do not send notifications to recipients specified in on_failure if the run is canceled.

no_alert_for_skipped_runs: bool | None = None

If true, do not send notifications to recipients specified in on_failure if the run is skipped.

as_dict() dict

Serializes the TaskNotificationSettings into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) TaskNotificationSettings

Deserializes the TaskNotificationSettings from a dictionary.

class databricks.sdk.service.jobs.TriggerInfo

Additional details about what triggered the run

run_id: int | None = None

The run id of the Run Job task run

as_dict() dict

Serializes the TriggerInfo into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) TriggerInfo

Deserializes the TriggerInfo from a dictionary.

class databricks.sdk.service.jobs.TriggerSettings
file_arrival: FileArrivalTriggerConfiguration | None = None

File arrival trigger settings.

pause_status: PauseStatus | None = None

Whether this trigger is paused or not.

table: TableUpdateTriggerConfiguration | None = None

Old table trigger settings name. Deprecated in favor of table_update.

table_update: TableUpdateTriggerConfiguration | None = None
as_dict() dict

Serializes the TriggerSettings into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) TriggerSettings

Deserializes the TriggerSettings from a dictionary.

class databricks.sdk.service.jobs.TriggerType

The type of trigger that fired this run. * PERIODIC: Schedules that periodically trigger runs, such as a cron scheduler. * ONE_TIME: One time triggers that fire a single run. This occurs you triggered a single run on demand through the UI or the API. * RETRY: Indicates a run that is triggered as a retry of a previously failed run. This occurs when you request to re-run the job in case of failures. * RUN_JOB_TASK: Indicates a run that is triggered using a Run Job task. * FILE_ARRIVAL: Indicates a run that is triggered by a file arrival. * TABLE: Indicates a run that is triggered by a table update.

FILE_ARRIVAL = "FILE_ARRIVAL"
ONE_TIME = "ONE_TIME"
PERIODIC = "PERIODIC"
RETRY = "RETRY"
RUN_JOB_TASK = "RUN_JOB_TASK"
TABLE = "TABLE"
class databricks.sdk.service.jobs.UpdateJob
job_id: int

The canonical identifier of the job to update. This field is required.

fields_to_remove: List[str] | None = None

Remove top-level fields in the job settings. Removing nested fields is not supported, except for tasks and job clusters (tasks/task_1). This field is optional.

new_settings: JobSettings | None = None

The new settings for the job.

Top-level fields specified in new_settings are completely replaced, except for arrays which are merged. That is, new and existing entries are completely replaced based on the respective key fields, i.e. task_key or job_cluster_key, while previous entries are kept.

Partially updating nested fields is not supported.

Changes to the field JobSettings.timeout_seconds are applied to active runs. Changes to other fields are applied to future runs only.

as_dict() dict

Serializes the UpdateJob into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) UpdateJob

Deserializes the UpdateJob from a dictionary.

class databricks.sdk.service.jobs.UpdateResponse
as_dict() dict

Serializes the UpdateResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) UpdateResponse

Deserializes the UpdateResponse from a dictionary.

class databricks.sdk.service.jobs.ViewItem
content: str | None = None

Content of the view.

name: str | None = None

Name of the view item. In the case of code view, it would be the notebook’s name. In the case of dashboard view, it would be the dashboard’s name.

type: ViewType | None = None

Type of the view item.

as_dict() dict

Serializes the ViewItem into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) ViewItem

Deserializes the ViewItem from a dictionary.

class databricks.sdk.service.jobs.ViewType
  • NOTEBOOK: Notebook view item. * DASHBOARD: Dashboard view item.

DASHBOARD = "DASHBOARD"
NOTEBOOK = "NOTEBOOK"
class databricks.sdk.service.jobs.ViewsToExport
  • CODE: Code view of the notebook. * DASHBOARDS: All dashboard views of the notebook. * ALL: All views of the notebook.

ALL = "ALL"
CODE = "CODE"
DASHBOARDS = "DASHBOARDS"
class databricks.sdk.service.jobs.Webhook
id: str
as_dict() dict

Serializes the Webhook into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) Webhook

Deserializes the Webhook from a dictionary.

class databricks.sdk.service.jobs.WebhookNotifications
on_duration_warning_threshold_exceeded: List[Webhook] | None = None

An optional list of system notification IDs to call when the duration of a run exceeds the threshold specified for the RUN_DURATION_SECONDS metric in the health field. A maximum of 3 destinations can be specified for the on_duration_warning_threshold_exceeded property.

on_failure: List[Webhook] | None = None

An optional list of system notification IDs to call when the run fails. A maximum of 3 destinations can be specified for the on_failure property.

on_start: List[Webhook] | None = None

An optional list of system notification IDs to call when the run starts. A maximum of 3 destinations can be specified for the on_start property.

on_success: List[Webhook] | None = None

An optional list of system notification IDs to call when the run completes successfully. A maximum of 3 destinations can be specified for the on_success property.

as_dict() dict

Serializes the WebhookNotifications into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) WebhookNotifications

Deserializes the WebhookNotifications from a dictionary.