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

@@ -14,6 +14,122 @@ _LOG = logging.getLogger('databricks.sdk')
14
14
  # all definitions in this file are in alphabetical order
15
15
 
16
16
 
17
+ @dataclass
18
+ class AibiDashboardEmbeddingAccessPolicy:
19
+ access_policy_type: AibiDashboardEmbeddingAccessPolicyAccessPolicyType
20
+
21
+ def as_dict(self) -> dict:
22
+ """Serializes the AibiDashboardEmbeddingAccessPolicy into a dictionary suitable for use as a JSON request body."""
23
+ body = {}
24
+ if self.access_policy_type is not None: body['access_policy_type'] = self.access_policy_type.value
25
+ return body
26
+
27
+ @classmethod
28
+ def from_dict(cls, d: Dict[str, any]) -> AibiDashboardEmbeddingAccessPolicy:
29
+ """Deserializes the AibiDashboardEmbeddingAccessPolicy from a dictionary."""
30
+ return cls(access_policy_type=_enum(d, 'access_policy_type',
31
+ AibiDashboardEmbeddingAccessPolicyAccessPolicyType))
32
+
33
+
34
+ class AibiDashboardEmbeddingAccessPolicyAccessPolicyType(Enum):
35
+
36
+ ALLOW_ALL_DOMAINS = 'ALLOW_ALL_DOMAINS'
37
+ ALLOW_APPROVED_DOMAINS = 'ALLOW_APPROVED_DOMAINS'
38
+ DENY_ALL_DOMAINS = 'DENY_ALL_DOMAINS'
39
+
40
+
41
+ @dataclass
42
+ class AibiDashboardEmbeddingAccessPolicySetting:
43
+ aibi_dashboard_embedding_access_policy: AibiDashboardEmbeddingAccessPolicy
44
+
45
+ etag: Optional[str] = None
46
+ """etag used for versioning. The response is at least as fresh as the eTag provided. This is used
47
+ for optimistic concurrency control as a way to help prevent simultaneous writes of a setting
48
+ overwriting each other. It is strongly suggested that systems make use of the etag in the read
49
+ -> update pattern to perform setting updates in order to avoid race conditions. That is, get an
50
+ etag from a GET request, and pass it with the PATCH request to identify the setting version you
51
+ are updating."""
52
+
53
+ setting_name: Optional[str] = None
54
+ """Name of the corresponding setting. This field is populated in the response, but it will not be
55
+ respected even if it's set in the request body. The setting name in the path parameter will be
56
+ respected instead. Setting name is required to be 'default' if the setting only has one instance
57
+ per workspace."""
58
+
59
+ def as_dict(self) -> dict:
60
+ """Serializes the AibiDashboardEmbeddingAccessPolicySetting into a dictionary suitable for use as a JSON request body."""
61
+ body = {}
62
+ if self.aibi_dashboard_embedding_access_policy:
63
+ body[
64
+ 'aibi_dashboard_embedding_access_policy'] = self.aibi_dashboard_embedding_access_policy.as_dict(
65
+ )
66
+ if self.etag is not None: body['etag'] = self.etag
67
+ if self.setting_name is not None: body['setting_name'] = self.setting_name
68
+ return body
69
+
70
+ @classmethod
71
+ def from_dict(cls, d: Dict[str, any]) -> AibiDashboardEmbeddingAccessPolicySetting:
72
+ """Deserializes the AibiDashboardEmbeddingAccessPolicySetting from a dictionary."""
73
+ return cls(aibi_dashboard_embedding_access_policy=_from_dict(
74
+ d, 'aibi_dashboard_embedding_access_policy', AibiDashboardEmbeddingAccessPolicy),
75
+ etag=d.get('etag', None),
76
+ setting_name=d.get('setting_name', None))
77
+
78
+
79
+ @dataclass
80
+ class AibiDashboardEmbeddingApprovedDomains:
81
+ approved_domains: Optional[List[str]] = None
82
+
83
+ def as_dict(self) -> dict:
84
+ """Serializes the AibiDashboardEmbeddingApprovedDomains into a dictionary suitable for use as a JSON request body."""
85
+ body = {}
86
+ if self.approved_domains: body['approved_domains'] = [v for v in self.approved_domains]
87
+ return body
88
+
89
+ @classmethod
90
+ def from_dict(cls, d: Dict[str, any]) -> AibiDashboardEmbeddingApprovedDomains:
91
+ """Deserializes the AibiDashboardEmbeddingApprovedDomains from a dictionary."""
92
+ return cls(approved_domains=d.get('approved_domains', None))
93
+
94
+
95
+ @dataclass
96
+ class AibiDashboardEmbeddingApprovedDomainsSetting:
97
+ aibi_dashboard_embedding_approved_domains: AibiDashboardEmbeddingApprovedDomains
98
+
99
+ etag: Optional[str] = None
100
+ """etag used for versioning. The response is at least as fresh as the eTag provided. This is used
101
+ for optimistic concurrency control as a way to help prevent simultaneous writes of a setting
102
+ overwriting each other. It is strongly suggested that systems make use of the etag in the read
103
+ -> update pattern to perform setting updates in order to avoid race conditions. That is, get an
104
+ etag from a GET request, and pass it with the PATCH request to identify the setting version you
105
+ are updating."""
106
+
107
+ setting_name: Optional[str] = None
108
+ """Name of the corresponding setting. This field is populated in the response, but it will not be
109
+ respected even if it's set in the request body. The setting name in the path parameter will be
110
+ respected instead. Setting name is required to be 'default' if the setting only has one instance
111
+ per workspace."""
112
+
113
+ def as_dict(self) -> dict:
114
+ """Serializes the AibiDashboardEmbeddingApprovedDomainsSetting into a dictionary suitable for use as a JSON request body."""
115
+ body = {}
116
+ if self.aibi_dashboard_embedding_approved_domains:
117
+ body[
118
+ 'aibi_dashboard_embedding_approved_domains'] = self.aibi_dashboard_embedding_approved_domains.as_dict(
119
+ )
120
+ if self.etag is not None: body['etag'] = self.etag
121
+ if self.setting_name is not None: body['setting_name'] = self.setting_name
122
+ return body
123
+
124
+ @classmethod
125
+ def from_dict(cls, d: Dict[str, any]) -> AibiDashboardEmbeddingApprovedDomainsSetting:
126
+ """Deserializes the AibiDashboardEmbeddingApprovedDomainsSetting from a dictionary."""
127
+ return cls(aibi_dashboard_embedding_approved_domains=_from_dict(
128
+ d, 'aibi_dashboard_embedding_approved_domains', AibiDashboardEmbeddingApprovedDomains),
129
+ etag=d.get('etag', None),
130
+ setting_name=d.get('setting_name', None))
131
+
132
+
17
133
  @dataclass
