databricks-sdk 0.19.1__py3-none-any.whl → 0.21.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.

Files changed (35) hide show
  1. databricks/sdk/__init__.py +28 -6
  2. databricks/sdk/_widgets/__init__.py +2 -2
  3. databricks/sdk/config.py +3 -2
  4. databricks/sdk/core.py +4 -2
  5. databricks/sdk/mixins/workspace.py +2 -1
  6. databricks/sdk/oauth.py +1 -1
  7. databricks/sdk/runtime/__init__.py +85 -11
  8. databricks/sdk/runtime/dbutils_stub.py +1 -1
  9. databricks/sdk/service/_internal.py +1 -1
  10. databricks/sdk/service/billing.py +64 -1
  11. databricks/sdk/service/catalog.py +796 -84
  12. databricks/sdk/service/compute.py +391 -13
  13. databricks/sdk/service/dashboards.py +15 -0
  14. databricks/sdk/service/files.py +289 -15
  15. databricks/sdk/service/iam.py +214 -0
  16. databricks/sdk/service/jobs.py +242 -143
  17. databricks/sdk/service/ml.py +407 -0
  18. databricks/sdk/service/oauth2.py +83 -0
  19. databricks/sdk/service/pipelines.py +78 -8
  20. databricks/sdk/service/provisioning.py +108 -36
  21. databricks/sdk/service/serving.py +101 -35
  22. databricks/sdk/service/settings.py +1316 -186
  23. databricks/sdk/service/sharing.py +94 -18
  24. databricks/sdk/service/sql.py +230 -13
  25. databricks/sdk/service/vectorsearch.py +105 -60
  26. databricks/sdk/service/workspace.py +175 -1
  27. databricks/sdk/version.py +1 -1
  28. {databricks_sdk-0.19.1.dist-info → databricks_sdk-0.21.0.dist-info}/METADATA +3 -1
  29. databricks_sdk-0.21.0.dist-info/RECORD +53 -0
  30. databricks/sdk/runtime/stub.py +0 -48
  31. databricks_sdk-0.19.1.dist-info/RECORD +0 -54
  32. {databricks_sdk-0.19.1.dist-info → databricks_sdk-0.21.0.dist-info}/LICENSE +0 -0
  33. {databricks_sdk-0.19.1.dist-info → databricks_sdk-0.21.0.dist-info}/NOTICE +0 -0
  34. {databricks_sdk-0.19.1.dist-info → databricks_sdk-0.21.0.dist-info}/WHEEL +0 -0
  35. {databricks_sdk-0.19.1.dist-info → databricks_sdk-0.21.0.dist-info}/top_level.txt +0 -0
@@ -14,6 +14,220 @@ _LOG = logging.getLogger('databricks.sdk')
14
14
  # all definitions in this file are in alphabetical order
15
15
 
16
16
 
17
+ @dataclass
18
+ class AutomaticClusterUpdateSetting:
19
+ automatic_cluster_update_workspace: ClusterAutoRestartMessage
20
+
21
+ etag: Optional[str] = None
22
+ """etag used for versioning. The response is at least as fresh as the eTag provided. This is used
23
+ for optimistic concurrency control as a way to help prevent simultaneous writes of a setting
24
+ overwriting each other. It is strongly suggested that systems make use of the etag in the read
25
+ -> update pattern to perform setting updates in order to avoid race conditions. That is, get an
26
+ etag from a GET request, and pass it with the PATCH request to identify the setting version you
27
+ are updating."""
28
+
29
+ setting_name: Optional[str] = None
30
+ """Name of the corresponding setting. This field is populated in the response, but it will not be
31
+ respected even if it's set in the request body. The setting name in the path parameter will be
32
+ respected instead. Setting name is required to be 'default' if the setting only has one instance
33
+ per workspace."""
34
+
35
+ def as_dict(self) -> dict:
36
+ """Serializes the AutomaticClusterUpdateSetting into a dictionary suitable for use as a JSON request body."""
37
+ body = {}
38
+ if self.automatic_cluster_update_workspace:
39
+ body['automatic_cluster_update_workspace'] = self.automatic_cluster_update_workspace.as_dict()
40
+ if self.etag is not None: body['etag'] = self.etag
41
+ if self.setting_name is not None: body['setting_name'] = self.setting_name
42
+ return body
43
+
44
+ @classmethod
45
+ def from_dict(cls, d: Dict[str, any]) -> AutomaticClusterUpdateSetting:
46
+ """Deserializes the AutomaticClusterUpdateSetting from a dictionary."""
47
+ return cls(automatic_cluster_update_workspace=_from_dict(d, 'automatic_cluster_update_workspace',
48
+ ClusterAutoRestartMessage),
49
+ etag=d.get('etag', None),
50
+ setting_name=d.get('setting_name', None))
51
+
52
+
53
+ @dataclass
54
+ class ClusterAutoRestartMessage:
55
+ can_toggle: Optional[bool] = None
56
+
57
+ enabled: Optional[bool] = None
58
+
59
+ enablement_details: Optional[ClusterAutoRestartMessageEnablementDetails] = None
60
+ """Contains an information about the enablement status judging (e.g. whether the enterprise tier is
61
+ enabled) This is only additional information that MUST NOT be used to decide whether the setting
62
+ is enabled or not. This is intended to use only for purposes like showing an error message to
63
+ the customer with the additional details. For example, using these details we can check why
64
+ exactly the feature is disabled for this customer."""
65
+
66
+ maintenance_window: Optional[ClusterAutoRestartMessageMaintenanceWindow] = None
67
+
68
+ restart_even_if_no_updates_available: Optional[bool] = None
69
+
70
+ def as_dict(self) -> dict:
71
+ """Serializes the ClusterAutoRestartMessage into a dictionary suitable for use as a JSON request body."""
72
+ body = {}
73
+ if self.can_toggle is not None: body['can_toggle'] = self.can_toggle
74
+ if self.enabled is not None: body['enabled'] = self.enabled
75
+ if self.enablement_details: body['enablement_details'] = self.enablement_details.as_dict()
76
+ if self.maintenance_window: body['maintenance_window'] = self.maintenance_window.as_dict()
77
+ if self.restart_even_if_no_updates_available is not None:
78
+ body['restart_even_if_no_updates_available'] = self.restart_even_if_no_updates_available
79
+ return body
80
+
81
+ @classmethod
82
+ def from_dict(cls, d: Dict[str, any]) -> ClusterAutoRestartMessage:
83
+ """Deserializes the ClusterAutoRestartMessage from a dictionary."""
84
+ return cls(can_toggle=d.get('can_toggle', None),
85
+ enabled=d.get('enabled', None),
86
+ enablement_details=_from_dict(d, 'enablement_details',
87
+ ClusterAutoRestartMessageEnablementDetails),
88
+ maintenance_window=_from_dict(d, 'maintenance_window',
89
+ ClusterAutoRestartMessageMaintenanceWindow),
90
+ restart_even_if_no_updates_available=d.get('restart_even_if_no_updates_available', None))
91
+
92
+
93
+ @dataclass
94
+ class ClusterAutoRestartMessageEnablementDetails:
95
+ """Contains an information about the enablement status judging (e.g. whether the enterprise tier is
96
+ enabled) This is only additional information that MUST NOT be used to decide whether the setting
97
+ is enabled or not. This is intended to use only for purposes like showing an error message to
98
+ the customer with the additional details. For example, using these details we can check why
99
+ exactly the feature is disabled for this customer."""
100
+
101
+ forced_for_compliance_mode: Optional[bool] = None
102
+ """The feature is force enabled if compliance mode is active"""
103
+
104
+ unavailable_for_disabled_entitlement: Optional[bool] = None
105
+ """The feature is unavailable if the corresponding entitlement disabled (see
106
+ getShieldEntitlementEnable)"""
107
+
108
+ unavailable_for_non_enterprise_tier: Optional[bool] = None
109
+ """The feature is unavailable if the customer doesn't have enterprise tier"""
110
+
111
+ def as_dict(self) -> dict:
112
+ """Serializes the ClusterAutoRestartMessageEnablementDetails into a dictionary suitable for use as a JSON request body."""
113
+ body = {}
114
+ if self.forced_for_compliance_mode is not None:
115
+ body['forced_for_compliance_mode'] = self.forced_for_compliance_mode
116
+ if self.unavailable_for_disabled_entitlement is not None:
117
+ body['unavailable_for_disabled_entitlement'] = self.unavailable_for_disabled_entitlement
118
+ if self.unavailable_for_non_enterprise_tier is not None:
119
+ body['unavailable_for_non_enterprise_tier'] = self.unavailable_for_non_enterprise_tier
120
+ return body
121
+
122
+ @classmethod
123
+ def from_dict(cls, d: Dict[str, any]) -> ClusterAutoRestartMessageEnablementDetails:
124
+ """Deserializes the ClusterAutoRestartMessageEnablementDetails from a dictionary."""
125
+ return cls(forced_for_compliance_mode=d.get('forced_for_compliance_mode', None),
126
+ unavailable_for_disabled_entitlement=d.get('unavailable_for_disabled_entitlement', None),
127
+ unavailable_for_non_enterprise_tier=d.get('unavailable_for_non_enterprise_tier', None))
128
+
129
+
130
+ @dataclass
131
+ class ClusterAutoRestartMessageMaintenanceWindow:
132
+ week_day_based_schedule: Optional[ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule] = None
133
+
134
+ def as_dict(self) -> dict:
135
+ """Serializes the ClusterAutoRestartMessageMaintenanceWindow into a dictionary suitable for use as a JSON request body."""
136
+ body = {}
137
+ if self.week_day_based_schedule:
138
+ body['week_day_based_schedule'] = self.week_day_based_schedule.as_dict()
139
+ return body
140
+
141
+ @classmethod
142
+ def from_dict(cls, d: Dict[str, any]) -> ClusterAutoRestartMessageMaintenanceWindow:
143
+ """Deserializes the ClusterAutoRestartMessageMaintenanceWindow from a dictionary."""
144
+ return cls(week_day_based_schedule=_from_dict(
145
+ d, 'week_day_based_schedule', ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule))
146
+
147
+
148
+ class ClusterAutoRestartMessageMaintenanceWindowDayOfWeek(Enum):
149
+
150
+ DAY_OF_WEEK_UNSPECIFIED = 'DAY_OF_WEEK_UNSPECIFIED'
151
+ FRIDAY = 'FRIDAY'
152
+ MONDAY = 'MONDAY'
153
+ SATURDAY = 'SATURDAY'
154
+ SUNDAY = 'SUNDAY'
155
+ THURSDAY = 'THURSDAY'
156
+ TUESDAY = 'TUESDAY'
157
+ WEDNESDAY = 'WEDNESDAY'
158
+
159
+
160
+ @dataclass
161
+ class ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule:
162
+ day_of_week: Optional[ClusterAutoRestartMessageMaintenanceWindowDayOfWeek] = None
163
+
164
+ frequency: Optional[ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency] = None
165
+
166
+ window_start_time: Optional[ClusterAutoRestartMessageMaintenanceWindowWindowStartTime] = None
167
+
168
+ def as_dict(self) -> dict:
169
+ """Serializes the ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule into a dictionary suitable for use as a JSON request body."""
170
+ body = {}
171
+ if self.day_of_week is not None: body['day_of_week'] = self.day_of_week.value
172
+ if self.frequency is not None: body['frequency'] = self.frequency.value
173
+ if self.window_start_time: body['window_start_time'] = self.window_start_time.as_dict()
174
+ return body
175
+
176
+ @classmethod
177
+ def from_dict(cls, d: Dict[str, any]) -> ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule:
178
+ """Deserializes the ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule from a dictionary."""
179
+ return cls(day_of_week=_enum(d, 'day_of_week', ClusterAutoRestartMessageMaintenanceWindowDayOfWeek),
180
+ frequency=_enum(d, 'frequency',
181
+ ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency),
182
+ window_start_time=_from_dict(d, 'window_start_time',
183
+ ClusterAutoRestartMessageMaintenanceWindowWindowStartTime))
184
+
185
+
186
+ class ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency(Enum):
187
+
188
+ EVERY_WEEK = 'EVERY_WEEK'
189
+ FIRST_AND_THIRD_OF_MONTH = 'FIRST_AND_THIRD_OF_MONTH'
190
+ FIRST_OF_MONTH = 'FIRST_OF_MONTH'
191
+ FOURTH_OF_MONTH = 'FOURTH_OF_MONTH'
192
+ SECOND_AND_FOURTH_OF_MONTH = 'SECOND_AND_FOURTH_OF_MONTH'
193
+ SECOND_OF_MONTH = 'SECOND_OF_MONTH'
194
+ THIRD_OF_MONTH = 'THIRD_OF_MONTH'
195
+ WEEK_DAY_FREQUENCY_UNSPECIFIED = 'WEEK_DAY_FREQUENCY_UNSPECIFIED'
196
+
197
+
198
+ @dataclass
199
+ class ClusterAutoRestartMessageMaintenanceWindowWindowStartTime:
200
+ hours: Optional[int] = None
201
+
202
+ minutes: Optional[int] = None
203
+
204
+ def as_dict(self) -> dict:
205
+ """Serializes the ClusterAutoRestartMessageMaintenanceWindowWindowStartTime into a dictionary suitable for use as a JSON request body."""
206
+ body = {}
207
+ if self.hours is not None: body['hours'] = self.hours
208
+ if self.minutes is not None: body['minutes'] = self.minutes
209
+ return body
210
+
211
+ @classmethod
212
+ def from_dict(cls, d: Dict[str, any]) -> ClusterAutoRestartMessageMaintenanceWindowWindowStartTime:
213
+ """Deserializes the ClusterAutoRestartMessageMaintenanceWindowWindowStartTime from a dictionary."""
214
+ return cls(hours=d.get('hours', None), minutes=d.get('minutes', None))
215
+
216
+
217
+ class ComplianceStandard(Enum):
218
+ """Compliance stardard for SHIELD customers"""
219
+
220
+ COMPLIANCE_STANDARD_UNSPECIFIED = 'COMPLIANCE_STANDARD_UNSPECIFIED'
221
+ FEDRAMP_HIGH = 'FEDRAMP_HIGH'
222
+ FEDRAMP_IL5 = 'FEDRAMP_IL5'
223
+ FEDRAMP_MODERATE = 'FEDRAMP_MODERATE'
224
+ HIPAA = 'HIPAA'
225
+ IRAP_PROTECTED = 'IRAP_PROTECTED'
226
+ ITAR_EAR = 'ITAR_EAR'
227
+ NONE = 'NONE'
228
+ PCI_DSS = 'PCI_DSS'
229
+
230
+
17
231
  @dataclass
