databricks-sdk 0.17.0__py3-none-any.whl → 0.19.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 (36) hide show
  1. databricks/sdk/__init__.py +41 -5
  2. databricks/sdk/azure.py +17 -7
  3. databricks/sdk/clock.py +49 -0
  4. databricks/sdk/config.py +459 -0
  5. databricks/sdk/core.py +7 -1026
  6. databricks/sdk/credentials_provider.py +628 -0
  7. databricks/sdk/environments.py +72 -0
  8. databricks/sdk/errors/__init__.py +1 -1
  9. databricks/sdk/errors/mapper.py +5 -5
  10. databricks/sdk/mixins/workspace.py +3 -3
  11. databricks/sdk/oauth.py +2 -1
  12. databricks/sdk/retries.py +9 -5
  13. databricks/sdk/service/_internal.py +1 -1
  14. databricks/sdk/service/catalog.py +946 -82
  15. databricks/sdk/service/compute.py +106 -41
  16. databricks/sdk/service/files.py +145 -31
  17. databricks/sdk/service/iam.py +44 -40
  18. databricks/sdk/service/jobs.py +199 -20
  19. databricks/sdk/service/ml.py +33 -42
  20. databricks/sdk/service/oauth2.py +3 -4
  21. databricks/sdk/service/pipelines.py +51 -31
  22. databricks/sdk/service/serving.py +1 -2
  23. databricks/sdk/service/settings.py +377 -72
  24. databricks/sdk/service/sharing.py +3 -4
  25. databricks/sdk/service/sql.py +27 -19
  26. databricks/sdk/service/vectorsearch.py +13 -17
  27. databricks/sdk/service/workspace.py +20 -11
  28. databricks/sdk/version.py +1 -1
  29. {databricks_sdk-0.17.0.dist-info → databricks_sdk-0.19.0.dist-info}/METADATA +4 -4
  30. databricks_sdk-0.19.0.dist-info/RECORD +53 -0
  31. databricks_sdk-0.17.0.dist-info/RECORD +0 -49
  32. /databricks/sdk/errors/{mapping.py → platform.py} +0 -0
  33. {databricks_sdk-0.17.0.dist-info → databricks_sdk-0.19.0.dist-info}/LICENSE +0 -0
  34. {databricks_sdk-0.17.0.dist-info → databricks_sdk-0.19.0.dist-info}/NOTICE +0 -0
  35. {databricks_sdk-0.17.0.dist-info → databricks_sdk-0.19.0.dist-info}/WHEEL +0 -0
  36. {databricks_sdk-0.17.0.dist-info → databricks_sdk-0.19.0.dist-info}/top_level.txt +0 -0
@@ -90,15 +90,17 @@ class CreateNetworkConnectivityConfigRequest:
90
90
 
91
91
  @dataclass
92
92
  class CreateOboTokenRequest:
93
+ """Configuration details for creating on-behalf tokens."""
94
+
93
95
  application_id: str
94
96
  """Application ID of the service principal."""
95
97
 
96
- lifetime_seconds: int
97
- """The number of seconds before the token expires."""
98
-
99
98
  comment: Optional[str] = None
100
99
  """Comment that describes the purpose of the token."""
101
100
 
101
+ lifetime_seconds: Optional[int] = None
102
+ """The number of seconds before the token expires."""
103
+
102
104
  def as_dict(self) -> dict:
103
105
  """Serializes the CreateOboTokenRequest into a dictionary suitable for use as a JSON request body."""
104
106
  body = {}
@@ -117,6 +119,8 @@ class CreateOboTokenRequest:
117
119
 
118
120
  @dataclass
119
121
  class CreateOboTokenResponse:
122
+ """An on-behalf token was successfully created for the service principal."""
123
+
120
124
  token_info: Optional[TokenInfo] = None
121
125
 
122
126
  token_value: Optional[str] = None
@@ -262,36 +266,40 @@ class DefaultNamespaceSetting:
262
266
 
263
267
 
264
268
  @dataclass
265
- class DeleteDefaultWorkspaceNamespaceResponse:
269
+ class DeleteDefaultNamespaceSettingResponse:
270
+ """The etag is returned."""
271
+
266
272
  etag: str
