databricks-sdk 0.29.0__py3-none-any.whl → 0.30.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.
- databricks/sdk/__init__.py +67 -19
- databricks/sdk/config.py +61 -75
- databricks/sdk/core.py +16 -9
- databricks/sdk/credentials_provider.py +15 -15
- databricks/sdk/data_plane.py +65 -0
- databricks/sdk/mixins/files.py +12 -4
- databricks/sdk/service/apps.py +977 -0
- databricks/sdk/service/billing.py +602 -218
- databricks/sdk/service/catalog.py +131 -34
- databricks/sdk/service/compute.py +494 -81
- databricks/sdk/service/dashboards.py +608 -5
- databricks/sdk/service/iam.py +99 -88
- databricks/sdk/service/jobs.py +34 -15
- databricks/sdk/service/marketplace.py +2 -122
- databricks/sdk/service/oauth2.py +127 -70
- databricks/sdk/service/pipelines.py +72 -52
- databricks/sdk/service/serving.py +303 -750
- databricks/sdk/service/settings.py +423 -4
- databricks/sdk/service/sharing.py +235 -25
- databricks/sdk/service/sql.py +2417 -566
- databricks/sdk/useragent.py +144 -0
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.29.0.dist-info → databricks_sdk-0.30.0.dist-info}/METADATA +36 -16
- {databricks_sdk-0.29.0.dist-info → databricks_sdk-0.30.0.dist-info}/RECORD +28 -25
- {databricks_sdk-0.29.0.dist-info → databricks_sdk-0.30.0.dist-info}/WHEEL +1 -1
- {databricks_sdk-0.29.0.dist-info → databricks_sdk-0.30.0.dist-info}/LICENSE +0 -0
- {databricks_sdk-0.29.0.dist-info → databricks_sdk-0.30.0.dist-info}/NOTICE +0 -0
- {databricks_sdk-0.29.0.dist-info → databricks_sdk-0.30.0.dist-info}/top_level.txt +0 -0
|
@@ -147,7 +147,6 @@ class ClusterAutoRestartMessageMaintenanceWindow:
|
|
|
147
147
|
|
|
148
148
|
class ClusterAutoRestartMessageMaintenanceWindowDayOfWeek(Enum):
|
|
149
149
|
|
|
150
|
-
DAY_OF_WEEK_UNSPECIFIED = 'DAY_OF_WEEK_UNSPECIFIED'
|
|
151
150
|
FRIDAY = 'FRIDAY'
|
|
152
151
|
MONDAY = 'MONDAY'
|
|
153
152
|
SATURDAY = 'SATURDAY'
|
|
@@ -192,7 +191,6 @@ class ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency(Enum):
|
|
|
192
191
|
SECOND_AND_FOURTH_OF_MONTH = 'SECOND_AND_FOURTH_OF_MONTH'
|
|
193
192
|
SECOND_OF_MONTH = 'SECOND_OF_MONTH'
|
|
194
193
|
THIRD_OF_MONTH = 'THIRD_OF_MONTH'
|
|
195
|
-
WEEK_DAY_FREQUENCY_UNSPECIFIED = 'WEEK_DAY_FREQUENCY_UNSPECIFIED'
|
|
196
194
|
|
|
197
195
|
|
|
198
196
|
@dataclass
|
|
@@ -281,7 +279,7 @@ class ComplianceSecurityProfileSetting:
|
|
|
281
279
|
class ComplianceStandard(Enum):
|
|
282
280
|
"""Compliance stardard for SHIELD customers"""
|
|
283
281
|
|
|
284
|
-
|
|
282
|
+
CANADA_PROTECTED_B = 'CANADA_PROTECTED_B'
|
|
285
283
|
CYBER_ESSENTIAL_PLUS = 'CYBER_ESSENTIAL_PLUS'
|
|
286
284
|
FEDRAMP_HIGH = 'FEDRAMP_HIGH'
|
|
287
285
|
FEDRAMP_IL5 = 'FEDRAMP_IL5'
|
|
@@ -293,6 +291,38 @@ class ComplianceStandard(Enum):
|
|
|
293
291
|
PCI_DSS = 'PCI_DSS'
|
|
294
292
|
|
|
295
293
|
|
|
294
|
+
@dataclass
|
|
295
|
+
class Config:
|
|
296
|
+
email: Optional[EmailConfig] = None
|
|
297
|
+
|
|
298
|
+
generic_webhook: Optional[GenericWebhookConfig] = None
|
|
299
|
+
|
|
300
|
+
microsoft_teams: Optional[MicrosoftTeamsConfig] = None
|
|
301
|
+
|
|
302
|
+
pagerduty: Optional[PagerdutyConfig] = None
|
|
303
|
+
|
|
304
|
+
slack: Optional[SlackConfig] = None
|
|
305
|
+
|
|
306
|
+
def as_dict(self) -> dict:
|
|
307
|
+
"""Serializes the Config into a dictionary suitable for use as a JSON request body."""
|
|
308
|
+
body = {}
|
|
309
|
+
if self.email: body['email'] = self.email.as_dict()
|
|
310
|
+
if self.generic_webhook: body['generic_webhook'] = self.generic_webhook.as_dict()
|
|
311
|
+
if self.microsoft_teams: body['microsoft_teams'] = self.microsoft_teams.as_dict()
|
|
312
|
+
if self.pagerduty: body['pagerduty'] = self.pagerduty.as_dict()
|
|
313
|
+
if self.slack: body['slack'] = self.slack.as_dict()
|
|
314
|
+
return body
|
|
315
|
+
|
|
316
|
+
@classmethod
|
|
317
|
+
def from_dict(cls, d: Dict[str, any]) -> Config:
|
|
318
|
+
"""Deserializes the Config from a dictionary."""
|
|
319
|
+
return cls(email=_from_dict(d, 'email', EmailConfig),
|
|
320
|
+
generic_webhook=_from_dict(d, 'generic_webhook', GenericWebhookConfig),
|
|
321
|
+
microsoft_teams=_from_dict(d, 'microsoft_teams', MicrosoftTeamsConfig),
|
|
322
|
+
pagerduty=_from_dict(d, 'pagerduty', PagerdutyConfig),
|
|
323
|
+
slack=_from_dict(d, 'slack', SlackConfig))
|
|
324
|
+
|
|
325
|
+
|
|
296
326
|
@dataclass
|
|
297
327
|
class CreateIpAccessList:
|
|
298
328
|
"""Details required to configure a block list or allow list."""
|
|
@@ -367,6 +397,27 @@ class CreateNetworkConnectivityConfigRequest:
|
|
|
367
397
|
return cls(name=d.get('name', None), region=d.get('region', None))
|
|
368
398
|
|
|
369
399
|
|
|
400
|
+
@dataclass
|
|
401
|
+
class CreateNotificationDestinationRequest:
|
|
402
|
+
config: Optional[Config] = None
|
|
403
|
+
"""The configuration for the notification destination. Must wrap EXACTLY one of the nested configs."""
|
|
404
|
+
|
|
405
|
+
display_name: Optional[str] = None
|
|
406
|
+
"""The display name for the notification destination."""
|
|
407
|
+
|
|
408
|
+
def as_dict(self) -> dict:
|
|
409
|
+
"""Serializes the CreateNotificationDestinationRequest into a dictionary suitable for use as a JSON request body."""
|
|
410
|
+
body = {}
|
|
411
|
+
if self.config: body['config'] = self.config.as_dict()
|
|
412
|
+
if self.display_name is not None: body['display_name'] = self.display_name
|
|
413
|
+
return body
|
|
414
|
+
|
|
415
|
+
@classmethod
|
|
416
|
+
def from_dict(cls, d: Dict[str, any]) -> CreateNotificationDestinationRequest:
|
|
417
|
+
"""Deserializes the CreateNotificationDestinationRequest from a dictionary."""
|
|
418
|
+
return cls(config=_from_dict(d, 'config', Config), display_name=d.get('display_name', None))
|
|
419
|
+
|
|
420
|
+
|
|
370
421
|
@dataclass
|
|
371
422
|
class CreateOboTokenRequest:
|
|
372
423
|
"""Configuration details for creating on-behalf tokens."""
|
|
@@ -705,6 +756,46 @@ class DeleteRestrictWorkspaceAdminsSettingResponse:
|
|
|
705
756
|
return cls(etag=d.get('etag', None))
|
|
706
757
|
|
|
707
758
|
|
|
759
|
+
class DestinationType(Enum):
|
|
760
|
+
|
|
761
|
+
EMAIL = 'EMAIL'
|
|
762
|
+
MICROSOFT_TEAMS = 'MICROSOFT_TEAMS'
|
|
763
|
+
PAGERDUTY = 'PAGERDUTY'
|
|
764
|
+
SLACK = 'SLACK'
|
|
765
|
+
WEBHOOK = 'WEBHOOK'
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
@dataclass
|
|
769
|
+
class EmailConfig:
|
|
770
|
+
addresses: Optional[List[str]] = None
|
|
771
|
+
"""Email addresses to notify."""
|
|
772
|
+
|
|
773
|
+
def as_dict(self) -> dict:
|
|
774
|
+
"""Serializes the EmailConfig into a dictionary suitable for use as a JSON request body."""
|
|
775
|
+
body = {}
|
|
776
|
+
if self.addresses: body['addresses'] = [v for v in self.addresses]
|
|
777
|
+
return body
|
|
778
|
+
|
|
779
|
+
@classmethod
|
|
780
|
+
def from_dict(cls, d: Dict[str, any]) -> EmailConfig:
|
|
781
|
+
"""Deserializes the EmailConfig from a dictionary."""
|
|
782
|
+
return cls(addresses=d.get('addresses', None))
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
@dataclass
|
|
786
|
+
class Empty:
|
|
787
|
+
|
|
788
|
+
def as_dict(self) -> dict:
|
|
789
|
+
"""Serializes the Empty into a dictionary suitable for use as a JSON request body."""
|
|
790
|
+
body = {}
|
|
791
|
+
return body
|
|
792
|
+
|
|
793
|
+
@classmethod
|
|
794
|
+
def from_dict(cls, d: Dict[str, any]) -> Empty:
|
|
795
|
+
"""Deserializes the Empty from a dictionary."""
|
|
796
|
+
return cls()
|
|
797
|
+
|
|
798
|
+
|
|
708
799
|
@dataclass
|
|
709
800
|
class EnhancedSecurityMonitoring:
|
|
710
801
|
"""SHIELD feature: ESM"""
|
|
@@ -920,6 +1011,48 @@ class FetchIpAccessListResponse:
|
|
|
920
1011
|
return cls(ip_access_list=_from_dict(d, 'ip_access_list', IpAccessListInfo))
|
|
921
1012
|
|
|
922
1013
|
|
|
1014
|
+
@dataclass
|
|
1015
|
+
class GenericWebhookConfig:
|
|
1016
|
+
password: Optional[str] = None
|
|
1017
|
+
"""[Input-Only][Optional] Password for webhook."""
|
|
1018
|
+
|
|
1019
|
+
password_set: Optional[bool] = None
|
|
1020
|
+
"""[Output-Only] Whether password is set."""
|
|
1021
|
+
|
|
1022
|
+
url: Optional[str] = None
|
|
1023
|
+
"""[Input-Only] URL for webhook."""
|
|
1024
|
+
|
|
1025
|
+
url_set: Optional[bool] = None
|
|
1026
|
+
"""[Output-Only] Whether URL is set."""
|
|
1027
|
+
|
|
1028
|
+
username: Optional[str] = None
|
|
1029
|
+
"""[Input-Only][Optional] Username for webhook."""
|
|
1030
|
+
|
|
1031
|
+
username_set: Optional[bool] = None
|
|
1032
|
+
"""[Output-Only] Whether username is set."""
|
|
1033
|
+
|
|
1034
|
+
def as_dict(self) -> dict:
|
|
1035
|
+
"""Serializes the GenericWebhookConfig into a dictionary suitable for use as a JSON request body."""
|
|
1036
|
+
body = {}
|
|
1037
|
+
if self.password is not None: body['password'] = self.password
|
|
1038
|
+
if self.password_set is not None: body['password_set'] = self.password_set
|
|
1039
|
+
if self.url is not None: body['url'] = self.url
|
|
1040
|
+
if self.url_set is not None: body['url_set'] = self.url_set
|
|
1041
|
+
if self.username is not None: body['username'] = self.username
|
|
1042
|
+
if self.username_set is not None: body['username_set'] = self.username_set
|
|
1043
|
+
return body
|
|
1044
|
+
|
|
1045
|
+
@classmethod
|
|
1046
|
+
def from_dict(cls, d: Dict[str, any]) -> GenericWebhookConfig:
|
|
1047
|
+
"""Deserializes the GenericWebhookConfig from a dictionary."""
|
|
1048
|
+
return cls(password=d.get('password', None),
|
|
1049
|
+
password_set=d.get('password_set', None),
|
|
1050
|
+
url=d.get('url', None),
|
|
1051
|
+
url_set=d.get('url_set', None),
|
|
1052
|
+
username=d.get('username', None),
|
|
1053
|
+
username_set=d.get('username_set', None))
|
|
1054
|
+
|
|
1055
|
+
|
|
923
1056
|
@dataclass
|
|
924
1057
|
class GetIpAccessListResponse:
|
|
925
1058
|
ip_access_list: Optional[IpAccessListInfo] = None
|
|
@@ -1118,6 +1251,54 @@ class ListNetworkConnectivityConfigurationsResponse:
|
|
|
1118
1251
|
next_page_token=d.get('next_page_token', None))
|
|
1119
1252
|
|
|
1120
1253
|
|
|
1254
|
+
@dataclass
|
|
1255
|
+
class ListNotificationDestinationsResponse:
|
|
1256
|
+
next_page_token: Optional[str] = None
|
|
1257
|
+
"""Page token for next of results."""
|
|
1258
|
+
|
|
1259
|
+
results: Optional[List[ListNotificationDestinationsResult]] = None
|
|
1260
|
+
|
|
1261
|
+
def as_dict(self) -> dict:
|
|
1262
|
+
"""Serializes the ListNotificationDestinationsResponse into a dictionary suitable for use as a JSON request body."""
|
|
1263
|
+
body = {}
|
|
1264
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
1265
|
+
if self.results: body['results'] = [v.as_dict() for v in self.results]
|
|
1266
|
+
return body
|
|
1267
|
+
|
|
1268
|
+
@classmethod
|
|
1269
|
+
def from_dict(cls, d: Dict[str, any]) -> ListNotificationDestinationsResponse:
|
|
1270
|
+
"""Deserializes the ListNotificationDestinationsResponse from a dictionary."""
|
|
1271
|
+
return cls(next_page_token=d.get('next_page_token', None),
|
|
1272
|
+
results=_repeated_dict(d, 'results', ListNotificationDestinationsResult))
|
|
1273
|
+
|
|
1274
|
+
|
|
1275
|
+
@dataclass
|
|
1276
|
+
class ListNotificationDestinationsResult:
|
|
1277
|
+
destination_type: Optional[DestinationType] = None
|
|
1278
|
+
"""[Output-only] The type of the notification destination. The type can not be changed once set."""
|
|
1279
|
+
|
|
1280
|
+
display_name: Optional[str] = None
|
|
1281
|
+
"""The display name for the notification destination."""
|
|
1282
|
+
|
|
1283
|
+
id: Optional[str] = None
|
|
1284
|
+
"""UUID identifying notification destination."""
|
|
1285
|
+
|
|
1286
|
+
def as_dict(self) -> dict:
|
|
1287
|
+
"""Serializes the ListNotificationDestinationsResult into a dictionary suitable for use as a JSON request body."""
|
|
1288
|
+
body = {}
|
|
1289
|
+
if self.destination_type is not None: body['destination_type'] = self.destination_type.value
|
|
1290
|
+
if self.display_name is not None: body['display_name'] = self.display_name
|
|
1291
|
+
if self.id is not None: body['id'] = self.id
|
|
1292
|
+
return body
|
|
1293
|
+
|
|
1294
|
+
@classmethod
|
|
1295
|
+
def from_dict(cls, d: Dict[str, any]) -> ListNotificationDestinationsResult:
|
|
1296
|
+
"""Deserializes the ListNotificationDestinationsResult from a dictionary."""
|
|
1297
|
+
return cls(destination_type=_enum(d, 'destination_type', DestinationType),
|
|
1298
|
+
display_name=d.get('display_name', None),
|
|
1299
|
+
id=d.get('id', None))
|
|
1300
|
+
|
|
1301
|
+
|
|
1121
1302
|
@dataclass
|
|
1122
1303
|
class ListPublicTokensResponse:
|
|
1123
1304
|
token_infos: Optional[List[PublicTokenInfo]] = None
|
|
@@ -1164,6 +1345,27 @@ class ListType(Enum):
|
|
|
1164
1345
|
BLOCK = 'BLOCK'
|
|
1165
1346
|
|
|
1166
1347
|
|
|
1348
|
+
@dataclass
|
|
1349
|
+
class MicrosoftTeamsConfig:
|
|
1350
|
+
url: Optional[str] = None
|
|
1351
|
+
"""[Input-Only] URL for Microsoft Teams."""
|
|
1352
|
+
|
|
1353
|
+
url_set: Optional[bool] = None
|
|
1354
|
+
"""[Output-Only] Whether URL is set."""
|
|
1355
|
+
|
|
1356
|
+
def as_dict(self) -> dict:
|
|
1357
|
+
"""Serializes the MicrosoftTeamsConfig into a dictionary suitable for use as a JSON request body."""
|
|
1358
|
+
body = {}
|
|
1359
|
+
if self.url is not None: body['url'] = self.url
|
|
1360
|
+
if self.url_set is not None: body['url_set'] = self.url_set
|
|
1361
|
+
return body
|
|
1362
|
+
|
|
1363
|
+
@classmethod
|
|
1364
|
+
def from_dict(cls, d: Dict[str, any]) -> MicrosoftTeamsConfig:
|
|
1365
|
+
"""Deserializes the MicrosoftTeamsConfig from a dictionary."""
|
|
1366
|
+
return cls(url=d.get('url', None), url_set=d.get('url_set', None))
|
|
1367
|
+
|
|
1368
|
+
|
|
1167
1369
|
@dataclass
|
|
1168
1370
|
class NccAwsStableIpRule:
|
|
1169
1371
|
"""The stable AWS IP CIDR blocks. You can use these to configure the firewall of your resources to
|
|
@@ -1450,6 +1652,61 @@ class NetworkConnectivityConfiguration:
|
|
|
1450
1652
|
updated_time=d.get('updated_time', None))
|
|
1451
1653
|
|
|
1452
1654
|
|
|
1655
|
+
@dataclass
|
|
1656
|
+
class NotificationDestination:
|
|
1657
|
+
config: Optional[Config] = None
|
|
1658
|
+
"""The configuration for the notification destination. Will be exactly one of the nested configs.
|
|
1659
|
+
Only returns for users with workspace admin permissions."""
|
|
1660
|
+
|
|
1661
|
+
destination_type: Optional[DestinationType] = None
|
|
1662
|
+
"""[Output-only] The type of the notification destination. The type can not be changed once set."""
|
|
1663
|
+
|
|
1664
|
+
display_name: Optional[str] = None
|
|
1665
|
+
"""The display name for the notification destination."""
|
|
1666
|
+
|
|
1667
|
+
id: Optional[str] = None
|
|
1668
|
+
"""UUID identifying notification destination."""
|
|
1669
|
+
|
|
1670
|
+
def as_dict(self) -> dict:
|
|
1671
|
+
"""Serializes the NotificationDestination into a dictionary suitable for use as a JSON request body."""
|
|
1672
|
+
body = {}
|
|
1673
|
+
if self.config: body['config'] = self.config.as_dict()
|
|
1674
|
+
if self.destination_type is not None: body['destination_type'] = self.destination_type.value
|
|
1675
|
+
if self.display_name is not None: body['display_name'] = self.display_name
|
|
1676
|
+
if self.id is not None: body['id'] = self.id
|
|
1677
|
+
return body
|
|
1678
|
+
|
|
1679
|
+
@classmethod
|
|
1680
|
+
def from_dict(cls, d: Dict[str, any]) -> NotificationDestination:
|
|
1681
|
+
"""Deserializes the NotificationDestination from a dictionary."""
|
|
1682
|
+
return cls(config=_from_dict(d, 'config', Config),
|
|
1683
|
+
destination_type=_enum(d, 'destination_type', DestinationType),
|
|
1684
|
+
display_name=d.get('display_name', None),
|
|
1685
|
+
id=d.get('id', None))
|
|
1686
|
+
|
|
1687
|
+
|
|
1688
|
+
@dataclass
|
|
1689
|
+
class PagerdutyConfig:
|
|
1690
|
+
integration_key: Optional[str] = None
|
|
1691
|
+
"""[Input-Only] Integration key for PagerDuty."""
|
|
1692
|
+
|
|
1693
|
+
integration_key_set: Optional[bool] = None
|
|
1694
|
+
"""[Output-Only] Whether integration key is set."""
|
|
1695
|
+
|
|
1696
|
+
def as_dict(self) -> dict:
|
|
1697
|
+
"""Serializes the PagerdutyConfig into a dictionary suitable for use as a JSON request body."""
|
|
1698
|
+
body = {}
|
|
1699
|
+
if self.integration_key is not None: body['integration_key'] = self.integration_key
|
|
1700
|
+
if self.integration_key_set is not None: body['integration_key_set'] = self.integration_key_set
|
|
1701
|
+
return body
|
|
1702
|
+
|
|
1703
|
+
@classmethod
|
|
1704
|
+
def from_dict(cls, d: Dict[str, any]) -> PagerdutyConfig:
|
|
1705
|
+
"""Deserializes the PagerdutyConfig from a dictionary."""
|
|
1706
|
+
return cls(integration_key=d.get('integration_key', None),
|
|
1707
|
+
integration_key_set=d.get('integration_key_set', None))
|
|
1708
|
+
|
|
1709
|
+
|
|
1453
1710
|
@dataclass
|
|
1454
1711
|
class PartitionId:
|
|
1455
1712
|
"""Partition by workspace or account"""
|
|
@@ -1642,7 +1899,6 @@ class RestrictWorkspaceAdminsMessageStatus(Enum):
|
|
|
1642
1899
|
|
|
1643
1900
|
ALLOW_ALL = 'ALLOW_ALL'
|
|
1644
1901
|
RESTRICT_TOKENS_AND_JOB_RUN_AS = 'RESTRICT_TOKENS_AND_JOB_RUN_AS'
|
|
1645
|
-
STATUS_UNSPECIFIED = 'STATUS_UNSPECIFIED'
|
|
1646
1902
|
|
|
1647
1903
|
|
|
1648
1904
|
@dataclass
|
|
@@ -1726,6 +1982,27 @@ class SetStatusResponse:
|
|
|
1726
1982
|
return cls()
|
|
1727
1983
|
|
|
1728
1984
|
|
|
1985
|
+
@dataclass
|
|
1986
|
+
class SlackConfig:
|
|
1987
|
+
url: Optional[str] = None
|
|
1988
|
+
"""[Input-Only] URL for Slack destination."""
|
|
1989
|
+
|
|
1990
|
+
url_set: Optional[bool] = None
|
|
1991
|
+
"""[Output-Only] Whether URL is set."""
|
|
1992
|
+
|
|
1993
|
+
def as_dict(self) -> dict:
|
|
1994
|
+
"""Serializes the SlackConfig into a dictionary suitable for use as a JSON request body."""
|
|
1995
|
+
body = {}
|
|
1996
|
+
if self.url is not None: body['url'] = self.url
|
|
1997
|
+
if self.url_set is not None: body['url_set'] = self.url_set
|
|
1998
|
+
return body
|
|
1999
|
+
|
|
2000
|
+
@classmethod
|
|
2001
|
+
def from_dict(cls, d: Dict[str, any]) -> SlackConfig:
|
|
2002
|
+
"""Deserializes the SlackConfig from a dictionary."""
|
|
2003
|
+
return cls(url=d.get('url', None), url_set=d.get('url_set', None))
|
|
2004
|
+
|
|
2005
|
+
|
|
1729
2006
|
@dataclass
|
|
1730
2007
|
class StringMessage:
|
|
1731
2008
|
value: Optional[str] = None
|
|
@@ -2189,6 +2466,32 @@ class UpdateIpAccessList:
|
|
|
2189
2466
|
list_type=_enum(d, 'list_type', ListType))
|
|
2190
2467
|
|
|
2191
2468
|
|
|
2469
|
+
@dataclass
|
|
2470
|
+
class UpdateNotificationDestinationRequest:
|
|
2471
|
+
config: Optional[Config] = None
|
|
2472
|
+
"""The configuration for the notification destination. Must wrap EXACTLY one of the nested configs."""
|
|
2473
|
+
|
|
2474
|
+
display_name: Optional[str] = None
|
|
2475
|
+
"""The display name for the notification destination."""
|
|
2476
|
+
|
|
2477
|
+
id: Optional[str] = None
|
|
2478
|
+
|
|
2479
|
+
def as_dict(self) -> dict:
|
|
2480
|
+
"""Serializes the UpdateNotificationDestinationRequest into a dictionary suitable for use as a JSON request body."""
|
|
2481
|
+
body = {}
|
|
2482
|
+
if self.config: body['config'] = self.config.as_dict()
|
|
2483
|
+
if self.display_name is not None: body['display_name'] = self.display_name
|
|
2484
|
+
if self.id is not None: body['id'] = self.id
|
|
2485
|
+
return body
|
|
2486
|
+
|
|
2487
|
+
@classmethod
|
|
2488
|
+
def from_dict(cls, d: Dict[str, any]) -> UpdateNotificationDestinationRequest:
|
|
2489
|
+
"""Deserializes the UpdateNotificationDestinationRequest from a dictionary."""
|
|
2490
|
+
return cls(config=_from_dict(d, 'config', Config),
|
|
2491
|
+
display_name=d.get('display_name', None),
|
|
2492
|
+
id=d.get('id', None))
|
|
2493
|
+
|
|
2494
|
+
|
|
2192
2495
|
@dataclass
|
|
2193
2496
|
class UpdatePersonalComputeSettingRequest:
|
|
2194
2497
|
"""Details required to update a setting."""
|
|
@@ -3402,6 +3705,122 @@ class NetworkConnectivityAPI:
|
|
|
3402
3705
|
query['page_token'] = json['next_page_token']
|
|
3403
3706
|
|
|
3404
3707
|
|
|
3708
|
+
class NotificationDestinationsAPI:
|
|
3709
|
+
"""The notification destinations API lets you programmatically manage a workspace's notification
|
|
3710
|
+
destinations. Notification destinations are used to send notifications for query alerts and jobs to
|
|
3711
|
+
destinations outside of Databricks. Only workspace admins can create, update, and delete notification
|
|
3712
|
+
destinations."""
|
|
3713
|
+
|
|
3714
|
+
def __init__(self, api_client):
|
|
3715
|
+
self._api = api_client
|
|
3716
|
+
|
|
3717
|
+
def create(self,
|
|
3718
|
+
*,
|
|
3719
|
+
config: Optional[Config] = None,
|
|
3720
|
+
display_name: Optional[str] = None) -> NotificationDestination:
|
|
3721
|
+
"""Create a notification destination.
|
|
3722
|
+
|
|
3723
|
+
Creates a notification destination. Requires workspace admin permissions.
|
|
3724
|
+
|
|
3725
|
+
:param config: :class:`Config` (optional)
|
|
3726
|
+
The configuration for the notification destination. Must wrap EXACTLY one of the nested configs.
|
|
3727
|
+
:param display_name: str (optional)
|
|
3728
|
+
The display name for the notification destination.
|
|
3729
|
+
|
|
3730
|
+
:returns: :class:`NotificationDestination`
|
|
3731
|
+
"""
|
|
3732
|
+
body = {}
|
|
3733
|
+
if config is not None: body['config'] = config.as_dict()
|
|
3734
|
+
if display_name is not None: body['display_name'] = display_name
|
|
3735
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
3736
|
+
|
|
3737
|
+
res = self._api.do('POST', '/api/2.0/notification-destinations', body=body, headers=headers)
|
|
3738
|
+
return NotificationDestination.from_dict(res)
|
|
3739
|
+
|
|
3740
|
+
def delete(self, id: str):
|
|
3741
|
+
"""Delete a notification destination.
|
|
3742
|
+
|
|
3743
|
+
Deletes a notification destination. Requires workspace admin permissions.
|
|
3744
|
+
|
|
3745
|
+
:param id: str
|
|
3746
|
+
|
|
3747
|
+
|
|
3748
|
+
"""
|
|
3749
|
+
|
|
3750
|
+
headers = {'Accept': 'application/json', }
|
|
3751
|
+
|
|
3752
|
+
self._api.do('DELETE', f'/api/2.0/notification-destinations/{id}', headers=headers)
|
|
3753
|
+
|
|
3754
|
+
def get(self, id: str) -> NotificationDestination:
|
|
3755
|
+
"""Get a notification destination.
|
|
3756
|
+
|
|
3757
|
+
Gets a notification destination.
|
|
3758
|
+
|
|
3759
|
+
:param id: str
|
|
3760
|
+
|
|
3761
|
+
:returns: :class:`NotificationDestination`
|
|
3762
|
+
"""
|
|
3763
|
+
|
|
3764
|
+
headers = {'Accept': 'application/json', }
|
|
3765
|
+
|
|
3766
|
+
res = self._api.do('GET', f'/api/2.0/notification-destinations/{id}', headers=headers)
|
|
3767
|
+
return NotificationDestination.from_dict(res)
|
|
3768
|
+
|
|
3769
|
+
def list(self,
|
|
3770
|
+
*,
|
|
3771
|
+
page_size: Optional[int] = None,
|
|
3772
|
+
page_token: Optional[str] = None) -> Iterator[ListNotificationDestinationsResult]:
|
|
3773
|
+
"""List notification destinations.
|
|
3774
|
+
|
|
3775
|
+
Lists notification destinations.
|
|
3776
|
+
|
|
3777
|
+
:param page_size: int (optional)
|
|
3778
|
+
:param page_token: str (optional)
|
|
3779
|
+
|
|
3780
|
+
:returns: Iterator over :class:`ListNotificationDestinationsResult`
|
|
3781
|
+
"""
|
|
3782
|
+
|
|
3783
|
+
query = {}
|
|
3784
|
+
if page_size is not None: query['page_size'] = page_size
|
|
3785
|
+
if page_token is not None: query['page_token'] = page_token
|
|
3786
|
+
headers = {'Accept': 'application/json', }
|
|
3787
|
+
|
|
3788
|
+
while True:
|
|
3789
|
+
json = self._api.do('GET', '/api/2.0/notification-destinations', query=query, headers=headers)
|
|
3790
|
+
if 'results' in json:
|
|
3791
|
+
for v in json['results']:
|
|
3792
|
+
yield ListNotificationDestinationsResult.from_dict(v)
|
|
3793
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
3794
|
+
return
|
|
3795
|
+
query['page_token'] = json['next_page_token']
|
|
3796
|
+
|
|
3797
|
+
def update(self,
|
|
3798
|
+
id: str,
|
|
3799
|
+
*,
|
|
3800
|
+
config: Optional[Config] = None,
|
|
3801
|
+
display_name: Optional[str] = None) -> NotificationDestination:
|
|
3802
|
+
"""Update a notification destination.
|
|
3803
|
+
|
|
3804
|
+
Updates a notification destination. Requires workspace admin permissions. At least one field is
|
|
3805
|
+
required in the request body.
|
|
3806
|
+
|
|
3807
|
+
:param id: str
|
|
3808
|
+
:param config: :class:`Config` (optional)
|
|
3809
|
+
The configuration for the notification destination. Must wrap EXACTLY one of the nested configs.
|
|
3810
|
+
:param display_name: str (optional)
|
|
3811
|
+
The display name for the notification destination.
|
|
3812
|
+
|
|
3813
|
+
:returns: :class:`NotificationDestination`
|
|
3814
|
+
"""
|
|
3815
|
+
body = {}
|
|
3816
|
+
if config is not None: body['config'] = config.as_dict()
|
|
3817
|
+
if display_name is not None: body['display_name'] = display_name
|
|
3818
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
3819
|
+
|
|
3820
|
+
res = self._api.do('PATCH', f'/api/2.0/notification-destinations/{id}', body=body, headers=headers)
|
|
3821
|
+
return NotificationDestination.from_dict(res)
|
|
3822
|
+
|
|
3823
|
+
|
|
3405
3824
|
class PersonalComputeAPI:
|
|
3406
3825
|
"""The Personal Compute enablement setting lets you control which users can use the Personal Compute default
|
|
3407
3826
|
policy to create compute resources. By default all users in all workspaces have access (ON), but you can
|