18
232
  class CreateIpAccessList:
19
233
  """Details required to configure a block list or allow list."""
@@ -72,8 +286,8 @@ class CreateNetworkConnectivityConfigRequest:
72
286
  must match the regular expression `^[0-9a-zA-Z-_]{3,30}$`."""
73
287
 
74
288
  region: str
75
- """The Azure region for this network connectivity configuration. Only workspaces in the same Azure
76
- region can be attached to this network connectivity configuration."""
289
+ """The region for the network connectivity configuration. Only workspaces in the same region can be
290
+ attached to the network connectivity configuration."""
77
291
 
78
292
  def as_dict(self) -> dict:
79
293
  """Serializes the CreateNetworkConnectivityConfigRequest into a dictionary suitable for use as a JSON request body."""
@@ -223,6 +437,130 @@ class CreateTokenResponse:
223
437
  token_value=d.get('token_value', None))
224
438
 
225
439
 
440
+ @dataclass
441
+ class CspEnablement:
442
+ """Compliance Security Profile (CSP) - one of the features in ESC product Tracks if the feature is
443
+ enabled."""
444
+
445
+ compliance_standards: Optional[List[ComplianceStandard]] = None
446
+ """Set by customers when they request Compliance Security Profile (CSP) Invariants are enforced in
447
+ Settings policy."""
448
+
449
+ is_enabled: Optional[bool] = None
450
+
451
+ def as_dict(self) -> dict:
452
+ """Serializes the CspEnablement into a dictionary suitable for use as a JSON request body."""
453
+ body = {}
454
+ if self.compliance_standards:
455
+ body['compliance_standards'] = [v.value for v in self.compliance_standards]
456
+ if self.is_enabled is not None: body['is_enabled'] = self.is_enabled
457
+ return body
458
+
459
+ @classmethod
460
+ def from_dict(cls, d: Dict[str, any]) -> CspEnablement:
461
+ """Deserializes the CspEnablement from a dictionary."""
462
+ return cls(compliance_standards=_repeated_enum(d, 'compliance_standards', ComplianceStandard),
463
+ is_enabled=d.get('is_enabled', None))
464
+
465
+
466
+ @dataclass
467
+ class CspEnablementAccount:
468
+ """Account level policy for CSP"""
469
+
470
+ compliance_standards: Optional[List[ComplianceStandard]] = None
471
+ """Set by customers when they request Compliance Security Profile (CSP) Invariants are enforced in
472
+ Settings policy."""
473
+
474
+ is_enforced: Optional[bool] = None
475
+ """Enforced = it cannot be overriden at workspace level."""
476
+
477
+ def as_dict(self) -> dict:
478
+ """Serializes the CspEnablementAccount into a dictionary suitable for use as a JSON request body."""
479
+ body = {}
480
+ if self.compliance_standards:
481
+ body['compliance_standards'] = [v.value for v in self.compliance_standards]
482
+ if self.is_enforced is not None: body['is_enforced'] = self.is_enforced
483
+ return body
484
+
485
+ @classmethod
486
+ def from_dict(cls, d: Dict[str, any]) -> CspEnablementAccount:
487
+ """Deserializes the CspEnablementAccount from a dictionary."""
488
+ return cls(compliance_standards=_repeated_enum(d, 'compliance_standards', ComplianceStandard),
489
+ is_enforced=d.get('is_enforced', None))
490
+
491
+
492
+ @dataclass
493
+ class CspEnablementAccountSetting:
494
+ csp_enablement_account: CspEnablementAccount
495
+ """Account level policy for CSP"""
496
+
497
+ etag: Optional[str] = None
498
+ """etag used for versioning. The response is at least as fresh as the eTag provided. This is used
499
+ for optimistic concurrency control as a way to help prevent simultaneous writes of a setting
500
+ overwriting each other. It is strongly suggested that systems make use of the etag in the read
501
+ -> update pattern to perform setting updates in order to avoid race conditions. That is, get an
502
+ etag from a GET request, and pass it with the PATCH request to identify the setting version you
503
+ are updating."""
504
+
505
+ setting_name: Optional[str] = None
506
+ """Name of the corresponding setting. This field is populated in the response, but it will not be
507
+ respected even if it's set in the request body. The setting name in the path parameter will be
508
+ respected instead. Setting name is required to be 'default' if the setting only has one instance
509
+ per workspace."""
510
+
511
+ def as_dict(self) -> dict:
512
+ """Serializes the CspEnablementAccountSetting into a dictionary suitable for use as a JSON request body."""
513
+ body = {}
514
+ if self.csp_enablement_account: body['csp_enablement_account'] = self.csp_enablement_account.as_dict()
515
+ if self.etag is not None: body['etag'] = self.etag
516
+ if self.setting_name is not None: body['setting_name'] = self.setting_name
517
+ return body
518
+
519
+ @classmethod
520
+ def from_dict(cls, d: Dict[str, any]) -> CspEnablementAccountSetting:
521
+ """Deserializes the CspEnablementAccountSetting from a dictionary."""
522
+ return cls(csp_enablement_account=_from_dict(d, 'csp_enablement_account', CspEnablementAccount),
523
+ etag=d.get('etag', None),
524
+ setting_name=d.get('setting_name', None))
525
+
526
+
527
+ @dataclass
528
+ class CspEnablementSetting:
529
+ csp_enablement_workspace: CspEnablement
530
+ """Compliance Security Profile (CSP) - one of the features in ESC product Tracks if the feature is
531
+ enabled."""
532
+
533
+ etag: Optional[str] = None
534
+ """etag used for versioning. The response is at least as fresh as the eTag provided. This is used
535
+ for optimistic concurrency control as a way to help prevent simultaneous writes of a setting
536
+ overwriting each other. It is strongly suggested that systems make use of the etag in the read
537
+ -> update pattern to perform setting updates in order to avoid race conditions. That is, get an
538
+ etag from a GET request, and pass it with the PATCH request to identify the setting version you
539
+ are updating."""
540
+
541
+ setting_name: Optional[str] = None
542
+ """Name of the corresponding setting. This field is populated in the response, but it will not be
543
+ respected even if it's set in the request body. The setting name in the path parameter will be
544
+ respected instead. Setting name is required to be 'default' if the setting only has one instance
545
+ per workspace."""
546
+
547
+ def as_dict(self) -> dict:
548
+ """Serializes the CspEnablementSetting into a dictionary suitable for use as a JSON request body."""
549
+ body = {}
550
+ if self.csp_enablement_workspace:
551
+ body['csp_enablement_workspace'] = self.csp_enablement_workspace.as_dict()
552
+ if self.etag is not None: body['etag'] = self.etag
553
+ if self.setting_name is not None: body['setting_name'] = self.setting_name
554
+ return body
555
+
556
+ @classmethod
557
+ def from_dict(cls, d: Dict[str, any]) -> CspEnablementSetting:
558
+ """Deserializes the CspEnablementSetting from a dictionary."""
559
+ return cls(csp_enablement_workspace=_from_dict(d, 'csp_enablement_workspace', CspEnablement),
560
+ etag=d.get('etag', None),
561
+ setting_name=d.get('setting_name', None))
562
+
563
+
226
564
  @dataclass
227
565
  class DefaultNamespaceSetting:
228
566
  """This represents the setting configuration for the default namespace in the Databricks workspace.
@@ -289,6 +627,20 @@ class DeleteDefaultNamespaceSettingResponse:
289
627
  return cls(etag=d.get('etag', None))
290
628
 
291
629
 
630
+ @dataclass
631
+ class DeleteNetworkConnectivityConfigurationResponse:
632
+
633
+ def as_dict(self) -> dict:
634
+ """Serializes the DeleteNetworkConnectivityConfigurationResponse into a dictionary suitable for use as a JSON request body."""
635
+ body = {}
636
+ return body
637
+
638
+ @classmethod
639
+ def from_dict(cls, d: Dict[str, any]) -> DeleteNetworkConnectivityConfigurationResponse:
640
+ """Deserializes the DeleteNetworkConnectivityConfigurationResponse from a dictionary."""
641
+ return cls()
642
+
643
+
292
644
  @dataclass
293
645
  class DeletePersonalComputeSettingResponse:
294
646
  """The etag is returned."""
@@ -313,6 +665,20 @@ class DeletePersonalComputeSettingResponse:
313
665
  return cls(etag=d.get('etag', None))
314
666
 
315
667
 
668
+ @dataclass
669
+ class DeleteResponse:
670
+
671
+ def as_dict(self) -> dict:
672
+ """Serializes the DeleteResponse into a dictionary suitable for use as a JSON request body."""
673
+ body = {}
674
+ return body
675
+
676
+ @classmethod
677
+ def from_dict(cls, d: Dict[str, any]) -> DeleteResponse:
678
+ """Deserializes the DeleteResponse from a dictionary."""
679
+ return cls()
680
+
681
+
316
682
  @dataclass
317
683
  class DeleteRestrictWorkspaceAdminsSettingResponse:
318
684
  """The etag is returned."""
@@ -337,6 +703,115 @@ class DeleteRestrictWorkspaceAdminsSettingResponse:
337
703
  return cls(etag=d.get('etag', None))
338
704
 
339
705
 