267
273
  """etag used for versioning. The response is at least as fresh as the eTag provided. This is used
268
274
  for optimistic concurrency control as a way to help prevent simultaneous writes of a setting
269
275
  overwriting each other. It is strongly suggested that systems make use of the etag in the read
270
- -> update pattern to perform setting updates in order to avoid race conditions. That is, get an
271
- etag from a GET request, and pass it with the PATCH request to identify the setting version you
272
- are updating."""
276
+ -> delete pattern to perform setting deletions in order to avoid race conditions. That is, get
277
+ an etag from a GET request, and pass it with the DELETE request to identify the rule set version
278
+ you are deleting."""
273
279
 
274
280
  def as_dict(self) -> dict:
275
- """Serializes the DeleteDefaultWorkspaceNamespaceResponse into a dictionary suitable for use as a JSON request body."""
281
+ """Serializes the DeleteDefaultNamespaceSettingResponse into a dictionary suitable for use as a JSON request body."""
276
282
  body = {}
277
283
  if self.etag is not None: body['etag'] = self.etag
278
284
  return body
279
285
 
280
286
  @classmethod
281
- def from_dict(cls, d: Dict[str, any]) -> DeleteDefaultWorkspaceNamespaceResponse:
282
- """Deserializes the DeleteDefaultWorkspaceNamespaceResponse from a dictionary."""
287
+ def from_dict(cls, d: Dict[str, any]) -> DeleteDefaultNamespaceSettingResponse:
288
+ """Deserializes the DeleteDefaultNamespaceSettingResponse from a dictionary."""
283
289
  return cls(etag=d.get('etag', None))
284
290
 
285
291
 
286
292
  @dataclass
287
293
  class DeletePersonalComputeSettingResponse:
294
+ """The etag is returned."""
295
+
288
296
  etag: str
289
297
  """etag used for versioning. The response is at least as fresh as the eTag provided. This is used
290
298
  for optimistic concurrency control as a way to help prevent simultaneous writes of a setting
291
299
  overwriting each other. It is strongly suggested that systems make use of the etag in the read
292
- -> update pattern to perform setting updates in order to avoid race conditions. That is, get an
293
- etag from a GET request, and pass it with the PATCH request to identify the setting version you
294
- are updating."""
300
+ -> delete pattern to perform setting deletions in order to avoid race conditions. That is, get
301
+ an etag from a GET request, and pass it with the DELETE request to identify the rule set version
302
+ you are deleting."""
295
303
 
296
304
  def as_dict(self) -> dict:
297
305
  """Serializes the DeletePersonalComputeSettingResponse into a dictionary suitable for use as a JSON request body."""
@@ -305,8 +313,34 @@ class DeletePersonalComputeSettingResponse:
305
313
  return cls(etag=d.get('etag', None))
306
314
 
307
315
 
316
+ @dataclass
317
+ class DeleteRestrictWorkspaceAdminsSettingResponse:
318
+ """The etag is returned."""
319
+
320
+ etag: str
321
+ """etag used for versioning. The response is at least as fresh as the eTag provided. This is used
322
+ for optimistic concurrency control as a way to help prevent simultaneous writes of a setting
323
+ overwriting each other. It is strongly suggested that systems make use of the etag in the read
324
+ -> delete pattern to perform setting deletions in order to avoid race conditions. That is, get
325
+ an etag from a GET request, and pass it with the DELETE request to identify the rule set version
326
+ you are deleting."""
327
+
328
+ def as_dict(self) -> dict:
329
+ """Serializes the DeleteRestrictWorkspaceAdminsSettingResponse into a dictionary suitable for use as a JSON request body."""
330
+ body = {}
331
+ if self.etag is not None: body['etag'] = self.etag
332
+ return body
333
+
334
+ @classmethod
335
+ def from_dict(cls, d: Dict[str, any]) -> DeleteRestrictWorkspaceAdminsSettingResponse:
336
+ """Deserializes the DeleteRestrictWorkspaceAdminsSettingResponse from a dictionary."""
337
+ return cls(etag=d.get('etag', None))
338
+
339
+
308
340
  @dataclass
309
341
  class ExchangeToken:
342
+ """The exchange token is the result of the token exchange with the IdP"""
343
+
310
344
  credential: Optional[str] = None
311
345
  """The requested token."""
312
346
 
@@ -320,7 +354,7 @@ class ExchangeToken:
320
354
  """The scopes of access granted in the token."""
321
355
 
322
356
  token_type: Optional[TokenType] = None
323
- """The type of token request. As of now, only `AZURE_ACTIVE_DIRECTORY_TOKEN` is supported."""
357
+ """The type of this exchange token"""
324
358
 
325
359
  def as_dict(self) -> dict:
326
360
  """Serializes the ExchangeToken into a dictionary suitable for use as a JSON request body."""
@@ -344,9 +378,13 @@ class ExchangeToken:
344
378
 
345
379
  @dataclass
346
380
  class ExchangeTokenRequest:
381
+ """Exchange a token with the IdP"""
382
+
347
383
  partition_id: PartitionId
384
+ """The partition of Credentials store"""
348
385
 
349
386
  token_type: List[TokenType]
387
+ """A list of token types being requested"""
350
388
 
351
389
  scopes: List[str]
352
390
  """Array of scopes for the token request."""
@@ -369,6 +407,8 @@ class ExchangeTokenRequest:
369
407
 
370
408
  @dataclass
371
409
  class ExchangeTokenResponse:
410
+ """Exhanged tokens were successfully returned."""
411
+
372
412
  values: Optional[List[ExchangeToken]] = None
373
413
 
374
414
  def as_dict(self) -> dict:
@@ -454,6 +494,24 @@ class GetTokenPermissionLevelsResponse:
454
494
  return cls(permission_levels=_repeated_dict(d, 'permission_levels', TokenPermissionsDescription))
455
495
 
456
496
 
