databricks-sdk 0.41.0__py3-none-any.whl → 0.43.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of databricks-sdk might be problematic. Click here for more details.

@@ -111,6 +111,12 @@ class BaseRun:
111
111
  description: Optional[str] = None
112
112
  """Description of the run"""
113
113
 
114
+ effective_performance_target: Optional[PerformanceTarget] = None
115
+ """effective_performance_target is the actual performance target used by the run during execution.
116
+ effective_performance_target can differ from performance_target depending on if the job was
117
+ eligible to be cost-optimized (e.g. contains at least 1 serverless task) or if we specifically
118
+ override the value for the run (ex. RunNow)."""
119
+
114
120
  end_time: Optional[int] = None
115
121
  """The time at which this run ended in epoch milliseconds (milliseconds since 1/1/1970 UTC). This
116
122
  field is set to 0 if the job is still running."""
@@ -240,6 +246,8 @@ class BaseRun:
240
246
  if self.cluster_spec: body['cluster_spec'] = self.cluster_spec.as_dict()
241
247
  if self.creator_user_name is not None: body['creator_user_name'] = self.creator_user_name
242
248
  if self.description is not None: body['description'] = self.description
249
+ if self.effective_performance_target is not None:
250
+ body['effective_performance_target'] = self.effective_performance_target.value
243
251
  if self.end_time is not None: body['end_time'] = self.end_time
244
252
  if self.execution_duration is not None: body['execution_duration'] = self.execution_duration
245
253
  if self.git_source: body['git_source'] = self.git_source.as_dict()
@@ -278,6 +286,8 @@ class BaseRun:
278
286
  if self.cluster_spec: body['cluster_spec'] = self.cluster_spec
279
287
  if self.creator_user_name is not None: body['creator_user_name'] = self.creator_user_name
280
288
  if self.description is not None: body['description'] = self.description
289
+ if self.effective_performance_target is not None:
290
+ body['effective_performance_target'] = self.effective_performance_target
281
291
  if self.end_time is not None: body['end_time'] = self.end_time
282
292
  if self.execution_duration is not None: body['execution_duration'] = self.execution_duration
283
293
  if self.git_source: body['git_source'] = self.git_source
@@ -316,6 +326,7 @@ class BaseRun:
316
326
  cluster_spec=_from_dict(d, 'cluster_spec', ClusterSpec),
317
327
  creator_user_name=d.get('creator_user_name', None),
318
328
  description=d.get('description', None),
329
+ effective_performance_target=_enum(d, 'effective_performance_target', PerformanceTarget),
319
330
  end_time=d.get('end_time', None),
320
331
  execution_duration=d.get('execution_duration', None),
321
332
  git_source=_from_dict(d, 'git_source', GitSource),
@@ -834,6 +845,10 @@ class CreateJob:
834
845
  parameters: Optional[List[JobParameterDefinition]] = None
835
846
  """Job-level parameter definitions"""
836
847
 
848
+ performance_target: Optional[PerformanceTarget] = None
849
+ """PerformanceTarget defines how performant or cost efficient the execution of run on serverless
850
+ should be."""
851
+
837
852
  queue: Optional[QueueSettings] = None
838
853
  """The queue settings of the job."""
839
854
 
@@ -888,6 +903,7 @@ class CreateJob:
888
903
  if self.name is not None: body['name'] = self.name
889
904
  if self.notification_settings: body['notification_settings'] = self.notification_settings.as_dict()
890
905
  if self.parameters: body['parameters'] = [v.as_dict() for v in self.parameters]
906
+ if self.performance_target is not None: body['performance_target'] = self.performance_target.value
891
907
  if self.queue: body['queue'] = self.queue.as_dict()
892
908
  if self.run_as: body['run_as'] = self.run_as.as_dict()
893
909
  if self.schedule: body['schedule'] = self.schedule.as_dict()
@@ -917,6 +933,7 @@ class CreateJob:
917
933
  if self.name is not None: body['name'] = self.name
918
934
  if self.notification_settings: body['notification_settings'] = self.notification_settings
919
935
  if self.parameters: body['parameters'] = self.parameters
936
+ if self.performance_target is not None: body['performance_target'] = self.performance_target
920
937
  if self.queue: body['queue'] = self.queue
921
938
  if self.run_as: body['run_as'] = self.run_as
922
939
  if self.schedule: body['schedule'] = self.schedule
@@ -946,6 +963,7 @@ class CreateJob:
946
963
  name=d.get('name', None),
947
964
  notification_settings=_from_dict(d, 'notification_settings', JobNotificationSettings),
948
965
  parameters=_repeated_dict(d, 'parameters', JobParameterDefinition),
966
+ performance_target=_enum(d, 'performance_target', PerformanceTarget),
949
967
  queue=_from_dict(d, 'queue', QueueSettings),
950
968
  run_as=_from_dict(d, 'run_as', JobRunAs),
951
969
  schedule=_from_dict(d, 'schedule', CronSchedule),
@@ -2463,6 +2481,10 @@ class JobSettings:
2463
2481
  parameters: Optional[List[JobParameterDefinition]] = None
2464
2482
  """Job-level parameter definitions"""
2465
2483
 