18
134
  class AutomaticClusterUpdateSetting:
19
135
  automatic_cluster_update_workspace: ClusterAutoRestartMessage
@@ -2299,6 +2415,9 @@ class TokenInfo:
2299
2415
  expiry_time: Optional[int] = None
2300
2416
  """Timestamp when the token expires."""
2301
2417
 
2418
+ last_used_day: Optional[int] = None
2419
+ """Approximate timestamp for the day the token was last used. Accurate up to 1 day."""
2420
+
2302
2421
  owner_id: Optional[int] = None
2303
2422
  """User ID of the user that owns the token."""
2304
2423
 
@@ -2316,6 +2435,7 @@ class TokenInfo:
2316
2435
  if self.created_by_username is not None: body['created_by_username'] = self.created_by_username
2317
2436
  if self.creation_time is not None: body['creation_time'] = self.creation_time
2318
2437
  if self.expiry_time is not None: body['expiry_time'] = self.expiry_time
2438
+ if self.last_used_day is not None: body['last_used_day'] = self.last_used_day
2319
2439
  if self.owner_id is not None: body['owner_id'] = self.owner_id
2320
2440
  if self.token_id is not None: body['token_id'] = self.token_id
2321
2441
  if self.workspace_id is not None: body['workspace_id'] = self.workspace_id
@@ -2329,6 +2449,7 @@ class TokenInfo:
2329
2449
  created_by_username=d.get('created_by_username', None),
2330
2450
  creation_time=d.get('creation_time', None),
2331
2451
  expiry_time=d.get('expiry_time', None),
2452
+ last_used_day=d.get('last_used_day', None),
2332
2453
  owner_id=d.get('owner_id', None),
2333
2454
  token_id=d.get('token_id', None),
2334
2455
  workspace_id=d.get('workspace_id', None))
@@ -2435,6 +2556,66 @@ class TokenType(Enum):
2435
2556
  AZURE_ACTIVE_DIRECTORY_TOKEN = 'AZURE_ACTIVE_DIRECTORY_TOKEN'
2436
2557
 
2437
2558
 