497
+ @dataclass
498
+ class GetTokenResponse:
499
+ """Token with specified Token ID was successfully returned."""
500
+
501
+ token_info: Optional[TokenInfo] = None
502
+
503
+ def as_dict(self) -> dict:
504
+ """Serializes the GetTokenResponse into a dictionary suitable for use as a JSON request body."""
505
+ body = {}
506
+ if self.token_info: body['token_info'] = self.token_info.as_dict()
507
+ return body
508
+
509
+ @classmethod
510
+ def from_dict(cls, d: Dict[str, any]) -> GetTokenResponse:
511
+ """Deserializes the GetTokenResponse from a dictionary."""
512
+ return cls(token_info=_from_dict(d, 'token_info', TokenInfo))
513
+
514
+
457
515
  @dataclass
458
516
  class IpAccessListInfo:
459
517
  """Definition of an IP Access list"""
@@ -601,7 +659,10 @@ class ListPublicTokensResponse:
601
659
 
602
660
  @dataclass
603
661
  class ListTokensResponse:
662
+ """Tokens were successfully returned."""
663
+
604
664
  token_infos: Optional[List[TokenInfo]] = None
665
+ """Token metadata of each user-created token in the workspace"""
605
666
 
606
667
  def as_dict(self) -> dict:
607
668
  """Serializes the ListTokensResponse into a dictionary suitable for use as a JSON request body."""
@@ -886,6 +947,8 @@ class NetworkConnectivityConfiguration:
886
947
 
887
948
  @dataclass
888
949
  class PartitionId:
950
+ """Partition by workspace or account"""
951
+
889
952
  workspace_id: Optional[int] = None
890
953
  """The ID of the workspace."""
891
954
 
@@ -948,7 +1011,8 @@ class PersonalComputeSetting:
948
1011
  setting_name: Optional[str] = None