2484
+ performance_target: Optional[PerformanceTarget] = None
2485
+ """PerformanceTarget defines how performant or cost efficient the execution of run on serverless
2486
+ should be."""
2487
+
2466
2488
  queue: Optional[QueueSettings] = None
2467
2489
  """The queue settings of the job."""
2468
2490
 
@@ -2515,6 +2537,7 @@ class JobSettings:
2515
2537
  if self.name is not None: body['name'] = self.name
2516
2538
  if self.notification_settings: body['notification_settings'] = self.notification_settings.as_dict()
2517
2539
  if self.parameters: body['parameters'] = [v.as_dict() for v in self.parameters]
2540
+ if self.performance_target is not None: body['performance_target'] = self.performance_target.value
2518
2541
  if self.queue: body['queue'] = self.queue.as_dict()
2519
2542
  if self.run_as: body['run_as'] = self.run_as.as_dict()
2520
2543
  if self.schedule: body['schedule'] = self.schedule.as_dict()
@@ -2543,6 +2566,7 @@ class JobSettings:
2543
2566
  if self.name is not None: body['name'] = self.name
2544
2567
  if self.notification_settings: body['notification_settings'] = self.notification_settings
2545
2568
  if self.parameters: body['parameters'] = self.parameters
2569
+ if self.performance_target is not None: body['performance_target'] = self.performance_target
2546
2570
  if self.queue: body['queue'] = self.queue
2547
2571
  if self.run_as: body['run_as'] = self.run_as
2548
2572
  if self.schedule: body['schedule'] = self.schedule
@@ -2571,6 +2595,7 @@ class JobSettings:
2571
2595
  name=d.get('name', None),
2572
2596
  notification_settings=_from_dict(d, 'notification_settings', JobNotificationSettings),
2573
2597
  parameters=_repeated_dict(d, 'parameters', JobParameterDefinition),
2598
+ performance_target=_enum(d, 'performance_target', PerformanceTarget),
2574
2599
  queue=_from_dict(d, 'queue', QueueSettings),
2575
2600
  run_as=_from_dict(d, 'run_as', JobRunAs),
2576
2601
  schedule=_from_dict(d, 'schedule', CronSchedule),
@@ -2994,6 +3019,15 @@ class PauseStatus(Enum):
2994
3019
  UNPAUSED = 'UNPAUSED'
2995
3020
 
2996
3021
 
3022
+ class PerformanceTarget(Enum):
3023
+ """PerformanceTarget defines how performant (lower latency) or cost efficient the execution of run
3024
+ on serverless compute should be. The performance mode on the job or pipeline should map to a
3025
+ performance setting that is passed to Cluster Manager (see cluster-common PerformanceTarget)."""
3026
+
3027
+ COST_OPTIMIZED = 'COST_OPTIMIZED'
3028
+ PERFORMANCE_OPTIMIZED = 'PERFORMANCE_OPTIMIZED'
3029
+
3030
+
2997
3031
  @dataclass
2998
3032
  class PeriodicTriggerConfiguration:
2999
3033
  interval: int
@@ -3755,6 +3789,12 @@ class Run:
3755
3789
  description: Optional[str] = None
3756
3790
  """Description of the run"""
3757
3791
 
3792
+ effective_performance_target: Optional[PerformanceTarget] = None
3793
+ """effective_performance_target is the actual performance target used by the run during execution.
3794
+ effective_performance_target can differ from performance_target depending on if the job was
3795
+ eligible to be cost-optimized (e.g. contains at least 1 serverless task) or if we specifically
3796
+ override the value for the run (ex. RunNow)."""
3797
+
3758
3798
  end_time: Optional[int] = None
3759
3799
  """The time at which this run ended in epoch milliseconds (milliseconds since 1/1/1970 UTC). This
3760
3800
  field is set to 0 if the job is still running."""
@@ -3890,6 +3930,8 @@ class Run:
3890
3930
  if self.cluster_spec: body['cluster_spec'] = self.cluster_spec.as_dict()
3891
3931
  if self.creator_user_name is not None: body['creator_user_name'] = self.creator_user_name
3892
3932
  if self.description is not None: body['description'] = self.description
3933
+ if self.effective_performance_target is not None:
3934
+ body['effective_performance_target'] = self.effective_performance_target.value
3893
3935
  if self.end_time is not None: body['end_time'] = self.end_time
3894
3936
  if self.execution_duration is not None: body['execution_duration'] = self.execution_duration
3895
3937
  if self.git_source: body['git_source'] = self.git_source.as_dict()
@@ -3930,6 +3972,8 @@ class Run:
3930
3972
  if self.cluster_spec: body['cluster_spec'] = self.cluster_spec
3931
3973
  if self.creator_user_name is not None: body['creator_user_name'] = self.creator_user_name
3932
3974
  if self.description is not None: body['description'] = self.description
3975
+ if self.effective_performance_target is not None:
3976
+ body['effective_performance_target'] = self.effective_performance_target
3933
3977
  if self.end_time is not None: body['end_time'] = self.end_time
3934
3978
  if self.execution_duration is not None: body['execution_duration'] = self.execution_duration
3935
3979
  if self.git_source: body['git_source'] = self.git_source
@@ -3970,6 +4014,7 @@ class Run:
3970
4014
  cluster_spec=_from_dict(d, 'cluster_spec', ClusterSpec),
3971
4015
  creator_user_name=d.get('creator_user_name', None),
