Documentation
¶
Overview ¶
These APIs allow you to manage Jobs, Policy Compliance For Jobs, etc.
Index ¶
- type AlertEvaluationState
- type AlertTask
- type AlertTaskOutput
- type AlertTaskSubscriber
- type AuthenticationMethod
- type BaseJob
- type BaseRun
- type CancelAllRuns
- type CancelRun
- type CleanRoomTaskRunLifeCycleState
- type CleanRoomTaskRunResultState
- type CleanRoomTaskRunState
- type CleanRoomsNotebookTask
- type CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput
- type ClusterInstance
- type ClusterSpec
- type Compute
- type ComputeConfig
- type Condition
- type ConditionTask
- type ConditionTaskOp
- type Continuous
- type CreateJob
- type CreateResponse
- type CronSchedule
- type DashboardPageSnapshot
- type DashboardTask
- type DashboardTaskOutput
- type DbtCloudJobRunStep
- type DbtCloudTask
- type DbtCloudTaskOutput
- type DbtOutput
- type DbtPlatformJobRunStep
- type DbtPlatformRunStatus
- type DbtPlatformTask
- type DbtPlatformTaskOutput
- type DbtTask
- type DeleteJob
- type DeleteRun
- type EnforcePolicyComplianceForJobResponseJobClusterSettingsChange
- type EnforcePolicyComplianceRequest
- type EnforcePolicyComplianceResponse
- type ExportRunOutput
- type ExportRunRequest
- type FileArrivalTriggerConfiguration
- type FileArrivalTriggerState
- type ForEachStats
- type ForEachTask
- type ForEachTaskErrorMessageStats
- type ForEachTaskTaskRunStats
- type Format
- type GenAiComputeTask
- type GetJobPermissionLevelsRequest
- type GetJobPermissionLevelsResponse
- type GetJobPermissionsRequest
- type GetJobRequest
- type GetPolicyComplianceRequest
- type GetPolicyComplianceResponse
- type GetRunOutputRequest
- type GetRunRequest
- type GitProvider
- type GitSnapshot
- type GitSource
- type Job
- type JobAccessControlRequest
- type JobAccessControlResponse
- type JobCluster
- type JobCompliance
- type JobDeployment
- type JobDeploymentKind
- type JobEditMode
- type JobEmailNotifications
- type JobEnvironment
- type JobNotificationSettings
- type JobParameter
- type JobParameterDefinition
- type JobPermission
- type JobPermissionLevel
- type JobPermissions
- type JobPermissionsDescription
- type JobPermissionsRequest
- type JobRunAs
- type JobSettings
- type JobSource
- type JobSourceDirtyState
- type JobsAPI
- func (a *JobsAPI) BaseJobSettingsNameToJobIdMap(ctx context.Context, request ListJobsRequest) (map[string]int64, error)
- func (a *JobsAPI) CancelAllRuns(ctx context.Context, request CancelAllRuns) error
- func (a *JobsAPI) CancelRun(ctx context.Context, cancelRun CancelRun) (*WaitGetRunJobTerminatedOrSkipped[struct{}], error)
- func (a *JobsAPI) CancelRunAndWait(ctx context.Context, cancelRun CancelRun, options ...retries.Option[Run]) (*Run, error)deprecated
- func (a *JobsAPI) CancelRunByRunId(ctx context.Context, runId int64) error
- func (a *JobsAPI) CancelRunByRunIdAndWait(ctx context.Context, runId int64, options ...retries.Option[Run]) (*Run, error)
- func (a *JobsAPI) Create(ctx context.Context, request CreateJob) (*CreateResponse, error)
- func (a *JobsAPI) Delete(ctx context.Context, request DeleteJob) error
- func (a *JobsAPI) DeleteByJobId(ctx context.Context, jobId int64) error
- func (a *JobsAPI) DeleteRun(ctx context.Context, request DeleteRun) error
- func (a *JobsAPI) DeleteRunByRunId(ctx context.Context, runId int64) error
- func (a *JobsAPI) ExportRun(ctx context.Context, request ExportRunRequest) (*ExportRunOutput, error)
- func (a *JobsAPI) Get(ctx context.Context, request GetJobRequest) (*Job, error)
- func (a *JobsAPI) GetByJobId(ctx context.Context, jobId int64) (*Job, error)
- func (a *JobsAPI) GetBySettingsName(ctx context.Context, name string) (*BaseJob, error)
- func (a *JobsAPI) GetPermissionLevels(ctx context.Context, request GetJobPermissionLevelsRequest) (*GetJobPermissionLevelsResponse, error)
- func (a *JobsAPI) GetPermissionLevelsByJobId(ctx context.Context, jobId string) (*GetJobPermissionLevelsResponse, error)
- func (a *JobsAPI) GetPermissions(ctx context.Context, request GetJobPermissionsRequest) (*JobPermissions, error)
- func (a *JobsAPI) GetPermissionsByJobId(ctx context.Context, jobId string) (*JobPermissions, error)
- func (a *JobsAPI) GetRun(ctx context.Context, request GetRunRequest) (*Run, error)
- func (a *JobsAPI) GetRunOutput(ctx context.Context, request GetRunOutputRequest) (*RunOutput, error)
- func (a *JobsAPI) GetRunOutputByRunId(ctx context.Context, runId int64) (*RunOutput, error)
- func (a *JobsAPI) List(ctx context.Context, request ListJobsRequest) listing.Iterator[BaseJob]
- func (a *JobsAPI) ListAll(ctx context.Context, request ListJobsRequest) ([]BaseJob, error)
- func (a *JobsAPI) ListRuns(ctx context.Context, request ListRunsRequest) listing.Iterator[BaseRun]
- func (a *JobsAPI) ListRunsAll(ctx context.Context, request ListRunsRequest) ([]BaseRun, error)
- func (a *JobsAPI) RepairRun(ctx context.Context, repairRun RepairRun) (*WaitGetRunJobTerminatedOrSkipped[RepairRunResponse], error)
- func (a *JobsAPI) RepairRunAndWait(ctx context.Context, repairRun RepairRun, options ...retries.Option[Run]) (*Run, error)deprecated
- func (a *JobsAPI) Reset(ctx context.Context, request ResetJob) error
- func (a *JobsAPI) RunNow(ctx context.Context, runNow RunNow) (*WaitGetRunJobTerminatedOrSkipped[RunNowResponse], error)
- func (a *JobsAPI) RunNowAndWait(ctx context.Context, runNow RunNow, options ...retries.Option[Run]) (*Run, error)deprecated
- func (a *JobsAPI) SetPermissions(ctx context.Context, request JobPermissionsRequest) (*JobPermissions, error)
- func (a *JobsAPI) Submit(ctx context.Context, submitRun SubmitRun) (*WaitGetRunJobTerminatedOrSkipped[SubmitRunResponse], error)
- func (a *JobsAPI) SubmitAndWait(ctx context.Context, submitRun SubmitRun, options ...retries.Option[Run]) (*Run, error)deprecated
- func (a *JobsAPI) Update(ctx context.Context, request UpdateJob) error
- func (a *JobsAPI) UpdatePermissions(ctx context.Context, request JobPermissionsRequest) (*JobPermissions, error)
- func (a *JobsAPI) WaitGetRunJobTerminatedOrSkipped(ctx context.Context, runId int64, timeout time.Duration, callback func(*Run)) (*Run, error)
- type JobsHealthMetric
- type JobsHealthOperator
- type JobsHealthRule
- type JobsHealthRules
- type JobsInterface
- type JobsServicedeprecated
- type ListJobComplianceForPolicyResponse
- type ListJobComplianceRequest
- type ListJobsRequest
- type ListJobsResponse
- type ListRunsRequest
- type ListRunsResponse
- type ModelTriggerConfiguration
- type ModelTriggerConfigurationCondition
- type NotebookOutput
- type NotebookTask
- type OutputSchemaInfo
- type PauseStatus
- type PerformanceTarget
- type PeriodicTriggerConfiguration
- type PeriodicTriggerConfigurationTimeUnit
- type PipelineParams
- type PipelineTask
- type PolicyComplianceForJobsAPI
- func (a *PolicyComplianceForJobsAPI) EnforceCompliance(ctx context.Context, request EnforcePolicyComplianceRequest) (*EnforcePolicyComplianceResponse, error)
- func (a *PolicyComplianceForJobsAPI) GetCompliance(ctx context.Context, request GetPolicyComplianceRequest) (*GetPolicyComplianceResponse, error)
- func (a *PolicyComplianceForJobsAPI) GetComplianceByJobId(ctx context.Context, jobId int64) (*GetPolicyComplianceResponse, error)
- func (a *PolicyComplianceForJobsAPI) ListCompliance(ctx context.Context, request ListJobComplianceRequest) listing.Iterator[JobCompliance]
- func (a *PolicyComplianceForJobsAPI) ListComplianceAll(ctx context.Context, request ListJobComplianceRequest) ([]JobCompliance, error)
- type PolicyComplianceForJobsInterface
- type PolicyComplianceForJobsServicedeprecated
- type PowerBiModel
- type PowerBiTable
- type PowerBiTask
- type PythonWheelTask
- type QueueDetails
- type QueueDetailsCodeCode
- type QueueSettings
- type RepairHistoryItem
- type RepairHistoryItemType
- type RepairRun
- type RepairRunResponse
- type ResetJob
- type ResolvedConditionTaskValues
- type ResolvedDbtTaskValues
- type ResolvedNotebookTaskValues
- type ResolvedParamPairValues
- type ResolvedPythonWheelTaskValues
- type ResolvedRunJobTaskValues
- type ResolvedStringParamsValues
- type ResolvedValues
- type Run
- type RunConditionTask
- type RunForEachTask
- type RunIf
- type RunJobOutput
- type RunJobTask
- type RunLifeCycleState
- type RunLifecycleStateV2State
- type RunNow
- type RunNowResponse
- type RunOutput
- type RunParameters
- type RunResultState
- type RunState
- type RunStatus
- type RunTask
- type RunType
- type Source
- type SparkJarTask
- type SparkPythonTask
- type SparkSubmitTask
- type SparseCheckout
- type SqlAlertOutput
- type SqlAlertState
- type SqlDashboardOutput
- type SqlDashboardWidgetOutput
- type SqlDashboardWidgetOutputStatus
- type SqlOutput
- type SqlOutputError
- type SqlQueryOutput
- type SqlStatementOutput
- type SqlTask
- type SqlTaskAlert
- type SqlTaskDashboard
- type SqlTaskFile
- type SqlTaskQuery
- type SqlTaskSubscription
- type StorageMode
- type SubmitRun
- type SubmitRunResponse
- type SubmitTask
- type Subscription
- type SubscriptionSubscriber
- type TableState
- type TableTriggerState
- type TableUpdateTriggerConfiguration
- type Task
- type TaskDependency
- type TaskEmailNotifications
- type TaskNotificationSettings
- type TaskRetryMode
- type TerminationCodeCode
- type TerminationDetails
- type TerminationTypeType
- type TriggerInfo
- type TriggerSettings
- type TriggerStateProto
- type TriggerType
- type UpdateJob
- type ViewItem
- type ViewType
- type ViewsToExport
- type WaitGetRunJobTerminatedOrSkipped
- type Webhook
- type WebhookNotifications
- type WidgetErrorDetail
Examples ¶
- JobsAPI.CancelAllRuns (JobsApiFullIntegration)
- JobsAPI.CancelRun (JobsApiFullIntegration)
- JobsAPI.Create (JobsApiFullIntegration)
- JobsAPI.ExportRun (JobsApiFullIntegration)
- JobsAPI.Get (JobsApiFullIntegration)
- JobsAPI.GetRunOutput (JobsApiFullIntegration)
- JobsAPI.List (JobsApiFullIntegration)
- JobsAPI.ListRuns (JobsApiFullIntegration)
- JobsAPI.RepairRun (JobsApiFullIntegration)
- JobsAPI.Reset (JobsApiFullIntegration)
- JobsAPI.RunNow (JobsApiFullIntegration)
- JobsAPI.Submit (JobsApiFullIntegration)
- JobsAPI.Update (JobsApiFullIntegration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertEvaluationState ¶ added in v0.122.0
type AlertEvaluationState string
Same alert evaluation state as in redash-v2/api/proto/alertsv2/alerts.proto
const AlertEvaluationStateError AlertEvaluationState = `ERROR`
const AlertEvaluationStateOk AlertEvaluationState = `OK`
const AlertEvaluationStateTriggered AlertEvaluationState = `TRIGGERED`
const AlertEvaluationStateUnknown AlertEvaluationState = `UNKNOWN`
func (*AlertEvaluationState) Set ¶ added in v0.122.0
func (f *AlertEvaluationState) Set(v string) error
Set raw string value and validate it against allowed values
func (*AlertEvaluationState) String ¶ added in v0.122.0
func (f *AlertEvaluationState) String() string
String representation for fmt.Print
func (*AlertEvaluationState) Type ¶ added in v0.122.0
func (f *AlertEvaluationState) Type() string
Type always returns AlertEvaluationState to satisfy [pflag.Value] interface
func (*AlertEvaluationState) Values ¶ added in v0.122.0
func (f *AlertEvaluationState) Values() []AlertEvaluationState
Values returns all possible values for AlertEvaluationState.
There is no guarantee on the order of the values in the slice.
type AlertTask ¶ added in v0.122.0
type AlertTask struct {
// The alert_id is the canonical identifier of the alert.
AlertId string `json:"alert_id,omitempty"`
// The subscribers receive alert evaluation result notifications after the
// alert task is completed. The number of subscriptions is limited to 100.
Subscribers []AlertTaskSubscriber `json:"subscribers,omitempty"`
// The warehouse_id identifies the warehouse settings used by the alert
// task.
WarehouseId string `json:"warehouse_id,omitempty"`
// The workspace_path is the path to the alert file in the workspace. The
// path: * must start with "/Workspace" * must be a normalized path. User
// has to select only one of alert_id or workspace_path to identify the
// alert.
WorkspacePath string `json:"workspace_path,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (AlertTask) MarshalJSON ¶ added in v0.122.0
func (*AlertTask) UnmarshalJSON ¶ added in v0.122.0
type AlertTaskOutput ¶ added in v0.122.0
type AlertTaskOutput struct {
AlertState AlertEvaluationState `json:"alert_state,omitempty"`
}
type AlertTaskSubscriber ¶ added in v0.122.0
type AlertTaskSubscriber struct {
DestinationId string `json:"destination_id,omitempty"`
// A valid workspace email address.
UserName string `json:"user_name,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Represents a subscriber that will receive alert notifications. A subscriber can be either a user (via email) or a notification destination (via destination_id).
func (AlertTaskSubscriber) MarshalJSON ¶ added in v0.122.0
func (s AlertTaskSubscriber) MarshalJSON() ([]byte, error)
func (*AlertTaskSubscriber) UnmarshalJSON ¶ added in v0.122.0
func (s *AlertTaskSubscriber) UnmarshalJSON(b []byte) error
type AuthenticationMethod ¶ added in v0.63.0
type AuthenticationMethod string
const AuthenticationMethodOauth AuthenticationMethod = `OAUTH`
const AuthenticationMethodPat AuthenticationMethod = `PAT`
func (*AuthenticationMethod) Set ¶ added in v0.63.0
func (f *AuthenticationMethod) Set(v string) error
Set raw string value and validate it against allowed values
func (*AuthenticationMethod) String ¶ added in v0.63.0
func (f *AuthenticationMethod) String() string
String representation for fmt.Print
func (*AuthenticationMethod) Type ¶ added in v0.63.0
func (f *AuthenticationMethod) Type() string
Type always returns AuthenticationMethod to satisfy [pflag.Value] interface
func (*AuthenticationMethod) Values ¶ added in v0.72.0
func (f *AuthenticationMethod) Values() []AuthenticationMethod
Values returns all possible values for AuthenticationMethod.
There is no guarantee on the order of the values in the slice.
type BaseJob ¶ added in v0.3.0
type BaseJob struct {
// The time at which this job was created in epoch milliseconds
// (milliseconds since 1/1/1970 UTC).
CreatedTime int64 `json:"created_time,omitempty"`
// The creator user name. This field won’t be included in the response if
// the user has already been deleted.
CreatorUserName string `json:"creator_user_name,omitempty"`
// The id of the budget policy used by this job for cost attribution
// purposes. This may be set through (in order of precedence): 1. Budget
// admins through the account or workspace console 2. Jobs UI in the job
// details page and Jobs API using `budget_policy_id` 3. Inferred default
// based on accessible budget policies of the run_as identity on job
// creation or modification.
EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"`
// The id of the usage policy used by this job for cost attribution
// purposes.
EffectiveUsagePolicyId string `json:"effective_usage_policy_id,omitempty"`
// Indicates if the job has more array properties (`tasks`, `job_clusters`)
// that are not shown. They can be accessed via :method:jobs/get endpoint.
// It is only relevant for API 2.2 :method:jobs/list requests with
// `expand_tasks=true`.
HasMore bool `json:"has_more,omitempty"`
// The canonical identifier for this job.
JobId int64 `json:"job_id,omitempty"`
// Settings for this job and all of its runs. These settings can be updated
// using the `resetJob` method.
Settings *JobSettings `json:"settings,omitempty"`
// State of the trigger associated with the job.
TriggerState *TriggerStateProto `json:"trigger_state,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (BaseJob) MarshalJSON ¶ added in v0.23.0
func (*BaseJob) UnmarshalJSON ¶ added in v0.23.0
type BaseRun ¶ added in v0.3.0
type BaseRun struct {
// 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.
AttemptNumber int `json:"attempt_number,omitempty"`
// 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.
CleanupDuration int64 `json:"cleanup_duration,omitempty"`
// 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.
ClusterInstance *ClusterInstance `json:"cluster_instance,omitempty"`
// A snapshot of the job’s cluster specification when this run was
// created.
ClusterSpec *ClusterSpec `json:"cluster_spec,omitempty"`
// The creator user name. This field won’t be included in the response if
// the user has already been deleted.
CreatorUserName string `json:"creator_user_name,omitempty"`
// Description of the run
Description string `json:"description,omitempty"`
// The actual performance target used by the serverless run during
// execution. This can differ from the client-set performance target on the
// request depending on whether the performance mode is supported by the job
// type.
//
// * `STANDARD`: Enables cost-efficient execution of serverless workloads. *
// `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times
// through rapid scaling and optimized cluster performance.
EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"`
// The id of the usage policy used by this run for cost attribution
// purposes.
EffectiveUsagePolicyId string `json:"effective_usage_policy_id,omitempty"`
// 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.
EndTime int64 `json:"end_time,omitempty"`
// 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.
ExecutionDuration int64 `json:"execution_duration,omitempty"`
// 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.
GitSource *GitSource `json:"git_source,omitempty"`
// Indicates if the run has more array properties (`tasks`, `job_clusters`)
// that are not shown. They can be accessed via :method:jobs/getrun
// endpoint. It is only relevant for API 2.2 :method:jobs/listruns requests
// with `expand_tasks=true`.
HasMore bool `json:"has_more,omitempty"`
// 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. If more than 100
// job clusters are available, you can paginate through them using
// :method:jobs/getrun.
JobClusters []JobCluster `json:"job_clusters,omitempty"`
// The canonical identifier of the job that contains this run.
JobId int64 `json:"job_id,omitempty"`
// Job-level parameters used in the run
JobParameters []JobParameter `json:"job_parameters,omitempty"`
// ID of the job run that this run belongs to. For legacy and single-task
// job runs the field is populated with the job run ID. For task runs, the
// field is populated with the ID of the job run that the task run belongs
// to.
JobRunId int64 `json:"job_run_id,omitempty"`
// A unique identifier for this job run. This is set to the same value as
// `run_id`.
NumberInJob int64 `json:"number_in_job,omitempty"`
// 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.
OriginalAttemptRunId int64 `json:"original_attempt_run_id,omitempty"`
// The parameters used for this run.
OverridingParameters *RunParameters `json:"overriding_parameters,omitempty"`
// The time in milliseconds that the run has spent in the queue.
QueueDuration int64 `json:"queue_duration,omitempty"`
// The repair history of the run.
RepairHistory []RepairHistoryItem `json:"repair_history,omitempty"`
// The time in milliseconds it took the job run and all of its repairs to
// finish.
RunDuration int64 `json:"run_duration,omitempty"`
// The canonical identifier of the run. This ID is unique across all runs of
// all jobs.
RunId int64 `json:"run_id,omitempty"`
// An optional name for the run. The maximum length is 4096 bytes in UTF-8
// encoding.
RunName string `json:"run_name,omitempty"`
// The URL to the detail page of the run.
RunPageUrl string `json:"run_page_url,omitempty"`
RunType RunType `json:"run_type,omitempty"`
// The cron schedule that triggered this run if it was triggered by the
// periodic scheduler.
Schedule *CronSchedule `json:"schedule,omitempty"`
// 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.
SetupDuration int64 `json:"setup_duration,omitempty"`
// 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.
StartTime int64 `json:"start_time,omitempty"`
// Deprecated. Please use the `status` field instead.
State *RunState `json:"state,omitempty"`
Status *RunStatus `json:"status,omitempty"`
// 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. If
// more than 100 tasks are available, you can paginate through them using
// :method:jobs/getrun. Use the `next_page_token` field at the object root
// to determine if more results are available.
Tasks []RunTask `json:"tasks,omitempty"`
Trigger TriggerType `json:"trigger,omitempty"`
TriggerInfo *TriggerInfo `json:"trigger_info,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (BaseRun) MarshalJSON ¶ added in v0.23.0
func (*BaseRun) UnmarshalJSON ¶ added in v0.23.0
type CancelAllRuns ¶
type CancelAllRuns struct {
// Optional boolean parameter to cancel all queued runs. If no job_id is
// provided, all queued runs in the workspace are canceled.
AllQueuedRuns bool `json:"all_queued_runs,omitempty"`
// The canonical identifier of the job to cancel all runs of.
JobId int64 `json:"job_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (CancelAllRuns) MarshalJSON ¶ added in v0.23.0
func (s CancelAllRuns) MarshalJSON() ([]byte, error)
func (*CancelAllRuns) UnmarshalJSON ¶ added in v0.23.0
func (s *CancelAllRuns) UnmarshalJSON(b []byte) error
type CleanRoomTaskRunLifeCycleState ¶ added in v0.53.0
type CleanRoomTaskRunLifeCycleState string
Copied from elastic-spark-common/api/messages/runs.proto. Using the original definition to remove coupling with jobs API definition
const CleanRoomTaskRunLifeCycleStateBlocked CleanRoomTaskRunLifeCycleState = `BLOCKED`
const CleanRoomTaskRunLifeCycleStateInternalError CleanRoomTaskRunLifeCycleState = `INTERNAL_ERROR`
const CleanRoomTaskRunLifeCycleStatePending CleanRoomTaskRunLifeCycleState = `PENDING`
const CleanRoomTaskRunLifeCycleStateQueued CleanRoomTaskRunLifeCycleState = `QUEUED`
const CleanRoomTaskRunLifeCycleStateRunLifeCycleStateUnspecified CleanRoomTaskRunLifeCycleState = `RUN_LIFE_CYCLE_STATE_UNSPECIFIED`
const CleanRoomTaskRunLifeCycleStateRunning CleanRoomTaskRunLifeCycleState = `RUNNING`
const CleanRoomTaskRunLifeCycleStateSkipped CleanRoomTaskRunLifeCycleState = `SKIPPED`
const CleanRoomTaskRunLifeCycleStateTerminated CleanRoomTaskRunLifeCycleState = `TERMINATED`
const CleanRoomTaskRunLifeCycleStateTerminating CleanRoomTaskRunLifeCycleState = `TERMINATING`
const CleanRoomTaskRunLifeCycleStateWaitingForRetry CleanRoomTaskRunLifeCycleState = `WAITING_FOR_RETRY`
func (*CleanRoomTaskRunLifeCycleState) Set ¶ added in v0.53.0
func (f *CleanRoomTaskRunLifeCycleState) Set(v string) error
Set raw string value and validate it against allowed values
func (*CleanRoomTaskRunLifeCycleState) String ¶ added in v0.53.0
func (f *CleanRoomTaskRunLifeCycleState) String() string
String representation for fmt.Print
func (*CleanRoomTaskRunLifeCycleState) Type ¶ added in v0.53.0
func (f *CleanRoomTaskRunLifeCycleState) Type() string
Type always returns CleanRoomTaskRunLifeCycleState to satisfy [pflag.Value] interface
func (*CleanRoomTaskRunLifeCycleState) Values ¶ added in v0.72.0
func (f *CleanRoomTaskRunLifeCycleState) Values() []CleanRoomTaskRunLifeCycleState
Values returns all possible values for CleanRoomTaskRunLifeCycleState.
There is no guarantee on the order of the values in the slice.
type CleanRoomTaskRunResultState ¶ added in v0.53.0
type CleanRoomTaskRunResultState string
Copied from elastic-spark-common/api/messages/runs.proto. Using the original definition to avoid cyclic dependency.
const CleanRoomTaskRunResultStateCanceled CleanRoomTaskRunResultState = `CANCELED`
const CleanRoomTaskRunResultStateDisabled CleanRoomTaskRunResultState = `DISABLED`
const CleanRoomTaskRunResultStateEvicted CleanRoomTaskRunResultState = `EVICTED`
const CleanRoomTaskRunResultStateExcluded CleanRoomTaskRunResultState = `EXCLUDED`
const CleanRoomTaskRunResultStateFailed CleanRoomTaskRunResultState = `FAILED`
const CleanRoomTaskRunResultStateMaximumConcurrentRunsReached CleanRoomTaskRunResultState = `MAXIMUM_CONCURRENT_RUNS_REACHED`
const CleanRoomTaskRunResultStateRunResultStateUnspecified CleanRoomTaskRunResultState = `RUN_RESULT_STATE_UNSPECIFIED`
const CleanRoomTaskRunResultStateSuccess CleanRoomTaskRunResultState = `SUCCESS`
const CleanRoomTaskRunResultStateSuccessWithFailures CleanRoomTaskRunResultState = `SUCCESS_WITH_FAILURES`
const CleanRoomTaskRunResultStateTimedout CleanRoomTaskRunResultState = `TIMEDOUT`
const CleanRoomTaskRunResultStateUpstreamCanceled CleanRoomTaskRunResultState = `UPSTREAM_CANCELED`
const CleanRoomTaskRunResultStateUpstreamEvicted CleanRoomTaskRunResultState = `UPSTREAM_EVICTED`
const CleanRoomTaskRunResultStateUpstreamFailed CleanRoomTaskRunResultState = `UPSTREAM_FAILED`
func (*CleanRoomTaskRunResultState) Set ¶ added in v0.53.0
func (f *CleanRoomTaskRunResultState) Set(v string) error
Set raw string value and validate it against allowed values
func (*CleanRoomTaskRunResultState) String ¶ added in v0.53.0
func (f *CleanRoomTaskRunResultState) String() string
String representation for fmt.Print
func (*CleanRoomTaskRunResultState) Type ¶ added in v0.53.0
func (f *CleanRoomTaskRunResultState) Type() string
Type always returns CleanRoomTaskRunResultState to satisfy [pflag.Value] interface
func (*CleanRoomTaskRunResultState) Values ¶ added in v0.72.0
func (f *CleanRoomTaskRunResultState) Values() []CleanRoomTaskRunResultState
Values returns all possible values for CleanRoomTaskRunResultState.
There is no guarantee on the order of the values in the slice.
type CleanRoomTaskRunState ¶ added in v0.53.0
type CleanRoomTaskRunState struct {
// A value indicating the run's current lifecycle state. This field is
// always available in the response. Note: Additional states might be
// introduced in future releases.
LifeCycleState CleanRoomTaskRunLifeCycleState `json:"life_cycle_state,omitempty"`
// A value indicating the run's result. This field is only available for
// terminal lifecycle states. Note: Additional states might be introduced in
// future releases.
ResultState CleanRoomTaskRunResultState `json:"result_state,omitempty"`
}
Stores the run state of the clean rooms notebook task.
type CleanRoomsNotebookTask ¶ added in v0.54.0
type CleanRoomsNotebookTask struct {
// The clean room that the notebook belongs to.
CleanRoomName string `json:"clean_room_name"`
// Checksum to validate the freshness of the notebook resource (i.e. the
// notebook being run is the latest version). It can be fetched by calling
// the :method:cleanroomassets/get API.
Etag string `json:"etag,omitempty"`
// Base parameters to be used for the clean room notebook job.
NotebookBaseParameters map[string]string `json:"notebook_base_parameters,omitempty"`
// Name of the notebook being run.
NotebookName string `json:"notebook_name"`
ForceSendFields []string `json:"-" url:"-"`
}
Clean Rooms notebook task for V1 Clean Room service (GA). Replaces the deprecated CleanRoomNotebookTask (defined above) which was for V0 service.
func (CleanRoomsNotebookTask) MarshalJSON ¶ added in v0.54.0
func (s CleanRoomsNotebookTask) MarshalJSON() ([]byte, error)
func (*CleanRoomsNotebookTask) UnmarshalJSON ¶ added in v0.54.0
func (s *CleanRoomsNotebookTask) UnmarshalJSON(b []byte) error
type CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput ¶ added in v0.56.0
type CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput struct {
// The run state of the clean rooms notebook task.
CleanRoomJobRunState *CleanRoomTaskRunState `json:"clean_room_job_run_state,omitempty"`
// The notebook output for the clean room run
NotebookOutput *NotebookOutput `json:"notebook_output,omitempty"`
// Information on how to access the output schema for the clean room run
OutputSchemaInfo *OutputSchemaInfo `json:"output_schema_info,omitempty"`
}
type ClusterInstance ¶
type ClusterInstance struct {
// 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.
ClusterId string `json:"cluster_id,omitempty"`
// 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.
SparkContextId string `json:"spark_context_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ClusterInstance) MarshalJSON ¶ added in v0.23.0
func (s ClusterInstance) MarshalJSON() ([]byte, error)
func (*ClusterInstance) UnmarshalJSON ¶ added in v0.23.0
func (s *ClusterInstance) UnmarshalJSON(b []byte) error
type ClusterSpec ¶
type ClusterSpec struct {
// 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
ExistingClusterId string `json:"existing_cluster_id,omitempty"`
// If job_cluster_key, this task is executed reusing the cluster specified
// in `job.settings.job_clusters`.
JobClusterKey string `json:"job_cluster_key,omitempty"`
// An optional list of libraries to be installed on the cluster. The default
// value is an empty list.
Libraries []compute.Library `json:"libraries,omitempty"`
// If new_cluster, a description of a new cluster that is created for each
// run.
NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ClusterSpec) MarshalJSON ¶ added in v0.23.0
func (s ClusterSpec) MarshalJSON() ([]byte, error)
func (*ClusterSpec) UnmarshalJSON ¶ added in v0.23.0
func (s *ClusterSpec) UnmarshalJSON(b []byte) error
type Compute ¶ added in v0.104.0
type Compute struct {
// Hardware accelerator configuration for Serverless GPU workloads.
HardwareAccelerator compute.HardwareAcceleratorType `json:"hardware_accelerator,omitempty"`
}
type ComputeConfig ¶ added in v0.59.0
type ComputeConfig struct {
// IDof the GPU pool to use.
GpuNodePoolId string `json:"gpu_node_pool_id,omitempty"`
// GPU type.
GpuType string `json:"gpu_type,omitempty"`
// Number of GPUs.
NumGpus int `json:"num_gpus"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ComputeConfig) MarshalJSON ¶ added in v0.59.0
func (s ComputeConfig) MarshalJSON() ([]byte, error)
func (*ComputeConfig) UnmarshalJSON ¶ added in v0.59.0
func (s *ComputeConfig) UnmarshalJSON(b []byte) error
type Condition ¶ added in v0.32.0
type Condition string
const ConditionAllUpdated Condition = `ALL_UPDATED`
const ConditionAnyUpdated Condition = `ANY_UPDATED`
func (*Condition) Set ¶ added in v0.32.0
Set raw string value and validate it against allowed values
type ConditionTask ¶ added in v0.11.0
type ConditionTask struct {
// The left operand of the condition task. Can be either a string value or a
// job state or parameter reference.
Left string `json:"left"`
// * `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.
Op ConditionTaskOp `json:"op"`
// The right operand of the condition task. Can be either a string value or
// a job state or parameter reference.
Right string `json:"right"`
}
type ConditionTaskOp ¶ added in v0.11.0
type ConditionTaskOp string
* `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.
const ConditionTaskOpEqualTo ConditionTaskOp = `EQUAL_TO`
const ConditionTaskOpGreaterThan ConditionTaskOp = `GREATER_THAN`
const ConditionTaskOpGreaterThanOrEqual ConditionTaskOp = `GREATER_THAN_OR_EQUAL`
const ConditionTaskOpLessThan ConditionTaskOp = `LESS_THAN`
const ConditionTaskOpLessThanOrEqual ConditionTaskOp = `LESS_THAN_OR_EQUAL`
const ConditionTaskOpNotEqual ConditionTaskOp = `NOT_EQUAL`
func (*ConditionTaskOp) Set ¶ added in v0.11.0
func (f *ConditionTaskOp) Set(v string) error
Set raw string value and validate it against allowed values
func (*ConditionTaskOp) String ¶ added in v0.11.0
func (f *ConditionTaskOp) String() string
String representation for fmt.Print
func (*ConditionTaskOp) Type ¶ added in v0.11.0
func (f *ConditionTaskOp) Type() string
Type always returns ConditionTaskOp to satisfy [pflag.Value] interface
func (*ConditionTaskOp) Values ¶ added in v0.72.0
func (f *ConditionTaskOp) Values() []ConditionTaskOp
Values returns all possible values for ConditionTaskOp.
There is no guarantee on the order of the values in the slice.
type Continuous ¶ added in v0.4.0
type Continuous struct {
// Indicate whether the continuous execution of the job is paused or not.
// Defaults to UNPAUSED.
PauseStatus PauseStatus `json:"pause_status,omitempty"`
// Indicate whether the continuous job is applying task level retries or
// not. Defaults to NEVER.
TaskRetryMode TaskRetryMode `json:"task_retry_mode,omitempty"`
}
type CreateJob ¶
type CreateJob struct {
// List of permissions to set on the job.
AccessControlList []JobAccessControlRequest `json:"access_control_list,omitempty"`
// The id of the user specified budget policy to use for this job. If not
// specified, a default budget policy may be applied when creating or
// modifying the job. See `effective_budget_policy_id` for the budget policy
// used by this workload.
BudgetPolicyId string `json:"budget_policy_id,omitempty"`
// 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.
Continuous *Continuous `json:"continuous,omitempty"`
// Deployment information for jobs managed by external sources.
Deployment *JobDeployment `json:"deployment,omitempty"`
// An optional description for the job. The maximum length is 27700
// characters in UTF-8 encoding.
Description string `json:"description,omitempty"`
// 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.
EditMode JobEditMode `json:"edit_mode,omitempty"`
// 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.
EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"`
// A list of task execution environment specifications that can be
// referenced by serverless tasks of this job. For serverless notebook
// tasks, if the environment_key is not specified, the notebook environment
// will be used if present. If a jobs environment is specified, it will
// override the notebook environment. For other serverless tasks, the task
// environment is required to be specified using environment_key in the task
// settings.
Environments []JobEnvironment `json:"environments,omitempty"`
// 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"`.
Format Format `json:"format,omitempty"`
// 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.
GitSource *GitSource `json:"git_source,omitempty"`
Health *JobsHealthRules `json:"health,omitempty"`
// 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.
JobClusters []JobCluster `json:"job_clusters,omitempty"`
// 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.
MaxConcurrentRuns int `json:"max_concurrent_runs,omitempty"`
// An optional name for the job. The maximum length is 4096 bytes in UTF-8
// encoding.
Name string `json:"name,omitempty"`
// Optional notification settings that are used when sending notifications
// to each of the `email_notifications` and `webhook_notifications` for this
// job.
NotificationSettings *JobNotificationSettings `json:"notification_settings,omitempty"`
// Job-level parameter definitions
Parameters []JobParameterDefinition `json:"parameters,omitempty"`
// The performance mode on a serverless job. This field determines the level
// of compute performance or cost-efficiency for the run. The performance
// target does not apply to tasks that run on Serverless GPU compute.
//
// * `STANDARD`: Enables cost-efficient execution of serverless workloads. *
// `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times
// through rapid scaling and optimized cluster performance.
PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"`
// The queue settings of the job.
Queue *QueueSettings `json:"queue,omitempty"`
// The user or service principal that the job runs as, if specified in the
// request. This field indicates the explicit configuration of `run_as` for
// the job. To find the value in all cases, explicit or implicit, use
// `run_as_user_name`.
RunAs *JobRunAs `json:"run_as,omitempty"`
// 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`.
Schedule *CronSchedule `json:"schedule,omitempty"`
// 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.
Tags map[string]string `json:"tags,omitempty"`
// A list of task specifications to be executed by this job. It supports up
// to 1000 elements in write endpoints (:method:jobs/create,
// :method:jobs/reset, :method:jobs/update, :method:jobs/submit). Read
// endpoints return only 100 tasks. If more than 100 tasks are available,
// you can paginate through them using :method:jobs/get. Use the
// `next_page_token` field at the object root to determine if more results
// are available.
Tasks []Task `json:"tasks,omitempty"`
// An optional timeout applied to each run of this job. A value of `0` means
// no timeout.
TimeoutSeconds int `json:"timeout_seconds,omitempty"`
// 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`.
Trigger *TriggerSettings `json:"trigger,omitempty"`
// The id of the user specified usage policy to use for this job. If not
// specified, a default usage policy may be applied when creating or
// modifying the job. See `effective_usage_policy_id` for the usage policy
// used by this workload.
UsagePolicyId string `json:"usage_policy_id,omitempty"`
// A collection of system notification IDs to notify when runs of this job
// begin or complete.
WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (CreateJob) MarshalJSON ¶ added in v0.23.0
func (*CreateJob) UnmarshalJSON ¶ added in v0.23.0
type CreateResponse ¶
type CreateResponse struct {
// The canonical identifier for the newly created job.
JobId int64 `json:"job_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Job was created successfully
func (CreateResponse) MarshalJSON ¶ added in v0.23.0
func (s CreateResponse) MarshalJSON() ([]byte, error)
func (*CreateResponse) UnmarshalJSON ¶ added in v0.23.0
func (s *CreateResponse) UnmarshalJSON(b []byte) error
type CronSchedule ¶
type CronSchedule struct {
// Indicate whether this schedule is paused or not.
PauseStatus PauseStatus `json:"pause_status,omitempty"`
// 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
QuartzCronExpression string `json:"quartz_cron_expression"`
// 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
TimezoneId string `json:"timezone_id"`
}
type DashboardPageSnapshot ¶ added in v0.63.0
type DashboardPageSnapshot struct {
PageDisplayName string `json:"page_display_name,omitempty"`
WidgetErrorDetails []WidgetErrorDetail `json:"widget_error_details,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (DashboardPageSnapshot) MarshalJSON ¶ added in v0.63.0
func (s DashboardPageSnapshot) MarshalJSON() ([]byte, error)
func (*DashboardPageSnapshot) UnmarshalJSON ¶ added in v0.63.0
func (s *DashboardPageSnapshot) UnmarshalJSON(b []byte) error
type DashboardTask ¶ added in v0.63.0
type DashboardTask struct {
// The identifier of the dashboard to refresh.
DashboardId string `json:"dashboard_id,omitempty"`
// Dashboard task parameters. Used to apply dashboard filter values during
// dashboard task execution. Parameter values get applied to any dashboard
// filters that have a matching URL identifier as the parameter key. The
// parameter value format is dependent on the filter type: - For text and
// single-select filters, provide a single value (e.g. `"value"`) - For date
// and datetime filters, provide the value in ISO 8601 format (e.g.
// `"2000-01-01T00:00:00"`) - For multi-select filters, provide a JSON array
// of values (e.g. `"[\"value1\",\"value2\"]"`) - For range and date range
// filters, provide a JSON object with `start` and `end` (e.g.
// `"{\"start\":\"1\",\"end\":\"10\"}"`)
Filters map[string]string `json:"filters,omitempty"`
// Optional: subscription configuration for sending the dashboard snapshot.
Subscription *Subscription `json:"subscription,omitempty"`
// Optional: The warehouse id to execute the dashboard with for the
// schedule. If not specified, the default warehouse of the dashboard will
// be used.
WarehouseId string `json:"warehouse_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Configures the Lakeview Dashboard job task type.
func (DashboardTask) MarshalJSON ¶ added in v0.63.0
func (s DashboardTask) MarshalJSON() ([]byte, error)
func (*DashboardTask) UnmarshalJSON ¶ added in v0.63.0
func (s *DashboardTask) UnmarshalJSON(b []byte) error
type DashboardTaskOutput ¶ added in v0.63.0
type DashboardTaskOutput struct {
// Should only be populated for manual PDF download jobs.
PageSnapshots []DashboardPageSnapshot `json:"page_snapshots,omitempty"`
}
type DbtCloudJobRunStep ¶ added in v0.72.0
type DbtCloudJobRunStep struct {
// Orders the steps in the job
Index int `json:"index,omitempty"`
// Output of the step
Logs string `json:"logs,omitempty"`
// Name of the step in the job
Name string `json:"name,omitempty"`
// State of the step
Status DbtPlatformRunStatus `json:"status,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Format of response retrieved from dbt Cloud, for inclusion in output Deprecated in favor of DbtPlatformJobRunStep
func (DbtCloudJobRunStep) MarshalJSON ¶ added in v0.72.0
func (s DbtCloudJobRunStep) MarshalJSON() ([]byte, error)
func (*DbtCloudJobRunStep) UnmarshalJSON ¶ added in v0.72.0
func (s *DbtCloudJobRunStep) UnmarshalJSON(b []byte) error
type DbtCloudTask ¶ added in v0.72.0
type DbtCloudTask struct {
// The resource name of the UC connection that authenticates the dbt Cloud
// for this task
ConnectionResourceName string `json:"connection_resource_name,omitempty"`
// Id of the dbt Cloud job to be triggered
DbtCloudJobId int64 `json:"dbt_cloud_job_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Deprecated in favor of DbtPlatformTask
func (DbtCloudTask) MarshalJSON ¶ added in v0.72.0
func (s DbtCloudTask) MarshalJSON() ([]byte, error)
func (*DbtCloudTask) UnmarshalJSON ¶ added in v0.72.0
func (s *DbtCloudTask) UnmarshalJSON(b []byte) error
type DbtCloudTaskOutput ¶ added in v0.72.0
type DbtCloudTaskOutput struct {
// Id of the job run in dbt Cloud
DbtCloudJobRunId int64 `json:"dbt_cloud_job_run_id,omitempty"`
// Steps of the job run as received from dbt Cloud
DbtCloudJobRunOutput []DbtCloudJobRunStep `json:"dbt_cloud_job_run_output,omitempty"`
// Url where full run details can be viewed
DbtCloudJobRunUrl string `json:"dbt_cloud_job_run_url,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Deprecated in favor of DbtPlatformTaskOutput
func (DbtCloudTaskOutput) MarshalJSON ¶ added in v0.72.0
func (s DbtCloudTaskOutput) MarshalJSON() ([]byte, error)
func (*DbtCloudTaskOutput) UnmarshalJSON ¶ added in v0.72.0
func (s *DbtCloudTaskOutput) UnmarshalJSON(b []byte) error
type DbtOutput ¶
type DbtOutput struct {
// An optional map of headers to send when retrieving the artifact from the
// `artifacts_link`.
ArtifactsHeaders map[string]string `json:"artifacts_headers,omitempty"`
// 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.
ArtifactsLink string `json:"artifacts_link,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (DbtOutput) MarshalJSON ¶ added in v0.23.0
func (*DbtOutput) UnmarshalJSON ¶ added in v0.23.0
type DbtPlatformJobRunStep ¶ added in v0.73.0
type DbtPlatformJobRunStep struct {
// Orders the steps in the job
Index int `json:"index,omitempty"`
// Output of the step
Logs string `json:"logs,omitempty"`
// Whether the logs of this step have been truncated. If true, the logs has
// been truncated to 10000 characters.
LogsTruncated bool `json:"logs_truncated,omitempty"`
// Name of the step in the job
Name string `json:"name,omitempty"`
// Whether the name of the job has been truncated. If true, the name has
// been truncated to 100 characters.
NameTruncated bool `json:"name_truncated,omitempty"`
// State of the step
Status DbtPlatformRunStatus `json:"status,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Format of response retrieved from dbt platform, for inclusion in output
func (DbtPlatformJobRunStep) MarshalJSON ¶ added in v0.73.0
func (s DbtPlatformJobRunStep) MarshalJSON() ([]byte, error)
func (*DbtPlatformJobRunStep) UnmarshalJSON ¶ added in v0.73.0
func (s *DbtPlatformJobRunStep) UnmarshalJSON(b []byte) error
type DbtPlatformRunStatus ¶ added in v0.73.0
type DbtPlatformRunStatus string
Response enumeration from calling the dbt platform API, for inclusion in output
const DbtPlatformRunStatusCancelled DbtPlatformRunStatus = `CANCELLED`
const DbtPlatformRunStatusError DbtPlatformRunStatus = `ERROR`
const DbtPlatformRunStatusQueued DbtPlatformRunStatus = `QUEUED`
const DbtPlatformRunStatusRunning DbtPlatformRunStatus = `RUNNING`
const DbtPlatformRunStatusStarting DbtPlatformRunStatus = `STARTING`
const DbtPlatformRunStatusSuccess DbtPlatformRunStatus = `SUCCESS`
func (*DbtPlatformRunStatus) Set ¶ added in v0.73.0
func (f *DbtPlatformRunStatus) Set(v string) error
Set raw string value and validate it against allowed values
func (*DbtPlatformRunStatus) String ¶ added in v0.73.0
func (f *DbtPlatformRunStatus) String() string
String representation for fmt.Print
func (*DbtPlatformRunStatus) Type ¶ added in v0.73.0
func (f *DbtPlatformRunStatus) Type() string
Type always returns DbtPlatformRunStatus to satisfy [pflag.Value] interface
func (*DbtPlatformRunStatus) Values ¶ added in v0.73.0
func (f *DbtPlatformRunStatus) Values() []DbtPlatformRunStatus
Values returns all possible values for DbtPlatformRunStatus.
There is no guarantee on the order of the values in the slice.
type DbtPlatformTask ¶ added in v0.73.0
type DbtPlatformTask struct {
// The resource name of the UC connection that authenticates the dbt
// platform for this task
ConnectionResourceName string `json:"connection_resource_name,omitempty"`
// Id of the dbt platform job to be triggered. Specified as a string for
// maximum compatibility with clients.
DbtPlatformJobId string `json:"dbt_platform_job_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (DbtPlatformTask) MarshalJSON ¶ added in v0.73.0
func (s DbtPlatformTask) MarshalJSON() ([]byte, error)
func (*DbtPlatformTask) UnmarshalJSON ¶ added in v0.73.0
func (s *DbtPlatformTask) UnmarshalJSON(b []byte) error
type DbtPlatformTaskOutput ¶ added in v0.73.0
type DbtPlatformTaskOutput struct {
// Id of the job run in dbt platform. Specified as a string for maximum
// compatibility with clients.
DbtPlatformJobRunId string `json:"dbt_platform_job_run_id,omitempty"`
// Steps of the job run as received from dbt platform
DbtPlatformJobRunOutput []DbtPlatformJobRunStep `json:"dbt_platform_job_run_output,omitempty"`
// Url where full run details can be viewed
DbtPlatformJobRunUrl string `json:"dbt_platform_job_run_url,omitempty"`
// Whether the number of steps in the output has been truncated. If true,
// the output will contain the first 20 steps of the output.
StepsTruncated bool `json:"steps_truncated,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (DbtPlatformTaskOutput) MarshalJSON ¶ added in v0.73.0
func (s DbtPlatformTaskOutput) MarshalJSON() ([]byte, error)
func (*DbtPlatformTaskOutput) UnmarshalJSON ¶ added in v0.73.0
func (s *DbtPlatformTaskOutput) UnmarshalJSON(b []byte) error
type DbtTask ¶
type DbtTask struct {
// 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.
Catalog string `json:"catalog,omitempty"`
// 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.
Commands []string `json:"commands"`
// 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.
ProfilesDirectory string `json:"profiles_directory,omitempty"`
// 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.
ProjectDirectory string `json:"project_directory,omitempty"`
// 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.
Schema string `json:"schema,omitempty"`
// 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.
Source Source `json:"source,omitempty"`
// 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.
WarehouseId string `json:"warehouse_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (DbtTask) MarshalJSON ¶ added in v0.23.0
func (*DbtTask) UnmarshalJSON ¶ added in v0.23.0
type DeleteJob ¶
type DeleteJob struct {
// The canonical identifier of the job to delete. This field is required.
JobId int64 `json:"job_id"`
}
type EnforcePolicyComplianceForJobResponseJobClusterSettingsChange ¶ added in v0.45.0
type EnforcePolicyComplianceForJobResponseJobClusterSettingsChange struct {
// The field where this change would be made, prepended with the job cluster
// key.
Field string `json:"field,omitempty"`
// The new value of this field after enforcing policy compliance (either a
// number, a boolean, or a string) converted to a string. This is intended
// to be read by a human. The typed new value of this field can be retrieved
// by reading the settings field in the API response.
NewValue string `json:"new_value,omitempty"`
// The previous value of this field before enforcing policy compliance
// (either a number, a boolean, or a string) converted to a string. This is
// intended to be read by a human. The type of the field can be retrieved by
// reading the settings field in the API response.
PreviousValue string `json:"previous_value,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Represents a change to the job cluster's settings that would be required for the job clusters to become compliant with their policies.
func (EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) MarshalJSON ¶ added in v0.45.0
func (s EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) MarshalJSON() ([]byte, error)
func (*EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) UnmarshalJSON ¶ added in v0.45.0
func (s *EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) UnmarshalJSON(b []byte) error
type EnforcePolicyComplianceRequest ¶ added in v0.45.0
type EnforcePolicyComplianceRequest struct {
// The ID of the job you want to enforce policy compliance on.
JobId int64 `json:"job_id"`
// If set, previews changes made to the job to comply with its policy, but
// does not update the job.
ValidateOnly bool `json:"validate_only,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (EnforcePolicyComplianceRequest) MarshalJSON ¶ added in v0.45.0
func (s EnforcePolicyComplianceRequest) MarshalJSON() ([]byte, error)
func (*EnforcePolicyComplianceRequest) UnmarshalJSON ¶ added in v0.45.0
func (s *EnforcePolicyComplianceRequest) UnmarshalJSON(b []byte) error
type EnforcePolicyComplianceResponse ¶ added in v0.45.0
type EnforcePolicyComplianceResponse struct {
// Whether any changes have been made to the job cluster settings for the
// job to become compliant with its policies.
HasChanges bool `json:"has_changes,omitempty"`
// A list of job cluster changes that have been made to the job’s cluster
// settings in order for all job clusters to become compliant with their
// policies.
JobClusterChanges []EnforcePolicyComplianceForJobResponseJobClusterSettingsChange `json:"job_cluster_changes,omitempty"`
// Updated job settings after policy enforcement. Policy enforcement only
// applies to job clusters that are created when running the job (which are
// specified in new_cluster) and does not apply to existing all-purpose
// clusters. Updated job settings are derived by applying policy default
// values to the existing job clusters in order to satisfy policy
// requirements.
Settings *JobSettings `json:"settings,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (EnforcePolicyComplianceResponse) MarshalJSON ¶ added in v0.45.0
func (s EnforcePolicyComplianceResponse) MarshalJSON() ([]byte, error)
func (*EnforcePolicyComplianceResponse) UnmarshalJSON ¶ added in v0.45.0
func (s *EnforcePolicyComplianceResponse) UnmarshalJSON(b []byte) error
type ExportRunOutput ¶
type ExportRunOutput struct {
// 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](/_static/examples/extract.py).
Views []ViewItem `json:"views,omitempty"`
}
Run was exported successfully.
type ExportRunRequest ¶ added in v0.8.0
type ExportRunRequest struct {
// The canonical identifier for the run. This field is required.
RunId int64 `json:"-" url:"run_id"`
// Which views to export (CODE, DASHBOARDS, or ALL). Defaults to CODE.
ViewsToExport ViewsToExport `json:"-" url:"views_to_export,omitempty"`
}
type FileArrivalTriggerConfiguration ¶ added in v0.11.0
type FileArrivalTriggerConfiguration struct {
// 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
MinTimeBetweenTriggersSeconds int `json:"min_time_between_triggers_seconds,omitempty"`
// URL to be monitored for file arrivals. The path must point to the root or
// a subpath of the external location.
Url string `json:"url"`
// 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.
WaitAfterLastChangeSeconds int `json:"wait_after_last_change_seconds,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (FileArrivalTriggerConfiguration) MarshalJSON ¶ added in v0.23.0
func (s FileArrivalTriggerConfiguration) MarshalJSON() ([]byte, error)
func (*FileArrivalTriggerConfiguration) UnmarshalJSON ¶ added in v0.23.0
func (s *FileArrivalTriggerConfiguration) UnmarshalJSON(b []byte) error
type FileArrivalTriggerState ¶ added in v0.72.0
type FileArrivalTriggerState struct {
// Indicates whether the trigger leverages file events to detect file
// arrivals.
UsingFileEvents bool `json:"using_file_events,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (FileArrivalTriggerState) MarshalJSON ¶ added in v0.72.0
func (s FileArrivalTriggerState) MarshalJSON() ([]byte, error)
func (*FileArrivalTriggerState) UnmarshalJSON ¶ added in v0.72.0
func (s *FileArrivalTriggerState) UnmarshalJSON(b []byte) error
type ForEachStats ¶ added in v0.31.0
type ForEachStats struct {
// Sample of 3 most common error messages occurred during the iteration.
ErrorMessageStats []ForEachTaskErrorMessageStats `json:"error_message_stats,omitempty"`
// Describes stats of the iteration. Only latest retries are considered.
TaskRunStats *ForEachTaskTaskRunStats `json:"task_run_stats,omitempty"`
}
type ForEachTask ¶ added in v0.31.0
type ForEachTask struct {
// An optional maximum allowed number of concurrent runs of the task. Set
// this value if you want to be able to execute multiple runs of the task
// concurrently.
Concurrency int `json:"concurrency,omitempty"`
// Array for task to iterate on. This can be a JSON string or a reference to
// an array parameter.
Inputs string `json:"inputs"`
// Configuration for the task that will be run for each element in the array
Task Task `json:"task"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ForEachTask) MarshalJSON ¶ added in v0.31.0
func (s ForEachTask) MarshalJSON() ([]byte, error)
func (*ForEachTask) UnmarshalJSON ¶ added in v0.31.0
func (s *ForEachTask) UnmarshalJSON(b []byte) error
type ForEachTaskErrorMessageStats ¶ added in v0.31.0
type ForEachTaskErrorMessageStats struct {
// Describes the count of such error message encountered during the
// iterations.
Count int `json:"count,omitempty"`
// Describes the error message occured during the iterations.
ErrorMessage string `json:"error_message,omitempty"`
// Describes the termination reason for the error message.
TerminationCategory string `json:"termination_category,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ForEachTaskErrorMessageStats) MarshalJSON ¶ added in v0.31.0
func (s ForEachTaskErrorMessageStats) MarshalJSON() ([]byte, error)
func (*ForEachTaskErrorMessageStats) UnmarshalJSON ¶ added in v0.31.0
func (s *ForEachTaskErrorMessageStats) UnmarshalJSON(b []byte) error
type ForEachTaskTaskRunStats ¶ added in v0.31.0
type ForEachTaskTaskRunStats struct {
// Describes the iteration runs having an active lifecycle state or an
// active run sub state.
ActiveIterations int `json:"active_iterations,omitempty"`
// Describes the number of failed and succeeded iteration runs.
CompletedIterations int `json:"completed_iterations,omitempty"`
// Describes the number of failed iteration runs.
FailedIterations int `json:"failed_iterations,omitempty"`
// Describes the number of iteration runs that have been scheduled.
ScheduledIterations int `json:"scheduled_iterations,omitempty"`
// Describes the number of succeeded iteration runs.
SucceededIterations int `json:"succeeded_iterations,omitempty"`
// Describes the length of the list of items to iterate over.
TotalIterations int `json:"total_iterations,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ForEachTaskTaskRunStats) MarshalJSON ¶ added in v0.31.0
func (s ForEachTaskTaskRunStats) MarshalJSON() ([]byte, error)
func (*ForEachTaskTaskRunStats) UnmarshalJSON ¶ added in v0.31.0
func (s *ForEachTaskTaskRunStats) UnmarshalJSON(b []byte) error
type Format ¶ added in v0.11.0
type Format string
const FormatMultiTask Format = `MULTI_TASK`
const FormatSingleTask Format = `SINGLE_TASK`
type GenAiComputeTask ¶ added in v0.59.0
type GenAiComputeTask struct {
// Command launcher to run the actual script, e.g. bash, python etc.
Command string `json:"command,omitempty"`
Compute *ComputeConfig `json:"compute,omitempty"`
// Runtime image
DlRuntimeImage string `json:"dl_runtime_image"`
// Optional string containing the name of the MLflow experiment to log the
// run to. If name is not found, backend will create the mlflow experiment
// using the name.
MlflowExperimentName string `json:"mlflow_experiment_name,omitempty"`
// Optional location type of the training script. When set to `WORKSPACE`,
// the script will be retrieved from the local Databricks workspace. When
// set to `GIT`, the script 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`: Script
// is located in Databricks workspace. * `GIT`: Script is located in cloud
// Git provider.
Source Source `json:"source,omitempty"`
// The training script file path 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.
TrainingScriptPath string `json:"training_script_path,omitempty"`
// Optional string containing model parameters passed to the training script
// in yaml format. If present, then the content in yaml_parameters_file_path
// will be ignored.
YamlParameters string `json:"yaml_parameters,omitempty"`
// Optional path to a YAML file containing model parameters passed to the
// training script.
YamlParametersFilePath string `json:"yaml_parameters_file_path,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (GenAiComputeTask) MarshalJSON ¶ added in v0.59.0
func (s GenAiComputeTask) MarshalJSON() ([]byte, error)
func (*GenAiComputeTask) UnmarshalJSON ¶ added in v0.59.0
func (s *GenAiComputeTask) UnmarshalJSON(b []byte) error
type GetJobPermissionLevelsRequest ¶ added in v0.15.0
type GetJobPermissionLevelsRequest struct {
// The job for which to get or manage permissions.
JobId string `json:"-" url:"-"`
}
type GetJobPermissionLevelsResponse ¶ added in v0.15.0
type GetJobPermissionLevelsResponse struct {
// Specific permission levels
PermissionLevels []JobPermissionsDescription `json:"permission_levels,omitempty"`
}
type GetJobPermissionsRequest ¶ added in v0.15.0
type GetJobPermissionsRequest struct {
// The job for which to get or manage permissions.
JobId string `json:"-" url:"-"`
}
type GetJobRequest ¶ added in v0.8.0
type GetJobRequest struct {
// The canonical identifier of the job to retrieve information about. This
// field is required.
JobId int64 `json:"-" url:"job_id"`
// Use `next_page_token` returned from the previous GetJob response to
// request the next page of the job's array properties.
PageToken string `json:"-" url:"page_token,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (GetJobRequest) MarshalJSON ¶ added in v0.55.0
func (s GetJobRequest) MarshalJSON() ([]byte, error)
func (*GetJobRequest) UnmarshalJSON ¶ added in v0.55.0
func (s *GetJobRequest) UnmarshalJSON(b []byte) error
type GetPolicyComplianceRequest ¶ added in v0.45.0
type GetPolicyComplianceRequest struct {
// The ID of the job whose compliance status you are requesting.
JobId int64 `json:"-" url:"job_id"`
}
type GetPolicyComplianceResponse ¶ added in v0.45.0
type GetPolicyComplianceResponse struct {
// Whether the job is compliant with its policies or not. Jobs could be out
// of compliance if a policy they are using was updated after the job was
// last edited and some of its job clusters no longer comply with their
// updated policies.
IsCompliant bool `json:"is_compliant,omitempty"`
// An object containing key-value mappings representing the first 200 policy
// validation errors. The keys indicate the path where the policy validation
// error is occurring. An identifier for the job cluster is prepended to the
// path. The values indicate an error message describing the policy
// validation error.
Violations map[string]string `json:"violations,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (GetPolicyComplianceResponse) MarshalJSON ¶ added in v0.45.0
func (s GetPolicyComplianceResponse) MarshalJSON() ([]byte, error)
func (*GetPolicyComplianceResponse) UnmarshalJSON ¶ added in v0.45.0
func (s *GetPolicyComplianceResponse) UnmarshalJSON(b []byte) error
type GetRunOutputRequest ¶ added in v0.8.0
type GetRunOutputRequest struct {
// The canonical identifier for the run.
RunId int64 `json:"-" url:"run_id"`
}
type GetRunRequest ¶ added in v0.8.0
type GetRunRequest struct {
// Whether to include the repair history in the response.
IncludeHistory bool `json:"-" url:"include_history,omitempty"`
// Whether to include resolved parameter values in the response.
IncludeResolvedValues bool `json:"-" url:"include_resolved_values,omitempty"`
// Use `next_page_token` returned from the previous GetRun response to
// request the next page of the run's array properties.
PageToken string `json:"-" url:"page_token,omitempty"`
// The canonical identifier of the run for which to retrieve the metadata.
// This field is required.
RunId int64 `json:"-" url:"run_id"`
ForceSendFields []string `json:"-" url:"-"`
}
func (GetRunRequest) MarshalJSON ¶ added in v0.23.0
func (s GetRunRequest) MarshalJSON() ([]byte, error)
func (*GetRunRequest) UnmarshalJSON ¶ added in v0.23.0
func (s *GetRunRequest) UnmarshalJSON(b []byte) error
type GitProvider ¶ added in v0.11.0
type GitProvider string
const GitProviderAwsCodeCommit GitProvider = `awsCodeCommit`
const GitProviderAzureDevOpsServices GitProvider = `azureDevOpsServices`
const GitProviderBitbucketCloud GitProvider = `bitbucketCloud`
const GitProviderBitbucketServer GitProvider = `bitbucketServer`
const GitProviderGitHub GitProvider = `gitHub`
const GitProviderGitHubEnterprise GitProvider = `gitHubEnterprise`
const GitProviderGitLab GitProvider = `gitLab`
const GitProviderGitLabEnterpriseEdition GitProvider = `gitLabEnterpriseEdition`
func (*GitProvider) Set ¶ added in v0.11.0
func (f *GitProvider) Set(v string) error
Set raw string value and validate it against allowed values
func (*GitProvider) String ¶ added in v0.11.0
func (f *GitProvider) String() string
String representation for fmt.Print
func (*GitProvider) Type ¶ added in v0.11.0
func (f *GitProvider) Type() string
Type always returns GitProvider to satisfy [pflag.Value] interface
func (*GitProvider) Values ¶ added in v0.72.0
func (f *GitProvider) Values() []GitProvider
Values returns all possible values for GitProvider.
There is no guarantee on the order of the values in the slice.
type GitSnapshot ¶
type GitSnapshot struct {
// 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.
UsedCommit string `json:"used_commit,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Read-only state of the remote repository at the time the job was run. This field is only included on job runs.
func (GitSnapshot) MarshalJSON ¶ added in v0.23.0
func (s GitSnapshot) MarshalJSON() ([]byte, error)
func (*GitSnapshot) UnmarshalJSON ¶ added in v0.23.0
func (s *GitSnapshot) UnmarshalJSON(b []byte) error
type GitSource ¶
type GitSource struct {
// 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.
GitBranch string `json:"git_branch,omitempty"`
// Commit to be checked out and used by this job. This field cannot be
// specified in conjunction with git_branch or git_tag.
GitCommit string `json:"git_commit,omitempty"`
// Unique identifier of the service used to host the Git repository. The
// value is case insensitive.
GitProvider GitProvider `json:"git_provider"`
GitSnapshot *GitSnapshot `json:"git_snapshot,omitempty"`
// 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.
GitTag string `json:"git_tag,omitempty"`
// URL of the repository to be cloned by this job.
GitUrl string `json:"git_url"`
// The source of the job specification in the remote repository when the job
// is source controlled.
JobSource *JobSource `json:"job_source,omitempty"`
SparseCheckout *SparseCheckout `json:"sparse_checkout,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
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.
func (GitSource) MarshalJSON ¶ added in v0.23.0
func (*GitSource) UnmarshalJSON ¶ added in v0.23.0
type Job ¶
type Job struct {
// The time at which this job was created in epoch milliseconds
// (milliseconds since 1/1/1970 UTC).
CreatedTime int64 `json:"created_time,omitempty"`
// The creator user name. This field won’t be included in the response if
// the user has already been deleted.
CreatorUserName string `json:"creator_user_name,omitempty"`
// The id of the budget policy used by this job for cost attribution
// purposes. This may be set through (in order of precedence): 1. Budget
// admins through the account or workspace console 2. Jobs UI in the job
// details page and Jobs API using `budget_policy_id` 3. Inferred default
// based on accessible budget policies of the run_as identity on job
// creation or modification.
EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"`
// The id of the usage policy used by this job for cost attribution
// purposes.
EffectiveUsagePolicyId string `json:"effective_usage_policy_id,omitempty"`
// Indicates if the job has more array properties (`tasks`, `job_clusters`)
// that are not shown. They can be accessed via :method:jobs/get endpoint.
// It is only relevant for API 2.2 :method:jobs/list requests with
// `expand_tasks=true`.
HasMore bool `json:"has_more,omitempty"`
// The canonical identifier for this job.
JobId int64 `json:"job_id,omitempty"`
// A token that can be used to list the next page of array properties.
NextPageToken string `json:"next_page_token,omitempty"`
// 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.
RunAsUserName string `json:"run_as_user_name,omitempty"`
// Settings for this job and all of its runs. These settings can be updated
// using the `resetJob` method.
Settings *JobSettings `json:"settings,omitempty"`
// State of the trigger associated with the job.
TriggerState *TriggerStateProto `json:"trigger_state,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Job was retrieved successfully.
func (Job) MarshalJSON ¶ added in v0.23.0
func (*Job) UnmarshalJSON ¶ added in v0.23.0
type JobAccessControlRequest ¶ added in v0.15.0
type JobAccessControlRequest struct {
// name of the group
GroupName string `json:"group_name,omitempty"`
PermissionLevel JobPermissionLevel `json:"permission_level,omitempty"`
// application ID of a service principal
ServicePrincipalName string `json:"service_principal_name,omitempty"`
// name of the user
UserName string `json:"user_name,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (JobAccessControlRequest) MarshalJSON ¶ added in v0.23.0
func (s JobAccessControlRequest) MarshalJSON() ([]byte, error)
func (*JobAccessControlRequest) UnmarshalJSON ¶ added in v0.23.0
func (s *JobAccessControlRequest) UnmarshalJSON(b []byte) error
type JobAccessControlResponse ¶ added in v0.15.0
type JobAccessControlResponse struct {
// All permissions.
AllPermissions []JobPermission `json:"all_permissions,omitempty"`
// Display name of the user or service principal.
DisplayName string `json:"display_name,omitempty"`
// name of the group
GroupName string `json:"group_name,omitempty"`
// Name of the service principal.
ServicePrincipalName string `json:"service_principal_name,omitempty"`
// name of the user
UserName string `json:"user_name,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (JobAccessControlResponse) MarshalJSON ¶ added in v0.23.0
func (s JobAccessControlResponse) MarshalJSON() ([]byte, error)
func (*JobAccessControlResponse) UnmarshalJSON ¶ added in v0.23.0
func (s *JobAccessControlResponse) UnmarshalJSON(b []byte) error
type JobCluster ¶
type JobCluster struct {
// 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.
JobClusterKey string `json:"job_cluster_key"`
// If new_cluster, a description of a cluster that is created for each task.
NewCluster compute.ClusterSpec `json:"new_cluster"`
}
type JobCompliance ¶ added in v0.45.0
type JobCompliance struct {
// Whether this job is in compliance with the latest version of its policy.
IsCompliant bool `json:"is_compliant,omitempty"`
// Canonical unique identifier for a job.
JobId int64 `json:"job_id"`
// An object containing key-value mappings representing the first 200 policy
// validation errors. The keys indicate the path where the policy validation
// error is occurring. An identifier for the job cluster is prepended to the
// path. The values indicate an error message describing the policy
// validation error.
Violations map[string]string `json:"violations,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (JobCompliance) MarshalJSON ¶ added in v0.45.0
func (s JobCompliance) MarshalJSON() ([]byte, error)
func (*JobCompliance) UnmarshalJSON ¶ added in v0.45.0
func (s *JobCompliance) UnmarshalJSON(b []byte) error
type JobDeployment ¶ added in v0.23.0
type JobDeployment struct {
// The kind of deployment that manages the job.
//
// * `BUNDLE`: The job is managed by Databricks Asset Bundle. *
// `SYSTEM_MANAGED`: The job is managed by Databricks and is read-only.
Kind JobDeploymentKind `json:"kind"`
// Path of the file that contains deployment metadata.
MetadataFilePath string `json:"metadata_file_path,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (JobDeployment) MarshalJSON ¶ added in v0.23.0
func (s JobDeployment) MarshalJSON() ([]byte, error)
func (*JobDeployment) UnmarshalJSON ¶ added in v0.23.0
func (s *JobDeployment) UnmarshalJSON(b []byte) error
type JobDeploymentKind ¶ added in v0.23.0
type JobDeploymentKind string
* `BUNDLE`: The job is managed by Databricks Asset Bundle. * `SYSTEM_MANAGED`: The job is managed by Databricks and is read-only.
const JobDeploymentKindBundle JobDeploymentKind = `BUNDLE`
The job is managed by Databricks Asset Bundle.
const JobDeploymentKindSystemManaged JobDeploymentKind = `SYSTEM_MANAGED`
The job is managed by <Databricks> and is read-only.
func (*JobDeploymentKind) Set ¶ added in v0.23.0
func (f *JobDeploymentKind) Set(v string) error
Set raw string value and validate it against allowed values
func (*JobDeploymentKind) String ¶ added in v0.23.0
func (f *JobDeploymentKind) String() string
String representation for fmt.Print
func (*JobDeploymentKind) Type ¶ added in v0.23.0
func (f *JobDeploymentKind) Type() string
Type always returns JobDeploymentKind to satisfy [pflag.Value] interface
func (*JobDeploymentKind) Values ¶ added in v0.72.0
func (f *JobDeploymentKind) Values() []JobDeploymentKind
Values returns all possible values for JobDeploymentKind.
There is no guarantee on the order of the values in the slice.
type JobEditMode ¶ added in v0.37.0
type JobEditMode string
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.
const JobEditModeEditable JobEditMode = `EDITABLE`
The job is in an editable state and can be modified.
const JobEditModeUiLocked JobEditMode = `UI_LOCKED`
The job is in a locked UI state and cannot be modified.
func (*JobEditMode) Set ¶ added in v0.37.0
func (f *JobEditMode) Set(v string) error
Set raw string value and validate it against allowed values
func (*JobEditMode) String ¶ added in v0.37.0
func (f *JobEditMode) String() string
String representation for fmt.Print
func (*JobEditMode) Type ¶ added in v0.37.0
func (f *JobEditMode) Type() string
Type always returns JobEditMode to satisfy [pflag.Value] interface
func (*JobEditMode) Values ¶ added in v0.72.0
func (f *JobEditMode) Values() []JobEditMode
Values returns all possible values for JobEditMode.
There is no guarantee on the order of the values in the slice.
type JobEmailNotifications ¶
type JobEmailNotifications struct {
// If true, do not send email to recipients specified in `on_failure` if the
// run is skipped. This field is `deprecated`. Please use the
// `notification_settings.no_alert_for_skipped_runs` field.
NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"`
// 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.
OnDurationWarningThresholdExceeded []string `json:"on_duration_warning_threshold_exceeded,omitempty"`
// 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.
OnFailure []string `json:"on_failure,omitempty"`
// 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.
OnStart []string `json:"on_start,omitempty"`
// A list of email addresses to notify when any streaming backlog thresholds
// are exceeded for any stream. Streaming backlog thresholds can be set in
// the `health` field using the following metrics:
// `STREAMING_BACKLOG_BYTES`, `STREAMING_BACKLOG_RECORDS`,
// `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`. Alerting is
// based on the 10-minute average of these metrics. If the issue persists,
// notifications are resent every 30 minutes.
OnStreamingBacklogExceeded []string `json:"on_streaming_backlog_exceeded,omitempty"`
// 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.
OnSuccess []string `json:"on_success,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (JobEmailNotifications) MarshalJSON ¶ added in v0.23.0
func (s JobEmailNotifications) MarshalJSON() ([]byte, error)
func (*JobEmailNotifications) UnmarshalJSON ¶ added in v0.23.0
func (s *JobEmailNotifications) UnmarshalJSON(b []byte) error
type JobEnvironment ¶ added in v0.38.0
type JobEnvironment struct {
// The key of an environment. It has to be unique within a job.
EnvironmentKey string `json:"environment_key"`
Spec *compute.Environment `json:"spec,omitempty"`
}
type JobNotificationSettings ¶ added in v0.9.0
type JobNotificationSettings struct {
// If true, do not send notifications to recipients specified in
// `on_failure` if the run is canceled.
NoAlertForCanceledRuns bool `json:"no_alert_for_canceled_runs,omitempty"`
// If true, do not send notifications to recipients specified in
// `on_failure` if the run is skipped.
NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (JobNotificationSettings) MarshalJSON ¶ added in v0.23.0
func (s JobNotificationSettings) MarshalJSON() ([]byte, error)
func (*JobNotificationSettings) UnmarshalJSON ¶ added in v0.23.0
func (s *JobNotificationSettings) UnmarshalJSON(b []byte) error
type JobParameter ¶ added in v0.12.0
type JobParameter struct {
// The optional default value of the parameter
Default string `json:"default,omitempty"`
// The name of the parameter
Name string `json:"name,omitempty"`
// The value used in the run
Value string `json:"value,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (JobParameter) MarshalJSON ¶ added in v0.23.0
func (s JobParameter) MarshalJSON() ([]byte, error)
func (*JobParameter) UnmarshalJSON ¶ added in v0.23.0
func (s *JobParameter) UnmarshalJSON(b []byte) error
type JobParameterDefinition ¶ added in v0.12.0
type JobPermission ¶ added in v0.15.0
type JobPermission struct {
Inherited bool `json:"inherited,omitempty"`
InheritedFromObject []string `json:"inherited_from_object,omitempty"`
PermissionLevel JobPermissionLevel `json:"permission_level,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (JobPermission) MarshalJSON ¶ added in v0.23.0
func (s JobPermission) MarshalJSON() ([]byte, error)
func (*JobPermission) UnmarshalJSON ¶ added in v0.23.0
func (s *JobPermission) UnmarshalJSON(b []byte) error
type JobPermissionLevel ¶ added in v0.15.0
type JobPermissionLevel string
Permission level
const JobPermissionLevelCanManage JobPermissionLevel = `CAN_MANAGE`
const JobPermissionLevelCanManageRun JobPermissionLevel = `CAN_MANAGE_RUN`
const JobPermissionLevelCanView JobPermissionLevel = `CAN_VIEW`
const JobPermissionLevelIsOwner JobPermissionLevel = `IS_OWNER`
func (*JobPermissionLevel) Set ¶ added in v0.15.0
func (f *JobPermissionLevel) Set(v string) error
Set raw string value and validate it against allowed values
func (*JobPermissionLevel) String ¶ added in v0.15.0
func (f *JobPermissionLevel) String() string
String representation for fmt.Print
func (*JobPermissionLevel) Type ¶ added in v0.15.0
func (f *JobPermissionLevel) Type() string
Type always returns JobPermissionLevel to satisfy [pflag.Value] interface
func (*JobPermissionLevel) Values ¶ added in v0.72.0
func (f *JobPermissionLevel) Values() []JobPermissionLevel
Values returns all possible values for JobPermissionLevel.
There is no guarantee on the order of the values in the slice.
type JobPermissions ¶ added in v0.15.0
type JobPermissions struct {
AccessControlList []JobAccessControlResponse `json:"access_control_list,omitempty"`
ObjectId string `json:"object_id,omitempty"`
ObjectType string `json:"object_type,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (JobPermissions) MarshalJSON ¶ added in v0.23.0
func (s JobPermissions) MarshalJSON() ([]byte, error)
func (*JobPermissions) UnmarshalJSON ¶ added in v0.23.0
func (s *JobPermissions) UnmarshalJSON(b []byte) error
type JobPermissionsDescription ¶ added in v0.15.0
type JobPermissionsDescription struct {
Description string `json:"description,omitempty"`
PermissionLevel JobPermissionLevel `json:"permission_level,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (JobPermissionsDescription) MarshalJSON ¶ added in v0.23.0
func (s JobPermissionsDescription) MarshalJSON() ([]byte, error)
func (*JobPermissionsDescription) UnmarshalJSON ¶ added in v0.23.0
func (s *JobPermissionsDescription) UnmarshalJSON(b []byte) error
type JobPermissionsRequest ¶ added in v0.15.0
type JobPermissionsRequest struct {
AccessControlList []JobAccessControlRequest `json:"access_control_list,omitempty"`
// The job for which to get or manage permissions.
JobId string `json:"-" url:"-"`
}
type JobRunAs ¶ added in v0.10.0
type JobRunAs struct {
// Group name of an account group assigned to the workspace. Setting this
// field requires being a member of the group.
GroupName string `json:"group_name,omitempty"`
// Application ID of an active service principal. Setting this field
// requires the `servicePrincipal/user` role.
ServicePrincipalName string `json:"service_principal_name,omitempty"`
// The email of an active workspace user. Non-admin users can only set this
// field to their own email.
UserName string `json:"user_name,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Write-only setting. Specifies the user or service principal that the job runs as. If not specified, the job runs as the user who created the job.
Either `user_name` or `service_principal_name` should be specified. If not, an error is thrown.
func (JobRunAs) MarshalJSON ¶ added in v0.23.0
func (*JobRunAs) UnmarshalJSON ¶ added in v0.23.0
type JobSettings ¶
type JobSettings struct {
// The id of the user specified budget policy to use for this job. If not
// specified, a default budget policy may be applied when creating or
// modifying the job. See `effective_budget_policy_id` for the budget policy
// used by this workload.
BudgetPolicyId string `json:"budget_policy_id,omitempty"`
// 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.
Continuous *Continuous `json:"continuous,omitempty"`
// Deployment information for jobs managed by external sources.
Deployment *JobDeployment `json:"deployment,omitempty"`
// An optional description for the job. The maximum length is 27700
// characters in UTF-8 encoding.
Description string `json:"description,omitempty"`
// 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.
EditMode JobEditMode `json:"edit_mode,omitempty"`
// 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.
EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"`
// A list of task execution environment specifications that can be
// referenced by serverless tasks of this job. For serverless notebook
// tasks, if the environment_key is not specified, the notebook environment
// will be used if present. If a jobs environment is specified, it will
// override the notebook environment. For other serverless tasks, the task
// environment is required to be specified using environment_key in the task
// settings.
Environments []JobEnvironment `json:"environments,omitempty"`
// 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"`.
Format Format `json:"format,omitempty"`
// 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.
GitSource *GitSource `json:"git_source,omitempty"`
Health *JobsHealthRules `json:"health,omitempty"`
// 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.
JobClusters []JobCluster `json:"job_clusters,omitempty"`
// 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.
MaxConcurrentRuns int `json:"max_concurrent_runs,omitempty"`
// An optional name for the job. The maximum length is 4096 bytes in UTF-8
// encoding.
Name string `json:"name,omitempty"`
// Optional notification settings that are used when sending notifications
// to each of the `email_notifications` and `webhook_notifications` for this
// job.
NotificationSettings *JobNotificationSettings `json:"notification_settings,omitempty"`
// Job-level parameter definitions
Parameters []JobParameterDefinition `json:"parameters,omitempty"`
// The performance mode on a serverless job. This field determines the level
// of compute performance or cost-efficiency for the run. The performance
// target does not apply to tasks that run on Serverless GPU compute.
//
// * `STANDARD`: Enables cost-efficient execution of serverless workloads. *
// `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times
// through rapid scaling and optimized cluster performance.
PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"`
// The queue settings of the job.
Queue *QueueSettings `json:"queue,omitempty"`
// The user or service principal that the job runs as, if specified in the
// request. This field indicates the explicit configuration of `run_as` for
// the job. To find the value in all cases, explicit or implicit, use
// `run_as_user_name`.
RunAs *JobRunAs `json:"run_as,omitempty"`
// 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`.
Schedule *CronSchedule `json:"schedule,omitempty"`
// 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.
Tags map[string]string `json:"tags,omitempty"`
// A list of task specifications to be executed by this job. It supports up
// to 1000 elements in write endpoints (:method:jobs/create,
// :method:jobs/reset, :method:jobs/update, :method:jobs/submit). Read
// endpoints return only 100 tasks. If more than 100 tasks are available,
// you can paginate through them using :method:jobs/get. Use the
// `next_page_token` field at the object root to determine if more results
// are available.
Tasks []Task `json:"tasks,omitempty"`
// An optional timeout applied to each run of this job. A value of `0` means
// no timeout.
TimeoutSeconds int `json:"timeout_seconds,omitempty"`
// 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`.
Trigger *TriggerSettings `json:"trigger,omitempty"`
// The id of the user specified usage policy to use for this job. If not
// specified, a default usage policy may be applied when creating or
// modifying the job. See `effective_usage_policy_id` for the usage policy
// used by this workload.
UsagePolicyId string `json:"usage_policy_id,omitempty"`
// A collection of system notification IDs to notify when runs of this job
// begin or complete.
WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (JobSettings) MarshalJSON ¶ added in v0.23.0
func (s JobSettings) MarshalJSON() ([]byte, error)
func (*JobSettings) UnmarshalJSON ¶ added in v0.23.0
func (s *JobSettings) UnmarshalJSON(b []byte) error
type JobSource ¶ added in v0.13.0
type JobSource struct {
// 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.
DirtyState JobSourceDirtyState `json:"dirty_state,omitempty"`
// Name of the branch which the job is imported from.
ImportFromGitBranch string `json:"import_from_git_branch"`
// Path of the job YAML file that contains the job specification.
JobConfigPath string `json:"job_config_path"`
}
The source of the job specification in the remote repository when the job is source controlled.
type JobSourceDirtyState ¶ added in v0.13.0
type JobSourceDirtyState string
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.
const JobSourceDirtyStateDisconnected JobSourceDirtyState = `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.
const JobSourceDirtyStateNotSynced JobSourceDirtyState = `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.
func (*JobSourceDirtyState) Set ¶ added in v0.13.0
func (f *JobSourceDirtyState) Set(v string) error
Set raw string value and validate it against allowed values
func (*JobSourceDirtyState) String ¶ added in v0.13.0
func (f *JobSourceDirtyState) String() string
String representation for fmt.Print
func (*JobSourceDirtyState) Type ¶ added in v0.13.0
func (f *JobSourceDirtyState) Type() string
Type always returns JobSourceDirtyState to satisfy [pflag.Value] interface
func (*JobSourceDirtyState) Values ¶ added in v0.72.0
func (f *JobSourceDirtyState) Values() []JobSourceDirtyState
Values returns all possible values for JobSourceDirtyState.
There is no guarantee on the order of the values in the slice.
type JobsAPI ¶
type JobsAPI struct {
// contains filtered or unexported fields
}
The Jobs API allows you to create, edit, and delete jobs.
You can use a Databricks job to run a data processing or data analysis task in a Databricks cluster with scalable resources. Your job can consist of a single task or can be a large, multi-task workflow with complex dependencies. Databricks manages the task orchestration, cluster management, monitoring, and error reporting for all of your jobs. You can run your jobs immediately or periodically through an easy-to-use scheduling system. You can implement job tasks using notebooks, JARS, Spark Declarative Pipelines, or Python, Scala, Spark submit, and Java applications.
You should never hard code secrets or store them in plain text. Use the Secrets CLI to manage secrets in the Databricks CLI. Use the Secrets utility to reference secrets in notebooks and jobs.
func NewJobs ¶
func NewJobs(client *client.DatabricksClient) *JobsAPI
func (*JobsAPI) BaseJobSettingsNameToJobIdMap ¶ added in v0.3.0
func (a *JobsAPI) BaseJobSettingsNameToJobIdMap(ctx context.Context, request ListJobsRequest) (map[string]int64, error)
BaseJobSettingsNameToJobIdMap calls JobsAPI.ListAll and creates a map of results with BaseJob.Settings.Name as key and BaseJob.JobId as value.
Returns an error if there's more than one BaseJob with the same .Settings.Name.
Note: All BaseJob instances are loaded into memory before creating a map.
This method is generated by Databricks SDK Code Generator.
func (*JobsAPI) CancelAllRuns ¶
func (a *JobsAPI) CancelAllRuns(ctx context.Context, request CancelAllRuns) error
Example (JobsApiFullIntegration) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
notebookPath := func() string {
me, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
return filepath.Join("/Users", me.UserName, fmt.Sprintf("sdk-%x", time.Now().UnixNano()))
}()
clusterId := func() string {
clusterId := os.Getenv("DATABRICKS_CLUSTER_ID")
err := w.Clusters.EnsureClusterIsRunning(ctx, clusterId)
if err != nil {
panic(err)
}
return clusterId
}()
createdJob, err := w.Jobs.Create(ctx, jobs.CreateJob{
Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
Tasks: []jobs.Task{jobs.Task{
Description: "test",
ExistingClusterId: clusterId,
NotebookTask: &jobs.NotebookTask{
NotebookPath: notebookPath,
},
TaskKey: "test",
TimeoutSeconds: 0,
}},
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", createdJob)
err = w.Jobs.CancelAllRuns(ctx, jobs.CancelAllRuns{
JobId: createdJob.JobId,
})
if err != nil {
panic(err)
}
// cleanup
err = w.Jobs.DeleteByJobId(ctx, createdJob.JobId)
if err != nil {
panic(err)
}
func (*JobsAPI) CancelRun ¶
func (a *JobsAPI) CancelRun(ctx context.Context, cancelRun CancelRun) (*WaitGetRunJobTerminatedOrSkipped[struct{}], error)
Cancels a job run or a task run. The run is canceled asynchronously, so it may still be running when this request completes.
Example (JobsApiFullIntegration) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
notebookPath := func() string {
me, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
return filepath.Join("/Users", me.UserName, fmt.Sprintf("sdk-%x", time.Now().UnixNano()))
}()
clusterId := func() string {
clusterId := os.Getenv("DATABRICKS_CLUSTER_ID")
err := w.Clusters.EnsureClusterIsRunning(ctx, clusterId)
if err != nil {
panic(err)
}
return clusterId
}()
createdJob, err := w.Jobs.Create(ctx, jobs.CreateJob{
Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
Tasks: []jobs.Task{jobs.Task{
Description: "test",
ExistingClusterId: clusterId,
NotebookTask: &jobs.NotebookTask{
NotebookPath: notebookPath,
},
TaskKey: "test",
TimeoutSeconds: 0,
}},
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", createdJob)
runNowResponse, err := w.Jobs.RunNow(ctx, jobs.RunNow{
JobId: createdJob.JobId,
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", runNowResponse)
cancelledRun, err := w.Jobs.CancelRunAndWait(ctx, jobs.CancelRun{
RunId: runNowResponse.Response.RunId,
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", cancelledRun)
// cleanup
err = w.Jobs.DeleteByJobId(ctx, createdJob.JobId)
if err != nil {
panic(err)
}
func (*JobsAPI) CancelRunAndWait
deprecated
func (a *JobsAPI) CancelRunAndWait(ctx context.Context, cancelRun CancelRun, options ...retries.Option[Run]) (*Run, error)
Calls JobsAPI.CancelRun and waits to reach TERMINATED or SKIPPED state
You can override the default timeout of 20 minutes by calling adding retries.Timeout[Run](60*time.Minute) functional option.
Deprecated: use JobsAPI.CancelRun.Get() or JobsAPI.WaitGetRunJobTerminatedOrSkipped
func (*JobsAPI) CancelRunByRunId ¶
Cancels a job run or a task run. The run is canceled asynchronously, so it may still be running when this request completes.
func (*JobsAPI) CancelRunByRunIdAndWait ¶
func (*JobsAPI) Create ¶
func (a *JobsAPI) Create(ctx context.Context, request CreateJob) (*CreateResponse, error)
Example (JobsApiFullIntegration) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
notebookPath := func() string {
me, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
return filepath.Join("/Users", me.UserName, fmt.Sprintf("sdk-%x", time.Now().UnixNano()))
}()
clusterId := func() string {
clusterId := os.Getenv("DATABRICKS_CLUSTER_ID")
err := w.Clusters.EnsureClusterIsRunning(ctx, clusterId)
if err != nil {
panic(err)
}
return clusterId
}()
createdJob, err := w.Jobs.Create(ctx, jobs.CreateJob{
Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
Tasks: []jobs.Task{jobs.Task{
Description: "test",
ExistingClusterId: clusterId,
NotebookTask: &jobs.NotebookTask{
NotebookPath: notebookPath,
},
TaskKey: "test",
TimeoutSeconds: 0,
}},
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", createdJob)
// cleanup
err = w.Jobs.DeleteByJobId(ctx, createdJob.JobId)
if err != nil {
panic(err)
}
func (*JobsAPI) DeleteByJobId ¶
Deletes a job.
func (*JobsAPI) DeleteRunByRunId ¶
Deletes a non-active run. Returns an error if the run is active.
func (*JobsAPI) ExportRun ¶
func (a *JobsAPI) ExportRun(ctx context.Context, request ExportRunRequest) (*ExportRunOutput, error)
Example (JobsApiFullIntegration) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
notebookPath := func() string {
me, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
return filepath.Join("/Users", me.UserName, fmt.Sprintf("sdk-%x", time.Now().UnixNano()))
}()
clusterId := func() string {
clusterId := os.Getenv("DATABRICKS_CLUSTER_ID")
err := w.Clusters.EnsureClusterIsRunning(ctx, clusterId)
if err != nil {
panic(err)
}
return clusterId
}()
createdJob, err := w.Jobs.Create(ctx, jobs.CreateJob{
Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
Tasks: []jobs.Task{jobs.Task{
Description: "test",
ExistingClusterId: clusterId,
NotebookTask: &jobs.NotebookTask{
NotebookPath: notebookPath,
},
TaskKey: "test",
TimeoutSeconds: 0,
}},
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", createdJob)
runById, err := w.Jobs.RunNowAndWait(ctx, jobs.RunNow{
JobId: createdJob.JobId,
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", runById)
exportedView, err := w.Jobs.ExportRun(ctx, jobs.ExportRunRequest{
RunId: runById.Tasks[0].RunId,
ViewsToExport: "CODE",
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", exportedView)
// cleanup
err = w.Jobs.DeleteByJobId(ctx, createdJob.JobId)
if err != nil {
panic(err)
}
func (*JobsAPI) Get ¶
Get retrieves a job based on the provided request. It handles pagination if the job contains multiple tasks, job_clusters, job_parameters or environments.
Example (JobsApiFullIntegration) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
notebookPath := func() string {
me, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
return filepath.Join("/Users", me.UserName, fmt.Sprintf("sdk-%x", time.Now().UnixNano()))
}()
clusterId := func() string {
clusterId := os.Getenv("DATABRICKS_CLUSTER_ID")
err := w.Clusters.EnsureClusterIsRunning(ctx, clusterId)
if err != nil {
panic(err)
}
return clusterId
}()
createdJob, err := w.Jobs.Create(ctx, jobs.CreateJob{
Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
Tasks: []jobs.Task{jobs.Task{
Description: "test",
ExistingClusterId: clusterId,
NotebookTask: &jobs.NotebookTask{
NotebookPath: notebookPath,
},
TaskKey: "test",
TimeoutSeconds: 0,
}},
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", createdJob)
byId, err := w.Jobs.GetByJobId(ctx, createdJob.JobId)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", byId)
// cleanup
err = w.Jobs.DeleteByJobId(ctx, createdJob.JobId)
if err != nil {
panic(err)
}
func (*JobsAPI) GetByJobId ¶
Retrieves the details for a single job.
Large arrays in the results will be paginated when they exceed 100 elements. A request for a single job will return all properties for that job, and the first 100 elements of array properties (`tasks`, `job_clusters`, `environments` and `parameters`). Use the `next_page_token` field to check for more results and pass its value as the `page_token` in subsequent requests. If any array properties have more than 100 elements, additional results will be returned on subsequent requests. Arrays without additional results will be empty on later pages.
func (*JobsAPI) GetBySettingsName ¶
GetBySettingsName calls JobsAPI.BaseJobSettingsNameToJobIdMap and returns a single BaseJob.
Returns an error if there's more than one BaseJob with the same .Settings.Name.
Note: All BaseJob instances are loaded into memory before returning matching by name.
This method is generated by Databricks SDK Code Generator.
func (*JobsAPI) GetPermissionLevels ¶ added in v0.19.0
func (a *JobsAPI) GetPermissionLevels(ctx context.Context, request GetJobPermissionLevelsRequest) (*GetJobPermissionLevelsResponse, error)
func (*JobsAPI) GetPermissionLevelsByJobId ¶ added in v0.19.0
func (a *JobsAPI) GetPermissionLevelsByJobId(ctx context.Context, jobId string) (*GetJobPermissionLevelsResponse, error)
Gets the permission levels that a user can have on an object.
func (*JobsAPI) GetPermissions ¶ added in v0.19.0
func (a *JobsAPI) GetPermissions(ctx context.Context, request GetJobPermissionsRequest) (*JobPermissions, error)
func (*JobsAPI) GetPermissionsByJobId ¶ added in v0.19.0
Gets the permissions of a job. Jobs can inherit permissions from their root object.
func (*JobsAPI) GetRun ¶
GetRun retrieves a run based on the provided request. It handles pagination if the run contains multiple iterations or tasks.
func (*JobsAPI) GetRunOutput ¶
func (a *JobsAPI) GetRunOutput(ctx context.Context, request GetRunOutputRequest) (*RunOutput, error)
Example (JobsApiFullIntegration) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
notebookPath := func() string {
me, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
return filepath.Join("/Users", me.UserName, fmt.Sprintf("sdk-%x", time.Now().UnixNano()))
}()
clusterId := func() string {
clusterId := os.Getenv("DATABRICKS_CLUSTER_ID")
err := w.Clusters.EnsureClusterIsRunning(ctx, clusterId)
if err != nil {
panic(err)
}
return clusterId
}()
run, err := w.Jobs.SubmitAndWait(ctx, jobs.SubmitRun{
RunName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
Tasks: []jobs.SubmitTask{jobs.SubmitTask{
ExistingClusterId: clusterId,
NotebookTask: &jobs.NotebookTask{
NotebookPath: notebookPath,
},
TaskKey: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
}},
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", run)
output, err := w.Jobs.GetRunOutputByRunId(ctx, run.Tasks[0].RunId)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", output)
// cleanup
err = w.Jobs.DeleteRunByRunId(ctx, run.RunId)
if err != nil {
panic(err)
}
func (*JobsAPI) GetRunOutputByRunId ¶
Retrieve the output and metadata of a single task run. When a notebook task returns a value through the `dbutils.notebook.exit()` call, you can use this endpoint to retrieve that value. Databricks restricts this API to returning the first 5 MB of the output. To return a larger result, you can store job results in a cloud storage service.
This endpoint validates that the __run_id__ parameter is valid and returns an HTTP status code 400 if the __run_id__ parameter is invalid. Runs are automatically removed after 60 days. If you to want to reference them beyond 60 days, you must save old run results before they expire.
func (*JobsAPI) List ¶ added in v0.24.0
List fetches a list of jobs. If expand_tasks is true, the response will include the full list of tasks and job_clusters for each job. This function handles pagination two ways: paginates all the jobs in the list and paginates all the tasks and job_clusters for each job.
Example (JobsApiFullIntegration) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
jobList, err := w.Jobs.ListAll(ctx, jobs.ListJobsRequest{
ExpandTasks: false,
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", jobList)
func (*JobsAPI) ListAll ¶
func (a *JobsAPI) ListAll(ctx context.Context, request ListJobsRequest) ([]BaseJob, error)
Retrieves a list of jobs.
func (*JobsAPI) ListRuns ¶ added in v0.24.0
ListRuns fetches a list of job runs. If expand_tasks is true, the response will include the full list of tasks and job_clusters for each run. This function handles pagination two ways: paginates all the runs in the list and paginates all the tasks and job_clusters for each run.
Example (JobsApiFullIntegration) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
notebookPath := func() string {
me, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
return filepath.Join("/Users", me.UserName, fmt.Sprintf("sdk-%x", time.Now().UnixNano()))
}()
clusterId := func() string {
clusterId := os.Getenv("DATABRICKS_CLUSTER_ID")
err := w.Clusters.EnsureClusterIsRunning(ctx, clusterId)
if err != nil {
panic(err)
}
return clusterId
}()
createdJob, err := w.Jobs.Create(ctx, jobs.CreateJob{
Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
Tasks: []jobs.Task{jobs.Task{
Description: "test",
ExistingClusterId: clusterId,
NotebookTask: &jobs.NotebookTask{
NotebookPath: notebookPath,
},
TaskKey: "test",
TimeoutSeconds: 0,
}},
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", createdJob)
runList, err := w.Jobs.ListRunsAll(ctx, jobs.ListRunsRequest{
JobId: createdJob.JobId,
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", runList)
// cleanup
err = w.Jobs.DeleteByJobId(ctx, createdJob.JobId)
if err != nil {
panic(err)
}
func (*JobsAPI) ListRunsAll ¶
func (a *JobsAPI) ListRunsAll(ctx context.Context, request ListRunsRequest) ([]BaseRun, error)
List runs in descending order by start time.
func (*JobsAPI) RepairRun ¶
func (a *JobsAPI) RepairRun(ctx context.Context, repairRun RepairRun) (*WaitGetRunJobTerminatedOrSkipped[RepairRunResponse], error)
Re-run one or more tasks. Tasks are re-run as part of the original job run. They use the current job and task settings, and can be viewed in the history for the original job run.
Example (JobsApiFullIntegration) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
notebookPath := func() string {
me, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
return filepath.Join("/Users", me.UserName, fmt.Sprintf("sdk-%x", time.Now().UnixNano()))
}()
clusterId := func() string {
clusterId := os.Getenv("DATABRICKS_CLUSTER_ID")
err := w.Clusters.EnsureClusterIsRunning(ctx, clusterId)
if err != nil {
panic(err)
}
return clusterId
}()
createdJob, err := w.Jobs.Create(ctx, jobs.CreateJob{
Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
Tasks: []jobs.Task{jobs.Task{
Description: "test",
ExistingClusterId: clusterId,
NotebookTask: &jobs.NotebookTask{
NotebookPath: notebookPath,
},
TaskKey: "test",
TimeoutSeconds: 0,
}},
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", createdJob)
runNowResponse, err := w.Jobs.RunNow(ctx, jobs.RunNow{
JobId: createdJob.JobId,
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", runNowResponse)
cancelledRun, err := w.Jobs.CancelRunAndWait(ctx, jobs.CancelRun{
RunId: runNowResponse.Response.RunId,
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", cancelledRun)
repairedRun, err := w.Jobs.RepairRunAndWait(ctx, jobs.RepairRun{
RerunTasks: []string{cancelledRun.Tasks[0].TaskKey},
RunId: runNowResponse.Response.RunId,
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", repairedRun)
// cleanup
err = w.Jobs.DeleteByJobId(ctx, createdJob.JobId)
if err != nil {
panic(err)
}
func (*JobsAPI) RepairRunAndWait
deprecated
func (a *JobsAPI) RepairRunAndWait(ctx context.Context, repairRun RepairRun, options ...retries.Option[Run]) (*Run, error)
Calls JobsAPI.RepairRun and waits to reach TERMINATED or SKIPPED state
You can override the default timeout of 20 minutes by calling adding retries.Timeout[Run](60*time.Minute) functional option.
Deprecated: use JobsAPI.RepairRun.Get() or JobsAPI.WaitGetRunJobTerminatedOrSkipped
func (*JobsAPI) Reset ¶
Example (JobsApiFullIntegration) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
notebookPath := func() string {
me, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
return filepath.Join("/Users", me.UserName, fmt.Sprintf("sdk-%x", time.Now().UnixNano()))
}()
clusterId := func() string {
clusterId := os.Getenv("DATABRICKS_CLUSTER_ID")
err := w.Clusters.EnsureClusterIsRunning(ctx, clusterId)
if err != nil {
panic(err)
}
return clusterId
}()
createdJob, err := w.Jobs.Create(ctx, jobs.CreateJob{
Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
Tasks: []jobs.Task{jobs.Task{
Description: "test",
ExistingClusterId: clusterId,
NotebookTask: &jobs.NotebookTask{
NotebookPath: notebookPath,
},
TaskKey: "test",
TimeoutSeconds: 0,
}},
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", createdJob)
newName := fmt.Sprintf("sdk-%x", time.Now().UnixNano())
byId, err := w.Jobs.GetByJobId(ctx, createdJob.JobId)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", byId)
err = w.Jobs.Reset(ctx, jobs.ResetJob{
JobId: byId.JobId,
NewSettings: jobs.JobSettings{
Name: newName,
Tasks: byId.Settings.Tasks,
},
})
if err != nil {
panic(err)
}
// cleanup
err = w.Jobs.DeleteByJobId(ctx, createdJob.JobId)
if err != nil {
panic(err)
}
func (*JobsAPI) RunNow ¶
func (a *JobsAPI) RunNow(ctx context.Context, runNow RunNow) (*WaitGetRunJobTerminatedOrSkipped[RunNowResponse], error)
Run a job and return the `run_id` of the triggered run.
Example (JobsApiFullIntegration) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
notebookPath := func() string {
me, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
return filepath.Join("/Users", me.UserName, fmt.Sprintf("sdk-%x", time.Now().UnixNano()))
}()
clusterId := func() string {
clusterId := os.Getenv("DATABRICKS_CLUSTER_ID")
err := w.Clusters.EnsureClusterIsRunning(ctx, clusterId)
if err != nil {
panic(err)
}
return clusterId
}()
createdJob, err := w.Jobs.Create(ctx, jobs.CreateJob{
Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
Tasks: []jobs.Task{jobs.Task{
Description: "test",
ExistingClusterId: clusterId,
NotebookTask: &jobs.NotebookTask{
NotebookPath: notebookPath,
},
TaskKey: "test",
TimeoutSeconds: 0,
}},
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", createdJob)
runById, err := w.Jobs.RunNowAndWait(ctx, jobs.RunNow{
JobId: createdJob.JobId,
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", runById)
// cleanup
err = w.Jobs.DeleteByJobId(ctx, createdJob.JobId)
if err != nil {
panic(err)
}
func (*JobsAPI) RunNowAndWait
deprecated
func (a *JobsAPI) RunNowAndWait(ctx context.Context, runNow RunNow, options ...retries.Option[Run]) (*Run, error)
Calls JobsAPI.RunNow and waits to reach TERMINATED or SKIPPED state
You can override the default timeout of 20 minutes by calling adding retries.Timeout[Run](60*time.Minute) functional option.
Deprecated: use JobsAPI.RunNow.Get() or JobsAPI.WaitGetRunJobTerminatedOrSkipped
func (*JobsAPI) SetPermissions ¶ added in v0.19.0
func (a *JobsAPI) SetPermissions(ctx context.Context, request JobPermissionsRequest) (*JobPermissions, error)
func (*JobsAPI) Submit ¶
func (a *JobsAPI) Submit(ctx context.Context, submitRun SubmitRun) (*WaitGetRunJobTerminatedOrSkipped[SubmitRunResponse], error)
Submit a one-time run. This endpoint allows you to submit a workload directly without creating a job. Runs submitted using this endpoint don’t display in the UI. Use the `jobs/runs/get` API to check the run state after the job is submitted.
**Important:** Jobs submitted using this endpoint are not saved as a job. They do not show up in the Jobs UI, and do not retry when they fail. Because they are not saved, Databricks cannot auto-optimize serverless compute in case of failure. If your job fails, you may want to use classic compute to specify the compute needs for the job. Alternatively, use the `POST /jobs/create` and `POST /jobs/run-now` endpoints to create and run a saved job.
Example (JobsApiFullIntegration) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
notebookPath := func() string {
me, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
return filepath.Join("/Users", me.UserName, fmt.Sprintf("sdk-%x", time.Now().UnixNano()))
}()
clusterId := func() string {
clusterId := os.Getenv("DATABRICKS_CLUSTER_ID")
err := w.Clusters.EnsureClusterIsRunning(ctx, clusterId)
if err != nil {
panic(err)
}
return clusterId
}()
run, err := w.Jobs.SubmitAndWait(ctx, jobs.SubmitRun{
RunName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
Tasks: []jobs.SubmitTask{jobs.SubmitTask{
ExistingClusterId: clusterId,
NotebookTask: &jobs.NotebookTask{
NotebookPath: notebookPath,
},
TaskKey: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
}},
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", run)
// cleanup
err = w.Jobs.DeleteRunByRunId(ctx, run.RunId)
if err != nil {
panic(err)
}
func (*JobsAPI) SubmitAndWait
deprecated
func (a *JobsAPI) SubmitAndWait(ctx context.Context, submitRun SubmitRun, options ...retries.Option[Run]) (*Run, error)
Calls JobsAPI.Submit and waits to reach TERMINATED or SKIPPED state
You can override the default timeout of 20 minutes by calling adding retries.Timeout[Run](60*time.Minute) functional option.
Deprecated: use JobsAPI.Submit.Get() or JobsAPI.WaitGetRunJobTerminatedOrSkipped
func (*JobsAPI) Update ¶
Example (JobsApiFullIntegration) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
notebookPath := func() string {
me, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
return filepath.Join("/Users", me.UserName, fmt.Sprintf("sdk-%x", time.Now().UnixNano()))
}()
clusterId := func() string {
clusterId := os.Getenv("DATABRICKS_CLUSTER_ID")
err := w.Clusters.EnsureClusterIsRunning(ctx, clusterId)
if err != nil {
panic(err)
}
return clusterId
}()
newName := fmt.Sprintf("sdk-%x", time.Now().UnixNano())
createdJob, err := w.Jobs.Create(ctx, jobs.CreateJob{
Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
Tasks: []jobs.Task{jobs.Task{
Description: "test",
ExistingClusterId: clusterId,
NotebookTask: &jobs.NotebookTask{
NotebookPath: notebookPath,
},
TaskKey: "test",
TimeoutSeconds: 0,
}},
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", createdJob)
err = w.Jobs.Update(ctx, jobs.UpdateJob{
JobId: createdJob.JobId,
NewSettings: &jobs.JobSettings{
Name: newName,
MaxConcurrentRuns: 5,
},
})
if err != nil {
panic(err)
}
// cleanup
err = w.Jobs.DeleteByJobId(ctx, createdJob.JobId)
if err != nil {
panic(err)
}
func (*JobsAPI) UpdatePermissions ¶ added in v0.19.0
func (a *JobsAPI) UpdatePermissions(ctx context.Context, request JobPermissionsRequest) (*JobPermissions, error)
func (*JobsAPI) WaitGetRunJobTerminatedOrSkipped ¶ added in v0.10.0
func (a *JobsAPI) WaitGetRunJobTerminatedOrSkipped(ctx context.Context, runId int64, timeout time.Duration, callback func(*Run)) (*Run, error)
WaitGetRunJobTerminatedOrSkipped repeatedly calls JobsAPI.GetRun and waits to reach TERMINATED or SKIPPED state
type JobsHealthMetric ¶ added in v0.13.0
type JobsHealthMetric string
Specifies the health metric that is being evaluated for a particular health rule.
* `RUN_DURATION_SECONDS`: Expected total time for a run in seconds. * `STREAMING_BACKLOG_BYTES`: An estimate of the maximum bytes of data waiting to be consumed across all streams. This metric is in Public Preview. * `STREAMING_BACKLOG_RECORDS`: An estimate of the maximum offset lag across all streams. This metric is in Public Preview. * `STREAMING_BACKLOG_SECONDS`: An estimate of the maximum consumer delay across all streams. This metric is in Public Preview. * `STREAMING_BACKLOG_FILES`: An estimate of the maximum number of outstanding files across all streams. This metric is in Public Preview.
const JobsHealthMetricRunDurationSeconds JobsHealthMetric = `RUN_DURATION_SECONDS`
Expected total time for a run in seconds.
const JobsHealthMetricStreamingBacklogBytes JobsHealthMetric = `STREAMING_BACKLOG_BYTES`
An estimate of the maximum bytes of data waiting to be consumed across all streams. This metric is in Public Preview.
const JobsHealthMetricStreamingBacklogFiles JobsHealthMetric = `STREAMING_BACKLOG_FILES`
An estimate of the maximum number of outstanding files across all streams. This metric is in Public Preview.
const JobsHealthMetricStreamingBacklogRecords JobsHealthMetric = `STREAMING_BACKLOG_RECORDS`
An estimate of the maximum offset lag across all streams. This metric is in Public Preview.
const JobsHealthMetricStreamingBacklogSeconds JobsHealthMetric = `STREAMING_BACKLOG_SECONDS`
An estimate of the maximum consumer delay across all streams. This metric is in Public Preview.
func (*JobsHealthMetric) Set ¶ added in v0.13.0
func (f *JobsHealthMetric) Set(v string) error
Set raw string value and validate it against allowed values
func (*JobsHealthMetric) String ¶ added in v0.13.0
func (f *JobsHealthMetric) String() string
String representation for fmt.Print
func (*JobsHealthMetric) Type ¶ added in v0.13.0
func (f *JobsHealthMetric) Type() string
Type always returns JobsHealthMetric to satisfy [pflag.Value] interface
func (*JobsHealthMetric) Values ¶ added in v0.72.0
func (f *JobsHealthMetric) Values() []JobsHealthMetric
Values returns all possible values for JobsHealthMetric.
There is no guarantee on the order of the values in the slice.
type JobsHealthOperator ¶ added in v0.13.0
type JobsHealthOperator string
Specifies the operator used to compare the health metric value with the specified threshold.
const JobsHealthOperatorGreaterThan JobsHealthOperator = `GREATER_THAN`
func (*JobsHealthOperator) Set ¶ added in v0.13.0
func (f *JobsHealthOperator) Set(v string) error
Set raw string value and validate it against allowed values
func (*JobsHealthOperator) String ¶ added in v0.13.0
func (f *JobsHealthOperator) String() string
String representation for fmt.Print
func (*JobsHealthOperator) Type ¶ added in v0.13.0
func (f *JobsHealthOperator) Type() string
Type always returns JobsHealthOperator to satisfy [pflag.Value] interface
func (*JobsHealthOperator) Values ¶ added in v0.72.0
func (f *JobsHealthOperator) Values() []JobsHealthOperator
Values returns all possible values for JobsHealthOperator.
There is no guarantee on the order of the values in the slice.
type JobsHealthRule ¶ added in v0.13.0
type JobsHealthRule struct {
Metric JobsHealthMetric `json:"metric"`
Op JobsHealthOperator `json:"op"`
// Specifies the threshold value that the health metric should obey to
// satisfy the health rule.
Value int64 `json:"value"`
}
type JobsHealthRules ¶ added in v0.13.0
type JobsHealthRules struct {
Rules []JobsHealthRule `json:"rules,omitempty"`
}
An optional set of health rules that can be defined for this job.
type JobsInterface ¶ added in v0.29.0
type JobsInterface interface {
// WaitGetRunJobTerminatedOrSkipped repeatedly calls [JobsAPI.GetRun] and waits to reach TERMINATED or SKIPPED state
WaitGetRunJobTerminatedOrSkipped(ctx context.Context, runId int64,
timeout time.Duration, callback func(*Run)) (*Run, error)
// Cancels all active runs of a job. The runs are canceled asynchronously, so it
// doesn't prevent new runs from being started.
CancelAllRuns(ctx context.Context, request CancelAllRuns) error
// Cancels a job run or a task run. The run is canceled asynchronously, so it
// may still be running when this request completes.
CancelRun(ctx context.Context, cancelRun CancelRun) (*WaitGetRunJobTerminatedOrSkipped[struct{}], error)
// Calls [JobsAPIInterface.CancelRun] and waits to reach TERMINATED or SKIPPED state
//
// You can override the default timeout of 20 minutes by calling adding
// retries.Timeout[Run](60*time.Minute) functional option.
//
// Deprecated: use [JobsAPIInterface.CancelRun].Get() or [JobsAPIInterface.WaitGetRunJobTerminatedOrSkipped]
CancelRunAndWait(ctx context.Context, cancelRun CancelRun, options ...retries.Option[Run]) (*Run, error)
// Cancels a job run or a task run. The run is canceled asynchronously, so it
// may still be running when this request completes.
CancelRunByRunId(ctx context.Context, runId int64) error
CancelRunByRunIdAndWait(ctx context.Context, runId int64, options ...retries.Option[Run]) (*Run, error)
// Create a new job.
Create(ctx context.Context, request CreateJob) (*CreateResponse, error)
// Deletes a job.
Delete(ctx context.Context, request DeleteJob) error
// Deletes a job.
DeleteByJobId(ctx context.Context, jobId int64) error
// Deletes a non-active run. Returns an error if the run is active.
DeleteRun(ctx context.Context, request DeleteRun) error
// Deletes a non-active run. Returns an error if the run is active.
DeleteRunByRunId(ctx context.Context, runId int64) error
// Export and retrieve the job run task.
ExportRun(ctx context.Context, request ExportRunRequest) (*ExportRunOutput, error)
// Retrieves the details for a single job.
//
// Large arrays in the results will be paginated when they exceed 100 elements.
// A request for a single job will return all properties for that job, and the
// first 100 elements of array properties (`tasks`, `job_clusters`,
// `environments` and `parameters`). Use the `next_page_token` field to check
// for more results and pass its value as the `page_token` in subsequent
// requests. If any array properties have more than 100 elements, additional
// results will be returned on subsequent requests. Arrays without additional
// results will be empty on later pages.
Get(ctx context.Context, request GetJobRequest) (*Job, error)
// Retrieves the details for a single job.
//
// Large arrays in the results will be paginated when they exceed 100 elements.
// A request for a single job will return all properties for that job, and the
// first 100 elements of array properties (`tasks`, `job_clusters`,
// `environments` and `parameters`). Use the `next_page_token` field to check
// for more results and pass its value as the `page_token` in subsequent
// requests. If any array properties have more than 100 elements, additional
// results will be returned on subsequent requests. Arrays without additional
// results will be empty on later pages.
GetByJobId(ctx context.Context, jobId int64) (*Job, error)
// Gets the permission levels that a user can have on an object.
GetPermissionLevels(ctx context.Context, request GetJobPermissionLevelsRequest) (*GetJobPermissionLevelsResponse, error)
// Gets the permission levels that a user can have on an object.
GetPermissionLevelsByJobId(ctx context.Context, jobId string) (*GetJobPermissionLevelsResponse, error)
// Gets the permissions of a job. Jobs can inherit permissions from their root
// object.
GetPermissions(ctx context.Context, request GetJobPermissionsRequest) (*JobPermissions, error)
// Gets the permissions of a job. Jobs can inherit permissions from their root
// object.
GetPermissionsByJobId(ctx context.Context, jobId string) (*JobPermissions, error)
// Retrieves the metadata of a run.
//
// Large arrays in the results will be paginated when they exceed 100 elements.
// A request for a single run will return all properties for that run, and the
// first 100 elements of array properties (`tasks`, `job_clusters`,
// `job_parameters` and `repair_history`). Use the next_page_token field to
// check for more results and pass its value as the page_token in subsequent
// requests. If any array properties have more than 100 elements, additional
// results will be returned on subsequent requests. Arrays without additional
// results will be empty on later pages.
GetRun(ctx context.Context, request GetRunRequest) (*Run, error)
// Retrieve the output and metadata of a single task run. When a notebook task
// returns a value through the `dbutils.notebook.exit()` call, you can use this
// endpoint to retrieve that value. Databricks restricts this API to returning
// the first 5 MB of the output. To return a larger result, you can store job
// results in a cloud storage service.
//
// This endpoint validates that the __run_id__ parameter is valid and returns an
// HTTP status code 400 if the __run_id__ parameter is invalid. Runs are
// automatically removed after 60 days. If you to want to reference them beyond
// 60 days, you must save old run results before they expire.
GetRunOutput(ctx context.Context, request GetRunOutputRequest) (*RunOutput, error)
// Retrieve the output and metadata of a single task run. When a notebook task
// returns a value through the `dbutils.notebook.exit()` call, you can use this
// endpoint to retrieve that value. Databricks restricts this API to returning
// the first 5 MB of the output. To return a larger result, you can store job
// results in a cloud storage service.
//
// This endpoint validates that the __run_id__ parameter is valid and returns an
// HTTP status code 400 if the __run_id__ parameter is invalid. Runs are
// automatically removed after 60 days. If you to want to reference them beyond
// 60 days, you must save old run results before they expire.
GetRunOutputByRunId(ctx context.Context, runId int64) (*RunOutput, error)
// Retrieves a list of jobs.
//
// This method is generated by Databricks SDK Code Generator.
List(ctx context.Context, request ListJobsRequest) listing.Iterator[BaseJob]
// Retrieves a list of jobs.
//
// This method is generated by Databricks SDK Code Generator.
ListAll(ctx context.Context, request ListJobsRequest) ([]BaseJob, error)
// BaseJobSettingsNameToJobIdMap calls [JobsAPI.ListAll] and creates a map of results with [BaseJob].Settings.Name as key and [BaseJob].JobId as value.
//
// Returns an error if there's more than one [BaseJob] with the same .Settings.Name.
//
// Note: All [BaseJob] instances are loaded into memory before creating a map.
//
// This method is generated by Databricks SDK Code Generator.
BaseJobSettingsNameToJobIdMap(ctx context.Context, request ListJobsRequest) (map[string]int64, error)
// GetBySettingsName calls [JobsAPI.BaseJobSettingsNameToJobIdMap] and returns a single [BaseJob].
//
// Returns an error if there's more than one [BaseJob] with the same .Settings.Name.
//
// Note: All [BaseJob] instances are loaded into memory before returning matching by name.
//
// This method is generated by Databricks SDK Code Generator.
GetBySettingsName(ctx context.Context, name string) (*BaseJob, error)
// List runs in descending order by start time.
//
// This method is generated by Databricks SDK Code Generator.
ListRuns(ctx context.Context, request ListRunsRequest) listing.Iterator[BaseRun]
// List runs in descending order by start time.
//
// This method is generated by Databricks SDK Code Generator.
ListRunsAll(ctx context.Context, request ListRunsRequest) ([]BaseRun, error)
// Re-run one or more tasks. Tasks are re-run as part of the original job run.
// They use the current job and task settings, and can be viewed in the history
// for the original job run.
RepairRun(ctx context.Context, repairRun RepairRun) (*WaitGetRunJobTerminatedOrSkipped[RepairRunResponse], error)
// Calls [JobsAPIInterface.RepairRun] and waits to reach TERMINATED or SKIPPED state
//
// You can override the default timeout of 20 minutes by calling adding
// retries.Timeout[Run](60*time.Minute) functional option.
//
// Deprecated: use [JobsAPIInterface.RepairRun].Get() or [JobsAPIInterface.WaitGetRunJobTerminatedOrSkipped]
RepairRunAndWait(ctx context.Context, repairRun RepairRun, options ...retries.Option[Run]) (*Run, error)
// Overwrite all settings for the given job. Use the [_Update_
// endpoint](:method:jobs/update) to update job settings partially.
Reset(ctx context.Context, request ResetJob) error
// Run a job and return the `run_id` of the triggered run.
RunNow(ctx context.Context, runNow RunNow) (*WaitGetRunJobTerminatedOrSkipped[RunNowResponse], error)
// Calls [JobsAPIInterface.RunNow] and waits to reach TERMINATED or SKIPPED state
//
// You can override the default timeout of 20 minutes by calling adding
// retries.Timeout[Run](60*time.Minute) functional option.
//
// Deprecated: use [JobsAPIInterface.RunNow].Get() or [JobsAPIInterface.WaitGetRunJobTerminatedOrSkipped]
RunNowAndWait(ctx context.Context, runNow RunNow, options ...retries.Option[Run]) (*Run, error)
// Sets permissions on an object, replacing existing permissions if they exist.
// Deletes all direct permissions if none are specified. Objects can inherit
// permissions from their root object.
SetPermissions(ctx context.Context, request JobPermissionsRequest) (*JobPermissions, error)
// Submit a one-time run. This endpoint allows you to submit a workload directly
// without creating a job. Runs submitted using this endpoint don’t display in
// the UI. Use the `jobs/runs/get` API to check the run state after the job is
// submitted.
//
// **Important:** Jobs submitted using this endpoint are not saved as a job.
// They do not show up in the Jobs UI, and do not retry when they fail. Because
// they are not saved, Databricks cannot auto-optimize serverless compute in
// case of failure. If your job fails, you may want to use classic compute to
// specify the compute needs for the job. Alternatively, use the `POST
// /jobs/create` and `POST /jobs/run-now` endpoints to create and run a saved
// job.
Submit(ctx context.Context, submitRun SubmitRun) (*WaitGetRunJobTerminatedOrSkipped[SubmitRunResponse], error)
// Calls [JobsAPIInterface.Submit] and waits to reach TERMINATED or SKIPPED state
//
// You can override the default timeout of 20 minutes by calling adding
// retries.Timeout[Run](60*time.Minute) functional option.
//
// Deprecated: use [JobsAPIInterface.Submit].Get() or [JobsAPIInterface.WaitGetRunJobTerminatedOrSkipped]
SubmitAndWait(ctx context.Context, submitRun SubmitRun, options ...retries.Option[Run]) (*Run, error)
// Add, update, or remove specific settings of an existing job. Use the [_Reset_
// endpoint](:method:jobs/reset) to overwrite all job settings.
Update(ctx context.Context, request UpdateJob) error
// Updates the permissions on a job. Jobs can inherit permissions from their
// root object.
UpdatePermissions(ctx context.Context, request JobPermissionsRequest) (*JobPermissions, error)
}
type JobsService
deprecated
type JobsService interface {
// Cancels all active runs of a job. The runs are canceled asynchronously,
// so it doesn't prevent new runs from being started.
CancelAllRuns(ctx context.Context, request CancelAllRuns) error
// Cancels a job run or a task run. The run is canceled asynchronously, so
// it may still be running when this request completes.
CancelRun(ctx context.Context, request CancelRun) error
// Create a new job.
Create(ctx context.Context, request CreateJob) (*CreateResponse, error)
// Deletes a job.
Delete(ctx context.Context, request DeleteJob) error
// Deletes a non-active run. Returns an error if the run is active.
DeleteRun(ctx context.Context, request DeleteRun) error
// Export and retrieve the job run task.
ExportRun(ctx context.Context, request ExportRunRequest) (*ExportRunOutput, error)
// Retrieves the details for a single job.
//
// Large arrays in the results will be paginated when they exceed 100
// elements. A request for a single job will return all properties for that
// job, and the first 100 elements of array properties (`tasks`,
// `job_clusters`, `environments` and `parameters`). Use the
// `next_page_token` field to check for more results and pass its value as
// the `page_token` in subsequent requests. If any array properties have
// more than 100 elements, additional results will be returned on subsequent
// requests. Arrays without additional results will be empty on later pages.
Get(ctx context.Context, request GetJobRequest) (*Job, error)
// Gets the permission levels that a user can have on an object.
GetPermissionLevels(ctx context.Context, request GetJobPermissionLevelsRequest) (*GetJobPermissionLevelsResponse, error)
// Gets the permissions of a job. Jobs can inherit permissions from their
// root object.
GetPermissions(ctx context.Context, request GetJobPermissionsRequest) (*JobPermissions, error)
// Retrieves the metadata of a run.
//
// Large arrays in the results will be paginated when they exceed 100
// elements. A request for a single run will return all properties for that
// run, and the first 100 elements of array properties (`tasks`,
// `job_clusters`, `job_parameters` and `repair_history`). Use the
// next_page_token field to check for more results and pass its value as the
// page_token in subsequent requests. If any array properties have more than
// 100 elements, additional results will be returned on subsequent requests.
// Arrays without additional results will be empty on later pages.
GetRun(ctx context.Context, request GetRunRequest) (*Run, error)
// Retrieve the output and metadata of a single task run. When a notebook
// task returns a value through the `dbutils.notebook.exit()` call, you can
// use this endpoint to retrieve that value. Databricks restricts this API
// to returning the first 5 MB of the output. To return a larger result, you
// can store job results in a cloud storage service.
//
// This endpoint validates that the __run_id__ parameter is valid and
// returns an HTTP status code 400 if the __run_id__ parameter is invalid.
// Runs are automatically removed after 60 days. If you to want to reference
// them beyond 60 days, you must save old run results before they expire.
GetRunOutput(ctx context.Context, request GetRunOutputRequest) (*RunOutput, error)
// Retrieves a list of jobs.
List(ctx context.Context, request ListJobsRequest) (*ListJobsResponse, error)
// List runs in descending order by start time.
ListRuns(ctx context.Context, request ListRunsRequest) (*ListRunsResponse, error)
// Re-run one or more tasks. Tasks are re-run as part of the original job
// run. They use the current job and task settings, and can be viewed in the
// history for the original job run.
RepairRun(ctx context.Context, request RepairRun) (*RepairRunResponse, error)
// Overwrite all settings for the given job. Use the [_Update_
// endpoint](:method:jobs/update) to update job settings partially.
Reset(ctx context.Context, request ResetJob) error
// Run a job and return the `run_id` of the triggered run.
RunNow(ctx context.Context, request RunNow) (*RunNowResponse, error)
// Sets permissions on an object, replacing existing permissions if they
// exist. Deletes all direct permissions if none are specified. Objects can
// inherit permissions from their root object.
SetPermissions(ctx context.Context, request JobPermissionsRequest) (*JobPermissions, error)
// Submit a one-time run. This endpoint allows you to submit a workload
// directly without creating a job. Runs submitted using this endpoint
// don’t display in the UI. Use the `jobs/runs/get` API to check the run
// state after the job is submitted.
//
// **Important:** Jobs submitted using this endpoint are not saved as a job.
// They do not show up in the Jobs UI, and do not retry when they fail.
// Because they are not saved, Databricks cannot auto-optimize serverless
// compute in case of failure. If your job fails, you may want to use
// classic compute to specify the compute needs for the job. Alternatively,
// use the `POST /jobs/create` and `POST /jobs/run-now` endpoints to create
// and run a saved job.
Submit(ctx context.Context, request SubmitRun) (*SubmitRunResponse, error)
// Add, update, or remove specific settings of an existing job. Use the
// [_Reset_ endpoint](:method:jobs/reset) to overwrite all job settings.
Update(ctx context.Context, request UpdateJob) error
// Updates the permissions on a job. Jobs can inherit permissions from their
// root object.
UpdatePermissions(ctx context.Context, request JobPermissionsRequest) (*JobPermissions, error)
}
The Jobs API allows you to create, edit, and delete jobs.
You can use a Databricks job to run a data processing or data analysis task in a Databricks cluster with scalable resources. Your job can consist of a single task or can be a large, multi-task workflow with complex dependencies. Databricks manages the task orchestration, cluster management, monitoring, and error reporting for all of your jobs. You can run your jobs immediately or periodically through an easy-to-use scheduling system. You can implement job tasks using notebooks, JARS, Spark Declarative Pipelines, or Python, Scala, Spark submit, and Java applications.
You should never hard code secrets or store them in plain text. Use the Secrets CLI to manage secrets in the Databricks CLI. Use the Secrets utility to reference secrets in notebooks and jobs.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type ListJobComplianceForPolicyResponse ¶ added in v0.45.0
type ListJobComplianceForPolicyResponse struct {
// A list of jobs and their policy compliance statuses.
Jobs []JobCompliance `json:"jobs,omitempty"`
// This field represents the pagination token to retrieve the next page of
// results. If this field is not in the response, it means no further
// results for the request.
NextPageToken string `json:"next_page_token,omitempty"`
// This field represents the pagination token to retrieve the previous page
// of results. If this field is not in the response, it means no further
// results for the request.
PrevPageToken string `json:"prev_page_token,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListJobComplianceForPolicyResponse) MarshalJSON ¶ added in v0.45.0
func (s ListJobComplianceForPolicyResponse) MarshalJSON() ([]byte, error)
func (*ListJobComplianceForPolicyResponse) UnmarshalJSON ¶ added in v0.45.0
func (s *ListJobComplianceForPolicyResponse) UnmarshalJSON(b []byte) error
type ListJobComplianceRequest ¶ added in v0.45.0
type ListJobComplianceRequest struct {
// Use this field to specify the maximum number of results to be returned by
// the server. The server may further constrain the maximum number of
// results returned in a single page.
PageSize int `json:"-" url:"page_size,omitempty"`
// A page token that can be used to navigate to the next page or previous
// page as returned by `next_page_token` or `prev_page_token`.
PageToken string `json:"-" url:"page_token,omitempty"`
// Canonical unique identifier for the cluster policy.
PolicyId string `json:"-" url:"policy_id"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListJobComplianceRequest) MarshalJSON ¶ added in v0.45.0
func (s ListJobComplianceRequest) MarshalJSON() ([]byte, error)
func (*ListJobComplianceRequest) UnmarshalJSON ¶ added in v0.45.0
func (s *ListJobComplianceRequest) UnmarshalJSON(b []byte) error
type ListJobsRequest ¶ added in v0.8.0
type ListJobsRequest struct {
// Whether to include task and cluster details in the response. Note that
// only the first 100 elements will be shown. Use :method:jobs/get to
// paginate through all tasks and clusters.
ExpandTasks bool `json:"-" url:"expand_tasks,omitempty"`
// The number of jobs to return. This value must be greater than 0 and less
// or equal to 100. The default value is 20.
Limit int `json:"-" url:"limit,omitempty"`
// A filter on the list based on the exact (case insensitive) job name.
Name string `json:"-" url:"name,omitempty"`
// The offset of the first job to return, relative to the most recently
// created job. Deprecated since June 2023. Use `page_token` to iterate
// through the pages instead.
Offset int `json:"-" url:"offset,omitempty"`
// Use `next_page_token` or `prev_page_token` returned from the previous
// request to list the next or previous page of jobs respectively.
PageToken string `json:"-" url:"page_token,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListJobsRequest) MarshalJSON ¶ added in v0.23.0
func (s ListJobsRequest) MarshalJSON() ([]byte, error)
func (*ListJobsRequest) UnmarshalJSON ¶ added in v0.23.0
func (s *ListJobsRequest) UnmarshalJSON(b []byte) error
type ListJobsResponse ¶
type ListJobsResponse struct {
// If true, additional jobs matching the provided filter are available for
// listing.
HasMore bool `json:"has_more,omitempty"`
// The list of jobs. Only included in the response if there are jobs to
// list.
Jobs []BaseJob `json:"jobs,omitempty"`
// A token that can be used to list the next page of jobs (if applicable).
NextPageToken string `json:"next_page_token,omitempty"`
// A token that can be used to list the previous page of jobs (if
// applicable).
PrevPageToken string `json:"prev_page_token,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
List of jobs was retrieved successfully.
func (ListJobsResponse) MarshalJSON ¶ added in v0.23.0
func (s ListJobsResponse) MarshalJSON() ([]byte, error)
func (*ListJobsResponse) UnmarshalJSON ¶ added in v0.23.0
func (s *ListJobsResponse) UnmarshalJSON(b []byte) error
type ListRunsRequest ¶ added in v0.8.0
type ListRunsRequest struct {
// If active_only is `true`, only active runs are included in the results;
// otherwise, lists both active and completed runs. An active run is a run
// in the `QUEUED`, `PENDING`, `RUNNING`, or `TERMINATING`. This field
// cannot be `true` when completed_only is `true`.
ActiveOnly bool `json:"-" url:"active_only,omitempty"`
// If completed_only is `true`, only completed runs are included in the
// results; otherwise, lists both active and completed runs. This field
// cannot be `true` when active_only is `true`.
CompletedOnly bool `json:"-" url:"completed_only,omitempty"`
// Whether to include task and cluster details in the response. Note that
// only the first 100 elements will be shown. Use :method:jobs/getrun to
// paginate through all tasks and clusters.
ExpandTasks bool `json:"-" url:"expand_tasks,omitempty"`
// The job for which to list runs. If omitted, the Jobs service lists runs
// from all jobs.
JobId int64 `json:"-" url:"job_id,omitempty"`
// The number of runs to return. This value must be greater than 0 and less
// than 25. The default value is 20. If a request specifies a limit of 0,
// the service instead uses the maximum limit.
Limit int `json:"-" url:"limit,omitempty"`
// The offset of the first run to return, relative to the most recent run.
// Deprecated since June 2023. Use `page_token` to iterate through the pages
// instead.
Offset int `json:"-" url:"offset,omitempty"`
// Use `next_page_token` or `prev_page_token` returned from the previous
// request to list the next or previous page of runs respectively.
PageToken string `json:"-" url:"page_token,omitempty"`
// The type of runs to return. For a description of run types, see
// :method:jobs/getRun.
RunType RunType `json:"-" url:"run_type,omitempty"`
// Show runs that started _at or after_ this value. The value must be a UTC
// timestamp in milliseconds. Can be combined with _start_time_to_ to filter
// by a time range.
StartTimeFrom int64 `json:"-" url:"start_time_from,omitempty"`
// Show runs that started _at or before_ this value. The value must be a UTC
// timestamp in milliseconds. Can be combined with _start_time_from_ to
// filter by a time range.
StartTimeTo int64 `json:"-" url:"start_time_to,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListRunsRequest) MarshalJSON ¶ added in v0.23.0
func (s ListRunsRequest) MarshalJSON() ([]byte, error)
func (*ListRunsRequest) UnmarshalJSON ¶ added in v0.23.0
func (s *ListRunsRequest) UnmarshalJSON(b []byte) error
type ListRunsResponse ¶
type ListRunsResponse struct {
// If true, additional runs matching the provided filter are available for
// listing.
HasMore bool `json:"has_more,omitempty"`
// A token that can be used to list the next page of runs (if applicable).
NextPageToken string `json:"next_page_token,omitempty"`
// A token that can be used to list the previous page of runs (if
// applicable).
PrevPageToken string `json:"prev_page_token,omitempty"`
// A list of runs, from most recently started to least. Only included in the
// response if there are runs to list.
Runs []BaseRun `json:"runs,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
List of runs was retrieved successfully.
func (ListRunsResponse) MarshalJSON ¶ added in v0.23.0
func (s ListRunsResponse) MarshalJSON() ([]byte, error)
func (*ListRunsResponse) UnmarshalJSON ¶ added in v0.23.0
func (s *ListRunsResponse) UnmarshalJSON(b []byte) error
type ModelTriggerConfiguration ¶ added in v0.92.0
type ModelTriggerConfiguration struct {
// Aliases of the model versions to monitor. Can only be used in conjunction
// with condition MODEL_ALIAS_SET.
Aliases []string `json:"aliases,omitempty"`
// The condition based on which to trigger a job run.
Condition ModelTriggerConfigurationCondition `json:"condition"`
// 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.
MinTimeBetweenTriggersSeconds int `json:"min_time_between_triggers_seconds,omitempty"`
// Name of the securable to monitor ("mycatalog.myschema.mymodel" in the
// case of model-level triggers, "mycatalog.myschema" in the case of
// schema-level triggers) or empty in the case of metastore-level triggers.
SecurableName string `json:"securable_name,omitempty"`
// If set, the trigger starts a run only after no model updates have
// occurred for the specified time and can be used to wait for a series of
// model updates before triggering a run. The minimum allowed value is 60
// seconds.
WaitAfterLastChangeSeconds int `json:"wait_after_last_change_seconds,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ModelTriggerConfiguration) MarshalJSON ¶ added in v0.92.0
func (s ModelTriggerConfiguration) MarshalJSON() ([]byte, error)
func (*ModelTriggerConfiguration) UnmarshalJSON ¶ added in v0.92.0
func (s *ModelTriggerConfiguration) UnmarshalJSON(b []byte) error
type ModelTriggerConfigurationCondition ¶ added in v0.92.0
type ModelTriggerConfigurationCondition string
const ModelTriggerConfigurationConditionModelAliasSet ModelTriggerConfigurationCondition = `MODEL_ALIAS_SET`
const ModelTriggerConfigurationConditionModelCreated ModelTriggerConfigurationCondition = `MODEL_CREATED`
const ModelTriggerConfigurationConditionModelVersionReady ModelTriggerConfigurationCondition = `MODEL_VERSION_READY`
func (*ModelTriggerConfigurationCondition) Set ¶ added in v0.92.0
func (f *ModelTriggerConfigurationCondition) Set(v string) error
Set raw string value and validate it against allowed values
func (*ModelTriggerConfigurationCondition) String ¶ added in v0.92.0
func (f *ModelTriggerConfigurationCondition) String() string
String representation for fmt.Print
func (*ModelTriggerConfigurationCondition) Type ¶ added in v0.92.0
func (f *ModelTriggerConfigurationCondition) Type() string
Type always returns ModelTriggerConfigurationCondition to satisfy [pflag.Value] interface
func (*ModelTriggerConfigurationCondition) Values ¶ added in v0.92.0
func (f *ModelTriggerConfigurationCondition) Values() []ModelTriggerConfigurationCondition
Values returns all possible values for ModelTriggerConfigurationCondition.
There is no guarantee on the order of the values in the slice.
type NotebookOutput ¶
type NotebookOutput struct {
// 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.
Result string `json:"result,omitempty"`
// Whether or not the result was truncated.
Truncated bool `json:"truncated,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (NotebookOutput) MarshalJSON ¶ added in v0.23.0
func (s NotebookOutput) MarshalJSON() ([]byte, error)
func (*NotebookOutput) UnmarshalJSON ¶ added in v0.23.0
func (s *NotebookOutput) UnmarshalJSON(b []byte) error
type NotebookTask ¶
type NotebookTask struct {
// 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
BaseParameters map[string]string `json:"base_parameters,omitempty"`
// 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.
NotebookPath string `json:"notebook_path"`
// 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.
Source Source `json:"source,omitempty"`
// 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.
WarehouseId string `json:"warehouse_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (NotebookTask) MarshalJSON ¶ added in v0.39.0
func (s NotebookTask) MarshalJSON() ([]byte, error)
func (*NotebookTask) UnmarshalJSON ¶ added in v0.39.0
func (s *NotebookTask) UnmarshalJSON(b []byte) error
type OutputSchemaInfo ¶ added in v0.56.0
type OutputSchemaInfo struct {
CatalogName string `json:"catalog_name,omitempty"`
// The expiration time for the output schema as a Unix timestamp in
// milliseconds.
ExpirationTime int64 `json:"expiration_time,omitempty"`
SchemaName string `json:"schema_name,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Stores the catalog name, schema name, and the output schema expiration time for the clean room run.
func (OutputSchemaInfo) MarshalJSON ¶ added in v0.56.0
func (s OutputSchemaInfo) MarshalJSON() ([]byte, error)
func (*OutputSchemaInfo) UnmarshalJSON ¶ added in v0.56.0
func (s *OutputSchemaInfo) UnmarshalJSON(b []byte) error
type PauseStatus ¶ added in v0.11.0
type PauseStatus string
const PauseStatusPaused PauseStatus = `PAUSED`
const PauseStatusUnpaused PauseStatus = `UNPAUSED`
func (*PauseStatus) Set ¶ added in v0.11.0
func (f *PauseStatus) Set(v string) error
Set raw string value and validate it against allowed values
func (*PauseStatus) String ¶ added in v0.11.0
func (f *PauseStatus) String() string
String representation for fmt.Print
func (*PauseStatus) Type ¶ added in v0.11.0
func (f *PauseStatus) Type() string
Type always returns PauseStatus to satisfy [pflag.Value] interface
func (*PauseStatus) Values ¶ added in v0.72.0
func (f *PauseStatus) Values() []PauseStatus
Values returns all possible values for PauseStatus.
There is no guarantee on the order of the values in the slice.
type PerformanceTarget ¶ added in v0.57.0
type PerformanceTarget string
PerformanceTarget defines how performant (lower latency) or cost efficient the execution of run on serverless compute should be. The performance mode on the job or pipeline should map to a performance setting that is passed to Cluster Manager (see cluster-common PerformanceTarget).
const PerformanceTargetPerformanceOptimized PerformanceTarget = `PERFORMANCE_OPTIMIZED`
const PerformanceTargetStandard PerformanceTarget = `STANDARD`
func (*PerformanceTarget) Set ¶ added in v0.57.0
func (f *PerformanceTarget) Set(v string) error
Set raw string value and validate it against allowed values
func (*PerformanceTarget) String ¶ added in v0.57.0
func (f *PerformanceTarget) String() string
String representation for fmt.Print
func (*PerformanceTarget) Type ¶ added in v0.57.0
func (f *PerformanceTarget) Type() string
Type always returns PerformanceTarget to satisfy [pflag.Value] interface
func (*PerformanceTarget) Values ¶ added in v0.72.0
func (f *PerformanceTarget) Values() []PerformanceTarget
Values returns all possible values for PerformanceTarget.
There is no guarantee on the order of the values in the slice.
type PeriodicTriggerConfiguration ¶ added in v0.43.0
type PeriodicTriggerConfiguration struct {
// The interval at which the trigger should run.
Interval int `json:"interval"`
// The unit of time for the interval.
Unit PeriodicTriggerConfigurationTimeUnit `json:"unit"`
}
type PeriodicTriggerConfigurationTimeUnit ¶ added in v0.43.0
type PeriodicTriggerConfigurationTimeUnit string
const PeriodicTriggerConfigurationTimeUnitDays PeriodicTriggerConfigurationTimeUnit = `DAYS`
const PeriodicTriggerConfigurationTimeUnitHours PeriodicTriggerConfigurationTimeUnit = `HOURS`
const PeriodicTriggerConfigurationTimeUnitWeeks PeriodicTriggerConfigurationTimeUnit = `WEEKS`
func (*PeriodicTriggerConfigurationTimeUnit) Set ¶ added in v0.43.0
func (f *PeriodicTriggerConfigurationTimeUnit) Set(v string) error
Set raw string value and validate it against allowed values
func (*PeriodicTriggerConfigurationTimeUnit) String ¶ added in v0.43.0
func (f *PeriodicTriggerConfigurationTimeUnit) String() string
String representation for fmt.Print
func (*PeriodicTriggerConfigurationTimeUnit) Type ¶ added in v0.43.0
func (f *PeriodicTriggerConfigurationTimeUnit) Type() string
Type always returns PeriodicTriggerConfigurationTimeUnit to satisfy [pflag.Value] interface
func (*PeriodicTriggerConfigurationTimeUnit) Values ¶ added in v0.72.0
func (f *PeriodicTriggerConfigurationTimeUnit) Values() []PeriodicTriggerConfigurationTimeUnit
Values returns all possible values for PeriodicTriggerConfigurationTimeUnit.
There is no guarantee on the order of the values in the slice.
type PipelineParams ¶
type PipelineParams struct {
// If true, triggers a full refresh on the delta live table.
FullRefresh bool `json:"full_refresh,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (PipelineParams) MarshalJSON ¶ added in v0.23.0
func (s PipelineParams) MarshalJSON() ([]byte, error)
func (*PipelineParams) UnmarshalJSON ¶ added in v0.23.0
func (s *PipelineParams) UnmarshalJSON(b []byte) error
type PipelineTask ¶
type PipelineTask struct {
// If true, triggers a full refresh on the delta live table.
FullRefresh bool `json:"full_refresh,omitempty"`
// The full name of the pipeline task to execute.
PipelineId string `json:"pipeline_id"`
ForceSendFields []string `json:"-" url:"-"`
}
func (PipelineTask) MarshalJSON ¶ added in v0.23.0
func (s PipelineTask) MarshalJSON() ([]byte, error)
func (*PipelineTask) UnmarshalJSON ¶ added in v0.23.0
func (s *PipelineTask) UnmarshalJSON(b []byte) error
type PolicyComplianceForJobsAPI ¶ added in v0.45.0
type PolicyComplianceForJobsAPI struct {
// contains filtered or unexported fields
}
The compliance APIs allow you to view and manage the policy compliance status of jobs in your workspace. This API currently only supports compliance controls for cluster policies.
A job is in compliance if its cluster configurations satisfy the rules of all their respective cluster policies. A job could be out of compliance if a cluster policy it uses was updated after the job was last edited. The job is considered out of compliance if any of its clusters no longer comply with their updated policies.
The get and list compliance APIs allow you to view the policy compliance status of a job. The enforce compliance API allows you to update a job so that it becomes compliant with all of its policies.
func NewPolicyComplianceForJobs ¶ added in v0.45.0
func NewPolicyComplianceForJobs(client *client.DatabricksClient) *PolicyComplianceForJobsAPI
func (*PolicyComplianceForJobsAPI) EnforceCompliance ¶ added in v0.45.0
func (a *PolicyComplianceForJobsAPI) EnforceCompliance(ctx context.Context, request EnforcePolicyComplianceRequest) (*EnforcePolicyComplianceResponse, error)
func (*PolicyComplianceForJobsAPI) GetCompliance ¶ added in v0.45.0
func (a *PolicyComplianceForJobsAPI) GetCompliance(ctx context.Context, request GetPolicyComplianceRequest) (*GetPolicyComplianceResponse, error)
func (*PolicyComplianceForJobsAPI) GetComplianceByJobId ¶ added in v0.45.0
func (a *PolicyComplianceForJobsAPI) GetComplianceByJobId(ctx context.Context, jobId int64) (*GetPolicyComplianceResponse, error)
Returns the policy compliance status of a job. Jobs could be out of compliance if a cluster policy they use was updated after the job was last edited and some of its job clusters no longer comply with their updated policies.
func (*PolicyComplianceForJobsAPI) ListCompliance ¶ added in v0.45.0
func (a *PolicyComplianceForJobsAPI) ListCompliance(ctx context.Context, request ListJobComplianceRequest) listing.Iterator[JobCompliance]
Returns the policy compliance status of all jobs that use a given policy. Jobs could be out of compliance if a cluster policy they use was updated after the job was last edited and its job clusters no longer comply with the updated policy.
func (*PolicyComplianceForJobsAPI) ListComplianceAll ¶ added in v0.45.0
func (a *PolicyComplianceForJobsAPI) ListComplianceAll(ctx context.Context, request ListJobComplianceRequest) ([]JobCompliance, error)
Returns the policy compliance status of all jobs that use a given policy. Jobs could be out of compliance if a cluster policy they use was updated after the job was last edited and its job clusters no longer comply with the updated policy.
type PolicyComplianceForJobsInterface ¶ added in v0.45.0
type PolicyComplianceForJobsInterface interface {
// Updates a job so the job clusters that are created when running the job
// (specified in `new_cluster`) are compliant with the current versions of their
// respective cluster policies. All-purpose clusters used in the job will not be
// updated.
EnforceCompliance(ctx context.Context, request EnforcePolicyComplianceRequest) (*EnforcePolicyComplianceResponse, error)
// Returns the policy compliance status of a job. Jobs could be out of
// compliance if a cluster policy they use was updated after the job was last
// edited and some of its job clusters no longer comply with their updated
// policies.
GetCompliance(ctx context.Context, request GetPolicyComplianceRequest) (*GetPolicyComplianceResponse, error)
// Returns the policy compliance status of a job. Jobs could be out of
// compliance if a cluster policy they use was updated after the job was last
// edited and some of its job clusters no longer comply with their updated
// policies.
GetComplianceByJobId(ctx context.Context, jobId int64) (*GetPolicyComplianceResponse, error)
// Returns the policy compliance status of all jobs that use a given policy.
// Jobs could be out of compliance if a cluster policy they use was updated
// after the job was last edited and its job clusters no longer comply with the
// updated policy.
//
// This method is generated by Databricks SDK Code Generator.
ListCompliance(ctx context.Context, request ListJobComplianceRequest) listing.Iterator[JobCompliance]
// Returns the policy compliance status of all jobs that use a given policy.
// Jobs could be out of compliance if a cluster policy they use was updated
// after the job was last edited and its job clusters no longer comply with the
// updated policy.
//
// This method is generated by Databricks SDK Code Generator.
ListComplianceAll(ctx context.Context, request ListJobComplianceRequest) ([]JobCompliance, error)
}
type PolicyComplianceForJobsService
deprecated
added in
v0.45.0
type PolicyComplianceForJobsService interface {
// Updates a job so the job clusters that are created when running the job
// (specified in `new_cluster`) are compliant with the current versions of
// their respective cluster policies. All-purpose clusters used in the job
// will not be updated.
EnforceCompliance(ctx context.Context, request EnforcePolicyComplianceRequest) (*EnforcePolicyComplianceResponse, error)
// Returns the policy compliance status of a job. Jobs could be out of
// compliance if a cluster policy they use was updated after the job was
// last edited and some of its job clusters no longer comply with their
// updated policies.
GetCompliance(ctx context.Context, request GetPolicyComplianceRequest) (*GetPolicyComplianceResponse, error)
// Returns the policy compliance status of all jobs that use a given policy.
// Jobs could be out of compliance if a cluster policy they use was updated
// after the job was last edited and its job clusters no longer comply with
// the updated policy.
ListCompliance(ctx context.Context, request ListJobComplianceRequest) (*ListJobComplianceForPolicyResponse, error)
}
The compliance APIs allow you to view and manage the policy compliance status of jobs in your workspace. This API currently only supports compliance controls for cluster policies.
A job is in compliance if its cluster configurations satisfy the rules of all their respective cluster policies. A job could be out of compliance if a cluster policy it uses was updated after the job was last edited. The job is considered out of compliance if any of its clusters no longer comply with their updated policies.
The get and list compliance APIs allow you to view the policy compliance status of a job. The enforce compliance API allows you to update a job so that it becomes compliant with all of its policies.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type PowerBiModel ¶ added in v0.63.0
type PowerBiModel struct {
// How the published Power BI model authenticates to Databricks
AuthenticationMethod AuthenticationMethod `json:"authentication_method,omitempty"`
// The name of the Power BI model
ModelName string `json:"model_name,omitempty"`
// Whether to overwrite existing Power BI models
OverwriteExisting bool `json:"overwrite_existing,omitempty"`
// The default storage mode of the Power BI model
StorageMode StorageMode `json:"storage_mode,omitempty"`
// The name of the Power BI workspace of the model
WorkspaceName string `json:"workspace_name,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (PowerBiModel) MarshalJSON ¶ added in v0.63.0
func (s PowerBiModel) MarshalJSON() ([]byte, error)
func (*PowerBiModel) UnmarshalJSON ¶ added in v0.63.0
func (s *PowerBiModel) UnmarshalJSON(b []byte) error
type PowerBiTable ¶ added in v0.63.0
type PowerBiTable struct {
// The catalog name in Databricks
Catalog string `json:"catalog,omitempty"`
// The table name in Databricks
Name string `json:"name,omitempty"`
// The schema name in Databricks
Schema string `json:"schema,omitempty"`
// The Power BI storage mode of the table
StorageMode StorageMode `json:"storage_mode,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (PowerBiTable) MarshalJSON ¶ added in v0.63.0
func (s PowerBiTable) MarshalJSON() ([]byte, error)
func (*PowerBiTable) UnmarshalJSON ¶ added in v0.63.0
func (s *PowerBiTable) UnmarshalJSON(b []byte) error
type PowerBiTask ¶ added in v0.63.0
type PowerBiTask struct {
// The resource name of the UC connection to authenticate from Databricks to
// Power BI
ConnectionResourceName string `json:"connection_resource_name,omitempty"`
// The semantic model to update
PowerBiModel *PowerBiModel `json:"power_bi_model,omitempty"`
// Whether the model should be refreshed after the update
RefreshAfterUpdate bool `json:"refresh_after_update,omitempty"`
// The tables to be exported to Power BI
Tables []PowerBiTable `json:"tables,omitempty"`
// The SQL warehouse ID to use as the Power BI data source
WarehouseId string `json:"warehouse_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (PowerBiTask) MarshalJSON ¶ added in v0.63.0
func (s PowerBiTask) MarshalJSON() ([]byte, error)
func (*PowerBiTask) UnmarshalJSON ¶ added in v0.63.0
func (s *PowerBiTask) UnmarshalJSON(b []byte) error
type PythonWheelTask ¶
type PythonWheelTask struct {
// 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()`
EntryPoint string `json:"entry_point"`
// 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.
NamedParameters map[string]string `json:"named_parameters,omitempty"`
// Name of the package to execute
PackageName string `json:"package_name"`
// Command-line parameters passed to Python wheel task. Leave it empty if
// `named_parameters` is not null.
Parameters []string `json:"parameters,omitempty"`
}
type QueueDetails ¶ added in v0.46.0
type QueueDetails struct {
Code QueueDetailsCodeCode `json:"code,omitempty"`
// A descriptive message with the queuing details. This field is
// unstructured, and its exact format is subject to change.
Message string `json:"message,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (QueueDetails) MarshalJSON ¶ added in v0.46.0
func (s QueueDetails) MarshalJSON() ([]byte, error)
func (*QueueDetails) UnmarshalJSON ¶ added in v0.46.0
func (s *QueueDetails) UnmarshalJSON(b []byte) error
type QueueDetailsCodeCode ¶ added in v0.46.0
type QueueDetailsCodeCode string
The reason for queuing the run. * `ACTIVE_RUNS_LIMIT_REACHED`: The run was queued due to reaching the workspace limit of active task runs. * `MAX_CONCURRENT_RUNS_REACHED`: The run was queued due to reaching the per-job limit of concurrent job runs. * `ACTIVE_RUN_JOB_TASKS_LIMIT_REACHED`: The run was queued due to reaching the workspace limit of active run job tasks.
const QueueDetailsCodeCodeActiveRunJobTasksLimitReached QueueDetailsCodeCode = `ACTIVE_RUN_JOB_TASKS_LIMIT_REACHED`
The run was queued due to reaching the workspace limit of active run job tasks.
const QueueDetailsCodeCodeActiveRunsLimitReached QueueDetailsCodeCode = `ACTIVE_RUNS_LIMIT_REACHED`
The run was queued due to reaching the workspace limit of active task runs.
const QueueDetailsCodeCodeMaxConcurrentRunsReached QueueDetailsCodeCode = `MAX_CONCURRENT_RUNS_REACHED`
The run was queued due to reaching the per-job limit of concurrent job runs.
func (*QueueDetailsCodeCode) Set ¶ added in v0.46.0
func (f *QueueDetailsCodeCode) Set(v string) error
Set raw string value and validate it against allowed values
func (*QueueDetailsCodeCode) String ¶ added in v0.46.0
func (f *QueueDetailsCodeCode) String() string
String representation for fmt.Print
func (*QueueDetailsCodeCode) Type ¶ added in v0.46.0
func (f *QueueDetailsCodeCode) Type() string
Type always returns QueueDetailsCodeCode to satisfy [pflag.Value] interface
func (*QueueDetailsCodeCode) Values ¶ added in v0.72.0
func (f *QueueDetailsCodeCode) Values() []QueueDetailsCodeCode
Values returns all possible values for QueueDetailsCodeCode.
There is no guarantee on the order of the values in the slice.
type QueueSettings ¶ added in v0.21.0
type QueueSettings struct {
// If true, enable queueing for the job. This is a required field.
Enabled bool `json:"enabled"`
}
type RepairHistoryItem ¶
type RepairHistoryItem struct {
// The actual performance target used by the serverless run during
// execution. This can differ from the client-set performance target on the
// request depending on whether the performance mode is supported by the job
// type.
//
// * `STANDARD`: Enables cost-efficient execution of serverless workloads. *
// `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times
// through rapid scaling and optimized cluster performance.
EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"`
// The end time of the (repaired) run.
EndTime int64 `json:"end_time,omitempty"`
// The ID of the repair. Only returned for the items that represent a repair
// in `repair_history`.
Id int64 `json:"id,omitempty"`
// The start time of the (repaired) run.
StartTime int64 `json:"start_time,omitempty"`
// Deprecated. Please use the `status` field instead.
State *RunState `json:"state,omitempty"`
Status *RunStatus `json:"status,omitempty"`
// The run IDs of the task runs that ran as part of this repair history
// item.
TaskRunIds []int64 `json:"task_run_ids,omitempty"`
// The repair history item type. Indicates whether a run is the original run
// or a repair run.
Type RepairHistoryItemType `json:"type,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (RepairHistoryItem) MarshalJSON ¶ added in v0.23.0
func (s RepairHistoryItem) MarshalJSON() ([]byte, error)
func (*RepairHistoryItem) UnmarshalJSON ¶ added in v0.23.0
func (s *RepairHistoryItem) UnmarshalJSON(b []byte) error
type RepairHistoryItemType ¶
type RepairHistoryItemType string
The repair history item type. Indicates whether a run is the original run or a repair run.
const RepairHistoryItemTypeOriginal RepairHistoryItemType = `ORIGINAL`
const RepairHistoryItemTypeRepair RepairHistoryItemType = `REPAIR`
func (*RepairHistoryItemType) Set ¶ added in v0.2.0
func (f *RepairHistoryItemType) Set(v string) error
Set raw string value and validate it against allowed values
func (*RepairHistoryItemType) String ¶ added in v0.2.0
func (f *RepairHistoryItemType) String() string
String representation for fmt.Print
func (*RepairHistoryItemType) Type ¶ added in v0.2.0
func (f *RepairHistoryItemType) Type() string
Type always returns RepairHistoryItemType to satisfy [pflag.Value] interface
func (*RepairHistoryItemType) Values ¶ added in v0.72.0
func (f *RepairHistoryItemType) Values() []RepairHistoryItemType
Values returns all possible values for RepairHistoryItemType.
There is no guarantee on the order of the values in the slice.
type RepairRun ¶
type RepairRun struct {
// 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"]`
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
DbtCommands []string `json:"dbt_commands,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
JarParams []string `json:"jar_params,omitempty"`
// Job-level parameters used in the run. for example `"param":
// "overriding_val"`
JobParameters map[string]string `json:"job_parameters,omitempty"`
// 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.
LatestRepairId int64 `json:"latest_repair_id,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// The JSON representation of this field (for example
// `{"notebook_params":{"name":"john doe","age":"35"}}`) cannot exceed
// 10,000 bytes.
//
// [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
NotebookParams map[string]string `json:"notebook_params,omitempty"`
// The performance mode on a serverless job. The performance target
// determines the level of compute performance or cost-efficiency for the
// run. This field overrides the performance target defined on the job
// level.
//
// * `STANDARD`: Enables cost-efficient execution of serverless workloads. *
// `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times
// through rapid scaling and optimized cluster performance.
PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"`
// Controls whether the pipeline should perform a full refresh
PipelineParams *PipelineParams `json:"pipeline_params,omitempty"`
PythonNamedParams map[string]string `json:"python_named_params,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// 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.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
PythonParams []string `json:"python_params,omitempty"`
// If true, repair all failed tasks. Only one of `rerun_tasks` or
// `rerun_all_failed_tasks` can be used.
RerunAllFailedTasks bool `json:"rerun_all_failed_tasks,omitempty"`
// 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`.
RerunDependentTasks bool `json:"rerun_dependent_tasks,omitempty"`
// The task keys of the task runs to repair.
RerunTasks []string `json:"rerun_tasks,omitempty"`
// The job run ID of the run to repair. The run must not be in progress.
RunId int64 `json:"run_id"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// 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.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
SparkSubmitParams []string `json:"spark_submit_params,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
SqlParams map[string]string `json:"sql_params,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (RepairRun) MarshalJSON ¶ added in v0.23.0
func (*RepairRun) UnmarshalJSON ¶ added in v0.23.0
type RepairRunResponse ¶
type RepairRunResponse struct {
// The ID of the repair. Must be provided in subsequent repairs using the
// `latest_repair_id` field to ensure sequential repairs.
RepairId int64 `json:"repair_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Run repair was initiated.
func (RepairRunResponse) MarshalJSON ¶ added in v0.23.0
func (s RepairRunResponse) MarshalJSON() ([]byte, error)
func (*RepairRunResponse) UnmarshalJSON ¶ added in v0.23.0
func (s *RepairRunResponse) UnmarshalJSON(b []byte) error
type ResetJob ¶
type ResetJob struct {
// The canonical identifier of the job to reset. This field is required.
JobId int64 `json:"job_id"`
// 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.
NewSettings JobSettings `json:"new_settings"`
}
type ResolvedConditionTaskValues ¶ added in v0.12.0
type ResolvedConditionTaskValues struct {
Left string `json:"left,omitempty"`
Right string `json:"right,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ResolvedConditionTaskValues) MarshalJSON ¶ added in v0.23.0
func (s ResolvedConditionTaskValues) MarshalJSON() ([]byte, error)
func (*ResolvedConditionTaskValues) UnmarshalJSON ¶ added in v0.23.0
func (s *ResolvedConditionTaskValues) UnmarshalJSON(b []byte) error
type ResolvedDbtTaskValues ¶ added in v0.12.0
type ResolvedDbtTaskValues struct {
Commands []string `json:"commands,omitempty"`
}
type ResolvedNotebookTaskValues ¶ added in v0.12.0
type ResolvedParamPairValues ¶ added in v0.12.0
type ResolvedPythonWheelTaskValues ¶ added in v0.12.0
type ResolvedRunJobTaskValues ¶ added in v0.12.0
type ResolvedStringParamsValues ¶ added in v0.12.0
type ResolvedStringParamsValues struct {
Parameters []string `json:"parameters,omitempty"`
}
type ResolvedValues ¶ added in v0.12.0
type ResolvedValues struct {
ConditionTask *ResolvedConditionTaskValues `json:"condition_task,omitempty"`
DbtTask *ResolvedDbtTaskValues `json:"dbt_task,omitempty"`
NotebookTask *ResolvedNotebookTaskValues `json:"notebook_task,omitempty"`
PythonWheelTask *ResolvedPythonWheelTaskValues `json:"python_wheel_task,omitempty"`
RunJobTask *ResolvedRunJobTaskValues `json:"run_job_task,omitempty"`
SimulationTask *ResolvedParamPairValues `json:"simulation_task,omitempty"`
SparkJarTask *ResolvedStringParamsValues `json:"spark_jar_task,omitempty"`
SparkPythonTask *ResolvedStringParamsValues `json:"spark_python_task,omitempty"`
SparkSubmitTask *ResolvedStringParamsValues `json:"spark_submit_task,omitempty"`
SqlTask *ResolvedParamPairValues `json:"sql_task,omitempty"`
}
type Run ¶
type Run struct {
// 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.
AttemptNumber int `json:"attempt_number,omitempty"`
// 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.
CleanupDuration int64 `json:"cleanup_duration,omitempty"`
// 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.
ClusterInstance *ClusterInstance `json:"cluster_instance,omitempty"`
// A snapshot of the job’s cluster specification when this run was
// created.
ClusterSpec *ClusterSpec `json:"cluster_spec,omitempty"`
// The creator user name. This field won’t be included in the response if
// the user has already been deleted.
CreatorUserName string `json:"creator_user_name,omitempty"`
// Description of the run
Description string `json:"description,omitempty"`
// The actual performance target used by the serverless run during
// execution. This can differ from the client-set performance target on the
// request depending on whether the performance mode is supported by the job
// type.
//
// * `STANDARD`: Enables cost-efficient execution of serverless workloads. *
// `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times
// through rapid scaling and optimized cluster performance.
EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"`
// The id of the usage policy used by this run for cost attribution
// purposes.
EffectiveUsagePolicyId string `json:"effective_usage_policy_id,omitempty"`
// 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.
EndTime int64 `json:"end_time,omitempty"`
// 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.
ExecutionDuration int64 `json:"execution_duration,omitempty"`
// 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.
GitSource *GitSource `json:"git_source,omitempty"`
// Indicates if the run has more array properties (`tasks`, `job_clusters`)
// that are not shown. They can be accessed via :method:jobs/getrun
// endpoint. It is only relevant for API 2.2 :method:jobs/listruns requests
// with `expand_tasks=true`.
HasMore bool `json:"has_more,omitempty"`
// Only populated by for-each iterations. The parent for-each task is
// located in tasks array.
Iterations []RunTask `json:"iterations,omitempty"`
// 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. If more than 100
// job clusters are available, you can paginate through them using
// :method:jobs/getrun.
JobClusters []JobCluster `json:"job_clusters,omitempty"`
// The canonical identifier of the job that contains this run.
JobId int64 `json:"job_id,omitempty"`
// Job-level parameters used in the run
JobParameters []JobParameter `json:"job_parameters,omitempty"`
// ID of the job run that this run belongs to. For legacy and single-task
// job runs the field is populated with the job run ID. For task runs, the
// field is populated with the ID of the job run that the task run belongs
// to.
JobRunId int64 `json:"job_run_id,omitempty"`
// A token that can be used to list the next page of array properties.
NextPageToken string `json:"next_page_token,omitempty"`
// A unique identifier for this job run. This is set to the same value as
// `run_id`.
NumberInJob int64 `json:"number_in_job,omitempty"`
// 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.
OriginalAttemptRunId int64 `json:"original_attempt_run_id,omitempty"`
// The parameters used for this run.
OverridingParameters *RunParameters `json:"overriding_parameters,omitempty"`
// The time in milliseconds that the run has spent in the queue.
QueueDuration int64 `json:"queue_duration,omitempty"`
// The repair history of the run.
RepairHistory []RepairHistoryItem `json:"repair_history,omitempty"`
// The time in milliseconds it took the job run and all of its repairs to
// finish.
RunDuration int64 `json:"run_duration,omitempty"`
// The canonical identifier of the run. This ID is unique across all runs of
// all jobs.
RunId int64 `json:"run_id,omitempty"`
// An optional name for the run. The maximum length is 4096 bytes in UTF-8
// encoding.
RunName string `json:"run_name,omitempty"`
// The URL to the detail page of the run.
RunPageUrl string `json:"run_page_url,omitempty"`
RunType RunType `json:"run_type,omitempty"`
// The cron schedule that triggered this run if it was triggered by the
// periodic scheduler.
Schedule *CronSchedule `json:"schedule,omitempty"`
// 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.
SetupDuration int64 `json:"setup_duration,omitempty"`
// 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.
StartTime int64 `json:"start_time,omitempty"`
// Deprecated. Please use the `status` field instead.
State *RunState `json:"state,omitempty"`
Status *RunStatus `json:"status,omitempty"`
// 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. If
// more than 100 tasks are available, you can paginate through them using
// :method:jobs/getrun. Use the `next_page_token` field at the object root
// to determine if more results are available.
Tasks []RunTask `json:"tasks,omitempty"`
Trigger TriggerType `json:"trigger,omitempty"`
TriggerInfo *TriggerInfo `json:"trigger_info,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Run was retrieved successfully
func (Run) MarshalJSON ¶ added in v0.23.0
func (*Run) UnmarshalJSON ¶ added in v0.23.0
type RunConditionTask ¶ added in v0.11.0
type RunConditionTask struct {
// The left operand of the condition task. Can be either a string value or a
// job state or parameter reference.
Left string `json:"left"`
// * `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.
Op ConditionTaskOp `json:"op"`
// The condition expression evaluation result. Filled in if the task was
// successfully completed. Can be `"true"` or `"false"`
Outcome string `json:"outcome,omitempty"`
// The right operand of the condition task. Can be either a string value or
// a job state or parameter reference.
Right string `json:"right"`
ForceSendFields []string `json:"-" url:"-"`
}
func (RunConditionTask) MarshalJSON ¶ added in v0.23.0
func (s RunConditionTask) MarshalJSON() ([]byte, error)
func (*RunConditionTask) UnmarshalJSON ¶ added in v0.23.0
func (s *RunConditionTask) UnmarshalJSON(b []byte) error
type RunForEachTask ¶ added in v0.31.0
type RunForEachTask struct {
// An optional maximum allowed number of concurrent runs of the task. Set
// this value if you want to be able to execute multiple runs of the task
// concurrently.
Concurrency int `json:"concurrency,omitempty"`
// Array for task to iterate on. This can be a JSON string or a reference to
// an array parameter.
Inputs string `json:"inputs"`
// Read only field. Populated for GetRun and ListRuns RPC calls and stores
// the execution stats of an For each task
Stats *ForEachStats `json:"stats,omitempty"`
// Configuration for the task that will be run for each element in the array
Task Task `json:"task"`
ForceSendFields []string `json:"-" url:"-"`
}
func (RunForEachTask) MarshalJSON ¶ added in v0.31.0
func (s RunForEachTask) MarshalJSON() ([]byte, error)
func (*RunForEachTask) UnmarshalJSON ¶ added in v0.31.0
func (s *RunForEachTask) UnmarshalJSON(b []byte) error
type RunIf ¶ added in v0.12.0
type RunIf string
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
const RunIfAllDone RunIf = `ALL_DONE`
All dependencies have been completed
const RunIfAllFailed RunIf = `ALL_FAILED`
ALl dependencies have failed
const RunIfAllSuccess RunIf = `ALL_SUCCESS`
All dependencies have executed and succeeded
const RunIfAtLeastOneFailed RunIf = `AT_LEAST_ONE_FAILED`
At least one dependency failed
const RunIfAtLeastOneSuccess RunIf = `AT_LEAST_ONE_SUCCESS`
At least one dependency has succeeded
const RunIfNoneFailed RunIf = `NONE_FAILED`
None of the dependencies have failed and at least one was executed
type RunJobOutput ¶ added in v0.13.0
type RunJobOutput struct {
// The run id of the triggered job run
RunId int64 `json:"run_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (RunJobOutput) MarshalJSON ¶ added in v0.23.0
func (s RunJobOutput) MarshalJSON() ([]byte, error)
func (*RunJobOutput) UnmarshalJSON ¶ added in v0.23.0
func (s *RunJobOutput) UnmarshalJSON(b []byte) error
type RunJobTask ¶ added in v0.13.0
type RunJobTask struct {
// 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"]`
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
DbtCommands []string `json:"dbt_commands,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
JarParams []string `json:"jar_params,omitempty"`
// ID of the job to trigger.
JobId int64 `json:"job_id"`
// Job-level parameters used to trigger the job.
JobParameters map[string]string `json:"job_parameters,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// The JSON representation of this field (for example
// `{"notebook_params":{"name":"john doe","age":"35"}}`) cannot exceed
// 10,000 bytes.
//
// [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
NotebookParams map[string]string `json:"notebook_params,omitempty"`
// Controls whether the pipeline should perform a full refresh
PipelineParams *PipelineParams `json:"pipeline_params,omitempty"`
PythonNamedParams map[string]string `json:"python_named_params,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// 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.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
PythonParams []string `json:"python_params,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// 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.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
SparkSubmitParams []string `json:"spark_submit_params,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
SqlParams map[string]string `json:"sql_params,omitempty"`
}
type RunLifeCycleState ¶
type RunLifeCycleState string
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.
const RunLifeCycleStateBlocked RunLifeCycleState = `BLOCKED`
The run is blocked on an upstream dependency.
const RunLifeCycleStateInternalError RunLifeCycleState = `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.
const RunLifeCycleStatePending RunLifeCycleState = `PENDING`
The run is waiting to be executed while the cluster and execution context are being prepared.
const RunLifeCycleStateQueued RunLifeCycleState = `QUEUED`
The run is queued.
const RunLifeCycleStateRunning RunLifeCycleState = `RUNNING`
The task of this run is being executed.
const RunLifeCycleStateSkipped RunLifeCycleState = `SKIPPED`
This run was aborted because a previous run of the same job was already active. This state is terminal.
const RunLifeCycleStateTerminated RunLifeCycleState = `TERMINATED`
The task of this run has completed, and the cluster and execution context have been cleaned up. This state is terminal.
const RunLifeCycleStateTerminating RunLifeCycleState = `TERMINATING`
The task of this run has completed, and the cluster and execution context are being cleaned up.
const RunLifeCycleStateWaitingForRetry RunLifeCycleState = `WAITING_FOR_RETRY`
The run is waiting for a retry.
func (*RunLifeCycleState) Set ¶ added in v0.2.0
func (f *RunLifeCycleState) Set(v string) error
Set raw string value and validate it against allowed values
func (*RunLifeCycleState) String ¶ added in v0.2.0
func (f *RunLifeCycleState) String() string
String representation for fmt.Print
func (*RunLifeCycleState) Type ¶ added in v0.2.0
func (f *RunLifeCycleState) Type() string
Type always returns RunLifeCycleState to satisfy [pflag.Value] interface
func (*RunLifeCycleState) Values ¶ added in v0.72.0
func (f *RunLifeCycleState) Values() []RunLifeCycleState
Values returns all possible values for RunLifeCycleState.
There is no guarantee on the order of the values in the slice.
type RunLifecycleStateV2State ¶ added in v0.46.0
type RunLifecycleStateV2State string
The current state of the run.
const RunLifecycleStateV2StateBlocked RunLifecycleStateV2State = `BLOCKED`
const RunLifecycleStateV2StatePending RunLifecycleStateV2State = `PENDING`
const RunLifecycleStateV2StateQueued RunLifecycleStateV2State = `QUEUED`
const RunLifecycleStateV2StateRunning RunLifecycleStateV2State = `RUNNING`
const RunLifecycleStateV2StateTerminated RunLifecycleStateV2State = `TERMINATED`
const RunLifecycleStateV2StateTerminating RunLifecycleStateV2State = `TERMINATING`
const RunLifecycleStateV2StateWaiting RunLifecycleStateV2State = `WAITING`
func (*RunLifecycleStateV2State) Set ¶ added in v0.46.0
func (f *RunLifecycleStateV2State) Set(v string) error
Set raw string value and validate it against allowed values
func (*RunLifecycleStateV2State) String ¶ added in v0.46.0
func (f *RunLifecycleStateV2State) String() string
String representation for fmt.Print
func (*RunLifecycleStateV2State) Type ¶ added in v0.46.0
func (f *RunLifecycleStateV2State) Type() string
Type always returns RunLifecycleStateV2State to satisfy [pflag.Value] interface
func (*RunLifecycleStateV2State) Values ¶ added in v0.72.0
func (f *RunLifecycleStateV2State) Values() []RunLifecycleStateV2State
Values returns all possible values for RunLifecycleStateV2State.
There is no guarantee on the order of the values in the slice.
type RunNow ¶
type RunNow struct {
// 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"]`
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
DbtCommands []string `json:"dbt_commands,omitempty"`
// 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
IdempotencyToken string `json:"idempotency_token,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
JarParams []string `json:"jar_params,omitempty"`
// The ID of the job to be executed
JobId int64 `json:"job_id"`
// Job-level parameters used in the run. for example `"param":
// "overriding_val"`
JobParameters map[string]string `json:"job_parameters,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// The JSON representation of this field (for example
// `{"notebook_params":{"name":"john doe","age":"35"}}`) cannot exceed
// 10,000 bytes.
//
// [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
NotebookParams map[string]string `json:"notebook_params,omitempty"`
// A list of task keys to run inside of the job. If this field is not
// provided, all tasks in the job will be run.
Only []string `json:"only,omitempty"`
// The performance mode on a serverless job. The performance target
// determines the level of compute performance or cost-efficiency for the
// run. This field overrides the performance target defined on the job
// level.
//
// * `STANDARD`: Enables cost-efficient execution of serverless workloads. *
// `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times
// through rapid scaling and optimized cluster performance.
PerformanceTarget PerformanceTarget `json:"performance_target,omitempty"`
// Controls whether the pipeline should perform a full refresh
PipelineParams *PipelineParams `json:"pipeline_params,omitempty"`
PythonNamedParams map[string]string `json:"python_named_params,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// 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.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
PythonParams []string `json:"python_params,omitempty"`
// The queue settings of the run.
Queue *QueueSettings `json:"queue,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// 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.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
SparkSubmitParams []string `json:"spark_submit_params,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
SqlParams map[string]string `json:"sql_params,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (RunNow) MarshalJSON ¶ added in v0.23.0
func (*RunNow) UnmarshalJSON ¶ added in v0.23.0
type RunNowResponse ¶
type RunNowResponse struct {
// A unique identifier for this job run. This is set to the same value as
// `run_id`.
NumberInJob int64 `json:"number_in_job,omitempty"`
// The globally unique ID of the newly triggered run.
RunId int64 `json:"run_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Run was started successfully.
func (RunNowResponse) MarshalJSON ¶ added in v0.23.0
func (s RunNowResponse) MarshalJSON() ([]byte, error)
func (*RunNowResponse) UnmarshalJSON ¶ added in v0.23.0
func (s *RunNowResponse) UnmarshalJSON(b []byte) error
type RunOutput ¶
type RunOutput struct {
// The output of an alert task, if available
AlertOutput *AlertTaskOutput `json:"alert_output,omitempty"`
// The output of a clean rooms notebook task, if available
CleanRoomsNotebookOutput *CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput `json:"clean_rooms_notebook_output,omitempty"`
// The output of a dashboard task, if available
DashboardOutput *DashboardTaskOutput `json:"dashboard_output,omitempty"`
// Deprecated in favor of the new dbt_platform_output
DbtCloudOutput *DbtCloudTaskOutput `json:"dbt_cloud_output,omitempty"`
// The output of a dbt task, if available.
DbtOutput *DbtOutput `json:"dbt_output,omitempty"`
DbtPlatformOutput *DbtPlatformTaskOutput `json:"dbt_platform_output,omitempty"`
// 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 string `json:"error,omitempty"`
// If there was an error executing the run, this field contains any
// available stack traces.
ErrorTrace string `json:"error_trace,omitempty"`
Info string `json:"info,omitempty"`
// 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 string `json:"logs,omitempty"`
// Whether the logs are truncated.
LogsTruncated bool `json:"logs_truncated,omitempty"`
// All details of the run except for its output.
Metadata *Run `json:"metadata,omitempty"`
// 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
NotebookOutput *NotebookOutput `json:"notebook_output,omitempty"`
// The output of a run job task, if available
RunJobOutput *RunJobOutput `json:"run_job_output,omitempty"`
// The output of a SQL task, if available.
SqlOutput *SqlOutput `json:"sql_output,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Run output was retrieved successfully.
func (RunOutput) MarshalJSON ¶ added in v0.23.0
func (*RunOutput) UnmarshalJSON ¶ added in v0.23.0
type RunParameters ¶
type RunParameters struct {
// 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"]`
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
DbtCommands []string `json:"dbt_commands,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
JarParams []string `json:"jar_params,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// The JSON representation of this field (for example
// `{"notebook_params":{"name":"john doe","age":"35"}}`) cannot exceed
// 10,000 bytes.
//
// [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
NotebookParams map[string]string `json:"notebook_params,omitempty"`
// Controls whether the pipeline should perform a full refresh
PipelineParams *PipelineParams `json:"pipeline_params,omitempty"`
PythonNamedParams map[string]string `json:"python_named_params,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// 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.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
PythonParams []string `json:"python_params,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// 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.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
SparkSubmitParams []string `json:"spark_submit_params,omitempty"`
// 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.
//
// ⚠ **Deprecation note** Use [job parameters] to pass information down to
// tasks.
//
// [job parameters]: https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown
SqlParams map[string]string `json:"sql_params,omitempty"`
}
type RunResultState ¶
type RunResultState string
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. * `DISABLED`: The run was skipped because it was disabled explicitly by the user.
const RunResultStateCanceled RunResultState = `CANCELED`
The run was canceled at user request.
const RunResultStateDisabled RunResultState = `DISABLED`
The run was skipped because it was disabled explicitly by the user.
const RunResultStateExcluded RunResultState = `EXCLUDED`
The run was skipped because the necessary conditions were not met.
const RunResultStateFailed RunResultState = `FAILED`
The task completed with an error.
const RunResultStateMaximumConcurrentRunsReached RunResultState = `MAXIMUM_CONCURRENT_RUNS_REACHED`
The run was skipped because the maximum concurrent runs were reached.
const RunResultStateSuccess RunResultState = `SUCCESS`
The task completed successfully.
const RunResultStateSuccessWithFailures RunResultState = `SUCCESS_WITH_FAILURES`
The job run completed successfully with some failures; leaf tasks were successful.
const RunResultStateTimedout RunResultState = `TIMEDOUT`
The run was stopped after reaching the timeout.
const RunResultStateUpstreamCanceled RunResultState = `UPSTREAM_CANCELED`
The run was skipped because an upstream task was canceled.
const RunResultStateUpstreamFailed RunResultState = `UPSTREAM_FAILED`
The run was skipped because of an upstream failure.
func (*RunResultState) Set ¶ added in v0.2.0
func (f *RunResultState) Set(v string) error
Set raw string value and validate it against allowed values
func (*RunResultState) String ¶ added in v0.2.0
func (f *RunResultState) String() string
String representation for fmt.Print
func (*RunResultState) Type ¶ added in v0.2.0
func (f *RunResultState) Type() string
Type always returns RunResultState to satisfy [pflag.Value] interface
func (*RunResultState) Values ¶ added in v0.72.0
func (f *RunResultState) Values() []RunResultState
Values returns all possible values for RunResultState.
There is no guarantee on the order of the values in the slice.
type RunState ¶
type RunState struct {
// A value indicating the run's current lifecycle state. This field is
// always available in the response. Note: Additional states might be
// introduced in future releases.
LifeCycleState RunLifeCycleState `json:"life_cycle_state,omitempty"`
// The reason indicating why the run was queued.
QueueReason string `json:"queue_reason,omitempty"`
// A value indicating the run's result. This field is only available for
// terminal lifecycle states. Note: Additional states might be introduced in
// future releases.
ResultState RunResultState `json:"result_state,omitempty"`
// A descriptive message for the current state. This field is unstructured,
// and its exact format is subject to change.
StateMessage string `json:"state_message,omitempty"`
// A value indicating whether a run was canceled manually by a user or by
// the scheduler because the run timed out.
UserCancelledOrTimedout bool `json:"user_cancelled_or_timedout,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
The current state of the run.
func (RunState) MarshalJSON ¶ added in v0.23.0
func (*RunState) UnmarshalJSON ¶ added in v0.23.0
type RunStatus ¶ added in v0.46.0
type RunStatus struct {
// If the run was queued, details about the reason for queuing the run.
QueueDetails *QueueDetails `json:"queue_details,omitempty"`
State RunLifecycleStateV2State `json:"state,omitempty"`
// If the run is in a TERMINATING or TERMINATED state, details about the
// reason for terminating the run.
TerminationDetails *TerminationDetails `json:"termination_details,omitempty"`
}
The current status of the run
type RunTask ¶
type RunTask struct {
// The task evaluates a Databricks alert and sends notifications to
// subscribers when the `alert_task` field is present.
AlertTask *AlertTask `json:"alert_task,omitempty"`
// 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.
AttemptNumber int `json:"attempt_number,omitempty"`
// The task runs a [clean rooms] notebook when the
// `clean_rooms_notebook_task` field is present.
//
// [clean rooms]: https://docs.databricks.com/clean-rooms/index.html
CleanRoomsNotebookTask *CleanRoomsNotebookTask `json:"clean_rooms_notebook_task,omitempty"`
// 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.
CleanupDuration int64 `json:"cleanup_duration,omitempty"`
// 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.
ClusterInstance *ClusterInstance `json:"cluster_instance,omitempty"`
// Task level compute configuration.
Compute *Compute `json:"compute,omitempty"`
// The task evaluates a condition that can be used to control the execution
// of other tasks when the `condition_task` field is present. The condition
// task does not require a cluster to execute and does not support retries
// or notifications.
ConditionTask *RunConditionTask `json:"condition_task,omitempty"`
// The task refreshes a dashboard and sends a snapshot to subscribers.
DashboardTask *DashboardTask `json:"dashboard_task,omitempty"`
// Task type for dbt cloud, deprecated in favor of the new name
// dbt_platform_task
DbtCloudTask *DbtCloudTask `json:"dbt_cloud_task,omitempty"`
DbtPlatformTask *DbtPlatformTask `json:"dbt_platform_task,omitempty"`
// The task runs one or more dbt commands when the `dbt_task` field is
// present. The dbt task requires both Databricks SQL and the ability to use
// a serverless or a pro SQL warehouse.
DbtTask *DbtTask `json:"dbt_task,omitempty"`
// 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.
DependsOn []TaskDependency `json:"depends_on,omitempty"`
// An optional description for this task.
Description string `json:"description,omitempty"`
// An option to disable auto optimization in serverless
DisableAutoOptimization bool `json:"disable_auto_optimization,omitempty"`
// The actual performance target used by the serverless run during
// execution. This can differ from the client-set performance target on the
// request depending on whether the performance mode is supported by the job
// type.
//
// * `STANDARD`: Enables cost-efficient execution of serverless workloads. *
// `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times
// through rapid scaling and optimized cluster performance.
EffectivePerformanceTarget PerformanceTarget `json:"effective_performance_target,omitempty"`
// An optional set of email addresses notified when the task run begins or
// completes. The default behavior is to not send any emails.
EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"`
// 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.
EndTime int64 `json:"end_time,omitempty"`
// 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.
EnvironmentKey string `json:"environment_key,omitempty"`
// 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.
ExecutionDuration int64 `json:"execution_duration,omitempty"`
// 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
ExistingClusterId string `json:"existing_cluster_id,omitempty"`
// The task executes a nested task for every input provided when the
// `for_each_task` field is present.
ForEachTask *RunForEachTask `json:"for_each_task,omitempty"`
GenAiComputeTask *GenAiComputeTask `json:"gen_ai_compute_task,omitempty"`
// 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.
GitSource *GitSource `json:"git_source,omitempty"`
// If job_cluster_key, this task is executed reusing the cluster specified
// in `job.settings.job_clusters`.
JobClusterKey string `json:"job_cluster_key,omitempty"`
// An optional list of libraries to be installed on the cluster. The default
// value is an empty list.
Libraries []compute.Library `json:"libraries,omitempty"`
// 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.
MaxRetries int `json:"max_retries,omitempty"`
// 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.
MinRetryIntervalMillis int `json:"min_retry_interval_millis,omitempty"`
// If new_cluster, a description of a new cluster that is created for each
// run.
NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"`
// The task runs a notebook when the `notebook_task` field is present.
NotebookTask *NotebookTask `json:"notebook_task,omitempty"`
// Optional notification settings that are used when sending notifications
// to each of the `email_notifications` and `webhook_notifications` for this
// task run.
NotificationSettings *TaskNotificationSettings `json:"notification_settings,omitempty"`
// The task triggers a pipeline update when the `pipeline_task` field is
// present. Only pipelines configured to use triggered more are supported.
PipelineTask *PipelineTask `json:"pipeline_task,omitempty"`
// The task triggers a Power BI semantic model update when the
// `power_bi_task` field is present.
PowerBiTask *PowerBiTask `json:"power_bi_task,omitempty"`
// The task runs a Python wheel when the `python_wheel_task` field is
// present.
PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty"`
// The time in milliseconds that the run has spent in the queue.
QueueDuration int64 `json:"queue_duration,omitempty"`
// Parameter values including resolved references
ResolvedValues *ResolvedValues `json:"resolved_values,omitempty"`
// An optional policy to specify whether to retry a job when it times out.
// The default behavior is to not retry on timeout.
RetryOnTimeout bool `json:"retry_on_timeout,omitempty"`
// The time in milliseconds it took the job run and all of its repairs to
// finish.
RunDuration int64 `json:"run_duration,omitempty"`
// The ID of the task run.
RunId int64 `json:"run_id,omitempty"`
// 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.
RunIf RunIf `json:"run_if,omitempty"`
// The task triggers another job when the `run_job_task` field is present.
RunJobTask *RunJobTask `json:"run_job_task,omitempty"`
RunPageUrl string `json:"run_page_url,omitempty"`
// 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.
SetupDuration int64 `json:"setup_duration,omitempty"`
// The task runs a JAR when the `spark_jar_task` field is present.
SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty"`
// The task runs a Python file when the `spark_python_task` field is
// present.
SparkPythonTask *SparkPythonTask `json:"spark_python_task,omitempty"`
// (Legacy) The task runs the spark-submit script when the spark_submit_task
// field is present. Databricks recommends using the spark_jar_task instead;
// see [Spark Submit task for jobs](/jobs/spark-submit).
SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty"`
// The task runs a SQL query or file, or it refreshes a SQL alert or a
// legacy SQL dashboard when the `sql_task` field is present.
SqlTask *SqlTask `json:"sql_task,omitempty"`
// 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.
StartTime int64 `json:"start_time,omitempty"`
// Deprecated. Please use the `status` field instead.
State *RunState `json:"state,omitempty"`
Status *RunStatus `json:"status,omitempty"`
// 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.
TaskKey string `json:"task_key"`
// An optional timeout applied to each run of this job task. A value of `0`
// means no timeout.
TimeoutSeconds int `json:"timeout_seconds,omitempty"`
// 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.
WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Used when outputting a child run, in GetRun or ListRuns.
func (RunTask) MarshalJSON ¶ added in v0.23.0
func (*RunTask) UnmarshalJSON ¶ added in v0.23.0
type RunType ¶
type RunType string
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.
const RunTypeJobRun RunType = `JOB_RUN`
Normal job run. A run created with :method:jobs/runNow.
const RunTypeSubmitRun RunType = `SUBMIT_RUN`
Submit run. A run created with :method:jobs/submit.
const RunTypeWorkflowRun RunType = `WORKFLOW_RUN`
Workflow run. A run created with [dbutils.notebook.run](/dev-tools/databricks-utils.html#dbutils-workflow).
type Source ¶ added in v0.11.0
type Source string
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.
const SourceGit Source = `GIT`
SQL file is located in cloud Git provider.
const SourceWorkspace Source = `WORKSPACE`
SQL file is located in <Databricks> workspace.
type SparkJarTask ¶
type SparkJarTask struct {
// Deprecated since 04/2016. For classic compute, provide a `jar` through
// the `libraries` field instead. For serverless compute, provide a `jar`
// though the `java_dependencies` field inside the `environments` list.
//
// See the examples of classic and serverless compute usage at the top of
// the page.
JarUri string `json:"jar_uri,omitempty"`
// 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.
MainClassName string `json:"main_class_name,omitempty"`
// 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
Parameters []string `json:"parameters,omitempty"`
// Deprecated. A value of `false` is no longer supported.
RunAsRepl bool `json:"run_as_repl,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (SparkJarTask) MarshalJSON ¶ added in v0.23.0
func (s SparkJarTask) MarshalJSON() ([]byte, error)
func (*SparkJarTask) UnmarshalJSON ¶ added in v0.23.0
func (s *SparkJarTask) UnmarshalJSON(b []byte) error
type SparkPythonTask ¶
type SparkPythonTask struct {
// 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
Parameters []string `json:"parameters,omitempty"`
// 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.
PythonFile string `json:"python_file"`
// 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.
Source Source `json:"source,omitempty"`
}
type SparkSubmitTask ¶
type SparkSubmitTask struct {
// 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
Parameters []string `json:"parameters,omitempty"`
}
type SparseCheckout ¶ added in v0.107.0
type SparseCheckout struct {
// List of patterns to include for sparse checkout.
Patterns []string `json:"patterns,omitempty"`
}
type SqlAlertOutput ¶
type SqlAlertOutput struct {
AlertState SqlAlertState `json:"alert_state,omitempty"`
// The link to find the output results.
OutputLink string `json:"output_link,omitempty"`
// The text of the SQL query. Can Run permission of the SQL query associated
// with the SQL alert is required to view this field.
QueryText string `json:"query_text,omitempty"`
// Information about SQL statements executed in the run.
SqlStatements []SqlStatementOutput `json:"sql_statements,omitempty"`
// The canonical identifier of the SQL warehouse.
WarehouseId string `json:"warehouse_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (SqlAlertOutput) MarshalJSON ¶ added in v0.23.0
func (s SqlAlertOutput) MarshalJSON() ([]byte, error)
func (*SqlAlertOutput) UnmarshalJSON ¶ added in v0.23.0
func (s *SqlAlertOutput) UnmarshalJSON(b []byte) error
type SqlAlertState ¶ added in v0.3.1
type SqlAlertState string
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
const SqlAlertStateOk SqlAlertState = `OK`
const SqlAlertStateTriggered SqlAlertState = `TRIGGERED`
const SqlAlertStateUnknown SqlAlertState = `UNKNOWN`
func (*SqlAlertState) Set ¶ added in v0.3.1
func (f *SqlAlertState) Set(v string) error
Set raw string value and validate it against allowed values
func (*SqlAlertState) String ¶ added in v0.3.1
func (f *SqlAlertState) String() string
String representation for fmt.Print
func (*SqlAlertState) Type ¶ added in v0.3.1
func (f *SqlAlertState) Type() string
Type always returns SqlAlertState to satisfy [pflag.Value] interface
func (*SqlAlertState) Values ¶ added in v0.72.0
func (f *SqlAlertState) Values() []SqlAlertState
Values returns all possible values for SqlAlertState.
There is no guarantee on the order of the values in the slice.
type SqlDashboardOutput ¶
type SqlDashboardOutput struct {
// The canonical identifier of the SQL warehouse.
WarehouseId string `json:"warehouse_id,omitempty"`
// Widgets executed in the run. Only SQL query based widgets are listed.
Widgets []SqlDashboardWidgetOutput `json:"widgets,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (SqlDashboardOutput) MarshalJSON ¶ added in v0.23.0
func (s SqlDashboardOutput) MarshalJSON() ([]byte, error)
func (*SqlDashboardOutput) UnmarshalJSON ¶ added in v0.23.0
func (s *SqlDashboardOutput) UnmarshalJSON(b []byte) error
type SqlDashboardWidgetOutput ¶
type SqlDashboardWidgetOutput struct {
// Time (in epoch milliseconds) when execution of the SQL widget ends.
EndTime int64 `json:"end_time,omitempty"`
// The information about the error when execution fails.
Error *SqlOutputError `json:"error,omitempty"`
// The link to find the output results.
OutputLink string `json:"output_link,omitempty"`
// Time (in epoch milliseconds) when execution of the SQL widget starts.
StartTime int64 `json:"start_time,omitempty"`
// The execution status of the SQL widget.
Status SqlDashboardWidgetOutputStatus `json:"status,omitempty"`
// The canonical identifier of the SQL widget.
WidgetId string `json:"widget_id,omitempty"`
// The title of the SQL widget.
WidgetTitle string `json:"widget_title,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (SqlDashboardWidgetOutput) MarshalJSON ¶ added in v0.23.0
func (s SqlDashboardWidgetOutput) MarshalJSON() ([]byte, error)
func (*SqlDashboardWidgetOutput) UnmarshalJSON ¶ added in v0.23.0
func (s *SqlDashboardWidgetOutput) UnmarshalJSON(b []byte) error
type SqlDashboardWidgetOutputStatus ¶
type SqlDashboardWidgetOutputStatus string
const SqlDashboardWidgetOutputStatusCancelled SqlDashboardWidgetOutputStatus = `CANCELLED`
const SqlDashboardWidgetOutputStatusFailed SqlDashboardWidgetOutputStatus = `FAILED`
const SqlDashboardWidgetOutputStatusPending SqlDashboardWidgetOutputStatus = `PENDING`
const SqlDashboardWidgetOutputStatusRunning SqlDashboardWidgetOutputStatus = `RUNNING`
const SqlDashboardWidgetOutputStatusSuccess SqlDashboardWidgetOutputStatus = `SUCCESS`
func (*SqlDashboardWidgetOutputStatus) Set ¶ added in v0.2.0
func (f *SqlDashboardWidgetOutputStatus) Set(v string) error
Set raw string value and validate it against allowed values
func (*SqlDashboardWidgetOutputStatus) String ¶ added in v0.2.0
func (f *SqlDashboardWidgetOutputStatus) String() string
String representation for fmt.Print
func (*SqlDashboardWidgetOutputStatus) Type ¶ added in v0.2.0
func (f *SqlDashboardWidgetOutputStatus) Type() string
Type always returns SqlDashboardWidgetOutputStatus to satisfy [pflag.Value] interface
func (*SqlDashboardWidgetOutputStatus) Values ¶ added in v0.72.0
func (f *SqlDashboardWidgetOutputStatus) Values() []SqlDashboardWidgetOutputStatus
Values returns all possible values for SqlDashboardWidgetOutputStatus.
There is no guarantee on the order of the values in the slice.
type SqlOutput ¶
type SqlOutput struct {
// The output of a SQL alert task, if available.
AlertOutput *SqlAlertOutput `json:"alert_output,omitempty"`
// The output of a SQL dashboard task, if available.
DashboardOutput *SqlDashboardOutput `json:"dashboard_output,omitempty"`
// The output of a SQL query task, if available.
QueryOutput *SqlQueryOutput `json:"query_output,omitempty"`
}
type SqlOutputError ¶
type SqlOutputError struct {
// The error message when execution fails.
Message string `json:"message,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (SqlOutputError) MarshalJSON ¶ added in v0.23.0
func (s SqlOutputError) MarshalJSON() ([]byte, error)
func (*SqlOutputError) UnmarshalJSON ¶ added in v0.23.0
func (s *SqlOutputError) UnmarshalJSON(b []byte) error
type SqlQueryOutput ¶
type SqlQueryOutput struct {
EndpointId string `json:"endpoint_id,omitempty"`
// The link to find the output results.
OutputLink string `json:"output_link,omitempty"`
// The text of the SQL query. Can Run permission of the SQL query is
// required to view this field.
QueryText string `json:"query_text,omitempty"`
// Information about SQL statements executed in the run.
SqlStatements []SqlStatementOutput `json:"sql_statements,omitempty"`
// The canonical identifier of the SQL warehouse.
WarehouseId string `json:"warehouse_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (SqlQueryOutput) MarshalJSON ¶ added in v0.23.0
func (s SqlQueryOutput) MarshalJSON() ([]byte, error)
func (*SqlQueryOutput) UnmarshalJSON ¶ added in v0.23.0
func (s *SqlQueryOutput) UnmarshalJSON(b []byte) error
type SqlStatementOutput ¶
type SqlStatementOutput struct {
// A key that can be used to look up query details.
LookupKey string `json:"lookup_key,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (SqlStatementOutput) MarshalJSON ¶ added in v0.23.0
func (s SqlStatementOutput) MarshalJSON() ([]byte, error)
func (*SqlStatementOutput) UnmarshalJSON ¶ added in v0.23.0
func (s *SqlStatementOutput) UnmarshalJSON(b []byte) error
type SqlTask ¶
type SqlTask struct {
// If alert, indicates that this job must refresh a SQL alert.
Alert *SqlTaskAlert `json:"alert,omitempty"`
// If dashboard, indicates that this job must refresh a SQL dashboard.
Dashboard *SqlTaskDashboard `json:"dashboard,omitempty"`
// If file, indicates that this job runs a SQL file in a remote Git
// repository.
File *SqlTaskFile `json:"file,omitempty"`
// Parameters to be used for each run of this job. The SQL alert task does
// not support custom parameters.
Parameters map[string]string `json:"parameters,omitempty"`
// If query, indicates that this job must execute a SQL query.
Query *SqlTaskQuery `json:"query,omitempty"`
// 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.
WarehouseId string `json:"warehouse_id"`
}
type SqlTaskAlert ¶
type SqlTaskAlert struct {
// The canonical identifier of the SQL alert.
AlertId string `json:"alert_id"`
// If true, the alert notifications are not sent to subscribers.
PauseSubscriptions bool `json:"pause_subscriptions,omitempty"`
// If specified, alert notifications are sent to subscribers.
Subscriptions []SqlTaskSubscription `json:"subscriptions,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (SqlTaskAlert) MarshalJSON ¶ added in v0.23.0
func (s SqlTaskAlert) MarshalJSON() ([]byte, error)
func (*SqlTaskAlert) UnmarshalJSON ¶ added in v0.23.0
func (s *SqlTaskAlert) UnmarshalJSON(b []byte) error
type SqlTaskDashboard ¶
type SqlTaskDashboard struct {
// Subject of the email sent to subscribers of this task.
CustomSubject string `json:"custom_subject,omitempty"`
// The canonical identifier of the SQL dashboard.
DashboardId string `json:"dashboard_id"`
// If true, the dashboard snapshot is not taken, and emails are not sent to
// subscribers.
PauseSubscriptions bool `json:"pause_subscriptions,omitempty"`
// If specified, dashboard snapshots are sent to subscriptions.
Subscriptions []SqlTaskSubscription `json:"subscriptions,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (SqlTaskDashboard) MarshalJSON ¶ added in v0.23.0
func (s SqlTaskDashboard) MarshalJSON() ([]byte, error)
func (*SqlTaskDashboard) UnmarshalJSON ¶ added in v0.23.0
func (s *SqlTaskDashboard) UnmarshalJSON(b []byte) error
type SqlTaskFile ¶ added in v0.9.0
type SqlTaskFile struct {
// Path of the SQL file. Must be relative if the source is a remote Git
// repository and absolute for workspace paths.
Path string `json:"path"`
// 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.
Source Source `json:"source,omitempty"`
}
type SqlTaskQuery ¶
type SqlTaskQuery struct {
// The canonical identifier of the SQL query.
QueryId string `json:"query_id"`
}
type SqlTaskSubscription ¶ added in v0.3.1
type SqlTaskSubscription struct {
// 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.
DestinationId string `json:"destination_id,omitempty"`
// 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.
UserName string `json:"user_name,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (SqlTaskSubscription) MarshalJSON ¶ added in v0.23.0
func (s SqlTaskSubscription) MarshalJSON() ([]byte, error)
func (*SqlTaskSubscription) UnmarshalJSON ¶ added in v0.23.0
func (s *SqlTaskSubscription) UnmarshalJSON(b []byte) error
type StorageMode ¶ added in v0.63.0
type StorageMode string
const StorageModeDirectQuery StorageMode = `DIRECT_QUERY`
const StorageModeDual StorageMode = `DUAL`
const StorageModeImport StorageMode = `IMPORT`
func (*StorageMode) Set ¶ added in v0.63.0
func (f *StorageMode) Set(v string) error
Set raw string value and validate it against allowed values
func (*StorageMode) String ¶ added in v0.63.0
func (f *StorageMode) String() string
String representation for fmt.Print
func (*StorageMode) Type ¶ added in v0.63.0
func (f *StorageMode) Type() string
Type always returns StorageMode to satisfy [pflag.Value] interface
func (*StorageMode) Values ¶ added in v0.72.0
func (f *StorageMode) Values() []StorageMode
Values returns all possible values for StorageMode.
There is no guarantee on the order of the values in the slice.
type SubmitRun ¶
type SubmitRun struct {
// List of permissions to set on the job.
AccessControlList []JobAccessControlRequest `json:"access_control_list,omitempty"`
// The user specified id of the budget policy to use for this one-time run.
// If not specified, the run will be not be attributed to any budget policy.
BudgetPolicyId string `json:"budget_policy_id,omitempty"`
// An optional set of email addresses notified when the run begins or
// completes.
EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"`
// A list of task execution environment specifications that can be
// referenced by tasks of this run.
Environments []JobEnvironment `json:"environments,omitempty"`
// 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.
GitSource *GitSource `json:"git_source,omitempty"`
Health *JobsHealthRules `json:"health,omitempty"`
// 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
IdempotencyToken string `json:"idempotency_token,omitempty"`
// Optional notification settings that are used when sending notifications
// to each of the `email_notifications` and `webhook_notifications` for this
// run.
NotificationSettings *JobNotificationSettings `json:"notification_settings,omitempty"`
// The queue settings of the one-time run.
Queue *QueueSettings `json:"queue,omitempty"`
// Specifies the user or service principal that the job runs as. If not
// specified, the job runs as the user who submits the request.
RunAs *JobRunAs `json:"run_as,omitempty"`
// An optional name for the run. The default value is `Untitled`.
RunName string `json:"run_name,omitempty"`
Tasks []SubmitTask `json:"tasks,omitempty"`
// An optional timeout applied to each run of this job. A value of `0` means
// no timeout.
TimeoutSeconds int `json:"timeout_seconds,omitempty"`
// The user specified id of the usage policy to use for this one-time run.
// If not specified, a default usage policy may be applied when creating or
// modifying the job.
UsagePolicyId string `json:"usage_policy_id,omitempty"`
// A collection of system notification IDs to notify when the run begins or
// completes.
WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (SubmitRun) MarshalJSON ¶ added in v0.23.0
func (*SubmitRun) UnmarshalJSON ¶ added in v0.23.0
type SubmitRunResponse ¶
type SubmitRunResponse struct {
// The canonical identifier for the newly submitted run.
RunId int64 `json:"run_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Run was created and started successfully.
func (SubmitRunResponse) MarshalJSON ¶ added in v0.23.0
func (s SubmitRunResponse) MarshalJSON() ([]byte, error)
func (*SubmitRunResponse) UnmarshalJSON ¶ added in v0.23.0
func (s *SubmitRunResponse) UnmarshalJSON(b []byte) error
type SubmitTask ¶ added in v0.11.0
type SubmitTask struct {
// The task evaluates a Databricks alert and sends notifications to
// subscribers when the `alert_task` field is present.
AlertTask *AlertTask `json:"alert_task,omitempty"`
// The task runs a [clean rooms] notebook when the
// `clean_rooms_notebook_task` field is present.
//
// [clean rooms]: https://docs.databricks.com/clean-rooms/index.html
CleanRoomsNotebookTask *CleanRoomsNotebookTask `json:"clean_rooms_notebook_task,omitempty"`
// Task level compute configuration.
Compute *Compute `json:"compute,omitempty"`
// The task evaluates a condition that can be used to control the execution
// of other tasks when the `condition_task` field is present. The condition
// task does not require a cluster to execute and does not support retries
// or notifications.
ConditionTask *ConditionTask `json:"condition_task,omitempty"`
// The task refreshes a dashboard and sends a snapshot to subscribers.
DashboardTask *DashboardTask `json:"dashboard_task,omitempty"`
// Task type for dbt cloud, deprecated in favor of the new name
// dbt_platform_task
DbtCloudTask *DbtCloudTask `json:"dbt_cloud_task,omitempty"`
DbtPlatformTask *DbtPlatformTask `json:"dbt_platform_task,omitempty"`
// The task runs one or more dbt commands when the `dbt_task` field is
// present. The dbt task requires both Databricks SQL and the ability to use
// a serverless or a pro SQL warehouse.
DbtTask *DbtTask `json:"dbt_task,omitempty"`
// 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.
DependsOn []TaskDependency `json:"depends_on,omitempty"`
// An optional description for this task.
Description string `json:"description,omitempty"`
// An option to disable auto optimization in serverless
DisableAutoOptimization bool `json:"disable_auto_optimization,omitempty"`
// An optional set of email addresses notified when the task run begins or
// completes. The default behavior is to not send any emails.
EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"`
// 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.
EnvironmentKey string `json:"environment_key,omitempty"`
// 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
ExistingClusterId string `json:"existing_cluster_id,omitempty"`
// The task executes a nested task for every input provided when the
// `for_each_task` field is present.
ForEachTask *ForEachTask `json:"for_each_task,omitempty"`
GenAiComputeTask *GenAiComputeTask `json:"gen_ai_compute_task,omitempty"`
Health *JobsHealthRules `json:"health,omitempty"`
// An optional list of libraries to be installed on the cluster. The default
// value is an empty list.
Libraries []compute.Library `json:"libraries,omitempty"`
// 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.
MaxRetries int `json:"max_retries,omitempty"`
// 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.
MinRetryIntervalMillis int `json:"min_retry_interval_millis,omitempty"`
// If new_cluster, a description of a new cluster that is created for each
// run.
NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"`
// The task runs a notebook when the `notebook_task` field is present.
NotebookTask *NotebookTask `json:"notebook_task,omitempty"`
// Optional notification settings that are used when sending notifications
// to each of the `email_notifications` and `webhook_notifications` for this
// task run.
NotificationSettings *TaskNotificationSettings `json:"notification_settings,omitempty"`
// The task triggers a pipeline update when the `pipeline_task` field is
// present. Only pipelines configured to use triggered more are supported.
PipelineTask *PipelineTask `json:"pipeline_task,omitempty"`
// The task triggers a Power BI semantic model update when the
// `power_bi_task` field is present.
PowerBiTask *PowerBiTask `json:"power_bi_task,omitempty"`
// The task runs a Python wheel when the `python_wheel_task` field is
// present.
PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty"`
// An optional policy to specify whether to retry a job when it times out.
// The default behavior is to not retry on timeout.
RetryOnTimeout bool `json:"retry_on_timeout,omitempty"`
// 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.
RunIf RunIf `json:"run_if,omitempty"`
// The task triggers another job when the `run_job_task` field is present.
RunJobTask *RunJobTask `json:"run_job_task,omitempty"`
// The task runs a JAR when the `spark_jar_task` field is present.
SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty"`
// The task runs a Python file when the `spark_python_task` field is
// present.
SparkPythonTask *SparkPythonTask `json:"spark_python_task,omitempty"`
// (Legacy) The task runs the spark-submit script when the spark_submit_task
// field is present. Databricks recommends using the spark_jar_task instead;
// see [Spark Submit task for jobs](/jobs/spark-submit).
SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty"`
// The task runs a SQL query or file, or it refreshes a SQL alert or a
// legacy SQL dashboard when the `sql_task` field is present.
SqlTask *SqlTask `json:"sql_task,omitempty"`
// 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.
TaskKey string `json:"task_key"`
// An optional timeout applied to each run of this job task. A value of `0`
// means no timeout.
TimeoutSeconds int `json:"timeout_seconds,omitempty"`
// 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.
WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (SubmitTask) MarshalJSON ¶ added in v0.23.0
func (s SubmitTask) MarshalJSON() ([]byte, error)
func (*SubmitTask) UnmarshalJSON ¶ added in v0.23.0
func (s *SubmitTask) UnmarshalJSON(b []byte) error
type Subscription ¶ added in v0.63.0
type Subscription struct {
// Optional: Allows users to specify a custom subject line on the email sent
// to subscribers.
CustomSubject string `json:"custom_subject,omitempty"`
// When true, the subscription will not send emails.
Paused bool `json:"paused,omitempty"`
// The list of subscribers to send the snapshot of the dashboard to.
Subscribers []SubscriptionSubscriber `json:"subscribers,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (Subscription) MarshalJSON ¶ added in v0.63.0
func (s Subscription) MarshalJSON() ([]byte, error)
func (*Subscription) UnmarshalJSON ¶ added in v0.63.0
func (s *Subscription) UnmarshalJSON(b []byte) error
type SubscriptionSubscriber ¶ added in v0.63.0
type SubscriptionSubscriber struct {
// A snapshot of the dashboard will be sent to the destination when the
// `destination_id` field is present.
DestinationId string `json:"destination_id,omitempty"`
// A snapshot of the dashboard will be sent to the user's email when the
// `user_name` field is present.
UserName string `json:"user_name,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (SubscriptionSubscriber) MarshalJSON ¶ added in v0.63.0
func (s SubscriptionSubscriber) MarshalJSON() ([]byte, error)
func (*SubscriptionSubscriber) UnmarshalJSON ¶ added in v0.63.0
func (s *SubscriptionSubscriber) UnmarshalJSON(b []byte) error
type TableState ¶ added in v0.79.0
type TableState struct {
// Whether or not the table has seen updates since either the creation of
// the trigger or the last successful evaluation of the trigger
HasSeenUpdates bool `json:"has_seen_updates,omitempty"`
// Full table name of the table to monitor, e.g.
// `mycatalog.myschema.mytable`
TableName string `json:"table_name,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (TableState) MarshalJSON ¶ added in v0.79.0
func (s TableState) MarshalJSON() ([]byte, error)
func (*TableState) UnmarshalJSON ¶ added in v0.79.0
func (s *TableState) UnmarshalJSON(b []byte) error
type TableTriggerState ¶ added in v0.79.0
type TableTriggerState struct {
LastSeenTableStates []TableState `json:"last_seen_table_states,omitempty"`
// Indicates whether the trigger is using scalable monitoring.
UsingScalableMonitoring bool `json:"using_scalable_monitoring,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (TableTriggerState) MarshalJSON ¶ added in v0.79.0
func (s TableTriggerState) MarshalJSON() ([]byte, error)
func (*TableTriggerState) UnmarshalJSON ¶ added in v0.79.0
func (s *TableTriggerState) UnmarshalJSON(b []byte) error
type TableUpdateTriggerConfiguration ¶ added in v0.38.0
type TableUpdateTriggerConfiguration struct {
// The table(s) condition based on which to trigger a job run.
Condition Condition `json:"condition,omitempty"`
// 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.
MinTimeBetweenTriggersSeconds int `json:"min_time_between_triggers_seconds,omitempty"`
// A list of tables to monitor for changes. The table name must be in the
// format `catalog_name.schema_name.table_name`.
TableNames []string `json:"table_names"`
// 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.
WaitAfterLastChangeSeconds int `json:"wait_after_last_change_seconds,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (TableUpdateTriggerConfiguration) MarshalJSON ¶ added in v0.38.0
func (s TableUpdateTriggerConfiguration) MarshalJSON() ([]byte, error)
func (*TableUpdateTriggerConfiguration) UnmarshalJSON ¶ added in v0.38.0
func (s *TableUpdateTriggerConfiguration) UnmarshalJSON(b []byte) error
type Task ¶ added in v0.11.0
type Task struct {
// The task evaluates a Databricks alert and sends notifications to
// subscribers when the `alert_task` field is present.
AlertTask *AlertTask `json:"alert_task,omitempty"`
// The task runs a [clean rooms] notebook when the
// `clean_rooms_notebook_task` field is present.
//
// [clean rooms]: https://docs.databricks.com/clean-rooms/index.html
CleanRoomsNotebookTask *CleanRoomsNotebookTask `json:"clean_rooms_notebook_task,omitempty"`
// Task level compute configuration.
Compute *Compute `json:"compute,omitempty"`
// The task evaluates a condition that can be used to control the execution
// of other tasks when the `condition_task` field is present. The condition
// task does not require a cluster to execute and does not support retries
// or notifications.
ConditionTask *ConditionTask `json:"condition_task,omitempty"`
// The task refreshes a dashboard and sends a snapshot to subscribers.
DashboardTask *DashboardTask `json:"dashboard_task,omitempty"`
// Task type for dbt cloud, deprecated in favor of the new name
// dbt_platform_task
DbtCloudTask *DbtCloudTask `json:"dbt_cloud_task,omitempty"`
DbtPlatformTask *DbtPlatformTask `json:"dbt_platform_task,omitempty"`
// The task runs one or more dbt commands when the `dbt_task` field is
// present. The dbt task requires both Databricks SQL and the ability to use
// a serverless or a pro SQL warehouse.
DbtTask *DbtTask `json:"dbt_task,omitempty"`
// 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.
DependsOn []TaskDependency `json:"depends_on,omitempty"`
// An optional description for this task.
Description string `json:"description,omitempty"`
// An option to disable auto optimization in serverless
DisableAutoOptimization bool `json:"disable_auto_optimization,omitempty"`
// An optional flag to disable the task. If set to true, the task will not
// run even if it is part of a job.
Disabled bool `json:"disabled,omitempty"`
// 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.
EmailNotifications *TaskEmailNotifications `json:"email_notifications,omitempty"`
// 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.
EnvironmentKey string `json:"environment_key,omitempty"`
// 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
ExistingClusterId string `json:"existing_cluster_id,omitempty"`
// The task executes a nested task for every input provided when the
// `for_each_task` field is present.
ForEachTask *ForEachTask `json:"for_each_task,omitempty"`
GenAiComputeTask *GenAiComputeTask `json:"gen_ai_compute_task,omitempty"`
Health *JobsHealthRules `json:"health,omitempty"`
// If job_cluster_key, this task is executed reusing the cluster specified
// in `job.settings.job_clusters`.
JobClusterKey string `json:"job_cluster_key,omitempty"`
// An optional list of libraries to be installed on the cluster. The default
// value is an empty list.
Libraries []compute.Library `json:"libraries,omitempty"`
// 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.
MaxRetries int `json:"max_retries,omitempty"`
// 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.
MinRetryIntervalMillis int `json:"min_retry_interval_millis,omitempty"`
// If new_cluster, a description of a new cluster that is created for each
// run.
NewCluster *compute.ClusterSpec `json:"new_cluster,omitempty"`
// The task runs a notebook when the `notebook_task` field is present.
NotebookTask *NotebookTask `json:"notebook_task,omitempty"`
// Optional notification settings that are used when sending notifications
// to each of the `email_notifications` and `webhook_notifications` for this
// task.
NotificationSettings *TaskNotificationSettings `json:"notification_settings,omitempty"`
// The task triggers a pipeline update when the `pipeline_task` field is
// present. Only pipelines configured to use triggered more are supported.
PipelineTask *PipelineTask `json:"pipeline_task,omitempty"`
// The task triggers a Power BI semantic model update when the
// `power_bi_task` field is present.
PowerBiTask *PowerBiTask `json:"power_bi_task,omitempty"`
// The task runs a Python wheel when the `python_wheel_task` field is
// present.
PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty"`
// An optional policy to specify whether to retry a job when it times out.
// The default behavior is to not retry on timeout.
RetryOnTimeout bool `json:"retry_on_timeout,omitempty"`
// 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
RunIf RunIf `json:"run_if,omitempty"`
// The task triggers another job when the `run_job_task` field is present.
RunJobTask *RunJobTask `json:"run_job_task,omitempty"`
// The task runs a JAR when the `spark_jar_task` field is present.
SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty"`
// The task runs a Python file when the `spark_python_task` field is
// present.
SparkPythonTask *SparkPythonTask `json:"spark_python_task,omitempty"`
// (Legacy) The task runs the spark-submit script when the spark_submit_task
// field is present. Databricks recommends using the spark_jar_task instead;
// see [Spark Submit task for jobs](/jobs/spark-submit).
SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty"`
// The task runs a SQL query or file, or it refreshes a SQL alert or a
// legacy SQL dashboard when the `sql_task` field is present.
SqlTask *SqlTask `json:"sql_task,omitempty"`
// 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.
TaskKey string `json:"task_key"`
// An optional timeout applied to each run of this job task. A value of `0`
// means no timeout.
TimeoutSeconds int `json:"timeout_seconds,omitempty"`
// 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.
WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (Task) MarshalJSON ¶ added in v0.23.0
func (*Task) UnmarshalJSON ¶ added in v0.23.0
type TaskDependency ¶ added in v0.11.0
type TaskDependency struct {
// Can only be specified on condition task dependencies. The outcome of the
// dependent task that must be met for this task to run.
Outcome string `json:"outcome,omitempty"`
// The name of the task this task depends on.
TaskKey string `json:"task_key"`
ForceSendFields []string `json:"-" url:"-"`
}
func (TaskDependency) MarshalJSON ¶ added in v0.23.0
func (s TaskDependency) MarshalJSON() ([]byte, error)
func (*TaskDependency) UnmarshalJSON ¶ added in v0.23.0
func (s *TaskDependency) UnmarshalJSON(b []byte) error
type TaskEmailNotifications ¶ added in v0.9.0
type TaskEmailNotifications struct {
// If true, do not send email to recipients specified in `on_failure` if the
// run is skipped. This field is `deprecated`. Please use the
// `notification_settings.no_alert_for_skipped_runs` field.
NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"`
// 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.
OnDurationWarningThresholdExceeded []string `json:"on_duration_warning_threshold_exceeded,omitempty"`
// 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.
OnFailure []string `json:"on_failure,omitempty"`
// 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.
OnStart []string `json:"on_start,omitempty"`
// A list of email addresses to notify when any streaming backlog thresholds
// are exceeded for any stream. Streaming backlog thresholds can be set in
// the `health` field using the following metrics:
// `STREAMING_BACKLOG_BYTES`, `STREAMING_BACKLOG_RECORDS`,
// `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`. Alerting is
// based on the 10-minute average of these metrics. If the issue persists,
// notifications are resent every 30 minutes.
OnStreamingBacklogExceeded []string `json:"on_streaming_backlog_exceeded,omitempty"`
// 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.
OnSuccess []string `json:"on_success,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (TaskEmailNotifications) MarshalJSON ¶ added in v0.37.0
func (s TaskEmailNotifications) MarshalJSON() ([]byte, error)
func (*TaskEmailNotifications) UnmarshalJSON ¶ added in v0.37.0
func (s *TaskEmailNotifications) UnmarshalJSON(b []byte) error
type TaskNotificationSettings ¶ added in v0.9.0
type TaskNotificationSettings struct {
// 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.
AlertOnLastAttempt bool `json:"alert_on_last_attempt,omitempty"`
// If true, do not send notifications to recipients specified in
// `on_failure` if the run is canceled.
NoAlertForCanceledRuns bool `json:"no_alert_for_canceled_runs,omitempty"`
// If true, do not send notifications to recipients specified in
// `on_failure` if the run is skipped.
NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (TaskNotificationSettings) MarshalJSON ¶ added in v0.23.0
func (s TaskNotificationSettings) MarshalJSON() ([]byte, error)
func (*TaskNotificationSettings) UnmarshalJSON ¶ added in v0.23.0
func (s *TaskNotificationSettings) UnmarshalJSON(b []byte) error
type TaskRetryMode ¶ added in v0.82.0
type TaskRetryMode string
task retry mode of the continuous job * NEVER: The failed task will not be retried. * ON_FAILURE: Retry a failed task if at least one other task in the job is still running its first attempt. When this condition is no longer met or the retry limit is reached, the job run is cancelled and a new run is started.
const TaskRetryModeNever TaskRetryMode = `NEVER`
const TaskRetryModeOnFailure TaskRetryMode = `ON_FAILURE`
func (*TaskRetryMode) Set ¶ added in v0.82.0
func (f *TaskRetryMode) Set(v string) error
Set raw string value and validate it against allowed values
func (*TaskRetryMode) String ¶ added in v0.82.0
func (f *TaskRetryMode) String() string
String representation for fmt.Print
func (*TaskRetryMode) Type ¶ added in v0.82.0
func (f *TaskRetryMode) Type() string
Type always returns TaskRetryMode to satisfy [pflag.Value] interface
func (*TaskRetryMode) Values ¶ added in v0.82.0
func (f *TaskRetryMode) Values() []TaskRetryMode
Values returns all possible values for TaskRetryMode.
There is no guarantee on the order of the values in the slice.
type TerminationCodeCode ¶ added in v0.46.0
type TerminationCodeCode string
The code indicates why the run was terminated. Additional codes might be introduced in future releases. * `SUCCESS`: The run was completed successfully. * `SUCCESS_WITH_FAILURES`: The run was completed successfully but some child runs failed. * `USER_CANCELED`: The run was successfully canceled during execution by a user. * `CANCELED`: The run was canceled during execution by the Databricks platform; for example, if the maximum run duration was exceeded. * `SKIPPED`: Run was never executed, for example, if the upstream task run failed, the dependency type condition was not met, or there were no material tasks to execute. * `INTERNAL_ERROR`: The run encountered an unexpected error. Refer to the state message for further details. * `DRIVER_ERROR`: The run encountered an error while communicating with the Spark Driver. * `CLUSTER_ERROR`: The run failed due to a cluster error. Refer to the state message for further details. * `REPOSITORY_CHECKOUT_FAILED`: Failed to complete the checkout due to an error when communicating with the third party service. * `INVALID_CLUSTER_REQUEST`: The run failed because it issued an invalid request to start the cluster. * `WORKSPACE_RUN_LIMIT_EXCEEDED`: The workspace has reached the quota for the maximum number of concurrent active runs. Consider scheduling the runs over a larger time frame. * `FEATURE_DISABLED`: The run failed because it tried to access a feature unavailable for the workspace. * `CLUSTER_REQUEST_LIMIT_EXCEEDED`: The number of cluster creation, start, and upsize requests have exceeded the allotted rate limit. Consider spreading the run execution over a larger time frame. * `STORAGE_ACCESS_ERROR`: The run failed due to an error when accessing the customer blob storage. Refer to the state message for further details. * `RUN_EXECUTION_ERROR`: The run was completed with task failures. For more details, refer to the state message or run output. * `UNAUTHORIZED_ERROR`: The run failed due to a permission issue while accessing a resource. Refer to the state message for further details. * `LIBRARY_INSTALLATION_ERROR`: The run failed while installing the user-requested library. Refer to the state message for further details. The causes might include, but are not limited to: The provided library is invalid, there are insufficient permissions to install the library, and so forth. * `MAX_CONCURRENT_RUNS_EXCEEDED`: The scheduled run exceeds the limit of maximum concurrent runs set for the job. * `MAX_SPARK_CONTEXTS_EXCEEDED`: The run is scheduled on a cluster that has already reached the maximum number of contexts it is configured to create. See: Link. * `RESOURCE_NOT_FOUND`: A resource necessary for run execution does not exist. Refer to the state message for further details. * `INVALID_RUN_CONFIGURATION`: The run failed due to an invalid configuration. Refer to the state message for further details. * `CLOUD_FAILURE`: The run failed due to a cloud provider issue. Refer to the state message for further details. * `MAX_JOB_QUEUE_SIZE_EXCEEDED`: The run was skipped due to reaching the job level queue size limit. * `DISABLED`: The run was never executed because it was disabled explicitly by the user. * `BREAKING_CHANGE`: Run failed because of an intentional breaking change in Spark, but it will be retried with a mitigation config. * `CLUSTER_TERMINATED_BY_USER`: The run failed because the externally managed cluster entered an unusable state, likely due to the user terminating or restarting it outside the jobs service.
const TerminationCodeCodeBudgetPolicyLimitExceeded TerminationCodeCode = `BUDGET_POLICY_LIMIT_EXCEEDED`
const TerminationCodeCodeCanceled TerminationCodeCode = `CANCELED`
The run was canceled during execution by the <Databricks> platform; for example, if the maximum run duration was exceeded.
const TerminationCodeCodeCloudFailure TerminationCodeCode = `CLOUD_FAILURE`
The run failed due to a cloud provider issue. Refer to the state message for further details.
const TerminationCodeCodeClusterError TerminationCodeCode = `CLUSTER_ERROR`
The run failed due to a cluster error. Refer to the state message for further details.
const TerminationCodeCodeClusterRequestLimitExceeded TerminationCodeCode = `CLUSTER_REQUEST_LIMIT_EXCEEDED`
The number of cluster creation, start, and upsize requests have exceeded the allotted rate limit. Consider spreading the run execution over a larger time frame.
const TerminationCodeCodeDisabled TerminationCodeCode = `DISABLED`
The run was never executed because it was disabled explicitly by the user.
const TerminationCodeCodeDriverError TerminationCodeCode = `DRIVER_ERROR`
The run encountered an error while communicating with the Spark Driver.
const TerminationCodeCodeFeatureDisabled TerminationCodeCode = `FEATURE_DISABLED`
The run failed because it tried to access a feature unavailable for the workspace.
const TerminationCodeCodeInternalError TerminationCodeCode = `INTERNAL_ERROR`
The run encountered an unexpected error. Refer to the state message for further details.
const TerminationCodeCodeInvalidClusterRequest TerminationCodeCode = `INVALID_CLUSTER_REQUEST`
The run failed because it issued an invalid request to start the cluster.
const TerminationCodeCodeInvalidRunConfiguration TerminationCodeCode = `INVALID_RUN_CONFIGURATION`
The run failed due to an invalid configuration. Refer to the state message for further details.
const TerminationCodeCodeLibraryInstallationError TerminationCodeCode = `LIBRARY_INSTALLATION_ERROR`
The run failed while installing the user-requested library. Refer to the state message for further details. The causes might include, but are not limited to: The provided library is invalid, there are insufficient permissions to install the library, and so forth.
const TerminationCodeCodeMaxConcurrentRunsExceeded TerminationCodeCode = `MAX_CONCURRENT_RUNS_EXCEEDED`
The scheduled run exceeds the limit of maximum concurrent runs set for the job.
const TerminationCodeCodeMaxJobQueueSizeExceeded TerminationCodeCode = `MAX_JOB_QUEUE_SIZE_EXCEEDED`
The run was skipped due to reaching the job level queue size limit.
const TerminationCodeCodeMaxSparkContextsExceeded TerminationCodeCode = `MAX_SPARK_CONTEXTS_EXCEEDED`
The run is scheduled on a cluster that has already reached the maximum number of contexts it is configured to create. See: Link.
const TerminationCodeCodeRepositoryCheckoutFailed TerminationCodeCode = `REPOSITORY_CHECKOUT_FAILED`
Failed to complete the checkout due to an error when communicating with the third party service.
const TerminationCodeCodeResourceNotFound TerminationCodeCode = `RESOURCE_NOT_FOUND`
A resource necessary for run execution does not exist. Refer to the state message for further details.
const TerminationCodeCodeRunExecutionError TerminationCodeCode = `RUN_EXECUTION_ERROR`
The run was completed with task failures. For more details, refer to the state message or run output.
const TerminationCodeCodeSkipped TerminationCodeCode = `SKIPPED`
Run was never executed, for example, if the upstream task run failed, the dependency type condition was not met, or there were no material tasks to execute.
const TerminationCodeCodeStorageAccessError TerminationCodeCode = `STORAGE_ACCESS_ERROR`
The run failed due to an error when accessing the customer blob storage. Refer to the state message for further details.
const TerminationCodeCodeSuccess TerminationCodeCode = `SUCCESS`
The run was completed successfully.
const TerminationCodeCodeSuccessWithFailures TerminationCodeCode = `SUCCESS_WITH_FAILURES`
The run was completed successfully but some child runs failed.
The run failed due to a permission issue while accessing a resource. Refer to the state message for further details.
const TerminationCodeCodeUserCanceled TerminationCodeCode = `USER_CANCELED`
The run was successfully canceled during execution by a user.
const TerminationCodeCodeWorkspaceRunLimitExceeded TerminationCodeCode = `WORKSPACE_RUN_LIMIT_EXCEEDED`
The workspace has reached the quota for the maximum number of concurrent active runs. Consider scheduling the runs over a larger time frame.
func (*TerminationCodeCode) Set ¶ added in v0.46.0
func (f *TerminationCodeCode) Set(v string) error
Set raw string value and validate it against allowed values
func (*TerminationCodeCode) String ¶ added in v0.46.0
func (f *TerminationCodeCode) String() string
String representation for fmt.Print
func (*TerminationCodeCode) Type ¶ added in v0.46.0
func (f *TerminationCodeCode) Type() string
Type always returns TerminationCodeCode to satisfy [pflag.Value] interface
func (*TerminationCodeCode) Values ¶ added in v0.72.0
func (f *TerminationCodeCode) Values() []TerminationCodeCode
Values returns all possible values for TerminationCodeCode.
There is no guarantee on the order of the values in the slice.
type TerminationDetails ¶ added in v0.46.0
type TerminationDetails struct {
Code TerminationCodeCode `json:"code,omitempty"`
// A descriptive message with the termination details. This field is
// unstructured and the format might change.
Message string `json:"message,omitempty"`
Type TerminationTypeType `json:"type,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (TerminationDetails) MarshalJSON ¶ added in v0.46.0
func (s TerminationDetails) MarshalJSON() ([]byte, error)
func (*TerminationDetails) UnmarshalJSON ¶ added in v0.46.0
func (s *TerminationDetails) UnmarshalJSON(b []byte) error
type TerminationTypeType ¶ added in v0.46.0
type TerminationTypeType string
* `SUCCESS`: The run terminated without any issues * `INTERNAL_ERROR`: An error occurred in the Databricks platform. Please look at the status page or contact support if the issue persists. * `CLIENT_ERROR`: The run was terminated because of an error caused by user input or the job configuration. * `CLOUD_FAILURE`: The run was terminated because of an issue with your cloud provider.
const TerminationTypeTypeClientError TerminationTypeType = `CLIENT_ERROR`
The run was terminated because of an error caused by user input or the job configuration.
const TerminationTypeTypeCloudFailure TerminationTypeType = `CLOUD_FAILURE`
The run was terminated because of an issue with your cloud provider.
const TerminationTypeTypeInternalError TerminationTypeType = `INTERNAL_ERROR`
An error occurred in the <Databricks> platform. Please look at the status page or contact support if the issue persists.
const TerminationTypeTypeSuccess TerminationTypeType = `SUCCESS`
The run terminated without any issues
func (*TerminationTypeType) Set ¶ added in v0.46.0
func (f *TerminationTypeType) Set(v string) error
Set raw string value and validate it against allowed values
func (*TerminationTypeType) String ¶ added in v0.46.0
func (f *TerminationTypeType) String() string
String representation for fmt.Print
func (*TerminationTypeType) Type ¶ added in v0.46.0
func (f *TerminationTypeType) Type() string
Type always returns TerminationTypeType to satisfy [pflag.Value] interface
func (*TerminationTypeType) Values ¶ added in v0.72.0
func (f *TerminationTypeType) Values() []TerminationTypeType
Values returns all possible values for TerminationTypeType.
There is no guarantee on the order of the values in the slice.
type TriggerInfo ¶ added in v0.13.0
type TriggerInfo struct {
// The run id of the Run Job task run
RunId int64 `json:"run_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Additional details about what triggered the run
func (TriggerInfo) MarshalJSON ¶ added in v0.23.0
func (s TriggerInfo) MarshalJSON() ([]byte, error)
func (*TriggerInfo) UnmarshalJSON ¶ added in v0.23.0
func (s *TriggerInfo) UnmarshalJSON(b []byte) error
type TriggerSettings ¶ added in v0.4.0
type TriggerSettings struct {
// File arrival trigger settings.
FileArrival *FileArrivalTriggerConfiguration `json:"file_arrival,omitempty"`
Model *ModelTriggerConfiguration `json:"model,omitempty"`
// Whether this trigger is paused or not.
PauseStatus PauseStatus `json:"pause_status,omitempty"`
// Periodic trigger settings.
Periodic *PeriodicTriggerConfiguration `json:"periodic,omitempty"`
TableUpdate *TableUpdateTriggerConfiguration `json:"table_update,omitempty"`
}
type TriggerStateProto ¶ added in v0.72.0
type TriggerStateProto struct {
FileArrival *FileArrivalTriggerState `json:"file_arrival,omitempty"`
Table *TableTriggerState `json:"table,omitempty"`
}
type TriggerType ¶
type TriggerType string
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. * `CONTINUOUS`: Indicates a run that is triggered by a continuous job. * `TABLE`: Indicates a run that is triggered by a table update. * `CONTINUOUS_RESTART`: Indicates a run created by user to manually restart a continuous job run. * `MODEL`: Indicates a run that is triggered by a model update.
const TriggerTypeContinuous TriggerType = `CONTINUOUS`
Indicates a run that is triggered by a continuous job.
const TriggerTypeContinuousRestart TriggerType = `CONTINUOUS_RESTART`
Indicates a run created by user to manually restart a continuous job run.
const TriggerTypeFileArrival TriggerType = `FILE_ARRIVAL`
Indicates a run that is triggered by a file arrival.
const TriggerTypeOneTime TriggerType = `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.
const TriggerTypePeriodic TriggerType = `PERIODIC`
Schedules that periodically trigger runs, such as a cron scheduler.
const TriggerTypeRetry TriggerType = `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.
const TriggerTypeRunJobTask TriggerType = `RUN_JOB_TASK`
Indicates a run that is triggered using a Run Job task.
const TriggerTypeTable TriggerType = `TABLE`
Indicates a run that is triggered by a table update.
func (*TriggerType) Set ¶ added in v0.2.0
func (f *TriggerType) Set(v string) error
Set raw string value and validate it against allowed values
func (*TriggerType) String ¶ added in v0.2.0
func (f *TriggerType) String() string
String representation for fmt.Print
func (*TriggerType) Type ¶ added in v0.2.0
func (f *TriggerType) Type() string
Type always returns TriggerType to satisfy [pflag.Value] interface
func (*TriggerType) Values ¶ added in v0.72.0
func (f *TriggerType) Values() []TriggerType
Values returns all possible values for TriggerType.
There is no guarantee on the order of the values in the slice.
type UpdateJob ¶
type UpdateJob struct {
// 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.
FieldsToRemove []string `json:"fields_to_remove,omitempty"`
// The canonical identifier of the job to update. This field is required.
JobId int64 `json:"job_id"`
// 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.
NewSettings *JobSettings `json:"new_settings,omitempty"`
}
type ViewItem ¶
type ViewItem struct {
// Content of the view.
Content string `json:"content,omitempty"`
// 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.
Name string `json:"name,omitempty"`
// Type of the view item.
Type ViewType `json:"type,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ViewItem) MarshalJSON ¶ added in v0.23.0
func (*ViewItem) UnmarshalJSON ¶ added in v0.23.0
type ViewType ¶
type ViewType string
* `NOTEBOOK`: Notebook view item. * `DASHBOARD`: Dashboard view item.
const ViewTypeDashboard ViewType = `DASHBOARD`
Dashboard view item.
const ViewTypeNotebook ViewType = `NOTEBOOK`
Notebook view item.
type ViewsToExport ¶
type ViewsToExport string
* `CODE`: Code view of the notebook. * `DASHBOARDS`: All dashboard views of the notebook. * `ALL`: All views of the notebook.
const ViewsToExportAll ViewsToExport = `ALL`
All views of the notebook.
const ViewsToExportCode ViewsToExport = `CODE`
Code view of the notebook.
const ViewsToExportDashboards ViewsToExport = `DASHBOARDS`
All dashboard views of the notebook.
func (*ViewsToExport) Set ¶ added in v0.2.0
func (f *ViewsToExport) Set(v string) error
Set raw string value and validate it against allowed values
func (*ViewsToExport) String ¶ added in v0.2.0
func (f *ViewsToExport) String() string
String representation for fmt.Print
func (*ViewsToExport) Type ¶ added in v0.2.0
func (f *ViewsToExport) Type() string
Type always returns ViewsToExport to satisfy [pflag.Value] interface
func (*ViewsToExport) Values ¶ added in v0.72.0
func (f *ViewsToExport) Values() []ViewsToExport
Values returns all possible values for ViewsToExport.
There is no guarantee on the order of the values in the slice.
type WaitGetRunJobTerminatedOrSkipped ¶ added in v0.10.0
type WaitGetRunJobTerminatedOrSkipped[R any] struct { Response *R RunId int64 `json:"run_id"` Poll func(time.Duration, func(*Run)) (*Run, error) // contains filtered or unexported fields }
WaitGetRunJobTerminatedOrSkipped is a wrapper that calls JobsAPI.WaitGetRunJobTerminatedOrSkipped and waits to reach TERMINATED or SKIPPED state.
func (*WaitGetRunJobTerminatedOrSkipped[R]) Get ¶ added in v0.10.0
func (w *WaitGetRunJobTerminatedOrSkipped[R]) Get() (*Run, error)
Get the Run with the default timeout of 20 minutes.
func (*WaitGetRunJobTerminatedOrSkipped[R]) GetWithTimeout ¶ added in v0.10.0
func (w *WaitGetRunJobTerminatedOrSkipped[R]) GetWithTimeout(timeout time.Duration) (*Run, error)
Get the Run with custom timeout.
func (*WaitGetRunJobTerminatedOrSkipped[R]) OnProgress ¶ added in v0.10.0
func (w *WaitGetRunJobTerminatedOrSkipped[R]) OnProgress(callback func(*Run)) *WaitGetRunJobTerminatedOrSkipped[R]
OnProgress invokes a callback every time it polls for the status update.
type WebhookNotifications ¶ added in v0.11.0
type WebhookNotifications struct {
// 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.
OnDurationWarningThresholdExceeded []Webhook `json:"on_duration_warning_threshold_exceeded,omitempty"`
// 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.
OnFailure []Webhook `json:"on_failure,omitempty"`
// 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.
OnStart []Webhook `json:"on_start,omitempty"`
// An optional list of system notification IDs to call when any streaming
// backlog thresholds are exceeded for any stream. Streaming backlog
// thresholds can be set in the `health` field using the following metrics:
// `STREAMING_BACKLOG_BYTES`, `STREAMING_BACKLOG_RECORDS`,
// `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`. Alerting is
// based on the 10-minute average of these metrics. If the issue persists,
// notifications are resent every 30 minutes. A maximum of 3 destinations
// can be specified for the `on_streaming_backlog_exceeded` property.
OnStreamingBacklogExceeded []Webhook `json:"on_streaming_backlog_exceeded,omitempty"`
// 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.
OnSuccess []Webhook `json:"on_success,omitempty"`
}
type WidgetErrorDetail ¶ added in v0.63.0
type WidgetErrorDetail struct {
Message string `json:"message,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (WidgetErrorDetail) MarshalJSON ¶ added in v0.63.0
func (s WidgetErrorDetail) MarshalJSON() ([]byte, error)
func (*WidgetErrorDetail) UnmarshalJSON ¶ added in v0.63.0
func (s *WidgetErrorDetail) UnmarshalJSON(b []byte) error