706
+ @dataclass
707
+ class EsmEnablement:
708
+ """Enhanced Security Monitoring (ESM) - one of the features in ESC product Tracks if the feature is
709
+ enabled."""
710
+
711
+ is_enabled: Optional[bool] = None
712
+
713
+ def as_dict(self) -> dict:
714
+ """Serializes the EsmEnablement into a dictionary suitable for use as a JSON request body."""
715
+ body = {}
716
+ if self.is_enabled is not None: body['is_enabled'] = self.is_enabled
717
+ return body
718
+
719
+ @classmethod
720
+ def from_dict(cls, d: Dict[str, any]) -> EsmEnablement:
721
+ """Deserializes the EsmEnablement from a dictionary."""
722
+ return cls(is_enabled=d.get('is_enabled', None))
723
+
724
+
725
+ @dataclass
726
+ class EsmEnablementAccount:
727
+ """Account level policy for ESM"""
728
+
729
+ is_enforced: Optional[bool] = None
730
+
731
+ def as_dict(self) -> dict:
732
+ """Serializes the EsmEnablementAccount into a dictionary suitable for use as a JSON request body."""
733
+ body = {}
734
+ if self.is_enforced is not None: body['is_enforced'] = self.is_enforced
735
+ return body
736
+
737
+ @classmethod
738
+ def from_dict(cls, d: Dict[str, any]) -> EsmEnablementAccount:
739
+ """Deserializes the EsmEnablementAccount from a dictionary."""
740
+ return cls(is_enforced=d.get('is_enforced', None))
741
+
742
+
743
+ @dataclass
744
+ class EsmEnablementAccountSetting:
745
+ esm_enablement_account: EsmEnablementAccount
746
+ """Account level policy for ESM"""
747
+
748
+ etag: Optional[str] = None
749
+ """etag used for versioning. The response is at least as fresh as the eTag provided. This is used
750
+ for optimistic concurrency control as a way to help prevent simultaneous writes of a setting
751
+ overwriting each other. It is strongly suggested that systems make use of the etag in the read
752
+ -> update pattern to perform setting updates in order to avoid race conditions. That is, get an
753
+ etag from a GET request, and pass it with the PATCH request to identify the setting version you
754
+ are updating."""
755
+
756
+ setting_name: Optional[str] = None
757
+ """Name of the corresponding setting. This field is populated in the response, but it will not be
758
+ respected even if it's set in the request body. The setting name in the path parameter will be
759
+ respected instead. Setting name is required to be 'default' if the setting only has one instance
760
+ per workspace."""
761
+
762
+ def as_dict(self) -> dict:
763
+ """Serializes the EsmEnablementAccountSetting into a dictionary suitable for use as a JSON request body."""
764
+ body = {}
765
+ if self.esm_enablement_account: body['esm_enablement_account'] = self.esm_enablement_account.as_dict()
766
+ if self.etag is not None: body['etag'] = self.etag
767
+ if self.setting_name is not None: body['setting_name'] = self.setting_name
768
+ return body
769
+
770
+ @classmethod
771
+ def from_dict(cls, d: Dict[str, any]) -> EsmEnablementAccountSetting:
772
+ """Deserializes the EsmEnablementAccountSetting from a dictionary."""
773
+ return cls(esm_enablement_account=_from_dict(d, 'esm_enablement_account', EsmEnablementAccount),
774
+ etag=d.get('etag', None),
775
+ setting_name=d.get('setting_name', None))
776
+
777
+
778
+ @dataclass
779
+ class EsmEnablementSetting:
780
+ esm_enablement_workspace: EsmEnablement
781
+ """Enhanced Security Monitoring (ESM) - one of the features in ESC product Tracks if the feature is
782
+ enabled."""
783
+
784
+ etag: Optional[str] = None
785
+ """etag used for versioning. The response is at least as fresh as the eTag provided. This is used
786
+ for optimistic concurrency control as a way to help prevent simultaneous writes of a setting
787
+ overwriting each other. It is strongly suggested that systems make use of the etag in the read
788
+ -> update pattern to perform setting updates in order to avoid race conditions. That is, get an
789
+ etag from a GET request, and pass it with the PATCH request to identify the setting version you
790
+ are updating."""
791
+
792
+ setting_name: Optional[str] = None
793
+ """Name of the corresponding setting. This field is populated in the response, but it will not be
794
+ respected even if it's set in the request body. The setting name in the path parameter will be
795
+ respected instead. Setting name is required to be 'default' if the setting only has one instance
796
+ per workspace."""
797
+
798
+ def as_dict(self) -> dict:
799
+ """Serializes the EsmEnablementSetting into a dictionary suitable for use as a JSON request body."""
800
+ body = {}
801
+ if self.esm_enablement_workspace:
802
+ body['esm_enablement_workspace'] = self.esm_enablement_workspace.as_dict()
803
+ if self.etag is not None: body['etag'] = self.etag
804
+ if self.setting_name is not None: body['setting_name'] = self.setting_name
805
+ return body
806
+
807
+ @classmethod
808
+ def from_dict(cls, d: Dict[str, any]) -> EsmEnablementSetting:
809
+ """Deserializes the EsmEnablementSetting from a dictionary."""
810
+ return cls(esm_enablement_workspace=_from_dict(d, 'esm_enablement_workspace', EsmEnablement),
811
+ etag=d.get('etag', None),
812
+ setting_name=d.get('setting_name', None))
813
+
814
+
340
815
  @dataclass
341
816
  class ExchangeToken:
342
817
  """The exchange token is the result of the token exchange with the IdP"""
@@ -686,6 +1161,27 @@ class ListType(Enum):
686
1161
  BLOCK = 'BLOCK'
687
1162
 
688
1163
 
1164
+ @dataclass
1165
+ class NccAwsStableIpRule:
1166
+ """The stable AWS IP CIDR blocks. You can use these to configure the firewall of your resources to
1167
+ allow traffic from your Databricks workspace."""
1168
+
1169
+ cidr_blocks: Optional[List[str]] = None
1170
+ """The list of stable IP CIDR blocks from which Databricks network traffic originates when
1171
+ accessing your resources."""
1172
+
1173
+ def as_dict(self) -> dict:
1174
+ """Serializes the NccAwsStableIpRule into a dictionary suitable for use as a JSON request body."""
1175
+ body = {}
1176
+ if self.cidr_blocks: body['cidr_blocks'] = [v for v in self.cidr_blocks]
1177
+ return body
1178
+
1179
+ @classmethod
1180
+ def from_dict(cls, d: Dict[str, any]) -> NccAwsStableIpRule:
1181
+ """Deserializes the NccAwsStableIpRule from a dictionary."""
1182
+ return cls(cidr_blocks=d.get('cidr_blocks', None))
1183
+
1184
+
689
1185
  @dataclass
690
1186
  class NccAzurePrivateEndpointRule:
691
1187
  connection_state: Optional[NccAzurePrivateEndpointRuleConnectionState] = None
@@ -854,6 +1350,10 @@ class NccEgressDefaultRules:
854
1350
  configurations. You can find the stable network information of your serverless compute resources
855
1351
  here."""
856
1352
 
1353
+ aws_stable_ip_rule: Optional[NccAwsStableIpRule] = None
1354
+ """The stable AWS IP CIDR blocks. You can use these to configure the firewall of your resources to
1355
+ allow traffic from your Databricks workspace."""
1356
+
857
1357
  azure_service_endpoint_rule: Optional[NccAzureServiceEndpointRule] = None
858
1358
  """The stable Azure service endpoints. You can configure the firewall of your Azure resources to
859
1359
  allow traffic from your Databricks serverless compute resources."""
@@ -861,6 +1361,7 @@ class NccEgressDefaultRules:
861
1361
  def as_dict(self) -> dict:
862
1362
  """Serializes the NccEgressDefaultRules into a dictionary suitable for use as a JSON request body."""
863
1363
  body = {}
1364
+ if self.aws_stable_ip_rule: body['aws_stable_ip_rule'] = self.aws_stable_ip_rule.as_dict()
864
1365
  if self.azure_service_endpoint_rule:
865
1366
  body['azure_service_endpoint_rule'] = self.azure_service_endpoint_rule.as_dict()
866
1367
  return body
@@ -868,7 +1369,8 @@ class NccEgressDefaultRules:
868
1369
  @classmethod
869
1370
  def from_dict(cls, d: Dict[str, any]) -> NccEgressDefaultRules:
870
1371
  """Deserializes the NccEgressDefaultRules from a dictionary."""
871
- return cls(azure_service_endpoint_rule=_from_dict(d, 'azure_service_endpoint_rule',
1372
+ return cls(aws_stable_ip_rule=_from_dict(d, 'aws_stable_ip_rule', NccAwsStableIpRule),
1373
+ azure_service_endpoint_rule=_from_dict(d, 'azure_service_endpoint_rule',
872
1374
  NccAzureServiceEndpointRule))
873
1375
 
874
1376
 
@@ -914,8 +1416,8 @@ class NetworkConnectivityConfiguration:
914
1416
  """Databricks network connectivity configuration ID."""
915
1417
 
916
1418
  region: Optional[str] = None
917
- """The Azure region for this network connectivity configuration. Only workspaces in the same Azure
918
- region can be attached to this network connectivity configuration."""
1419
+ """The region for the network connectivity configuration. Only workspaces in the same region can be
1420
+ attached to the network connectivity configuration."""
919
1421
 
920
1422
  updated_time: Optional[int] = None
921
1423
  """Time in epoch milliseconds when this object was updated."""
@@ -1103,6 +1605,20 @@ class ReplaceIpAccessList:
1103
1605
  list_type=_enum(d, 'list_type', ListType))
1104
1606
 
1105
1607
 
1608
+ @dataclass
1609
+ class ReplaceResponse:
1610
+
1611
+ def as_dict(self) -> dict:
1612
+ """Serializes the ReplaceResponse into a dictionary suitable for use as a JSON request body."""
1613
+ body = {}
1614
+ return body
1615
+
1616
+ @classmethod
1617
+ def from_dict(cls, d: Dict[str, any]) -> ReplaceResponse:
1618
+ """Deserializes the ReplaceResponse from a dictionary."""
1619
+ return cls()
1620
+
1621
+
1106
1622
  @dataclass
1107
1623
  class RestrictWorkspaceAdminsMessage:
1108
1624
  status: RestrictWorkspaceAdminsMessageStatus
@@ -1179,6 +1695,34 @@ class RevokeTokenRequest:
1179
1695
  return cls(token_id=d.get('token_id', None))
1180
1696
 
1181
1697
 
1698
+ @dataclass
1699
+ class RevokeTokenResponse:
1700
+
1701
+ def as_dict(self) -> dict:
1702
+ """Serializes the RevokeTokenResponse into a dictionary suitable for use as a JSON request body."""
1703
+ body = {}
1704
+ return body
1705
+
1706
+ @classmethod
1707
+ def from_dict(cls, d: Dict[str, any]) -> RevokeTokenResponse:
1708
+ """Deserializes the RevokeTokenResponse from a dictionary."""
1709
+ return cls()
1710
+
1711
+
1712
+ @dataclass
1713
+ class SetStatusResponse:
1714
+
1715
+ def as_dict(self) -> dict:
1716
+ """Serializes the SetStatusResponse into a dictionary suitable for use as a JSON request body."""
1717
+ body = {}
1718
+ return body
1719
+
1720
+ @classmethod
1721
+ def from_dict(cls, d: Dict[str, any]) -> SetStatusResponse:
1722
+ """Deserializes the SetStatusResponse from a dictionary."""
1723
+ return cls()
1724
+
1725
+
1182
1726
  @dataclass
1183
1727
  class StringMessage:
1184
1728
  value: Optional[str] = None
@@ -1414,6 +1958,96 @@ class TokenType(Enum):
1414
1958
  AZURE_ACTIVE_DIRECTORY_TOKEN = 'AZURE_ACTIVE_DIRECTORY_TOKEN'
1415
1959
 
1416
1960
 
1961
+ @dataclass
1962
+ class UpdateAutomaticClusterUpdateSettingRequest:
1963
+ """Details required to update a setting."""
1964
+
1965
+ allow_missing: bool
1966
+ """This should always be set to true for Settings API. Added for AIP compliance."""
1967
+
1968
+ setting: AutomaticClusterUpdateSetting
1969
+
1970
+ field_mask: str
1971
+ """Field mask is required to be passed into the PATCH request. Field mask specifies which fields of
1972
+ the setting payload will be updated. The field mask needs to be supplied as single string. To
1973
+ specify multiple fields in the field mask, use comma as the separator (no space)."""
1974
+
1975
+ def as_dict(self) -> dict:
1976
+ """Serializes the UpdateAutomaticClusterUpdateSettingRequest into a dictionary suitable for use as a JSON request body."""
1977
+ body = {}
1978
+ if self.allow_missing is not None: body['allow_missing'] = self.allow_missing
1979
+ if self.field_mask is not None: body['field_mask'] = self.field_mask
1980
+ if self.setting: body['setting'] = self.setting.as_dict()
1981
+ return body
1982
+
1983
+ @classmethod
1984
+ def from_dict(cls, d: Dict[str, any]) -> UpdateAutomaticClusterUpdateSettingRequest:
1985
+ """Deserializes the UpdateAutomaticClusterUpdateSettingRequest from a dictionary."""
1986
+ return cls(allow_missing=d.get('allow_missing', None),
1987
+ field_mask=d.get('field_mask', None),
1988
+ setting=_from_dict(d, 'setting', AutomaticClusterUpdateSetting))
1989
+
1990
+
1991
+ @dataclass
1992
+ class UpdateCspEnablementAccountSettingRequest:
1993
+ """Details required to update a setting."""
1994
+
1995
+ allow_missing: bool
1996
+ """This should always be set to true for Settings API. Added for AIP compliance."""
1997
+
1998
+ setting: CspEnablementAccountSetting
1999
+
2000
+ field_mask: str
2001
+ """Field mask is required to be passed into the PATCH request. Field mask specifies which fields of
2002
+ the setting payload will be updated. The field mask needs to be supplied as single string. To
2003
+ specify multiple fields in the field mask, use comma as the separator (no space)."""
2004
+
2005
+ def as_dict(self) -> dict:
2006
+ """Serializes the UpdateCspEnablementAccountSettingRequest into a dictionary suitable for use as a JSON request body."""
2007
+ body = {}
2008
+ if self.allow_missing is not None: body['allow_missing'] = self.allow_missing
2009
+ if self.field_mask is not None: body['field_mask'] = self.field_mask
2010
+ if self.setting: body['setting'] = self.setting.as_dict()
2011
+ return body
2012
+
2013
+ @classmethod
2014
+ def from_dict(cls, d: Dict[str, any]) -> UpdateCspEnablementAccountSettingRequest:
2015
+ """Deserializes the UpdateCspEnablementAccountSettingRequest from a dictionary."""
2016
+ return cls(allow_missing=d.get('allow_missing', None),
2017
+ field_mask=d.get('field_mask', None),
2018
+ setting=_from_dict(d, 'setting', CspEnablementAccountSetting))
2019
+
2020
+
2021
+ @dataclass
2022
+ class UpdateCspEnablementSettingRequest:
2023
+ """Details required to update a setting."""
2024
+
2025
+ allow_missing: bool
2026
+ """This should always be set to true for Settings API. Added for AIP compliance."""
2027
+
2028
+ setting: CspEnablementSetting
2029
+
2030
+ field_mask: str
2031
+ """Field mask is required to be passed into the PATCH request. Field mask specifies which fields of
2032
+ the setting payload will be updated. The field mask needs to be supplied as single string. To
2033
+ specify multiple fields in the field mask, use comma as the separator (no space)."""
2034
+
2035
+ def as_dict(self) -> dict:
2036
+ """Serializes the UpdateCspEnablementSettingRequest into a dictionary suitable for use as a JSON request body."""
2037
+ body = {}
2038
+ if self.allow_missing is not None: body['allow_missing'] = self.allow_missing
2039
+ if self.field_mask is not None: body['field_mask'] = self.field_mask
2040
+ if self.setting: body['setting'] = self.setting.as_dict()
2041
+ return body
2042
+
2043
+ @classmethod
2044
+ def from_dict(cls, d: Dict[str, any]) -> UpdateCspEnablementSettingRequest:
2045
+ """Deserializes the UpdateCspEnablementSettingRequest from a dictionary."""
2046
+ return cls(allow_missing=d.get('allow_missing', None),
2047
+ field_mask=d.get('field_mask', None),
2048
+ setting=_from_dict(d, 'setting', CspEnablementSetting))
2049
+
2050
+
1417
2051
  @dataclass
1418
2052
  class UpdateDefaultNamespaceSettingRequest:
1419
2053
  """Details required to update a setting."""
@@ -1451,6 +2085,66 @@ class UpdateDefaultNamespaceSettingRequest:
1451
2085
  setting=_from_dict(d, 'setting', DefaultNamespaceSetting))
1452
2086
 
1453
2087
 
2088
+ @dataclass
2089
+ class UpdateEsmEnablementAccountSettingRequest:
2090
+ """Details required to update a setting."""
2091
+
2092
+ allow_missing: bool
2093
+ """This should always be set to true for Settings API. Added for AIP compliance."""
2094
+
2095
+ setting: EsmEnablementAccountSetting
2096
+
2097
+ field_mask: str
2098
+ """Field mask is required to be passed into the PATCH request. Field mask specifies which fields of
2099
+ the setting payload will be updated. The field mask needs to be supplied as single string. To
2100
+ specify multiple fields in the field mask, use comma as the separator (no space)."""
2101
+
2102
+ def as_dict(self) -> dict:
2103
+ """Serializes the UpdateEsmEnablementAccountSettingRequest into a dictionary suitable for use as a JSON request body."""
2104
+ body = {}
2105
+ if self.allow_missing is not None: body['allow_missing'] = self.allow_missing
2106
+ if self.field_mask is not None: body['field_mask'] = self.field_mask
2107
+ if self.setting: body['setting'] = self.setting.as_dict()
2108
+ return body
2109
+
2110
+ @classmethod
2111
+ def from_dict(cls, d: Dict[str, any]) -> UpdateEsmEnablementAccountSettingRequest:
2112
+ """Deserializes the UpdateEsmEnablementAccountSettingRequest from a dictionary."""
2113
+ return cls(allow_missing=d.get('allow_missing', None),
2114
+ field_mask=d.get('field_mask', None),
2115
+ setting=_from_dict(d, 'setting', EsmEnablementAccountSetting))
2116
+
2117
+
2118
+ @dataclass
2119
+ class UpdateEsmEnablementSettingRequest:
2120
+ """Details required to update a setting."""
2121
+
2122
+ allow_missing: bool
2123
+ """This should always be set to true for Settings API. Added for AIP compliance."""
2124
+
2125
+ setting: EsmEnablementSetting
2126
+
2127
+ field_mask: str
2128
+ """Field mask is required to be passed into the PATCH request. Field mask specifies which fields of
2129
+ the setting payload will be updated. The field mask needs to be supplied as single string. To
2130
+ specify multiple fields in the field mask, use comma as the separator (no space)."""
2131
+
2132
+ def as_dict(self) -> dict:
2133
+ """Serializes the UpdateEsmEnablementSettingRequest into a dictionary suitable for use as a JSON request body."""
2134
+ body = {}
2135
+ if self.allow_missing is not None: body['allow_missing'] = self.allow_missing
2136
+ if self.field_mask is not None: body['field_mask'] = self.field_mask
2137
+ if self.setting: body['setting'] = self.setting.as_dict()
2138
+ return body
2139
+
2140
+ @classmethod
2141
+ def from_dict(cls, d: Dict[str, any]) -> UpdateEsmEnablementSettingRequest:
2142
+ """Deserializes the UpdateEsmEnablementSettingRequest from a dictionary."""
2143
+ return cls(allow_missing=d.get('allow_missing', None),
2144
+ field_mask=d.get('field_mask', None),
2145
+ setting=_from_dict(d, 'setting', EsmEnablementSetting))
2146
+
2147
+
1454
2148
  @dataclass
1455
2149
  class UpdateIpAccessList:
1456
2150
  """Details required to update an IP access list."""
@@ -1522,6 +2216,20 @@ class UpdatePersonalComputeSettingRequest:
1522
2216
  setting=_from_dict(d, 'setting', PersonalComputeSetting))
1523
2217
 
1524
2218
 
2219
+ @dataclass
2220
+ class UpdateResponse:
2221
+
2222
+ def as_dict(self) -> dict:
2223
+ """Serializes the UpdateResponse into a dictionary suitable for use as a JSON request body."""
2224
+ body = {}
2225
+ return body
2226
+
2227
+ @classmethod
2228
+ def from_dict(cls, d: Dict[str, any]) -> UpdateResponse:
2229
+ """Deserializes the UpdateResponse from a dictionary."""
2230
+ return cls()
2231
+
2232
+
1525
2233
  @dataclass
1526
2234
  class UpdateRestrictWorkspaceAdminsSettingRequest:
1527
2235
  """Details required to update a setting."""
@@ -1615,6 +2323,7 @@ class AccountIpAccessListsAPI:
1615
2323
  if label is not None: body['label'] = label
1616
2324
  if list_type is not None: body['list_type'] = list_type.value
1617
2325
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2326
+
1618
2327
  res = self._api.do('POST',
1619
2328
  f'/api/2.0/accounts/{self._api.account_id}/ip-access-lists',
1620
2329
  body=body,
@@ -1633,6 +2342,7 @@ class AccountIpAccessListsAPI:
1633
2342
  """