3972
4016
  description=d.get('description', None),
4017
+ effective_performance_target=_enum(d, 'effective_performance_target', PerformanceTarget),
3973
4018
  end_time=d.get('end_time', None),
3974
4019
  execution_duration=d.get('execution_duration', None),
3975
4020
  git_source=_from_dict(d, 'git_source', GitSource),
@@ -4356,6 +4401,11 @@ class RunNow:
4356
4401
  """A list of task keys to run inside of the job. If this field is not provided, all tasks in the
4357
4402
  job will be run."""
4358
4403
 
4404
+ performance_target: Optional[PerformanceTarget] = None
4405
+ """PerformanceTarget defines how performant or cost efficient the execution of run on serverless
4406
+ compute should be. For RunNow request, the run will execute with this settings instead of ones
4407
+ defined in job."""
4408
+
4359
4409
  pipeline_params: Optional[PipelineParams] = None
4360
4410
  """Controls whether the pipeline should perform a full refresh"""
4361
4411
 
@@ -4411,6 +4461,7 @@ class RunNow:
4411
4461
  if self.job_parameters: body['job_parameters'] = self.job_parameters
4412
4462
  if self.notebook_params: body['notebook_params'] = self.notebook_params
4413
4463
  if self.only: body['only'] = [v for v in self.only]
4464
+ if self.performance_target is not None: body['performance_target'] = self.performance_target.value
4414
4465
  if self.pipeline_params: body['pipeline_params'] = self.pipeline_params.as_dict()
4415
4466
  if self.python_named_params: body['python_named_params'] = self.python_named_params
4416
4467
  if self.python_params: body['python_params'] = [v for v in self.python_params]
@@ -4429,6 +4480,7 @@ class RunNow:
4429
4480
  if self.job_parameters: body['job_parameters'] = self.job_parameters
4430
4481
  if self.notebook_params: body['notebook_params'] = self.notebook_params
4431
4482
  if self.only: body['only'] = self.only
4483
+ if self.performance_target is not None: body['performance_target'] = self.performance_target
4432
4484
  if self.pipeline_params: body['pipeline_params'] = self.pipeline_params
4433
4485
  if self.python_named_params: body['python_named_params'] = self.python_named_params
4434
4486
  if self.python_params: body['python_params'] = self.python_params
@@ -4447,6 +4499,7 @@ class RunNow:
4447
4499
  job_parameters=d.get('job_parameters', None),
4448
4500
  notebook_params=d.get('notebook_params', None),
4449
4501
  only=d.get('only', None),
4502
+ performance_target=_enum(d, 'performance_target', PerformanceTarget),
4450
4503
  pipeline_params=_from_dict(d, 'pipeline_params', PipelineParams),
4451
4504
  python_named_params=d.get('python_named_params', None),
4452
4505
  python_params=d.get('python_params', None),
@@ -4862,6 +4915,16 @@ class RunTask:
4862
4915
  description: Optional[str] = None
4863
4916
  """An optional description for this task."""
4864
4917
 
4918
+ disabled: Optional[bool] = None
4919
+ """Denotes whether or not the task was disabled by the user. Disabled tasks do not execute and are
4920
+ immediately skipped as soon as they are unblocked."""
4921
+
4922
+ effective_performance_target: Optional[PerformanceTarget] = None
4923
+ """effective_performance_target is the actual performance target used by the run during execution.
4924
+ effective_performance_target can differ from performance_target depending on if the job was
4925
+ eligible to be cost-optimized (e.g. contains at least 1 serverless task) or if an override was
4926
+ provided for the run (ex. RunNow)."""
4927
+
4865
4928
  email_notifications: Optional[JobEmailNotifications] = None
4866
4929
  """An optional set of email addresses notified when the task run begins or completes. The default
4867
4930
  behavior is to not send any emails."""
@@ -5010,6 +5073,9 @@ class RunTask:
5010
5073
  if self.dbt_task: body['dbt_task'] = self.dbt_task.as_dict()
5011
5074
  if self.depends_on: body['depends_on'] = [v.as_dict() for v in self.depends_on]
5012
5075
  if self.description is not None: body['description'] = self.description
5076
+ if self.disabled is not None: body['disabled'] = self.disabled
5077
+ if self.effective_performance_target is not None:
5078
+ body['effective_performance_target'] = self.effective_performance_target.value
5013
5079
  if self.email_notifications: body['email_notifications'] = self.email_notifications.as_dict()
5014
5080
  if self.end_time is not None: body['end_time'] = self.end_time
5015
5081
  if self.environment_key is not None: body['environment_key'] = self.environment_key
@@ -5055,6 +5121,9 @@ class RunTask:
5055
5121
  if self.dbt_task: body['dbt_task'] = self.dbt_task
5056
5122
  if self.depends_on: body['depends_on'] = self.depends_on
5057
5123
  if self.description is not None: body['description'] = self.description
5124
+ if self.disabled is not None: body['disabled'] = self.disabled
5125
+ if self.effective_performance_target is not None:
5126
+ body['effective_performance_target'] = self.effective_performance_target
5058
5127
  if self.email_notifications: body['email_notifications'] = self.email_notifications
5059
5128
  if self.end_time is not None: body['end_time'] = self.end_time