2559
+ @dataclass
2560
+ class UpdateAibiDashboardEmbeddingAccessPolicySettingRequest:
2561
+ """Details required to update a setting."""
2562
+
2563
+ allow_missing: bool
2564
+ """This should always be set to true for Settings API. Added for AIP compliance."""
2565
+
2566
+ setting: AibiDashboardEmbeddingAccessPolicySetting
2567
+
2568
+ field_mask: str
2569
+ """Field mask is required to be passed into the PATCH request. Field mask specifies which fields of
2570
+ the setting payload will be updated. The field mask needs to be supplied as single string. To
2571
+ specify multiple fields in the field mask, use comma as the separator (no space)."""
2572
+
2573
+ def as_dict(self) -> dict:
2574
+ """Serializes the UpdateAibiDashboardEmbeddingAccessPolicySettingRequest into a dictionary suitable for use as a JSON request body."""
2575
+ body = {}
2576
+ if self.allow_missing is not None: body['allow_missing'] = self.allow_missing
2577
+ if self.field_mask is not None: body['field_mask'] = self.field_mask
2578
+ if self.setting: body['setting'] = self.setting.as_dict()
2579
+ return body
2580
+
2581
+ @classmethod
2582
+ def from_dict(cls, d: Dict[str, any]) -> UpdateAibiDashboardEmbeddingAccessPolicySettingRequest:
2583
+ """Deserializes the UpdateAibiDashboardEmbeddingAccessPolicySettingRequest from a dictionary."""
2584
+ return cls(allow_missing=d.get('allow_missing', None),
2585
+ field_mask=d.get('field_mask', None),
2586
+ setting=_from_dict(d, 'setting', AibiDashboardEmbeddingAccessPolicySetting))
2587
+
2588
+
2589
+ @dataclass
2590
+ class UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest:
2591
+ """Details required to update a setting."""
2592
+
2593
+ allow_missing: bool
2594
+ """This should always be set to true for Settings API. Added for AIP compliance."""
2595
+
2596
+ setting: AibiDashboardEmbeddingApprovedDomainsSetting
2597
+
2598
+ field_mask: str
2599
+ """Field mask is required to be passed into the PATCH request. Field mask specifies which fields of
2600
+ the setting payload will be updated. The field mask needs to be supplied as single string. To
2601
+ specify multiple fields in the field mask, use comma as the separator (no space)."""
2602
+
2603
+ def as_dict(self) -> dict:
2604
+ """Serializes the UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest into a dictionary suitable for use as a JSON request body."""
2605
+ body = {}
2606
+ if self.allow_missing is not None: body['allow_missing'] = self.allow_missing
2607
+ if self.field_mask is not None: body['field_mask'] = self.field_mask
2608
+ if self.setting: body['setting'] = self.setting.as_dict()
2609
+ return body
2610
+
2611
+ @classmethod
2612
+ def from_dict(cls, d: Dict[str, any]) -> UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest:
2613
+ """Deserializes the UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest from a dictionary."""
2614
+ return cls(allow_missing=d.get('allow_missing', None),
2615
+ field_mask=d.get('field_mask', None),
2616
+ setting=_from_dict(d, 'setting', AibiDashboardEmbeddingApprovedDomainsSetting))
2617
+
2618
+
2438
2619
  @dataclass
2439
2620
  class UpdateAutomaticClusterUpdateSettingRequest:
2440
2621
  """Details required to update a setting."""
@@ -2762,6 +2943,7 @@ class UpdateNotificationDestinationRequest:
2762
2943
  """The display name for the notification destination."""
2763
2944
 
2764
2945
  id: Optional[str] = None
2946
+ """UUID identifying notification destination."""
2765
2947
 
2766
2948
  def as_dict(self) -> dict:
2767
2949
  """Serializes the UpdateNotificationDestinationRequest into a dictionary suitable for use as a JSON request body."""
@@ -3103,6 +3285,130 @@ class AccountSettingsAPI:
3103
3285
  return self._personal_compute
3104
3286
 
3105
3287
 