949
1012
  """Name of the corresponding setting. This field is populated in the response, but it will not be
950
1013
  respected even if it's set in the request body. The setting name in the path parameter will be
951
- respected instead."""
1014
+ respected instead. Setting name is required to be 'default' if the setting only has one instance
1015
+ per workspace."""
952
1016
 
953
1017
  def as_dict(self) -> dict:
954
1018
  """Serializes the PersonalComputeSetting into a dictionary suitable for use as a JSON request body."""
@@ -1039,6 +1103,65 @@ class ReplaceIpAccessList:
1039
1103
  list_type=_enum(d, 'list_type', ListType))
1040
1104
 
1041
1105
 
1106
+ @dataclass
1107
+ class RestrictWorkspaceAdminsMessage:
1108
+ status: RestrictWorkspaceAdminsMessageStatus
1109
+
1110
+ def as_dict(self) -> dict:
1111
+ """Serializes the RestrictWorkspaceAdminsMessage into a dictionary suitable for use as a JSON request body."""
1112
+ body = {}
1113
+ if self.status is not None: body['status'] = self.status.value
1114
+ return body
1115
+
1116
+ @classmethod
1117
+ def from_dict(cls, d: Dict[str, any]) -> RestrictWorkspaceAdminsMessage:
1118
+ """Deserializes the RestrictWorkspaceAdminsMessage from a dictionary."""
1119
+ return cls(status=_enum(d, 'status', RestrictWorkspaceAdminsMessageStatus))
1120
+
1121
+
1122
+ class RestrictWorkspaceAdminsMessageStatus(Enum):
1123
+
1124
+ ALLOW_ALL = 'ALLOW_ALL'
1125
+ RESTRICT_TOKENS_AND_JOB_RUN_AS = 'RESTRICT_TOKENS_AND_JOB_RUN_AS'
1126
+ STATUS_UNSPECIFIED = 'STATUS_UNSPECIFIED'
1127
+
1128
+
1129
+ @dataclass
1130
+ class RestrictWorkspaceAdminsSetting:
1131
+ restrict_workspace_admins: RestrictWorkspaceAdminsMessage
1132
+
1133
+ etag: Optional[str] = None
1134
+ """etag used for versioning. The response is at least as fresh as the eTag provided. This is used
1135
+ for optimistic concurrency control as a way to help prevent simultaneous writes of a setting
1136
+ overwriting each other. It is strongly suggested that systems make use of the etag in the read
1137
+ -> update pattern to perform setting updates in order to avoid race conditions. That is, get an
1138
+ etag from a GET request, and pass it with the PATCH request to identify the setting version you
1139
+ are updating."""
1140
+
1141
+ setting_name: Optional[str] = None
1142
+ """Name of the corresponding setting. This field is populated in the response, but it will not be
1143
+ respected even if it's set in the request body. The setting name in the path parameter will be
1144
+ respected instead. Setting name is required to be 'default' if the setting only has one instance
1145
+ per workspace."""
1146
+
1147
+ def as_dict(self) -> dict:
1148
+ """Serializes the RestrictWorkspaceAdminsSetting into a dictionary suitable for use as a JSON request body."""
1149
+ body = {}
1150
+ if self.etag is not None: body['etag'] = self.etag
1151
+ if self.restrict_workspace_admins:
1152
+ body['restrict_workspace_admins'] = self.restrict_workspace_admins.as_dict()
1153
+ if self.setting_name is not None: body['setting_name'] = self.setting_name
1154
+ return body
1155
+
1156
+ @classmethod
1157
+ def from_dict(cls, d: Dict[str, any]) -> RestrictWorkspaceAdminsSetting:
1158
+ """Deserializes the RestrictWorkspaceAdminsSetting from a dictionary."""
1159
+ return cls(etag=d.get('etag', None),
1160
+ restrict_workspace_admins=_from_dict(d, 'restrict_workspace_admins',
1161
+ RestrictWorkspaceAdminsMessage),
1162
+ setting_name=d.get('setting_name', None))
1163
+
1164
+
1042
1165
  @dataclass
1043
1166
  class RevokeTokenRequest:
1044
1167
  token_id: str
@@ -1082,8 +1205,7 @@ class TokenAccessControlRequest:
1082
1205
  """Permission level"""
1083
1206
 
1084
1207
  service_principal_name: Optional[str] = None
1085
- """Application ID of an active service principal. Setting this field requires the
1086
- `servicePrincipal/user` role."""
1208
+ """application ID of a service principal"""
1087
1209
 
1088
1210
  user_name: Optional[str] = None
1089
1211
  """name of the user"""
@@ -1292,6 +1414,43 @@ class TokenType(Enum):
1292
1414
  AZURE_ACTIVE_DIRECTORY_TOKEN = 'AZURE_ACTIVE_DIRECTORY_TOKEN'
1293
1415
 
1294
1416
 
1417
+ @dataclass
1418
+ class UpdateDefaultNamespaceSettingRequest:
1419
+ """Details required to update a setting."""
1420
+
1421
+ allow_missing: bool
1422
+ """This should always be set to true for Settings API. Added for AIP compliance."""
1423
+
1424
+ setting: DefaultNamespaceSetting
1425
+ """This represents the setting configuration for the default namespace in the Databricks workspace.
1426
+ Setting the default catalog for the workspace determines the catalog that is used when queries
1427
+ do not reference a fully qualified 3 level name. For example, if the default catalog is set to
1428
+ 'retail_prod' then a query 'SELECT * FROM myTable' would reference the object
1429
+ 'retail_prod.default.myTable' (the schema 'default' is always assumed). This setting requires a
1430
+ restart of clusters and SQL warehouses to take effect. Additionally, the default namespace only
1431
+ applies when using Unity Catalog-enabled compute."""
1432
+
1433
+ field_mask: str
1434
+ """Field mask is required to be passed into the PATCH request. Field mask specifies which fields of
1435
+ the setting payload will be updated. The field mask needs to be supplied as single string. To
1436
+ specify multiple fields in the field mask, use comma as the separator (no space)."""
1437
+
1438
+ def as_dict(self) -> dict:
1439
+ """Serializes the UpdateDefaultNamespaceSettingRequest into a dictionary suitable for use as a JSON request body."""
1440
+ body = {}
1441
+ if self.allow_missing is not None: body['allow_missing'] = self.allow_missing
1442
+ if self.field_mask is not None: body['field_mask'] = self.field_mask
1443
+ if self.setting: body['setting'] = self.setting.as_dict()
1444
+ return body
1445
+
1446
+ @classmethod
1447
+ def from_dict(cls, d: Dict[str, any]) -> UpdateDefaultNamespaceSettingRequest:
1448
+ """Deserializes the UpdateDefaultNamespaceSettingRequest from a dictionary."""
1449
+ return cls(allow_missing=d.get('allow_missing', None),
1450
+ field_mask=d.get('field_mask', None),
1451
+ setting=_from_dict(d, 'setting', DefaultNamespaceSetting))
1452
+
1453
+
1295
1454
  @dataclass
1296
1455
  class UpdateIpAccessList:
1297
1456
  """Details required to update an IP access list."""
@@ -1333,6 +1492,66 @@ class UpdateIpAccessList:
1333
1492
  list_type=_enum(d, 'list_type', ListType))
1334
1493
 
1335
1494
 
1495
+ @dataclass
1496
+ class UpdatePersonalComputeSettingRequest:
1497
+ """Details required to update a setting."""
1498
+
1499
+ allow_missing: bool
1500
+ """This should always be set to true for Settings API. Added for AIP compliance."""
1501
+
1502
+ setting: PersonalComputeSetting
1503
+
1504
+ field_mask: str
1505
+ """Field mask is required to be passed into the PATCH request. Field mask specifies which fields of
1506
+ the setting payload will be updated. The field mask needs to be supplied as single string. To
1507
+ specify multiple fields in the field mask, use comma as the separator (no space)."""
1508
+
1509
+ def as_dict(self) -> dict:
1510
+ """Serializes the UpdatePersonalComputeSettingRequest into a dictionary suitable for use as a JSON request body."""
1511
+ body = {}
1512
+ if self.allow_missing is not None: body['allow_missing'] = self.allow_missing
1513
+ if self.field_mask is not None: body['field_mask'] = self.field_mask
1514
+ if self.setting: body['setting'] = self.setting.as_dict()
1515
+ return body
1516
+
1517
+ @classmethod
1518
+ def from_dict(cls, d: Dict[str, any]) -> UpdatePersonalComputeSettingRequest:
1519
+ """Deserializes the UpdatePersonalComputeSettingRequest from a dictionary."""
1520
+ return cls(allow_missing=d.get('allow_missing', None),
1521
+ field_mask=d.get('field_mask', None),
1522
+ setting=_from_dict(d, 'setting', PersonalComputeSetting))
1523
+
1524
+
1525
+ @dataclass
1526
+ class UpdateRestrictWorkspaceAdminsSettingRequest:
1527
+ """Details required to update a setting."""
1528
+
1529
+ allow_missing: bool
1530
+ """This should always be set to true for Settings API. Added for AIP compliance."""
1531
+
1532
+ setting: RestrictWorkspaceAdminsSetting
1533
+
1534
+ field_mask: str
1535
+ """Field mask is required to be passed into the PATCH request. Field mask specifies which fields of
1536
+ the setting payload will be updated. The field mask needs to be supplied as single string. To
1537
+ specify multiple fields in the field mask, use comma as the separator (no space)."""
1538
+
1539
+ def as_dict(self) -> dict:
1540
+ """Serializes the UpdateRestrictWorkspaceAdminsSettingRequest into a dictionary suitable for use as a JSON request body."""
1541
+ body = {}
1542
+ if self.allow_missing is not None: body['allow_missing'] = self.allow_missing
1543
+ if self.field_mask is not None: body['field_mask'] = self.field_mask
1544
+ if self.setting: body['setting'] = self.setting.as_dict()
1545
+ return body
1546
+
1547
+ @classmethod
1548
+ def from_dict(cls, d: Dict[str, any]) -> UpdateRestrictWorkspaceAdminsSettingRequest:
1549
+ """Deserializes the UpdateRestrictWorkspaceAdminsSettingRequest from a dictionary."""
1550
+ return cls(allow_missing=d.get('allow_missing', None),
1551
+ field_mask=d.get('field_mask', None),
1552
+ setting=_from_dict(d, 'setting', RestrictWorkspaceAdminsSetting))
1553
+
1554
+
1336
1555
  WorkspaceConf = Dict[str, str]
1337
1556
 
1338
1557
 
@@ -1557,12 +1776,14 @@ class AccountSettingsAPI:
1557
1776
  def __init__(self, api_client):
1558
1777
  self._api = api_client
1559
1778
 
1560
- def delete_personal_compute_setting(self, etag: str) -> DeletePersonalComputeSettingResponse:
1779
+ def delete_personal_compute_setting(self,
1780
+ *,
1781
+ etag: Optional[str] = None) -> DeletePersonalComputeSettingResponse:
1561
1782
  """Delete Personal Compute setting.