5060
5129
  if self.environment_key is not None: body['environment_key'] = self.environment_key
@@ -5101,6 +5170,8 @@ class RunTask:
5101
5170
  dbt_task=_from_dict(d, 'dbt_task', DbtTask),
5102
5171
  depends_on=_repeated_dict(d, 'depends_on', TaskDependency),
5103
5172
  description=d.get('description', None),
5173
+ disabled=d.get('disabled', None),
5174
+ effective_performance_target=_enum(d, 'effective_performance_target', PerformanceTarget),
5104
5175
  email_notifications=_from_dict(d, 'email_notifications', JobEmailNotifications),
5105
5176
  end_time=d.get('end_time', None),
5106
5177
  environment_key=d.get('environment_key', None),
@@ -5180,12 +5251,16 @@ class SparkJarTask:
5180
5251
 
5181
5252
  [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables"""
5182
5253
 
5254
+ run_as_repl: Optional[bool] = None
5255
+ """Deprecated. A value of `false` is no longer supported."""
5256
+
5183
5257
  def as_dict(self) -> dict:
5184
5258
  """Serializes the SparkJarTask into a dictionary suitable for use as a JSON request body."""
5185
5259
  body = {}
5186
5260
  if self.jar_uri is not None: body['jar_uri'] = self.jar_uri
5187
5261
  if self.main_class_name is not None: body['main_class_name'] = self.main_class_name
5188
5262
  if self.parameters: body['parameters'] = [v for v in self.parameters]
5263
+ if self.run_as_repl is not None: body['run_as_repl'] = self.run_as_repl
5189
5264
  return body
5190
5265
 
5191
5266
  def as_shallow_dict(self) -> dict:
@@ -5194,6 +5269,7 @@ class SparkJarTask:
5194
5269
  if self.jar_uri is not None: body['jar_uri'] = self.jar_uri
5195
5270
  if self.main_class_name is not None: body['main_class_name'] = self.main_class_name
5196
5271
  if self.parameters: body['parameters'] = self.parameters
5272
+ if self.run_as_repl is not None: body['run_as_repl'] = self.run_as_repl
5197
5273
  return body
5198
5274
 
5199
5275
  @classmethod
@@ -5201,7 +5277,8 @@ class SparkJarTask:
5201
5277
  """Deserializes the SparkJarTask from a dictionary."""
5202
5278
  return cls(jar_uri=d.get('jar_uri', None),
5203
5279
  main_class_name=d.get('main_class_name', None),
5204
- parameters=d.get('parameters', None))
5280
+ parameters=d.get('parameters', None),
5281
+ run_as_repl=d.get('run_as_repl', None))
5205
5282
 
5206
5283
 
5207
5284
  @dataclass
@@ -6622,6 +6699,7 @@ class TerminationCodeCode(Enum):
6622
6699
 
6623
6700
  [Link]: https://kb.databricks.com/en_US/notebooks/too-many-execution-contexts-are-open-right-now"""
6624
6701
 
6702
+ BUDGET_POLICY_LIMIT_EXCEEDED = 'BUDGET_POLICY_LIMIT_EXCEEDED'
6625
6703
  CANCELED = 'CANCELED'
6626
6704
  CLOUD_FAILURE = 'CLOUD_FAILURE'
6627
6705
  CLUSTER_ERROR = 'CLUSTER_ERROR'
@@ -7144,6 +7222,7 @@ class JobsAPI:
7144
7222
  name: Optional[str] = None,
7145
7223
  notification_settings: Optional[JobNotificationSettings] = None,
7146
7224
  parameters: Optional[List[JobParameterDefinition]] = None,
7225
+ performance_target: Optional[PerformanceTarget] = None,
7147
7226
  queue: Optional[QueueSettings] = None,
7148
7227
  run_as: Optional[JobRunAs] = None,
7149
7228
  schedule: Optional[CronSchedule] = None,
@@ -7216,6 +7295,9 @@ class JobsAPI:
7216
7295
  `email_notifications` and `webhook_notifications` for this job.
7217
7296
  :param parameters: List[:class:`JobParameterDefinition`] (optional)
7218
7297
  Job-level parameter definitions
7298
+ :param performance_target: :class:`PerformanceTarget` (optional)
7299
+ PerformanceTarget defines how performant or cost efficient the execution of run on serverless should
7300
+ be.
7219
7301
  :param queue: :class:`QueueSettings` (optional)
7220
7302
  The queue settings of the job.
7221
7303
  :param run_as: :class:`JobRunAs` (optional)
@@ -7263,6 +7345,7 @@ class JobsAPI:
7263
7345
  if name is not None: body['name'] = name
7264
7346
  if notification_settings is not None: body['notification_settings'] = notification_settings.as_dict()
7265
7347
  if parameters is not None: body['parameters'] = [v.as_dict() for v in parameters]
7348
+ if performance_target is not None: body['performance_target'] = performance_target.value
7266
7349
  if queue is not None: body['queue'] = queue.as_dict()
7267
7350
  if run_as is not None: body['run_as'] = run_as.as_dict()
7268
7351
  if schedule is not None: body['schedule'] = schedule.as_dict()
@@ -7761,6 +7844,7 @@ class JobsAPI:
7761
7844
  job_parameters: Optional[Dict[str, str]] = None,
7762
7845
  notebook_params: Optional[Dict[str, str]] = None,
7763
7846
  only: Optional[List[str]] = None,
7847
+ performance_target: Optional[PerformanceTarget] = None,
7764
7848
  pipeline_params: Optional[PipelineParams] = None,
7765
7849
  python_named_params: Optional[Dict[str, str]] = None,
7766
7850
  python_params: Optional[List[str]] = None,
@@ -7820,6 +7904,10 @@ class JobsAPI:
7820
7904
  :param only: List[str] (optional)
7821
7905
  A list of task keys to run inside of the job. If this field is not provided, all tasks in the job
7822
7906
  will be run.
7907
+ :param performance_target: :class:`PerformanceTarget` (optional)
7908
+ PerformanceTarget defines how performant or cost efficient the execution of run on serverless
7909
+ compute should be. For RunNow request, the run will execute with this settings instead of ones
7910
+ defined in job.
7823
7911
  :param pipeline_params: :class:`PipelineParams` (optional)
7824
7912
  Controls whether the pipeline should perform a full refresh
7825
7913
  :param python_named_params: Dict[str,str] (optional)
@@ -7872,6 +7960,7 @@ class JobsAPI:
7872
7960
  if job_parameters is not None: body['job_parameters'] = job_parameters
7873
7961
  if notebook_params is not None: body['notebook_params'] = notebook_params
7874
7962
  if only is not None: body['only'] = [v for v in only]
7963
+ if performance_target is not None: body['performance_target'] = performance_target.value
7875
7964
  if pipeline_params is not None: body['pipeline_params'] = pipeline_params.as_dict()
7876
7965
  if python_named_params is not None: body['python_named_params'] = python_named_params
7877
7966
  if python_params is not None: body['python_params'] = [v for v in python_params]
@@ -7894,6 +7983,7 @@ class JobsAPI:
7894
7983
  job_parameters: Optional[Dict[str, str]] = None,
7895
7984
  notebook_params: Optional[Dict[str, str]] = None,
7896
7985
  only: Optional[List[str]] = None,
7986
+ performance_target: Optional[PerformanceTarget] = None,
7897
7987
  pipeline_params: Optional[PipelineParams] = None,
7898
7988
  python_named_params: Optional[Dict[str, str]] = None,
7899
7989
  python_params: Optional[List[str]] = None,
@@ -7908,6 +7998,7 @@ class JobsAPI:
7908
7998
  job_parameters=job_parameters,
7909
7999
  notebook_params=notebook_params,
7910
8000
  only=only,
8001
+ performance_target=performance_target,
7911
8002
  pipeline_params=pipeline_params,
7912
8003
  python_named_params=python_named_params,
7913
8004
  python_params=python_params,
@@ -31,6 +31,10 @@ class CreateCustomAppIntegration:
31
31
  token_access_policy: Optional[TokenAccessPolicy] = None
32
32
  """Token access policy"""
33
33
 
34
+ user_authorized_scopes: Optional[List[str]] = None
35
+ """Scopes that will need to be consented by end user to mint the access token. If the user does not
36
+ authorize the access token will not be minted. Must be a subset of scopes."""
37
+
34
38
  def as_dict(self) -> dict:
35
39
  """Serializes the CreateCustomAppIntegration into a dictionary suitable for use as a JSON request body."""
36
40
  body = {}
@@ -39,6 +43,8 @@ class CreateCustomAppIntegration:
39
43
  if self.redirect_urls: body['redirect_urls'] = [v for v in self.redirect_urls]
40
44
  if self.scopes: body['scopes'] = [v for v in self.scopes]
41
45
  if self.token_access_policy: body['token_access_policy'] = self.token_access_policy.as_dict()
46
+ if self.user_authorized_scopes:
47
+ body['user_authorized_scopes'] = [v for v in self.user_authorized_scopes]
42
48
  return body
43
49
 
44
50
  def as_shallow_dict(self) -> dict:
@@ -49,6 +55,7 @@ class CreateCustomAppIntegration:
49
55
  if self.redirect_urls: body['redirect_urls'] = self.redirect_urls
50
56
  if self.scopes: body['scopes'] = self.scopes
51
57
  if self.token_access_policy: body['token_access_policy'] = self.token_access_policy
58
+ if self.user_authorized_scopes: body['user_authorized_scopes'] = self.user_authorized_scopes
52
59
  return body
53
60
 
54
61
  @classmethod
@@ -58,7 +65,8 @@ class CreateCustomAppIntegration:
58
65
  name=d.get('name', None),
59
66
  redirect_urls=d.get('redirect_urls', None),
60
67
  scopes=d.get('scopes', None),
61
- token_access_policy=_from_dict(d, 'token_access_policy', TokenAccessPolicy))
68
+ token_access_policy=_from_dict(d, 'token_access_policy', TokenAccessPolicy),
69
+ user_authorized_scopes=d.get('user_authorized_scopes', None))
62
70
 