3288
+ class AibiDashboardEmbeddingAccessPolicyAPI:
3289
+ """Controls whether AI/BI published dashboard embedding is enabled, conditionally enabled, or disabled at the
3290
+ workspace level. By default, this setting is conditionally enabled (ALLOW_APPROVED_DOMAINS)."""
3291
+
3292
+ def __init__(self, api_client):
3293
+ self._api = api_client
3294
+
3295
+ def get(self, *, etag: Optional[str] = None) -> AibiDashboardEmbeddingAccessPolicySetting:
3296
+ """Retrieve the AI/BI dashboard embedding access policy.
3297
+
3298
+ Retrieves the AI/BI dashboard embedding access policy. The default setting is ALLOW_APPROVED_DOMAINS,
3299
+ permitting AI/BI dashboards to be embedded on approved domains.
3300
+
3301
+ :param etag: str (optional)
3302
+ etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
3303
+ optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting
3304
+ each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern
3305
+ to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET
3306
+ request, and pass it with the DELETE request to identify the rule set version you are deleting.
3307
+
3308
+ :returns: :class:`AibiDashboardEmbeddingAccessPolicySetting`
3309
+ """
3310
+
3311
+ query = {}
3312
+ if etag is not None: query['etag'] = etag
3313
+ headers = {'Accept': 'application/json', }
3314
+
3315
+ res = self._api.do('GET',
3316
+ '/api/2.0/settings/types/aibi_dash_embed_ws_acc_policy/names/default',
3317
+ query=query,
3318
+ headers=headers)
3319
+ return AibiDashboardEmbeddingAccessPolicySetting.from_dict(res)
3320
+
3321
+ def update(self, allow_missing: bool, setting: AibiDashboardEmbeddingAccessPolicySetting,
3322
+ field_mask: str) -> AibiDashboardEmbeddingAccessPolicySetting:
3323
+ """Update the AI/BI dashboard embedding access policy.
3324
+
3325
+ Updates the AI/BI dashboard embedding access policy at the workspace level.
3326
+
3327
+ :param allow_missing: bool
3328
+ This should always be set to true for Settings API. Added for AIP compliance.
3329
+ :param setting: :class:`AibiDashboardEmbeddingAccessPolicySetting`
3330
+ :param field_mask: str
3331
+ Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the
3332
+ setting payload will be updated. The field mask needs to be supplied as single string. To specify
3333
+ multiple fields in the field mask, use comma as the separator (no space).
3334
+
3335
+ :returns: :class:`AibiDashboardEmbeddingAccessPolicySetting`
3336
+ """
3337
+ body = {}
3338
+ if allow_missing is not None: body['allow_missing'] = allow_missing
3339
+ if field_mask is not None: body['field_mask'] = field_mask
3340
+ if setting is not None: body['setting'] = setting.as_dict()
3341
+ headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
3342
+
3343
+ res = self._api.do('PATCH',
3344
+ '/api/2.0/settings/types/aibi_dash_embed_ws_acc_policy/names/default',
3345
+ body=body,
3346
+ headers=headers)
3347
+ return AibiDashboardEmbeddingAccessPolicySetting.from_dict(res)
3348
+
3349
+
3350
+ class AibiDashboardEmbeddingApprovedDomainsAPI:
3351
+ """Controls the list of domains approved to host the embedded AI/BI dashboards. The approved domains list
3352
+ can't be mutated when the current access policy is not set to ALLOW_APPROVED_DOMAINS."""
3353
+
3354
+ def __init__(self, api_client):
3355
+ self._api = api_client
3356
+
3357
+ def get(self, *, etag: Optional[str] = None) -> AibiDashboardEmbeddingApprovedDomainsSetting:
3358
+ """Retrieve the list of domains approved to host embedded AI/BI dashboards.
3359
+
3360
+ Retrieves the list of domains approved to host embedded AI/BI dashboards.
3361
+
3362
+ :param etag: str (optional)
3363
+ etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
3364
+ optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting
3365
+ each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern
3366
+ to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET
3367
+ request, and pass it with the DELETE request to identify the rule set version you are deleting.
3368
+
3369
+ :returns: :class:`AibiDashboardEmbeddingApprovedDomainsSetting`
3370
+ """
3371
+
3372
+ query = {}
3373
+ if etag is not None: query['etag'] = etag
3374
+ headers = {'Accept': 'application/json', }
3375
+
3376
+ res = self._api.do('GET',
3377
+ '/api/2.0/settings/types/aibi_dash_embed_ws_apprvd_domains/names/default',
3378
+ query=query,
3379
+ headers=headers)
3380
+ return AibiDashboardEmbeddingApprovedDomainsSetting.from_dict(res)
3381
+
3382
+ def update(self, allow_missing: bool, setting: AibiDashboardEmbeddingApprovedDomainsSetting,
3383
+ field_mask: str) -> AibiDashboardEmbeddingApprovedDomainsSetting:
3384
+ """Update the list of domains approved to host embedded AI/BI dashboards.
3385
+
3386
+ Updates the list of domains approved to host embedded AI/BI dashboards. This update will fail if the
3387
+ current workspace access policy is not ALLOW_APPROVED_DOMAINS.
3388
+
3389
+ :param allow_missing: bool
3390
+ This should always be set to true for Settings API. Added for AIP compliance.
3391
+ :param setting: :class:`AibiDashboardEmbeddingApprovedDomainsSetting`
3392
+ :param field_mask: str
3393
+ Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the
3394
+ setting payload will be updated. The field mask needs to be supplied as single string. To specify
3395
+ multiple fields in the field mask, use comma as the separator (no space).
3396
+
3397
+ :returns: :class:`AibiDashboardEmbeddingApprovedDomainsSetting`
3398
+ """
3399
+ body = {}
3400
+ if allow_missing is not None: body['allow_missing'] = allow_missing
3401
+ if field_mask is not None: body['field_mask'] = field_mask
3402
+ if setting is not None: body['setting'] = setting.as_dict()
3403
+ headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
3404
+
3405
+ res = self._api.do('PATCH',
3406
+ '/api/2.0/settings/types/aibi_dash_embed_ws_apprvd_domains/names/default',
3407
+ body=body,
3408
+ headers=headers)
3409
+ return AibiDashboardEmbeddingApprovedDomainsSetting.from_dict(res)
3410
+
3411
+
3106
3412
  class AutomaticClusterUpdateAPI:
3107
3413
  """Controls whether automatic cluster update is enabled for the current workspace. By default, it is turned
3108
3414
  off."""
@@ -4365,6 +4671,7 @@ class NotificationDestinationsAPI:
4365
4671
  required in the request body.
4366
4672
 
4367
4673
  :param id: str
4674
+ UUID identifying notification destination.
4368
4675
  :param config: :class:`Config` (optional)
4369
4676
  The configuration for the notification destination. Must wrap EXACTLY one of the nested configs.
4370
4677
  :param display_name: str (optional)
@@ -4580,6 +4887,8 @@ class SettingsAPI:
4580
4887
  def __init__(self, api_client):
4581
4888
  self._api = api_client
4582
4889
 
4890
+ self._aibi_dashboard_embedding_access_policy = AibiDashboardEmbeddingAccessPolicyAPI(self._api)
4891
+ self._aibi_dashboard_embedding_approved_domains = AibiDashboardEmbeddingApprovedDomainsAPI(self._api)
4583
4892
  self._automatic_cluster_update = AutomaticClusterUpdateAPI(self._api)
4584
4893
  self._compliance_security_profile = ComplianceSecurityProfileAPI(self._api)
4585
4894
  self._default_namespace = DefaultNamespaceAPI(self._api)
@@ -4588,6 +4897,16 @@ class SettingsAPI:
4588
4897
  self._enhanced_security_monitoring = EnhancedSecurityMonitoringAPI(self._api)
4589
4898
  self._restrict_workspace_admins = RestrictWorkspaceAdminsAPI(self._api)
4590
4899
 
4900
+ @property
4901
+ def aibi_dashboard_embedding_access_policy(self) -> AibiDashboardEmbeddingAccessPolicyAPI:
4902
+ """Controls whether AI/BI published dashboard embedding is enabled, conditionally enabled, or disabled at the workspace level."""
4903
+ return self._aibi_dashboard_embedding_access_policy
4904
+
4905
+ @property
4906
+ def aibi_dashboard_embedding_approved_domains(self) -> AibiDashboardEmbeddingApprovedDomainsAPI:
4907
+ """Controls the list of domains approved to host the embedded AI/BI dashboards."""
4908
+ return self._aibi_dashboard_embedding_approved_domains
4909
+
4591
4910
  @property
4592
4911
  def automatic_cluster_update(self) -> AutomaticClusterUpdateAPI:
4593
4912
  """Controls whether automatic cluster update is enabled for the current workspace."""
@@ -4667,7 +4986,7 @@ class TokenManagementAPI:
4667
4986
  Deletes a token, specified by its ID.
4668
4987
 
4669
4988
  :param token_id: str
4670
- The ID of the token to get.
4989
+ The ID of the token to revoke.
4671
4990
 
4672
4991
 
4673
4992
  """
@@ -4751,7 +5070,8 @@ class TokenManagementAPI:
4751
5070
  access_control_list: Optional[List[TokenAccessControlRequest]] = None) -> TokenPermissions:
4752
5071
  """Set token permissions.
4753
5072
 
4754
- Sets permissions on all tokens. Tokens can inherit permissions from their root object.
5073
+ Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct
5074
+ permissions if none are specified. Objects can inherit permissions from their root object.
4755
5075
 
4756
5076
  :param access_control_list: List[:class:`TokenAccessControlRequest`] (optional)
4757
5077