1562
1783
 
1563
1784
  Reverts back the Personal Compute setting value to default (ON)
1564
1785
 
1565
- :param etag: str
1786
+ :param etag: str (optional)
1566
1787
  etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
1567
1788
  optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting
1568
1789
  each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern
@@ -1582,12 +1803,12 @@ class AccountSettingsAPI:
1582
1803
  headers=headers)
1583
1804
  return DeletePersonalComputeSettingResponse.from_dict(res)
1584
1805
 
1585
- def read_personal_compute_setting(self, etag: str) -> PersonalComputeSetting:
1806
+ def get_personal_compute_setting(self, *, etag: Optional[str] = None) -> PersonalComputeSetting:
1586
1807
  """Get Personal Compute setting.
1587
1808
 
1588
1809
  Gets the value of the Personal Compute setting.
1589
1810
 
1590
- :param etag: str
1811
+ :param etag: str (optional)
1591
1812
  etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
1592
1813
  optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting
1593
1814
  each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern
@@ -1607,23 +1828,25 @@ class AccountSettingsAPI:
1607
1828
  headers=headers)
1608
1829
  return PersonalComputeSetting.from_dict(res)
1609
1830
 
1610
- def update_personal_compute_setting(
1611
- self,
1612
- *,
1613
- allow_missing: Optional[bool] = None,
1614
- setting: Optional[PersonalComputeSetting] = None) -> PersonalComputeSetting:
1831
+ def update_personal_compute_setting(self, allow_missing: bool, setting: PersonalComputeSetting,
1832
+ field_mask: str) -> PersonalComputeSetting:
1615
1833
  """Update Personal Compute setting.
1616
1834
 
1617
1835
  Updates the value of the Personal Compute setting.
1618
1836
 
1619
- :param allow_missing: bool (optional)
1620
- This should always be set to true for Settings RPCs. Added for AIP compliance.
1621
- :param setting: :class:`PersonalComputeSetting` (optional)
1837
+ :param allow_missing: bool
1838
+ This should always be set to true for Settings API. Added for AIP compliance.
1839
+ :param setting: :class:`PersonalComputeSetting`
1840
+ :param field_mask: str
1841
+ Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the
1842
+ setting payload will be updated. The field mask needs to be supplied as single string. To specify
1843
+ multiple fields in the field mask, use comma as the separator (no space).
1622
1844
 
1623
1845
  :returns: :class:`PersonalComputeSetting`