63
71
 
64
72
  @dataclass
@@ -346,6 +354,10 @@ class GetCustomAppIntegrationOutput:
346
354
  token_access_policy: Optional[TokenAccessPolicy] = None
347
355
  """Token access policy"""
348
356
 
357
+ user_authorized_scopes: Optional[List[str]] = None
358
+ """Scopes that will need to be consented by end user to mint the access token. If the user does not
359
+ authorize the access token will not be minted. Must be a subset of scopes."""
360
+
349
361
  def as_dict(self) -> dict:
350
362
  """Serializes the GetCustomAppIntegrationOutput into a dictionary suitable for use as a JSON request body."""
351
363
  body = {}
@@ -359,6 +371,8 @@ class GetCustomAppIntegrationOutput:
359
371
  if self.redirect_urls: body['redirect_urls'] = [v for v in self.redirect_urls]
360
372
  if self.scopes: body['scopes'] = [v for v in self.scopes]
361
373
  if self.token_access_policy: body['token_access_policy'] = self.token_access_policy.as_dict()
374
+ if self.user_authorized_scopes:
375
+ body['user_authorized_scopes'] = [v for v in self.user_authorized_scopes]
362
376
  return body
363
377
 
364
378
  def as_shallow_dict(self) -> dict:
@@ -374,6 +388,7 @@ class GetCustomAppIntegrationOutput:
374
388
  if self.redirect_urls: body['redirect_urls'] = self.redirect_urls