1634
2343
 
1635
2344
  headers = {'Accept': 'application/json', }
2345
+
1636
2346
  self._api.do('DELETE',
1637
2347
  f'/api/2.0/accounts/{self._api.account_id}/ip-access-lists/{ip_access_list_id}',
1638
2348
  headers=headers)
@@ -1649,6 +2359,7 @@ class AccountIpAccessListsAPI:
1649
2359
  """
1650
2360
 
1651
2361
  headers = {'Accept': 'application/json', }
2362
+
1652
2363
  res = self._api.do('GET',
1653
2364
  f'/api/2.0/accounts/{self._api.account_id}/ip-access-lists/{ip_access_list_id}',
1654
2365
  headers=headers)
@@ -1663,6 +2374,7 @@ class AccountIpAccessListsAPI:
1663
2374
  """
1664
2375
 
1665
2376
  headers = {'Accept': 'application/json', }
2377
+
1666
2378
  json = self._api.do('GET',
1667
2379
  f'/api/2.0/accounts/{self._api.account_id}/ip-access-lists',
1668
2380
  headers=headers)
@@ -1709,6 +2421,7 @@ class AccountIpAccessListsAPI:
1709
2421
  if label is not None: body['label'] = label
1710
2422
  if list_type is not None: body['list_type'] = list_type.value