1624
1846
  """
1625
1847
  body = {}
1626
1848
  if allow_missing is not None: body['allow_missing'] = allow_missing
1849
+ if field_mask is not None: body['field_mask'] = field_mask
1627
1850
  if setting is not None: body['setting'] = setting.as_dict()
1628
1851
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
1629
1852
  res = self._api.do(
@@ -1645,11 +1868,13 @@ class CredentialsManagerAPI:
1645
1868
  scopes: List[str]) -> ExchangeTokenResponse:
1646
1869
  """Exchange token.
1647
1870
 
1648
- Exchange tokens with an Identity Provider to get a new access token. It allowes specifying scopes to
1871
+ Exchange tokens with an Identity Provider to get a new access token. It allows specifying scopes to
1649
1872
  determine token permissions.
1650
1873
 
1651
1874
  :param partition_id: :class:`PartitionId`
1875
+ The partition of Credentials store
1652
1876
  :param token_type: List[:class:`TokenType`]
1877
+ A list of token types being requested
1653
1878
  :param scopes: List[str]
1654
1879
  Array of scopes for the token request.
1655
1880
 
@@ -2051,10 +2276,9 @@ class NetworkConnectivityAPI:
2051
2276
  f'/api/2.0/accounts/{self._api.account_id}/network-connectivity-configs',
2052
2277
  query=query,
2053
2278
  headers=headers)
2054
- if 'items' not in json or not json['items']:
2055
- return
2056
- for v in json['items']:
2057
- yield NetworkConnectivityConfiguration.from_dict(v)
2279
+ if 'items' in json:
2280
+ for v in json['items']:
2281
+ yield NetworkConnectivityConfiguration.from_dict(v)
2058
2282
  if 'next_page_token' not in json or not json['next_page_token']:
2059
2283
  return
2060
2284
  query['page_token'] = json['next_page_token']
@@ -2086,10 +2310,9 @@ class NetworkConnectivityAPI:
2086
2310
  f'/api/2.0/accounts/{self._api.account_id}/network-connectivity-configs/{network_connectivity_config_id}/private-endpoint-rules',
2087
2311
  query=query,
2088
2312
  headers=headers)
2089
- if 'items' not in json or not json['items']:
2090
- return
2091
- for v in json['items']:
2092
- yield NccAzurePrivateEndpointRule.from_dict(v)
2313
+ if 'items' in json:
2314
+ for v in json['items']:
2315
+ yield NccAzurePrivateEndpointRule.from_dict(v)
2093
2316
  if 'next_page_token' not in json or not json['next_page_token']:
2094
2317
  return
2095
2318
  query['page_token'] = json['next_page_token']
@@ -2110,7 +2333,9 @@ class SettingsAPI:
2110
2333
  def __init__(self, api_client):
2111
2334
  self._api = api_client
2112
2335
 
2113
- def delete_default_workspace_namespace(self, etag: str) -> DeleteDefaultWorkspaceNamespaceResponse:
2336
+ def delete_default_namespace_setting(self,
2337
+ *,
2338
+ etag: Optional[str] = None) -> DeleteDefaultNamespaceSettingResponse:
2114
2339
  """Delete the default namespace setting.
2115
2340
 
2116
2341
  Deletes the default namespace setting for the workspace. A fresh etag needs to be provided in DELETE
@@ -2118,14 +2343,14 @@ class SettingsAPI:
2118
2343
  request. If the setting is updated/deleted concurrently, DELETE will fail with 409 and the request
2119
2344
  will need to be retried by using the fresh etag in the 409 response.
2120
2345
 
2121
- :param etag: str
2346
+ :param etag: str (optional)
2122
2347
  etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
2123
2348
  optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting
2124
2349
  each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern
2125
2350
  to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET
2126
2351
  request, and pass it with the DELETE request to identify the rule set version you are deleting.
2127
2352
 
2128
- :returns: :class:`DeleteDefaultWorkspaceNamespaceResponse`
2353
+ :returns: :class:`DeleteDefaultNamespaceSettingResponse`
2129
2354
  """
2130
2355
 
2131
2356
  query = {}
@@ -2135,14 +2360,44 @@ class SettingsAPI:
2135
2360
  '/api/2.0/settings/types/default_namespace_ws/names/default',
2136
2361
  query=query,
2137
2362
  headers=headers)
2138
- return DeleteDefaultWorkspaceNamespaceResponse.from_dict(res)
2363
+ return DeleteDefaultNamespaceSettingResponse.from_dict(res)
2139
2364
 