375
389
  if self.scopes: body['scopes'] = self.scopes
376
390
  if self.token_access_policy: body['token_access_policy'] = self.token_access_policy
391
+ if self.user_authorized_scopes: body['user_authorized_scopes'] = self.user_authorized_scopes
377
392
  return body
378
393
 
379
394
  @classmethod
@@ -388,7 +403,8 @@ class GetCustomAppIntegrationOutput:
388
403
  name=d.get('name', None),
389
404
  redirect_urls=d.get('redirect_urls', None),
390
405
  scopes=d.get('scopes', None),
391
- token_access_policy=_from_dict(d, 'token_access_policy', TokenAccessPolicy))
406
+ token_access_policy=_from_dict(d, 'token_access_policy', TokenAccessPolicy),
407
+ user_authorized_scopes=d.get('user_authorized_scopes', None))
392
408
 
393
409
 
394
410
  @dataclass
@@ -798,6 +814,10 @@ class UpdateCustomAppIntegration:
798
814
  token_access_policy: Optional[TokenAccessPolicy] = None
799
815
  """Token access policy to be updated in the custom OAuth app integration"""
800
816
 
817
+ user_authorized_scopes: Optional[List[str]] = None
818
+ """Scopes that will need to be consented by end user to mint the access token. If the user does not
819
+ authorize the access token will not be minted. Must be a subset of scopes."""
820
+
801
821
  def as_dict(self) -> dict:
802
822
  """Serializes the UpdateCustomAppIntegration into a dictionary suitable for use as a JSON request body."""
803
823
  body = {}
@@ -805,6 +825,8 @@ class UpdateCustomAppIntegration:
805
825
  if self.redirect_urls: body['redirect_urls'] = [v for v in self.redirect_urls]
806
826
  if self.scopes: body['scopes'] = [v for v in self.scopes]
807
827
  if self.token_access_policy: body['token_access_policy'] = self.token_access_policy.as_dict()
828
+ if self.user_authorized_scopes:
829
+ body['user_authorized_scopes'] = [v for v in self.user_authorized_scopes]
808
830
  return body
809
831
 
810
832
  def as_shallow_dict(self) -> dict:
@@ -814,6 +836,7 @@ class UpdateCustomAppIntegration:
814
836
  if self.redirect_urls: body['redirect_urls'] = self.redirect_urls
815
837
  if self.scopes: body['scopes'] = self.scopes
816
838
  if self.token_access_policy: body['token_access_policy'] = self.token_access_policy
839
+ if self.user_authorized_scopes: body['user_authorized_scopes'] = self.user_authorized_scopes
817
840
  return body
818
841
 
819
842
  @classmethod
@@ -822,7 +845,8 @@ class UpdateCustomAppIntegration:
822
845
  return cls(integration_id=d.get('integration_id', None),
823
846
  redirect_urls=d.get('redirect_urls', None),
824
847
  scopes=d.get('scopes', None),
825
- token_access_policy=_from_dict(d, 'token_access_policy', TokenAccessPolicy))
848
+ token_access_policy=_from_dict(d, 'token_access_policy', TokenAccessPolicy),
849
+ user_authorized_scopes=d.get('user_authorized_scopes', None))
826
850
 
827
851
 
828
852
  @dataclass
@@ -1066,7 +1090,8 @@ class CustomAppIntegrationAPI:
1066
1090
  name: Optional[str] = None,
1067
1091
  redirect_urls: Optional[List[str]] = None,
1068
1092
  scopes: Optional[List[str]] = None,
1069
- token_access_policy: Optional[TokenAccessPolicy] = None) -> CreateCustomAppIntegrationOutput:
1093
+ token_access_policy: Optional[TokenAccessPolicy] = None,
1094
+ user_authorized_scopes: Optional[List[str]] = None) -> CreateCustomAppIntegrationOutput:
1070
1095
  """Create Custom OAuth App Integration.
1071
1096
 
1072
1097
  Create Custom OAuth App Integration.
@@ -1084,6 +1109,9 @@ class CustomAppIntegrationAPI:
1084
1109
  profile, email.
1085
1110
  :param token_access_policy: :class:`TokenAccessPolicy` (optional)
1086
1111
  Token access policy
1112
+ :param user_authorized_scopes: List[str] (optional)
1113
+ Scopes that will need to be consented by end user to mint the access token. If the user does not
1114
+ authorize the access token will not be minted. Must be a subset of scopes.
1087
1115
 
1088
1116
  :returns: :class:`CreateCustomAppIntegrationOutput`
1089
1117
  """