1711
2423
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2424
+
1712
2425
  self._api.do('PUT',
1713
2426
  f'/api/2.0/accounts/{self._api.account_id}/ip-access-lists/{ip_access_list_id}',
1714
2427
  body=body,
@@ -1758,6 +2471,7 @@ class AccountIpAccessListsAPI:
1758
2471
  if label is not None: body['label'] = label
1759
2472
  if list_type is not None: body['list_type'] = list_type.value
1760
2473
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2474
+
1761
2475
  self._api.do('PATCH',
1762
2476
  f'/api/2.0/accounts/{self._api.account_id}/ip-access-lists/{ip_access_list_id}',
1763
2477
  body=body,
@@ -1765,23 +2479,388 @@ class AccountIpAccessListsAPI:
1765
2479
 
1766
2480
 
1767
2481
  class AccountSettingsAPI:
1768
- """The Personal Compute enablement setting lets you control which users can use the Personal Compute default
1769
- policy to create compute resources. By default all users in all workspaces have access (ON), but you can
1770
- change the setting to instead let individual workspaces configure access control (DELEGATE).
2482
+ """Accounts Settings API allows users to manage settings at the account level."""
2483
+
2484
+ def __init__(self, api_client):
2485
+ self._api = api_client
2486
+
2487
+ self._csp_enablement_account = CspEnablementAccountAPI(self._api)
2488
+ self._esm_enablement_account = EsmEnablementAccountAPI(self._api)
2489
+ self._personal_compute = PersonalComputeAPI(self._api)
2490
+
2491
+ @property
2492
+ def csp_enablement_account(self) -> CspEnablementAccountAPI:
2493
+ """The compliance security profile settings at the account level control whether to enable it for new workspaces."""
2494
+ return self._csp_enablement_account
2495
+
2496
+ @property
2497
+ def esm_enablement_account(self) -> EsmEnablementAccountAPI:
2498
+ """The enhanced security monitoring setting at the account level controls whether to enable the feature on new workspaces."""
2499
+ return self._esm_enablement_account
2500
+
2501
+ @property
2502
+ def personal_compute(self) -> PersonalComputeAPI:
2503
+ """The Personal Compute enablement setting lets you control which users can use the Personal Compute default policy to create compute resources."""
2504
+ return self._personal_compute
2505
+
2506
+
2507
+ class AutomaticClusterUpdateAPI:
2508
+ """Controls whether automatic cluster update is enabled for the current workspace. By default, it is turned
2509
+ off."""
2510
+
2511
+ def __init__(self, api_client):
2512
+ self._api = api_client
2513
+
2514
+ def get(self, *, etag: Optional[str] = None) -> AutomaticClusterUpdateSetting:
2515
+ """Get the automatic cluster update setting.
2516
+
2517
+ Gets the automatic cluster update setting.
2518
+
2519
+ :param etag: str (optional)
2520
+ etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
2521
+ optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting
2522
+ each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern
2523
+ to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET
2524
+ request, and pass it with the DELETE request to identify the rule set version you are deleting.
2525
+
2526
+ :returns: :class:`AutomaticClusterUpdateSetting`
2527
+ """
2528
+
2529
+ query = {}
2530
+ if etag is not None: query['etag'] = etag
2531
+ headers = {'Accept': 'application/json', }
2532
+
2533
+ res = self._api.do('GET',
2534
+ '/api/2.0/settings/types/automatic_cluster_update/names/default',
2535
+ query=query,
2536
+ headers=headers)
2537
+ return AutomaticClusterUpdateSetting.from_dict(res)
2538
+
2539
+ def update(self, allow_missing: bool, setting: AutomaticClusterUpdateSetting,
2540
+ field_mask: str) -> AutomaticClusterUpdateSetting:
2541
+ """Update the automatic cluster update setting.
2542
+
2543
+ Updates the automatic cluster update setting for the workspace. A fresh etag needs to be provided in
2544
+ `PATCH` requests (as part of the setting field). The etag can be retrieved by making a `GET` request
2545
+ before the `PATCH` request. If the setting is updated concurrently, `PATCH` fails with 409 and the
2546
+ request must be retried by using the fresh etag in the 409 response.
2547
+
2548
+ :param allow_missing: bool
2549
+ This should always be set to true for Settings API. Added for AIP compliance.
2550
+ :param setting: :class:`AutomaticClusterUpdateSetting`
2551
+ :param field_mask: str
2552
+ Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the
2553
+ setting payload will be updated. The field mask needs to be supplied as single string. To specify
2554
+ multiple fields in the field mask, use comma as the separator (no space).
2555
+
2556
+ :returns: :class:`AutomaticClusterUpdateSetting`
2557
+ """
2558
+ body = {}
2559
+ if allow_missing is not None: body['allow_missing'] = allow_missing
2560
+ if field_mask is not None: body['field_mask'] = field_mask
2561
+ if setting is not None: body['setting'] = setting.as_dict()
2562
+ headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2563
+
2564
+ res = self._api.do('PATCH',
2565
+ '/api/2.0/settings/types/automatic_cluster_update/names/default',
2566
+ body=body,
2567
+ headers=headers)
2568
+ return AutomaticClusterUpdateSetting.from_dict(res)
2569
+
2570
+
2571
+ class CredentialsManagerAPI:
2572
+ """Credentials manager interacts with with Identity Providers to to perform token exchanges using stored
2573
+ credentials and refresh tokens."""
2574
+
2575
+ def __init__(self, api_client):
2576
+ self._api = api_client
2577
+
2578
+ def exchange_token(self, partition_id: PartitionId, token_type: List[TokenType],
2579
+ scopes: List[str]) -> ExchangeTokenResponse:
2580
+ """Exchange token.
2581
+
2582
+ Exchange tokens with an Identity Provider to get a new access token. It allows specifying scopes to
2583
+ determine token permissions.
2584
+
2585
+ :param partition_id: :class:`PartitionId`
2586
+ The partition of Credentials store
2587
+ :param token_type: List[:class:`TokenType`]
2588
+ A list of token types being requested
2589
+ :param scopes: List[str]
2590
+ Array of scopes for the token request.
2591
+
2592
+ :returns: :class:`ExchangeTokenResponse`
2593
+ """
2594
+ body = {}
2595
+ if partition_id is not None: body['partitionId'] = partition_id.as_dict()
2596
+ if scopes is not None: body['scopes'] = [v for v in scopes]
2597
+ if token_type is not None: body['tokenType'] = [v.value for v in token_type]
2598
+ headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2599
+
2600
+ res = self._api.do('POST',
2601
+ '/api/2.0/credentials-manager/exchange-tokens/token',
2602
+ body=body,
2603
+ headers=headers)
2604
+ return ExchangeTokenResponse.from_dict(res)
2605
+
2606
+
2607
+ class CspEnablementAPI:
2608
+ """Controls whether to enable the compliance security profile for the current workspace. Enabling it on a
2609
+ workspace is permanent. By default, it is turned off.
1771
2610
 
1772
- There is only one instance of this setting per account. Since this setting has a default value, this
1773
- setting is present on all accounts even though it's never set on a given account. Deletion reverts the
1774
- value of the setting back to the default value."""
2611
+ This settings can NOT be disabled once it is enabled."""
1775
2612
 
1776
2613
  def __init__(self, api_client):
1777
2614
  self._api = api_client
1778
2615
 
1779
- def delete_personal_compute_setting(self,
1780
- *,
1781
- etag: Optional[str] = None) -> DeletePersonalComputeSettingResponse:
1782
- """Delete Personal Compute setting.
2616
+ def get(self, *, etag: Optional[str] = None) -> CspEnablementSetting:
2617
+ """Get the compliance security profile setting.
1783
2618
 
1784
- Reverts back the Personal Compute setting value to default (ON)
2619
+ Gets the compliance security profile setting.
2620
+
2621
+ :param etag: str (optional)
2622
+ etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
2623
+ optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting
2624
+ each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern
2625
+ to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET
2626
+ request, and pass it with the DELETE request to identify the rule set version you are deleting.
2627
+
2628
+ :returns: :class:`CspEnablementSetting`
2629
+ """
2630
+
2631
+ query = {}
2632
+ if etag is not None: query['etag'] = etag
2633
+ headers = {'Accept': 'application/json', }
2634
+
2635
+ res = self._api.do('GET',
2636
+ '/api/2.0/settings/types/shield_csp_enablement_ws_db/names/default',
2637
+ query=query,
2638
+ headers=headers)
2639
+ return CspEnablementSetting.from_dict(res)
2640
+
2641
+ def update(self, allow_missing: bool, setting: CspEnablementSetting,
2642
+ field_mask: str) -> CspEnablementSetting:
2643
+ """Update the compliance security profile setting.
2644
+
2645
+ Updates the compliance security profile setting for the workspace. A fresh etag needs to be provided
2646
+ in `PATCH` requests (as part of the setting field). The etag can be retrieved by making a `GET`
2647
+ request before the `PATCH` request. If the setting is updated concurrently, `PATCH` fails with 409 and
2648
+ the request must be retried by using the fresh etag in the 409 response.
2649
+
2650
+ :param allow_missing: bool
2651
+ This should always be set to true for Settings API. Added for AIP compliance.
2652
+ :param setting: :class:`CspEnablementSetting`
2653
+ :param field_mask: str
2654
+ Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the
2655
+ setting payload will be updated. The field mask needs to be supplied as single string. To specify
2656
+ multiple fields in the field mask, use comma as the separator (no space).
2657
+
2658
+ :returns: :class:`CspEnablementSetting`
2659
+ """
2660
+ body = {}
2661
+ if allow_missing is not None: body['allow_missing'] = allow_missing
2662
+ if field_mask is not None: body['field_mask'] = field_mask
2663
+ if setting is not None: body['setting'] = setting.as_dict()
2664
+ headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2665
+
2666
+ res = self._api.do('PATCH',
2667
+ '/api/2.0/settings/types/shield_csp_enablement_ws_db/names/default',
2668
+ body=body,
2669
+ headers=headers)
2670
+ return CspEnablementSetting.from_dict(res)
2671
+
2672
+
2673
+ class CspEnablementAccountAPI:
2674
+ """The compliance security profile settings at the account level control whether to enable it for new
2675
+ workspaces. By default, this account-level setting is disabled for new workspaces. After workspace
2676
+ creation, account admins can enable the compliance security profile individually for each workspace.
2677
+
2678
+ This settings can be disabled so that new workspaces do not have compliance security profile enabled by
2679
+ default."""
2680
+
2681
+ def __init__(self, api_client):
2682
+ self._api = api_client
2683
+
2684
+ def get(self, *, etag: Optional[str] = None) -> CspEnablementAccountSetting:
2685
+ """Get the compliance security profile setting for new workspaces.
2686
+
2687
+ Gets the compliance security profile setting for new workspaces.
2688
+
2689
+ :param etag: str (optional)
2690
+ etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
2691
+ optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting
2692
+ each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern
2693
+ to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET
2694
+ request, and pass it with the DELETE request to identify the rule set version you are deleting.
2695
+
2696
+ :returns: :class:`CspEnablementAccountSetting`
2697
+ """
2698
+
2699
+ query = {}
2700
+ if etag is not None: query['etag'] = etag
2701
+ headers = {'Accept': 'application/json', }
2702
+
2703
+ res = self._api.do(
2704
+ 'GET',
2705
+ f'/api/2.0/accounts/{self._api.account_id}/settings/types/shield_csp_enablement_ac/names/default',
2706
+ query=query,
2707
+ headers=headers)
2708
+ return CspEnablementAccountSetting.from_dict(res)
2709
+
2710
+ def update(self, allow_missing: bool, setting: CspEnablementAccountSetting,
2711
+ field_mask: str) -> CspEnablementAccountSetting:
2712
+ """Update the compliance security profile setting for new workspaces.
2713
+
2714
+ Updates the value of the compliance security profile setting for new workspaces.
2715
+
2716
+ :param allow_missing: bool
2717
+ This should always be set to true for Settings API. Added for AIP compliance.
2718
+ :param setting: :class:`CspEnablementAccountSetting`
2719
+ :param field_mask: str
2720
+ Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the
2721
+ setting payload will be updated. The field mask needs to be supplied as single string. To specify
2722
+ multiple fields in the field mask, use comma as the separator (no space).
2723
+
2724
+ :returns: :class:`CspEnablementAccountSetting`
2725
+ """
2726
+ body = {}
2727
+ if allow_missing is not None: body['allow_missing'] = allow_missing
2728
+ if field_mask is not None: body['field_mask'] = field_mask
2729
+ if setting is not None: body['setting'] = setting.as_dict()
2730
+ headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2731
+
2732
+ res = self._api.do(
2733
+ 'PATCH',
2734
+ f'/api/2.0/accounts/{self._api.account_id}/settings/types/shield_csp_enablement_ac/names/default',
2735
+ body=body,
2736
+ headers=headers)
2737
+ return CspEnablementAccountSetting.from_dict(res)
2738
+
2739
+
2740
+ class DefaultNamespaceAPI:
2741
+ """The default namespace setting API allows users to configure the default namespace for a Databricks
2742
+ workspace.
2743
+
2744
+ Through this API, users can retrieve, set, or modify the default namespace used when queries do not
2745
+ reference a fully qualified three-level name. For example, if you use the API to set 'retail_prod' as the
2746
+ default catalog, then a query 'SELECT * FROM myTable' would reference the object
2747
+ 'retail_prod.default.myTable' (the schema 'default' is always assumed).
2748
+
2749
+ This setting requires a restart of clusters and SQL warehouses to take effect. Additionally, the default
2750
+ namespace only applies when using Unity Catalog-enabled compute."""
2751
+
2752
+ def __init__(self, api_client):
2753
+ self._api = api_client
2754
+
2755
+ def delete(self, *, etag: Optional[str] = None) -> DeleteDefaultNamespaceSettingResponse:
2756
+ """Delete the default namespace setting.
2757
+
2758
+ Deletes the default namespace setting for the workspace. A fresh etag needs to be provided in `DELETE`
2759
+ requests (as a query parameter). The etag can be retrieved by making a `GET` request before the
2760
+ `DELETE` request. If the setting is updated/deleted concurrently, `DELETE` fails with 409 and the
2761
+ request must be retried by using the fresh etag in the 409 response.
2762
+
2763
+ :param etag: str (optional)
2764
+ etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
2765
+ optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting
2766
+ each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern
2767
+ to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET
2768
+ request, and pass it with the DELETE request to identify the rule set version you are deleting.
2769
+
2770
+ :returns: :class:`DeleteDefaultNamespaceSettingResponse`
2771
+ """
2772
+
2773
+ query = {}
2774
+ if etag is not None: query['etag'] = etag
2775
+ headers = {'Accept': 'application/json', }
2776
+
2777
+ res = self._api.do('DELETE',
2778
+ '/api/2.0/settings/types/default_namespace_ws/names/default',
2779
+ query=query,
2780
+ headers=headers)
2781
+ return DeleteDefaultNamespaceSettingResponse.from_dict(res)
2782
+
2783
+ def get(self, *, etag: Optional[str] = None) -> DefaultNamespaceSetting:
2784
+ """Get the default namespace setting.
2785
+
2786
+ Gets the default namespace setting.
2787
+
2788
+ :param etag: str (optional)
2789
+ etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
2790
+ optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting
2791
+ each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern
2792
+ to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET
2793
+ request, and pass it with the DELETE request to identify the rule set version you are deleting.
2794
+
2795
+ :returns: :class:`DefaultNamespaceSetting`
2796
+ """
2797
+
2798
+ query = {}
2799
+ if etag is not None: query['etag'] = etag
2800
+ headers = {'Accept': 'application/json', }
2801
+
2802
+ res = self._api.do('GET',
2803
+ '/api/2.0/settings/types/default_namespace_ws/names/default',
2804
+ query=query,
2805
+ headers=headers)
2806
+ return DefaultNamespaceSetting.from_dict(res)
2807
+
2808
+ def update(self, allow_missing: bool, setting: DefaultNamespaceSetting,
2809
+ field_mask: str) -> DefaultNamespaceSetting:
2810
+ """Update the default namespace setting.
2811
+
2812
+ Updates the default namespace setting for the workspace. A fresh etag needs to be provided in `PATCH`
2813
+ requests (as part of the setting field). The etag can be retrieved by making a `GET` request before
2814
+ the `PATCH` request. Note that if the setting does not exist, `GET` returns a NOT_FOUND error and the
2815
+ etag is present in the error response, which should be set in the `PATCH` request. If the setting is
2816
+ updated concurrently, `PATCH` fails with 409 and the request must be retried by using the fresh etag
2817
+ in the 409 response.
2818
+
2819
+ :param allow_missing: bool
2820
+ This should always be set to true for Settings API. Added for AIP compliance.
2821
+ :param setting: :class:`DefaultNamespaceSetting`
2822
+ This represents the setting configuration for the default namespace in the Databricks workspace.
2823
+ Setting the default catalog for the workspace determines the catalog that is used when queries do
2824
+ not reference a fully qualified 3 level name. For example, if the default catalog is set to
2825
+ 'retail_prod' then a query 'SELECT * FROM myTable' would reference the object
2826
+ 'retail_prod.default.myTable' (the schema 'default' is always assumed). This setting requires a
2827
+ restart of clusters and SQL warehouses to take effect. Additionally, the default namespace only
2828
+ applies when using Unity Catalog-enabled compute.
2829
+ :param field_mask: str
2830
+ Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the
2831
+ setting payload will be updated. The field mask needs to be supplied as single string. To specify
2832
+ multiple fields in the field mask, use comma as the separator (no space).
2833
+
2834
+ :returns: :class:`DefaultNamespaceSetting`
2835
+ """
2836
+ body = {}
2837
+ if allow_missing is not None: body['allow_missing'] = allow_missing
2838
+ if field_mask is not None: body['field_mask'] = field_mask
2839
+ if setting is not None: body['setting'] = setting.as_dict()
2840
+ headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2841
+
2842
+ res = self._api.do('PATCH',
2843
+ '/api/2.0/settings/types/default_namespace_ws/names/default',
2844
+ body=body,
2845
+ headers=headers)
2846
+ return DefaultNamespaceSetting.from_dict(res)
2847
+
2848
+
2849
+ class EsmEnablementAPI:
2850
+ """Controls whether enhanced security monitoring is enabled for the current workspace. If the compliance
2851
+ security profile is enabled, this is automatically enabled. By default, it is disabled. However, if the
2852
+ compliance security profile is enabled, this is automatically enabled.
2853
+
2854
+ If the compliance security profile is disabled, you can enable or disable this setting and it is not
2855
+ permanent."""
2856
+
2857
+ def __init__(self, api_client):
2858
+ self._api = api_client
2859
+
2860
+ def get(self, *, etag: Optional[str] = None) -> EsmEnablementSetting:
2861
+ """Get the enhanced security monitoring setting.
2862
+
2863
+ Gets the enhanced security monitoring setting.
1785
2864
 
1786
2865
  :param etag: str (optional)
1787
2866
  etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
@@ -1790,23 +2869,63 @@ class AccountSettingsAPI:
1790
2869
  to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET
1791
2870
  request, and pass it with the DELETE request to identify the rule set version you are deleting.
1792
2871
 
1793
- :returns: :class:`DeletePersonalComputeSettingResponse`
2872
+ :returns: :class:`EsmEnablementSetting`
1794
2873
  """
1795
2874
 
1796
2875
  query = {}
1797
2876
  if etag is not None: query['etag'] = etag
1798
2877
  headers = {'Accept': 'application/json', }
1799
- res = self._api.do(
1800
- 'DELETE',
1801
- f'/api/2.0/accounts/{self._api.account_id}/settings/types/dcp_acct_enable/names/default',
1802
- query=query,
1803
- headers=headers)
1804
- return DeletePersonalComputeSettingResponse.from_dict(res)
1805
2878
 
1806
- def get_personal_compute_setting(self, *, etag: Optional[str] = None) -> PersonalComputeSetting:
1807
- """Get Personal Compute setting.
2879
+ res = self._api.do('GET',
2880
+ '/api/2.0/settings/types/shield_esm_enablement_ws_db/names/default',
2881
+ query=query,
2882
+ headers=headers)
2883
+ return EsmEnablementSetting.from_dict(res)
2884
+
2885
+ def update(self, allow_missing: bool, setting: EsmEnablementSetting,
2886
+ field_mask: str) -> EsmEnablementSetting:
2887
+ """Update the enhanced security monitoring setting.
1808
2888
 
1809
- Gets the value of the Personal Compute setting.
2889
+ Updates the enhanced security monitoring setting for the workspace. A fresh etag needs to be provided
2890
+ in `PATCH` requests (as part of the setting field). The etag can be retrieved by making a `GET`
2891
+ request before the `PATCH` request. If the setting is updated concurrently, `PATCH` fails with 409 and
2892
+ the request must be retried by using the fresh etag in the 409 response.
2893
+
2894
+ :param allow_missing: bool
2895
+ This should always be set to true for Settings API. Added for AIP compliance.
2896
+ :param setting: :class:`EsmEnablementSetting`
2897
+ :param field_mask: str
2898
+ Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the
2899
+ setting payload will be updated. The field mask needs to be supplied as single string. To specify
2900
+ multiple fields in the field mask, use comma as the separator (no space).
2901
+
2902
+ :returns: :class:`EsmEnablementSetting`
2903
+ """
2904
+ body = {}
2905
+ if allow_missing is not None: body['allow_missing'] = allow_missing
2906
+ if field_mask is not None: body['field_mask'] = field_mask
2907
+ if setting is not None: body['setting'] = setting.as_dict()
2908
+ headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2909
+
2910
+ res = self._api.do('PATCH',
2911
+ '/api/2.0/settings/types/shield_esm_enablement_ws_db/names/default',
2912
+ body=body,
2913
+ headers=headers)
2914
+ return EsmEnablementSetting.from_dict(res)
2915
+
2916
+
2917
+ class EsmEnablementAccountAPI:
2918
+ """The enhanced security monitoring setting at the account level controls whether to enable the feature on
2919
+ new workspaces. By default, this account-level setting is disabled for new workspaces. After workspace
2920
+ creation, account admins can enable enhanced security monitoring individually for each workspace."""
2921
+
2922
+ def __init__(self, api_client):
2923
+ self._api = api_client
2924
+
2925
+ def get(self, *, etag: Optional[str] = None) -> EsmEnablementAccountSetting:
2926
+ """Get the enhanced security monitoring setting for new workspaces.
2927
+
2928
+ Gets the enhanced security monitoring setting for new workspaces.
1810
2929
 
1811
2930
  :param etag: str (optional)
1812
2931
  etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
@@ -1815,81 +2934,48 @@ class AccountSettingsAPI:
1815
2934
  to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET
1816
2935
  request, and pass it with the DELETE request to identify the rule set version you are deleting.
1817
2936
 
1818
- :returns: :class:`PersonalComputeSetting`
2937
+ :returns: :class:`EsmEnablementAccountSetting`
1819
2938
  """
1820
2939
 
1821
2940
  query = {}
1822
2941
  if etag is not None: query['etag'] = etag
1823
2942
  headers = {'Accept': 'application/json', }
2943
+
1824
2944
  res = self._api.do(
1825
2945
  'GET',
1826
- f'/api/2.0/accounts/{self._api.account_id}/settings/types/dcp_acct_enable/names/default',
2946
+ f'/api/2.0/accounts/{self._api.account_id}/settings/types/shield_esm_enablement_ac/names/default',
1827
2947
  query=query,
1828
2948
  headers=headers)
1829
- return PersonalComputeSetting.from_dict(res)
2949
+ return EsmEnablementAccountSetting.from_dict(res)
1830
2950
 
1831
- def update_personal_compute_setting(self, allow_missing: bool, setting: PersonalComputeSetting,
1832
- field_mask: str) -> PersonalComputeSetting:
1833
- """Update Personal Compute setting.
2951
+ def update(self, allow_missing: bool, setting: EsmEnablementAccountSetting,
2952
+ field_mask: str) -> EsmEnablementAccountSetting:
2953
+ """Update the enhanced security monitoring setting for new workspaces.
1834
2954
 
1835
- Updates the value of the Personal Compute setting.
2955
+ Updates the value of the enhanced security monitoring setting for new workspaces.
1836
2956
 
1837
2957
  :param allow_missing: bool
1838
2958
  This should always be set to true for Settings API. Added for AIP compliance.
1839
- :param setting: :class:`PersonalComputeSetting`
2959
+ :param setting: :class:`EsmEnablementAccountSetting`
1840
2960
  :param field_mask: str
1841
2961
  Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the
1842
2962
  setting payload will be updated. The field mask needs to be supplied as single string. To specify
1843
2963
  multiple fields in the field mask, use comma as the separator (no space).
1844
2964
 
1845
- :returns: :class:`PersonalComputeSetting`
2965
+ :returns: :class:`EsmEnablementAccountSetting`
1846
2966
  """
1847
2967
  body = {}
1848
2968
  if allow_missing is not None: body['allow_missing'] = allow_missing
1849
2969
  if field_mask is not None: body['field_mask'] = field_mask
1850
2970
  if setting is not None: body['setting'] = setting.as_dict()
1851
2971
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2972
+
1852
2973
  res = self._api.do(
1853
2974
  'PATCH',
1854
- f'/api/2.0/accounts/{self._api.account_id}/settings/types/dcp_acct_enable/names/default',
2975
+ f'/api/2.0/accounts/{self._api.account_id}/settings/types/shield_esm_enablement_ac/names/default',
1855
2976
  body=body,
1856
2977
  headers=headers)
1857
- return PersonalComputeSetting.from_dict(res)
1858
-
1859
-
1860
- class CredentialsManagerAPI:
1861
- """Credentials manager interacts with with Identity Providers to to perform token exchanges using stored
1862
- credentials and refresh tokens."""
1863
-
1864
- def __init__(self, api_client):
1865
- self._api = api_client
1866
-
1867
- def exchange_token(self, partition_id: PartitionId, token_type: List[TokenType],
1868
- scopes: List[str]) -> ExchangeTokenResponse:
1869
- """Exchange token.
1870
-
1871
- Exchange tokens with an Identity Provider to get a new access token. It allows specifying scopes to
1872
- determine token permissions.
1873
-
1874
- :param partition_id: :class:`PartitionId`
1875
- The partition of Credentials store
1876
- :param token_type: List[:class:`TokenType`]
1877
- A list of token types being requested
1878
- :param scopes: List[str]
1879
- Array of scopes for the token request.
1880
-
1881
- :returns: :class:`ExchangeTokenResponse`
1882
- """
1883
- body = {}
1884
- if partition_id is not None: body['partitionId'] = partition_id.as_dict()
1885
- if scopes is not None: body['scopes'] = [v for v in scopes]
1886
- if token_type is not None: body['tokenType'] = [v.value for v in token_type]
1887
- headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
1888
- res = self._api.do('POST',
1889
- '/api/2.0/credentials-manager/exchange-tokens/token',
1890
- body=body,
1891
- headers=headers)
1892
- return ExchangeTokenResponse.from_dict(res)
2978
+ return EsmEnablementAccountSetting.from_dict(res)
1893
2979
 
1894
2980
 
1895
2981
  class IpAccessListsAPI:
@@ -1952,6 +3038,7 @@ class IpAccessListsAPI:
1952
3038
  if label is not None: body['label'] = label
1953
3039
  if list_type is not None: body['list_type'] = list_type.value
1954
3040
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
3041
+
1955
3042
  res = self._api.do('POST', '/api/2.0/ip-access-lists', body=body, headers=headers)
1956
3043
  return CreateIpAccessListResponse.from_dict(res)
1957
3044
 
@@ -1967,6 +3054,7 @@ class IpAccessListsAPI:
1967
3054
  """
1968
3055
 
1969
3056
  headers = {'Accept': 'application/json', }
3057
+
1970
3058
  self._api.do('DELETE', f'/api/2.0/ip-access-lists/{ip_access_list_id}', headers=headers)
1971
3059
 
1972
3060
  def get(self, ip_access_list_id: str) -> FetchIpAccessListResponse:
@@ -1981,6 +3069,7 @@ class IpAccessListsAPI:
1981
3069
  """
1982
3070
 
1983
3071
  headers = {'Accept': 'application/json', }
3072
+
1984
3073
  res = self._api.do('GET', f'/api/2.0/ip-access-lists/{ip_access_list_id}', headers=headers)
1985
3074
  return FetchIpAccessListResponse.from_dict(res)
1986
3075
 
@@ -1993,6 +3082,7 @@ class IpAccessListsAPI:
1993
3082
  """
1994
3083
 
1995
3084
  headers = {'Accept': 'application/json', }
3085
+
1996
3086
  json = self._api.do('GET', '/api/2.0/ip-access-lists', headers=headers)
1997
3087
  parsed = ListIpAccessListResponse.from_dict(json).ip_access_lists
1998
3088
  return parsed if parsed is not None else []
@@ -2038,6 +3128,7 @@ class IpAccessListsAPI:
2038
3128
  if label is not None: body['label'] = label
2039
3129
  if list_type is not None: body['list_type'] = list_type.value
2040
3130
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
3131
+
2041
3132
  self._api.do('PUT', f'/api/2.0/ip-access-lists/{ip_access_list_id}', body=body, headers=headers)
2042
3133
 
2043
3134
  def update(self,
@@ -2085,17 +3176,13 @@ class IpAccessListsAPI:
2085
3176
  if label is not None: body['label'] = label
2086
3177
  if list_type is not None: body['list_type'] = list_type.value
2087
3178
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
3179
+
2088
3180
  self._api.do('PATCH', f'/api/2.0/ip-access-lists/{ip_access_list_id}', body=body, headers=headers)
2089
3181
 
2090
3182
 
2091
3183
  class NetworkConnectivityAPI:
2092
3184
  """These APIs provide configurations for the network connectivity of your workspaces for serverless compute
2093
- resources. This API provides stable subnets for your workspace so that you can configure your firewalls on
2094
- your Azure Storage accounts to allow access from Databricks. You can also use the API to provision private
2095
- endpoints for Databricks to privately connect serverless compute resources to your Azure resources using
2096
- Azure Private Link. See [configure serverless secure connectivity].
2097
-
2098
- [configure serverless secure connectivity]: https://learn.microsoft.com/azure/databricks/security/network/serverless-network-security"""
3185
+ resources."""
2099
3186
 
2100
3187
  def __init__(self, api_client):
2101
3188
  self._api = api_client
@@ -2104,25 +3191,13 @@ class NetworkConnectivityAPI:
2104
3191
  region: str) -> NetworkConnectivityConfiguration:
2105
3192
  """Create a network connectivity configuration.
2106
3193
 
2107
- Creates a network connectivity configuration (NCC), which provides stable Azure service subnets when
2108
- accessing your Azure Storage accounts. You can also use a network connectivity configuration to create
2109
- Databricks-managed private endpoints so that Databricks serverless compute resources privately access
2110
- your resources.
2111
-
2112
- **IMPORTANT**: After you create the network connectivity configuration, you must assign one or more
2113
- workspaces to the new network connectivity configuration. You can share one network connectivity
2114
- configuration with multiple workspaces from the same Azure region within the same Databricks account.
2115
- See [configure serverless secure connectivity].
2116
-
2117
- [configure serverless secure connectivity]: https://learn.microsoft.com/azure/databricks/security/network/serverless-network-security
2118
-
2119
3194
  :param name: str
2120
3195
  The name of the network connectivity configuration. The name can contain alphanumeric characters,
2121
3196
  hyphens, and underscores. The length must be between 3 and 30 characters. The name must match the
2122
3197
  regular expression `^[0-9a-zA-Z-_]{3,30}$`.
2123
3198
  :param region: str
2124
- The Azure region for this network connectivity configuration. Only workspaces in the same Azure
2125
- region can be attached to this network connectivity configuration.
3199
+ The region for the network connectivity configuration. Only workspaces in the same region can be
3200
+ attached to the network connectivity configuration.
2126
3201
 
2127
3202
  :returns: :class:`NetworkConnectivityConfiguration`
2128
3203
  """
@@ -2130,6 +3205,7 @@ class NetworkConnectivityAPI:
2130
3205
  if name is not None: body['name'] = name
2131
3206
  if region is not None: body['region'] = region
2132
3207
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
3208
+
2133
3209
  res = self._api.do('POST',
2134
3210
  f'/api/2.0/accounts/{self._api.account_id}/network-connectivity-configs',
2135
3211
  body=body,
@@ -2165,6 +3241,7 @@ class NetworkConnectivityAPI:
2165
3241
  if group_id is not None: body['group_id'] = group_id.value
2166
3242
  if resource_id is not None: body['resource_id'] = resource_id
2167
3243
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
3244
+
2168
3245
  res = self._api.do(
2169
3246
  'POST',
2170
3247
  f'/api/2.0/accounts/{self._api.account_id}/network-connectivity-configs/{network_connectivity_config_id}/private-endpoint-rules',
@@ -2184,6 +3261,7 @@ class NetworkConnectivityAPI:
2184
3261
  """
2185
3262
 
2186
3263
  headers = {'Accept': 'application/json', }
3264
+
2187
3265
  self._api.do(
2188
3266
  'DELETE',
2189
3267
  f'/api/2.0/accounts/{self._api.account_id}/network-connectivity-configs/{network_connectivity_config_id}',
@@ -2207,6 +3285,7 @@ class NetworkConnectivityAPI:
2207
3285
  """
2208
3286
 
2209
3287
  headers = {'Accept': 'application/json', }
3288
+
2210
3289
  res = self._api.do(
2211
3290
  'DELETE',
2212
3291
  f'/api/2.0/accounts/{self._api.account_id}/network-connectivity-configs/{network_connectivity_config_id}/private-endpoint-rules/{private_endpoint_rule_id}',
@@ -2226,6 +3305,7 @@ class NetworkConnectivityAPI:
2226
3305
  """
2227
3306
 
2228
3307
  headers = {'Accept': 'application/json', }
3308
+
2229
3309
  res = self._api.do(
2230
3310
  'GET',
2231
3311
  f'/api/2.0/accounts/{self._api.account_id}/network-connectivity-configs/{network_connectivity_config_id}',
@@ -2247,6 +3327,7 @@ class NetworkConnectivityAPI:
2247
3327
  """
2248
3328
 
2249
3329
  headers = {'Accept': 'application/json', }
3330
+
2250
3331
  res = self._api.do(
2251
3332
  'GET',
2252
3333
  f'/api/2.0/accounts/{self._api.account_id}/network-connectivity-configs/{network_connectivity_config_id}/private-endpoint-rules/{private_endpoint_rule_id}',
@@ -2318,30 +3399,22 @@ class NetworkConnectivityAPI:
2318
3399
  query['page_token'] = json['next_page_token']
2319
3400
 
2320
3401
 
2321
- class SettingsAPI:
2322
- """The default namespace setting API allows users to configure the default namespace for a Databricks
2323
- workspace.
2324
-
2325
- Through this API, users can retrieve, set, or modify the default namespace used when queries do not
2326
- reference a fully qualified three-level name. For example, if you use the API to set 'retail_prod' as the
2327
- default catalog, then a query 'SELECT * FROM myTable' would reference the object
2328
- 'retail_prod.default.myTable' (the schema 'default' is always assumed).
3402
+ class PersonalComputeAPI:
3403
+ """The Personal Compute enablement setting lets you control which users can use the Personal Compute default
3404
+ policy to create compute resources. By default all users in all workspaces have access (ON), but you can
3405
+ change the setting to instead let individual workspaces configure access control (DELEGATE).
2329
3406
 
2330
- This setting requires a restart of clusters and SQL warehouses to take effect. Additionally, the default
2331
- namespace only applies when using Unity Catalog-enabled compute."""
3407
+ There is only one instance of this setting per account. Since this setting has a default value, this
3408
+ setting is present on all accounts even though it's never set on a given account. Deletion reverts the
3409
+ value of the setting back to the default value."""
2332
3410
 
2333
3411
  def __init__(self, api_client):
2334
3412
  self._api = api_client
2335
3413
 
2336
- def delete_default_namespace_setting(self,
2337
- *,
2338
- etag: Optional[str] = None) -> DeleteDefaultNamespaceSettingResponse:
2339
- """Delete the default namespace setting.
3414
+ def delete(self, *, etag: Optional[str] = None) -> DeletePersonalComputeSettingResponse:
3415
+ """Delete Personal Compute setting.
2340
3416
 
2341
- Deletes the default namespace setting for the workspace. A fresh etag needs to be provided in DELETE
2342
- requests (as a query parameter). The etag can be retrieved by making a GET request before the DELETE
2343
- request. If the setting is updated/deleted concurrently, DELETE will fail with 409 and the request
2344
- will need to be retried by using the fresh etag in the 409 response.
3417
+ Reverts back the Personal Compute setting value to default (ON)
2345
3418
 
2346
3419
  :param etag: str (optional)
2347
3420
  etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
@@ -2350,28 +3423,24 @@ class SettingsAPI:
2350
3423
  to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET
2351
3424
  request, and pass it with the DELETE request to identify the rule set version you are deleting.
2352
3425
 
2353
- :returns: :class:`DeleteDefaultNamespaceSettingResponse`
3426
+ :returns: :class:`DeletePersonalComputeSettingResponse`
2354
3427
  """
2355
3428
 
2356
3429
  query = {}
2357
3430
  if etag is not None: query['etag'] = etag
2358
3431
  headers = {'Accept': 'application/json', }
2359
- res = self._api.do('DELETE',
2360
- '/api/2.0/settings/types/default_namespace_ws/names/default',
2361
- query=query,
2362
- headers=headers)
2363
- return DeleteDefaultNamespaceSettingResponse.from_dict(res)
2364
3432
 
2365
- def delete_restrict_workspace_admins_setting(self,
2366
- *,
2367
- etag: Optional[str] = None
2368
- ) -> DeleteRestrictWorkspaceAdminsSettingResponse:
2369
- """Delete the restrict workspace admins setting.
3433
+ res = self._api.do(
3434
+ 'DELETE',
3435
+ f'/api/2.0/accounts/{self._api.account_id}/settings/types/dcp_acct_enable/names/default',
3436
+ query=query,
3437
+ headers=headers)
3438
+ return DeletePersonalComputeSettingResponse.from_dict(res)
3439
+
3440
+ def get(self, *, etag: Optional[str] = None) -> PersonalComputeSetting:
3441
+ """Get Personal Compute setting.
2370
3442
 
2371
- Reverts the restrict workspace admins setting status for the workspace. A fresh etag needs to be
2372
- provided in DELETE requests (as a query parameter). The etag can be retrieved by making a GET request
2373
- before the DELETE request. If the setting is updated/deleted concurrently, DELETE will fail with 409
2374
- and the request will need to be retried by using the fresh etag in the 409 response.
3443
+ Gets the value of the Personal Compute setting.
2375
3444
 
2376
3445
  :param etag: str (optional)
2377
3446
  etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
@@ -2380,22 +3449,71 @@ class SettingsAPI:
2380
3449
  to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET
2381
3450
  request, and pass it with the DELETE request to identify the rule set version you are deleting.
2382
3451
 
2383
- :returns: :class:`DeleteRestrictWorkspaceAdminsSettingResponse`
3452
+ :returns: :class:`PersonalComputeSetting`
2384
3453
  """
2385
3454
 
2386
3455
  query = {}
2387
3456
  if etag is not None: query['etag'] = etag
2388
3457
  headers = {'Accept': 'application/json', }
2389
- res = self._api.do('DELETE',
2390
- '/api/2.0/settings/types/restrict_workspace_admins/names/default',
2391
- query=query,
2392
- headers=headers)
2393
- return DeleteRestrictWorkspaceAdminsSettingResponse.from_dict(res)
2394
3458
 
2395
- def get_default_namespace_setting(self, *, etag: Optional[str] = None) -> DefaultNamespaceSetting:
2396
- """Get the default namespace setting.
3459
+ res = self._api.do(
3460
+ 'GET',
3461
+ f'/api/2.0/accounts/{self._api.account_id}/settings/types/dcp_acct_enable/names/default',
3462
+ query=query,
3463
+ headers=headers)
3464
+ return PersonalComputeSetting.from_dict(res)
3465
+
3466
+ def update(self, allow_missing: bool, setting: PersonalComputeSetting,
3467
+ field_mask: str) -> PersonalComputeSetting:
3468
+ """Update Personal Compute setting.
2397
3469
 
2398
- Gets the default namespace setting.
3470
+ Updates the value of the Personal Compute setting.
3471
+
3472
+ :param allow_missing: bool
3473
+ This should always be set to true for Settings API. Added for AIP compliance.
3474
+ :param setting: :class:`PersonalComputeSetting`
3475
+ :param field_mask: str
3476
+ Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the
3477
+ setting payload will be updated. The field mask needs to be supplied as single string. To specify
3478
+ multiple fields in the field mask, use comma as the separator (no space).
3479
+
3480
+ :returns: :class:`PersonalComputeSetting`
3481
+ """
3482
+ body = {}
3483
+ if allow_missing is not None: body['allow_missing'] = allow_missing
3484
+ if field_mask is not None: body['field_mask'] = field_mask
3485
+ if setting is not None: body['setting'] = setting.as_dict()
3486
+ headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
3487
+
3488
+ res = self._api.do(
3489
+ 'PATCH',
3490
+ f'/api/2.0/accounts/{self._api.account_id}/settings/types/dcp_acct_enable/names/default',
3491
+ body=body,
3492
+ headers=headers)
3493
+ return PersonalComputeSetting.from_dict(res)
3494
+
3495
+
3496
+ class RestrictWorkspaceAdminsAPI:
3497
+ """The Restrict Workspace Admins setting lets you control the capabilities of workspace admins. With the
3498
+ setting status set to ALLOW_ALL, workspace admins can create service principal personal access tokens on
3499
+ behalf of any service principal in their workspace. Workspace admins can also change a job owner to any
3500
+ user in their workspace. And they can change the job run_as setting to any user in their workspace or to a
3501
+ service principal on which they have the Service Principal User role. With the setting status set to
3502
+ RESTRICT_TOKENS_AND_JOB_RUN_AS, workspace admins can only create personal access tokens on behalf of
3503
+ service principals they have the Service Principal User role on. They can also only change a job owner to
3504
+ themselves. And they can change the job run_as setting to themselves or to a service principal on which
3505
+ they have the Service Principal User role."""
3506
+
3507
+ def __init__(self, api_client):
3508
+ self._api = api_client
3509
+
3510
+ def delete(self, *, etag: Optional[str] = None) -> DeleteRestrictWorkspaceAdminsSettingResponse:
3511
+ """Delete the restrict workspace admins setting.
3512
+
3513
+ Reverts the restrict workspace admins setting status for the workspace. A fresh etag needs to be
3514
+ provided in `DELETE` requests (as a query parameter). The etag can be retrieved by making a `GET`
3515
+ request before the DELETE request. If the setting is updated/deleted concurrently, `DELETE` fails with
3516
+ 409 and the request must be retried by using the fresh etag in the 409 response.
2399
3517
 
2400
3518
  :param etag: str (optional)
2401
3519
  etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
@@ -2404,21 +3522,20 @@ class SettingsAPI:
2404
3522
  to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET
2405
3523
  request, and pass it with the DELETE request to identify the rule set version you are deleting.
2406
3524
 
2407
- :returns: :class:`DefaultNamespaceSetting`
3525
+ :returns: :class:`DeleteRestrictWorkspaceAdminsSettingResponse`
2408
3526
  """
2409
3527
 
2410
3528
  query = {}
2411
3529
  if etag is not None: query['etag'] = etag
2412
3530
  headers = {'Accept': 'application/json', }
2413
- res = self._api.do('GET',
2414
- '/api/2.0/settings/types/default_namespace_ws/names/default',
3531
+
3532
+ res = self._api.do('DELETE',
3533
+ '/api/2.0/settings/types/restrict_workspace_admins/names/default',
2415
3534
  query=query,
2416
3535
  headers=headers)
2417
- return DefaultNamespaceSetting.from_dict(res)
3536
+ return DeleteRestrictWorkspaceAdminsSettingResponse.from_dict(res)
2418
3537
 
2419
- def get_restrict_workspace_admins_setting(self,
2420
- *,
2421
- etag: Optional[str] = None) -> RestrictWorkspaceAdminsSetting:
3538
+ def get(self, *, etag: Optional[str] = None) -> RestrictWorkspaceAdminsSetting:
2422
3539
  """Get the restrict workspace admins setting.
2423
3540
 
2424
3541
  Gets the restrict workspace admins setting.
@@ -2436,60 +3553,21 @@ class SettingsAPI:
2436
3553
  query = {}
2437
3554
  if etag is not None: query['etag'] = etag
2438
3555
  headers = {'Accept': 'application/json', }
3556
+
2439
3557
  res = self._api.do('GET',
2440
3558
  '/api/2.0/settings/types/restrict_workspace_admins/names/default',
2441
3559
  query=query,
2442
3560
  headers=headers)
2443
3561
  return RestrictWorkspaceAdminsSetting.from_dict(res)
2444
3562
 
2445
- def update_default_namespace_setting(self, allow_missing: bool, setting: DefaultNamespaceSetting,
2446
- field_mask: str) -> DefaultNamespaceSetting:
2447
- """Update the default namespace setting.
2448
-
2449
- Updates the default namespace setting for the workspace. A fresh etag needs to be provided in PATCH
2450
- requests (as part of the setting field). The etag can be retrieved by making a GET request before the
2451
- PATCH request. Note that if the setting does not exist, GET will return a NOT_FOUND error and the etag
2452
- will be present in the error response, which should be set in the PATCH request. If the setting is
2453
- updated concurrently, PATCH will fail with 409 and the request will need to be retried by using the
2454
- fresh etag in the 409 response.
2455
-
2456
- :param allow_missing: bool
2457
- This should always be set to true for Settings API. Added for AIP compliance.
2458
- :param setting: :class:`DefaultNamespaceSetting`
2459
- This represents the setting configuration for the default namespace in the Databricks workspace.
2460
- Setting the default catalog for the workspace determines the catalog that is used when queries do
2461
- not reference a fully qualified 3 level name. For example, if the default catalog is set to
2462
- 'retail_prod' then a query 'SELECT * FROM myTable' would reference the object
2463
- 'retail_prod.default.myTable' (the schema 'default' is always assumed). This setting requires a
2464
- restart of clusters and SQL warehouses to take effect. Additionally, the default namespace only
2465
- applies when using Unity Catalog-enabled compute.
2466
- :param field_mask: str
2467
- Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the
2468
- setting payload will be updated. The field mask needs to be supplied as single string. To specify
2469
- multiple fields in the field mask, use comma as the separator (no space).
2470
-
2471
- :returns: :class:`DefaultNamespaceSetting`
2472
- """
2473
- body = {}
2474
- if allow_missing is not None: body['allow_missing'] = allow_missing
2475
- if field_mask is not None: body['field_mask'] = field_mask
2476
- if setting is not None: body['setting'] = setting.as_dict()
2477
- headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2478
- res = self._api.do('PATCH',
2479
- '/api/2.0/settings/types/default_namespace_ws/names/default',
2480
- body=body,
2481
- headers=headers)
2482
- return DefaultNamespaceSetting.from_dict(res)
2483
-
2484
- def update_restrict_workspace_admins_setting(self, allow_missing: bool,
2485
- setting: RestrictWorkspaceAdminsSetting,
2486
- field_mask: str) -> RestrictWorkspaceAdminsSetting:
3563
+ def update(self, allow_missing: bool, setting: RestrictWorkspaceAdminsSetting,
3564
+ field_mask: str) -> RestrictWorkspaceAdminsSetting:
2487
3565
  """Update the restrict workspace admins setting.
2488
3566
 
2489
3567
  Updates the restrict workspace admins setting for the workspace. A fresh etag needs to be provided in
2490
- PATCH requests (as part of the setting field). The etag can be retrieved by making a GET request
2491
- before the PATCH request. If the setting is updated concurrently, PATCH will fail with 409 and the
2492
- request will need to be retried by using the fresh etag in the 409 response.
3568
+ `PATCH` requests (as part of the setting field). The etag can be retrieved by making a GET request
3569
+ before the `PATCH` request. If the setting is updated concurrently, `PATCH` fails with 409 and the
3570
+ request must be retried by using the fresh etag in the 409 response.
2493
3571
 
2494
3572
  :param allow_missing: bool
2495
3573
  This should always be set to true for Settings API. Added for AIP compliance.
@@ -2506,6 +3584,7 @@ class SettingsAPI:
2506
3584
  if field_mask is not None: body['field_mask'] = field_mask
2507
3585
  if setting is not None: body['setting'] = setting.as_dict()
2508
3586
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
3587
+
2509
3588
  res = self._api.do('PATCH',
2510
3589
  '/api/2.0/settings/types/restrict_workspace_admins/names/default',
2511
3590
  body=body,
@@ -2513,6 +3592,44 @@ class SettingsAPI:
2513
3592
  return RestrictWorkspaceAdminsSetting.from_dict(res)
2514
3593
 
2515
3594
 
3595
+ class SettingsAPI:
3596
+ """Workspace Settings API allows users to manage settings at the workspace level."""
3597
+
3598
+ def __init__(self, api_client):
3599
+ self._api = api_client
3600
+
3601
+ self._automatic_cluster_update = AutomaticClusterUpdateAPI(self._api)
3602
+ self._csp_enablement = CspEnablementAPI(self._api)
3603
+ self._default_namespace = DefaultNamespaceAPI(self._api)
3604
+ self._esm_enablement = EsmEnablementAPI(self._api)
3605
+ self._restrict_workspace_admins = RestrictWorkspaceAdminsAPI(self._api)
3606
+
3607
+ @property
3608
+ def automatic_cluster_update(self) -> AutomaticClusterUpdateAPI:
3609
+ """Controls whether automatic cluster update is enabled for the current workspace."""
3610
+ return self._automatic_cluster_update
3611
+
3612
+ @property
3613
+ def csp_enablement(self) -> CspEnablementAPI:
3614
+ """Controls whether to enable the compliance security profile for the current workspace."""
3615
+ return self._csp_enablement
3616
+
3617
+ @property
3618
+ def default_namespace(self) -> DefaultNamespaceAPI:
3619
+ """The default namespace setting API allows users to configure the default namespace for a Databricks workspace."""
3620
+ return self._default_namespace
3621
+
3622
+ @property
3623
+ def esm_enablement(self) -> EsmEnablementAPI:
3624
+ """Controls whether enhanced security monitoring is enabled for the current workspace."""
3625
+ return self._esm_enablement
3626
+
3627
+ @property
3628
+ def restrict_workspace_admins(self) -> RestrictWorkspaceAdminsAPI:
3629
+ """The Restrict Workspace Admins setting lets you control the capabilities of workspace admins."""
3630
+ return self._restrict_workspace_admins
3631
+
3632
+
2516
3633
  class TokenManagementAPI:
2517
3634
  """Enables administrators to get all tokens and delete tokens for other users. Admins can either get every
2518
3635
  token, get a specific token by ID, or get all tokens for a particular user."""
@@ -2543,6 +3660,7 @@ class TokenManagementAPI:
2543
3660
  if comment is not None: body['comment'] = comment
2544
3661
  if lifetime_seconds is not None: body['lifetime_seconds'] = lifetime_seconds
2545
3662
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
3663
+
2546
3664
  res = self._api.do('POST',
2547
3665
  '/api/2.0/token-management/on-behalf-of/tokens',
2548
3666
  body=body,
@@ -2561,6 +3679,7 @@ class TokenManagementAPI:
2561
3679
  """
2562
3680
 
2563
3681
  headers = {'Accept': 'application/json', }
3682
+
2564
3683
  self._api.do('DELETE', f'/api/2.0/token-management/tokens/{token_id}', headers=headers)
2565
3684
 
2566
3685
  def get(self, token_id: str) -> GetTokenResponse:
@@ -2575,6 +3694,7 @@ class TokenManagementAPI:
2575
3694
  """
2576
3695
 
2577
3696
  headers = {'Accept': 'application/json', }
3697
+
2578
3698
  res = self._api.do('GET', f'/api/2.0/token-management/tokens/{token_id}', headers=headers)
2579
3699
  return GetTokenResponse.from_dict(res)
2580
3700
 
@@ -2587,6 +3707,7 @@ class TokenManagementAPI:
2587
3707
  """
2588
3708
 
2589
3709
  headers = {'Accept': 'application/json', }
3710
+
2590
3711
  res = self._api.do('GET',
2591
3712
  '/api/2.0/permissions/authorization/tokens/permissionLevels',
2592
3713
  headers=headers)
@@ -2601,6 +3722,7 @@ class TokenManagementAPI:
2601
3722
  """
2602
3723
 
2603
3724
  headers = {'Accept': 'application/json', }
3725
+
2604
3726
  res = self._api.do('GET', '/api/2.0/permissions/authorization/tokens', headers=headers)
2605
3727
  return TokenPermissions.from_dict(res)
2606
3728
 
@@ -2624,6 +3746,7 @@ class TokenManagementAPI:
2624
3746
  if created_by_id is not None: query['created_by_id'] = created_by_id
2625
3747
  if created_by_username is not None: query['created_by_username'] = created_by_username
2626
3748
  headers = {'Accept': 'application/json', }
3749
+
2627
3750
  json = self._api.do('GET', '/api/2.0/token-management/tokens', query=query, headers=headers)
2628
3751
  parsed = ListTokensResponse.from_dict(json).token_infos
2629
3752
  return parsed if parsed is not None else []
@@ -2644,6 +3767,7 @@ class TokenManagementAPI:
2644
3767
  if access_control_list is not None:
2645
3768
  body['access_control_list'] = [v.as_dict() for v in access_control_list]
2646
3769
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
3770
+
2647
3771
  res = self._api.do('PUT', '/api/2.0/permissions/authorization/tokens', body=body, headers=headers)
2648
3772
  return TokenPermissions.from_dict(res)
2649
3773
 
@@ -2663,6 +3787,7 @@ class TokenManagementAPI:
2663
3787
  if access_control_list is not None:
2664
3788
  body['access_control_list'] = [v.as_dict() for v in access_control_list]
2665
3789
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
3790
+
2666
3791
  res = self._api.do('PATCH', '/api/2.0/permissions/authorization/tokens', body=body, headers=headers)
2667
3792
  return TokenPermissions.from_dict(res)
2668
3793
 
@@ -2697,6 +3822,7 @@ class TokensAPI:
2697
3822
  if comment is not None: body['comment'] = comment
2698
3823
  if lifetime_seconds is not None: body['lifetime_seconds'] = lifetime_seconds
2699
3824
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
3825
+
2700
3826
  res = self._api.do('POST', '/api/2.0/token/create', body=body, headers=headers)
2701
3827
  return CreateTokenResponse.from_dict(res)
2702
3828
 
@@ -2715,6 +3841,7 @@ class TokensAPI:
2715
3841
  body = {}
2716
3842
  if token_id is not None: body['token_id'] = token_id
2717
3843
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
3844
+
2718
3845
  self._api.do('POST', '/api/2.0/token/delete', body=body, headers=headers)
2719
3846
 
2720
3847
  def list(self) -> Iterator[PublicTokenInfo]:
@@ -2726,6 +3853,7 @@ class TokensAPI:
2726
3853
  """
2727
3854
 
2728
3855
  headers = {'Accept': 'application/json', }
3856
+
2729
3857
  json = self._api.do('GET', '/api/2.0/token/list', headers=headers)
2730
3858
  parsed = ListPublicTokensResponse.from_dict(json).token_infos
2731
3859
  return parsed if parsed is not None else []
@@ -2750,6 +3878,7 @@ class WorkspaceConfAPI:
2750
3878
  query = {}
2751
3879
  if keys is not None: query['keys'] = keys
2752
3880
  headers = {'Accept': 'application/json', }
3881
+
2753
3882
  res = self._api.do('GET', '/api/2.0/workspace-conf', query=query, headers=headers)
2754
3883
  return res
2755
3884
 
@@ -2763,4 +3892,5 @@ class WorkspaceConfAPI:
2763
3892
  """
2764
3893
 
2765
3894
  headers = {'Content-Type': 'application/json', }
3895
+
2766
3896
  self._api.do('PATCH', '/api/2.0/workspace-conf', body=contents, headers=headers)