2140
- def read_default_workspace_namespace(self, etag: str) -> DefaultNamespaceSetting:
2365
+ def delete_restrict_workspace_admins_setting(self,
2366
+ *,
2367
+ etag: Optional[str] = None
2368
+ ) -> DeleteRestrictWorkspaceAdminsSettingResponse:
2369
+ """Delete the restrict workspace admins setting.
2370
+
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.
2375
+
2376
+ :param etag: str (optional)
2377
+ etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
2378
+ optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting
2379
+ each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern
2380
+ to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET
2381
+ request, and pass it with the DELETE request to identify the rule set version you are deleting.
2382
+
2383
+ :returns: :class:`DeleteRestrictWorkspaceAdminsSettingResponse`
2384
+ """
2385
+
2386
+ query = {}
2387
+ if etag is not None: query['etag'] = etag
2388
+ 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
+
2395
+ def get_default_namespace_setting(self, *, etag: Optional[str] = None) -> DefaultNamespaceSetting:
2141
2396
  """Get the default namespace setting.
2142
2397
 
2143
2398
  Gets the default namespace setting.
2144
2399
 
2145
- :param etag: str
2400
+ :param etag: str (optional)
2146
2401
  etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
2147
2402
  optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting
2148
2403
  each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern
@@ -2161,12 +2416,34 @@ class SettingsAPI:
2161
2416
  headers=headers)
2162
2417
  return DefaultNamespaceSetting.from_dict(res)
2163
2418
 
2164
- def update_default_workspace_namespace(
2165
- self,
2166
- *,
2167
- allow_missing: Optional[bool] = None,
2168
- field_mask: Optional[str] = None,
2169
- setting: Optional[DefaultNamespaceSetting] = None) -> DefaultNamespaceSetting:
2419
+ def get_restrict_workspace_admins_setting(self,
2420
+ *,
2421
+ etag: Optional[str] = None) -> RestrictWorkspaceAdminsSetting:
2422
+ """Get the restrict workspace admins setting.
2423
+
2424
+ Gets the restrict workspace admins setting.
2425
+
2426
+ :param etag: str (optional)
2427
+ etag used for versioning. The response is at least as fresh as the eTag provided. This is used for
2428
+ optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting
2429
+ each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern
2430
+ to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET
2431
+ request, and pass it with the DELETE request to identify the rule set version you are deleting.
2432
+
2433
+ :returns: :class:`RestrictWorkspaceAdminsSetting`
2434
+ """
2435
+
2436
+ query = {}
2437
+ if etag is not None: query['etag'] = etag
2438
+ headers = {'Accept': 'application/json', }
2439
+ res = self._api.do('GET',
2440
+ '/api/2.0/settings/types/restrict_workspace_admins/names/default',
2441
+ query=query,
2442
+ headers=headers)
2443
+ return RestrictWorkspaceAdminsSetting.from_dict(res)
2444
+
2445
+ def update_default_namespace_setting(self, allow_missing: bool, setting: DefaultNamespaceSetting,
2446
+ field_mask: str) -> DefaultNamespaceSetting:
2170
2447
  """Update the default namespace setting.
2171
2448
 
2172
2449
  Updates the default namespace setting for the workspace. A fresh etag needs to be provided in PATCH
@@ -2176,16 +2453,9 @@ class SettingsAPI:
2176
2453
  updated concurrently, PATCH will fail with 409 and the request will need to be retried by using the
2177
2454
  fresh etag in the 409 response.
2178
2455
 
2179
- :param allow_missing: bool (optional)
2456
+ :param allow_missing: bool
2180
2457
  This should always be set to true for Settings API. Added for AIP compliance.
2181
- :param field_mask: str (optional)
2182
- Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the
2183
- setting payload will be updated. For example, for Default Namespace setting, the field mask is
2184
- supposed to contain fields from the DefaultNamespaceSetting.namespace schema.
2185
-
2186
- The field mask needs to be supplied as single string. To specify multiple fields in the field mask,
2187
- use comma as the seperator (no space).
2188
- :param setting: :class:`DefaultNamespaceSetting` (optional)
2458
+ :param setting: :class:`DefaultNamespaceSetting`
2189
2459
  This represents the setting configuration for the default namespace in the Databricks workspace.
2190
2460
  Setting the default catalog for the workspace determines the catalog that is used when queries do
2191
2461
  not reference a fully qualified 3 level name. For example, if the default catalog is set to
@@ -2193,6 +2463,10 @@ class SettingsAPI:
2193
2463
  'retail_prod.default.myTable' (the schema 'default' is always assumed). This setting requires a
2194
2464
  restart of clusters and SQL warehouses to take effect. Additionally, the default namespace only
2195
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).
2196
2470
 
2197
2471
  :returns: :class:`DefaultNamespaceSetting`
2198
2472
  """
@@ -2207,6 +2481,37 @@ class SettingsAPI:
2207
2481
  headers=headers)
2208
2482
  return DefaultNamespaceSetting.from_dict(res)
2209
2483
 
2484
+ def update_restrict_workspace_admins_setting(self, allow_missing: bool,
2485
+ setting: RestrictWorkspaceAdminsSetting,
2486
+ field_mask: str) -> RestrictWorkspaceAdminsSetting:
2487
+ """Update the restrict workspace admins setting.
2488
+
2489
+ 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.
2493
+
2494
+ :param allow_missing: bool
2495
+ This should always be set to true for Settings API. Added for AIP compliance.
2496
+ :param setting: :class:`RestrictWorkspaceAdminsSetting`
2497
+ :param field_mask: str
2498
+ Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the
2499
+ setting payload will be updated. The field mask needs to be supplied as single string. To specify
2500
+ multiple fields in the field mask, use comma as the separator (no space).
2501
+
2502
+ :returns: :class:`RestrictWorkspaceAdminsSetting`
2503
+ """
2504
+ body = {}
2505
+ if allow_missing is not None: body['allow_missing'] = allow_missing
2506
+ if field_mask is not None: body['field_mask'] = field_mask
2507
+ if setting is not None: body['setting'] = setting.as_dict()
2508
+ headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2509
+ res = self._api.do('PATCH',
2510
+ '/api/2.0/settings/types/restrict_workspace_admins/names/default',
2511
+ body=body,
2512
+ headers=headers)
2513
+ return RestrictWorkspaceAdminsSetting.from_dict(res)
2514
+
2210
2515
 
2211
2516
  class TokenManagementAPI:
2212
2517
  """Enables administrators to get all tokens and delete tokens for other users. Admins can either get every