@@ -1093,6 +1121,8 @@ class CustomAppIntegrationAPI:
1093
1121
  if redirect_urls is not None: body['redirect_urls'] = [v for v in redirect_urls]
1094
1122
  if scopes is not None: body['scopes'] = [v for v in scopes]
1095
1123
  if token_access_policy is not None: body['token_access_policy'] = token_access_policy.as_dict()
1124
+ if user_authorized_scopes is not None:
1125
+ body['user_authorized_scopes'] = [v for v in user_authorized_scopes]
1096
1126
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
1097
1127
 
1098
1128
  res = self._api.do('POST',
@@ -1177,7 +1207,8 @@ class CustomAppIntegrationAPI:
1177
1207
  *,
1178
1208
  redirect_urls: Optional[List[str]] = None,
1179
1209
  scopes: Optional[List[str]] = None,
1180
- token_access_policy: Optional[TokenAccessPolicy] = None):
1210
+ token_access_policy: Optional[TokenAccessPolicy] = None,
1211
+ user_authorized_scopes: Optional[List[str]] = None):
1181
1212
  """Updates Custom OAuth App Integration.
1182
1213
 
1183
1214
  Updates an existing custom OAuth App Integration. You can retrieve the custom OAuth app integration
@@ -1191,6 +1222,9 @@ class CustomAppIntegrationAPI:
1191
1222
  this will fully replace the existing values instead of appending
1192
1223
  :param token_access_policy: :class:`TokenAccessPolicy` (optional)
1193
1224
  Token access policy to be updated in the custom OAuth app integration
1225
+ :param user_authorized_scopes: List[str] (optional)
1226
+ Scopes that will need to be consented by end user to mint the access token. If the user does not
1227
+ authorize the access token will not be minted. Must be a subset of scopes.
1194
1228
 
1195
1229
 
1196
1230
  """
@@ -1198,6 +1232,8 @@ class CustomAppIntegrationAPI:
1198
1232
  if redirect_urls is not None: body['redirect_urls'] = [v for v in redirect_urls]
1199
1233
  if scopes is not None: body['scopes'] = [v for v in scopes]
1200
1234
  if token_access_policy is not None: body['token_access_policy'] = token_access_policy.as_dict()
1235
+ if user_authorized_scopes is not None:
1236
+ body['user_authorized_scopes'] = [v for v in user_authorized_scopes]
1201
1237
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
1202
1238
 
1203
1239
  self._api.do(
@@ -650,13 +650,13 @@ class CreateServingEndpoint:
650
650
  """The name of the serving endpoint. This field is required and must be unique across a Databricks
651
651
  workspace. An endpoint name can consist of alphanumeric characters, dashes, and underscores."""
652
652
 
653
- config: EndpointCoreConfigInput
654
- """The core config of the serving endpoint."""
655
-
656
653
  ai_gateway: Optional[AiGatewayConfig] = None
657
654
  """The AI Gateway configuration for the serving endpoint. NOTE: Only external model and provisioned
658
655
  throughput endpoints are currently supported."""
659
656
 
657
+ config: Optional[EndpointCoreConfigInput] = None
658
+ """The core config of the serving endpoint."""
659
+
660
660
  rate_limits: Optional[List[RateLimit]] = None
661
661
  """Rate limits to be applied to the serving endpoint. NOTE: this field is deprecated, please use AI
662
662
  Gateway to manage rate limits."""
@@ -1242,34 +1242,6 @@ class ExternalFunctionRequestHttpMethod(Enum):
1242
1242
  PUT = 'PUT'
1243
1243
 
1244
1244
 
1245
- @dataclass
1246
- class ExternalFunctionResponse:
1247
- status_code: Optional[int] = None
1248
- """The HTTP status code of the response"""
1249
-
1250
- text: Optional[str] = None
1251
- """The content of the response"""
1252
-
1253
- def as_dict(self) -> dict:
1254
- """Serializes the ExternalFunctionResponse into a dictionary suitable for use as a JSON request body."""
1255
- body = {}
1256
- if self.status_code is not None: body['status_code'] = self.status_code
1257
- if self.text is not None: body['text'] = self.text
1258
- return body
1259
-
1260
- def as_shallow_dict(self) -> dict:
1261
- """Serializes the ExternalFunctionResponse into a shallow dictionary of its immediate attributes."""
1262
- body = {}
1263
- if self.status_code is not None: body['status_code'] = self.status_code
1264
- if self.text is not None: body['text'] = self.text
1265
- return body
1266
-
1267
- @classmethod
1268
- def from_dict(cls, d: Dict[str, any]) -> ExternalFunctionResponse:
1269
- """Deserializes the ExternalFunctionResponse from a dictionary."""
1270
- return cls(status_code=d.get('status_code', None), text=d.get('text', None))
1271
-
1272
-
1273
1245
  @dataclass
1274
1246
  class ExternalModel:
1275
1247
  provider: ExternalModelProvider
@@ -1550,6 +1522,28 @@ class GoogleCloudVertexAiConfig:
1550
1522
  region=d.get('region', None))