@@ -2217,19 +2522,19 @@ class TokenManagementAPI:
2217
2522
 
2218
2523
  def create_obo_token(self,
2219
2524
  application_id: str,
2220
- lifetime_seconds: int,
2221
2525
  *,
2222
- comment: Optional[str] = None) -> CreateOboTokenResponse:
2526
+ comment: Optional[str] = None,
2527
+ lifetime_seconds: Optional[int] = None) -> CreateOboTokenResponse:
2223
2528
  """Create on-behalf token.
2224
2529
 
2225
2530
  Creates a token on behalf of a service principal.
2226
2531
 
2227
2532
  :param application_id: str
2228
2533
  Application ID of the service principal.
2229
- :param lifetime_seconds: int
2230
- The number of seconds before the token expires.
2231
2534
  :param comment: str (optional)
2232
2535
  Comment that describes the purpose of the token.
2536
+ :param lifetime_seconds: int (optional)
2537
+ The number of seconds before the token expires.
2233
2538
 
2234
2539
  :returns: :class:`CreateOboTokenResponse`
2235
2540
  """
@@ -2255,10 +2560,10 @@ class TokenManagementAPI:
2255
2560
 
2256
2561
  """
2257
2562
 
2258
- headers = {}
2563
+ headers = {'Accept': 'application/json', }
2259
2564
  self._api.do('DELETE', f'/api/2.0/token-management/tokens/{token_id}', headers=headers)
2260
2565
 
2261
- def get(self, token_id: str) -> TokenInfo:
2566
+ def get(self, token_id: str) -> GetTokenResponse:
2262
2567
  """Get token info.
2263
2568
 
2264
2569
  Gets information about a token, specified by its ID.
@@ -2266,12 +2571,12 @@ class TokenManagementAPI:
2266
2571
  :param token_id: str
2267
2572
  The ID of the token to get.
2268
2573
 
2269
- :returns: :class:`TokenInfo`
2574
+ :returns: :class:`GetTokenResponse`
2270
2575
  """
2271
2576
 
2272
2577
  headers = {'Accept': 'application/json', }
2273
2578
  res = self._api.do('GET', f'/api/2.0/token-management/tokens/{token_id}', headers=headers)
2274
- return TokenInfo.from_dict(res)
2579
+ return GetTokenResponse.from_dict(res)
2275
2580
 
2276
2581
  def get_permission_levels(self) -> GetTokenPermissionLevelsResponse:
2277
2582
  """Get token permission levels.
@@ -2301,13 +2606,13 @@ class TokenManagementAPI:
2301
2606
 
2302
2607
  def list(self,
2303
2608
  *,
2304
- created_by_id: Optional[str] = None,
2609
+ created_by_id: Optional[int] = None,
2305
2610
  created_by_username: Optional[str] = None) -> Iterator[TokenInfo]:
2306
2611
  """List all tokens.
2307
2612
 
2308
2613
  Lists all tokens associated with the specified workspace or user.
2309
2614
 
2310
- :param created_by_id: str (optional)
2615
+ :param created_by_id: int (optional)
2311
2616
  User ID of the user that created the token.
2312
2617
  :param created_by_username: str (optional)
2313
2618
  Username of the user that created the token.
@@ -2446,9 +2751,9 @@ class WorkspaceConfAPI:
2446
2751
  if keys is not None: query['keys'] = keys
2447
2752
  headers = {'Accept': 'application/json', }
2448
2753
  res = self._api.do('GET', '/api/2.0/workspace-conf', query=query, headers=headers)
2449
- return WorkspaceConf.from_dict(res)
2754
+ return res
2450
2755
 
2451
- def set_status(self):
2756
+ def set_status(self, contents: Dict[str, str]):
2452
2757
  """Enable/disable features.
2453
2758
 
2454
2759
  Sets the configuration status for a workspace, including enabling or disabling it.
@@ -2458,4 +2763,4 @@ class WorkspaceConfAPI:
2458
2763
  """
2459
2764
 
2460
2765
  headers = {'Content-Type': 'application/json', }
2461
- self._api.do('PATCH', '/api/2.0/workspace-conf', headers=headers)
2766
+ self._api.do('PATCH', '/api/2.0/workspace-conf', body=contents, headers=headers)