1551
1523
 
1552
1524
 
1525
+ @dataclass
1526
+ class HttpRequestResponse:
1527
+ contents: Optional[BinaryIO] = None
1528
+
1529
+ def as_dict(self) -> dict:
1530
+ """Serializes the HttpRequestResponse into a dictionary suitable for use as a JSON request body."""
1531
+ body = {}
1532
+ if self.contents: body['contents'] = self.contents
1533
+ return body
1534
+
1535
+ def as_shallow_dict(self) -> dict:
1536
+ """Serializes the HttpRequestResponse into a shallow dictionary of its immediate attributes."""
1537
+ body = {}
1538
+ if self.contents: body['contents'] = self.contents
1539
+ return body
1540
+
1541
+ @classmethod
1542
+ def from_dict(cls, d: Dict[str, any]) -> HttpRequestResponse:
1543
+ """Deserializes the HttpRequestResponse from a dictionary."""
1544
+ return cls(contents=d.get('contents', None))
1545
+
1546
+
1553
1547
  @dataclass
1554
1548
  class ListEndpointsResponse:
1555
1549
  endpoints: Optional[List[ServingEndpoint]] = None
@@ -3403,9 +3397,9 @@ class ServingEndpointsAPI:
3403
3397
 
3404
3398
  def create(self,
3405
3399
  name: str,
3406
- config: EndpointCoreConfigInput,
3407
3400
  *,
3408
3401
  ai_gateway: Optional[AiGatewayConfig] = None,
3402
+ config: Optional[EndpointCoreConfigInput] = None,
3409
3403
  rate_limits: Optional[List[RateLimit]] = None,
3410
3404
  route_optimized: Optional[bool] = None,
3411
3405
  tags: Optional[List[EndpointTag]] = None) -> Wait[ServingEndpointDetailed]:
@@ -3414,11 +3408,11 @@ class ServingEndpointsAPI:
3414
3408
  :param name: str
3415
3409
  The name of the serving endpoint. This field is required and must be unique across a Databricks
3416
3410
  workspace. An endpoint name can consist of alphanumeric characters, dashes, and underscores.
3417
- :param config: :class:`EndpointCoreConfigInput`
3418
- The core config of the serving endpoint.
3419
3411
  :param ai_gateway: :class:`AiGatewayConfig` (optional)
3420
3412
  The AI Gateway configuration for the serving endpoint. NOTE: Only external model and provisioned
3421
3413
  throughput endpoints are currently supported.
3414
+ :param config: :class:`EndpointCoreConfigInput` (optional)
3415
+ The core config of the serving endpoint.
3422
3416
  :param rate_limits: List[:class:`RateLimit`] (optional)
3423
3417
  Rate limits to be applied to the serving endpoint. NOTE: this field is deprecated, please use AI
3424
3418
  Gateway to manage rate limits.
@@ -3448,9 +3442,9 @@ class ServingEndpointsAPI:
3448
3442
  def create_and_wait(
3449
3443
  self,
3450
3444
  name: str,
3451
- config: EndpointCoreConfigInput,
3452
3445
  *,
3453
3446
  ai_gateway: Optional[AiGatewayConfig] = None,
3447
+ config: Optional[EndpointCoreConfigInput] = None,
3454
3448
  rate_limits: Optional[List[RateLimit]] = None,
3455
3449
  route_optimized: Optional[bool] = None,
3456
3450
  tags: Optional[List[EndpointTag]] = None,
@@ -3568,7 +3562,7 @@ class ServingEndpointsAPI:
3568
3562
  *,
3569
3563
  headers: Optional[str] = None,
3570
3564
  json: Optional[str] = None,
3571
- params: Optional[str] = None) -> ExternalFunctionResponse:
3565
+ params: Optional[str] = None) -> HttpRequestResponse:
3572
3566
  """Make external services call using the credentials stored in UC Connection.
3573
3567
 
3574
3568
  :param connection_name: str
@@ -3585,7 +3579,7 @@ class ServingEndpointsAPI:
3585
3579
  :param params: str (optional)
3586
3580
  Query parameters for the request.
3587
3581
 
3588
- :returns: :class:`ExternalFunctionResponse`
3582
+ :returns: :class:`HttpRequestResponse`
3589
3583
  """
3590
3584
  body = {}
3591
3585
  if connection_name is not None: body['connection_name'] = connection_name
@@ -3594,10 +3588,10 @@ class ServingEndpointsAPI:
3594
3588
  if method is not None: body['method'] = method.value
3595
3589
  if params is not None: body['params'] = params
3596
3590
  if path is not None: body['path'] = path
3597
- headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
3591
+ headers = {'Accept': 'text/plain', 'Content-Type': 'application/json', }
3598
3592
 
3599
- res = self._api.do('POST', '/api/2.0/external-function', body=body, headers=headers)
3600
- return ExternalFunctionResponse.from_dict(res)
3593
+ res = self._api.do('POST', '/api/2.0/external-function', body=body, headers=headers, raw=True)
3594
+ return HttpRequestResponse.from_dict(res)
3601
3595
 
3602
3596
  def list(self) -> Iterator[ServingEndpoint]:
3603
3597
  """Get all serving endpoints.