databricks-sdk 0.36.0__py3-none-any.whl → 0.37.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 +19 -27
- databricks/sdk/service/apps.py +46 -188
- databricks/sdk/service/catalog.py +788 -45
- databricks/sdk/service/compute.py +23 -20
- databricks/sdk/service/dashboards.py +26 -276
- databricks/sdk/service/iam.py +4 -2
- databricks/sdk/service/jobs.py +76 -68
- databricks/sdk/service/marketplace.py +1 -0
- databricks/sdk/service/ml.py +4 -3
- databricks/sdk/service/oauth2.py +28 -8
- databricks/sdk/service/pipelines.py +14 -7
- databricks/sdk/service/provisioning.py +53 -0
- databricks/sdk/service/serving.py +2 -2
- databricks/sdk/service/settings.py +319 -1
- databricks/sdk/service/sharing.py +0 -618
- databricks/sdk/service/sql.py +7 -7
- databricks/sdk/service/workspace.py +5 -3
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.36.0.dist-info → databricks_sdk-0.37.0.dist-info}/METADATA +1 -1
- {databricks_sdk-0.36.0.dist-info → databricks_sdk-0.37.0.dist-info}/RECORD +24 -24
- {databricks_sdk-0.36.0.dist-info → databricks_sdk-0.37.0.dist-info}/WHEEL +1 -1
- {databricks_sdk-0.36.0.dist-info → databricks_sdk-0.37.0.dist-info}/LICENSE +0 -0
- {databricks_sdk-0.36.0.dist-info → databricks_sdk-0.37.0.dist-info}/NOTICE +0 -0
- {databricks_sdk-0.36.0.dist-info → databricks_sdk-0.37.0.dist-info}/top_level.txt +0 -0
|
@@ -2661,7 +2661,7 @@ class EbsVolumeType(Enum):
|
|
|
2661
2661
|
@dataclass
|
|
2662
2662
|
class EditCluster:
|
|
2663
2663
|
cluster_id: str
|
|
2664
|
-
"""ID of the
|
|
2664
|
+
"""ID of the cluster"""
|
|
2665
2665
|
|
|
2666
2666
|
spark_version: str
|
|
2667
2667
|
"""The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of available Spark versions can
|
|
@@ -6645,7 +6645,8 @@ class ClusterPoliciesAPI:
|
|
|
6645
6645
|
) -> ClusterPolicyPermissions:
|
|
6646
6646
|
"""Set cluster policy permissions.
|
|
6647
6647
|
|
|
6648
|
-
Sets permissions on
|
|
6648
|
+
Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct
|
|
6649
|
+
permissions if none are specified. Objects can inherit permissions from their root object.
|
|
6649
6650
|
|
|
6650
6651
|
:param cluster_policy_id: str
|
|
6651
6652
|
The cluster policy for which to get or manage permissions.
|
|
@@ -7145,7 +7146,7 @@ class ClustersAPI:
|
|
|
7145
7146
|
Clusters created by the Databricks Jobs service cannot be edited.
|
|
7146
7147
|
|
|
7147
7148
|
:param cluster_id: str
|
|
7148
|
-
ID of the
|
|
7149
|
+
ID of the cluster
|
|
7149
7150
|
:param spark_version: str
|
|
7150
7151
|
The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of available Spark versions can be
|
|
7151
7152
|
retrieved by using the :method:clusters/sparkVersions API call.
|
|
@@ -7672,7 +7673,8 @@ class ClustersAPI:
|
|
|
7672
7673
|
access_control_list: Optional[List[ClusterAccessControlRequest]] = None) -> ClusterPermissions:
|
|
7673
7674
|
"""Set cluster permissions.
|
|
7674
7675
|
|
|
7675
|
-
Sets permissions on
|
|
7676
|
+
Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct
|
|
7677
|
+
permissions if none are specified. Objects can inherit permissions from their root object.
|
|
7676
7678
|
|
|
7677
7679
|
:param cluster_id: str
|
|
7678
7680
|
The cluster for which to get or manage permissions.
|
|
@@ -7865,20 +7867,19 @@ class CommandExecutionAPI:
|
|
|
7865
7867
|
attempt += 1
|
|
7866
7868
|
raise TimeoutError(f'timed out after {timeout}: {status_message}')
|
|
7867
7869
|
|
|
7868
|
-
def
|
|
7870
|
+
def wait_context_status_command_execution_running(
|
|
7869
7871
|
self,
|
|
7870
7872
|
cluster_id: str,
|
|
7871
|
-
command_id: str,
|
|
7872
7873
|
context_id: str,
|
|
7873
7874
|
timeout=timedelta(minutes=20),
|
|
7874
|
-
callback: Optional[Callable[[
|
|
7875
|
+
callback: Optional[Callable[[ContextStatusResponse], None]] = None) -> ContextStatusResponse:
|
|
7875
7876
|
deadline = time.time() + timeout.total_seconds()
|
|
7876
|
-
target_states = (
|
|
7877
|
-
failure_states = (
|
|
7877
|
+
target_states = (ContextStatus.RUNNING, )
|
|
7878
|
+
failure_states = (ContextStatus.ERROR, )
|
|
7878
7879
|
status_message = 'polling...'
|
|
7879
7880
|
attempt = 1
|
|
7880
7881
|
while time.time() < deadline:
|
|
7881
|
-
poll = self.
|
|
7882
|
+
poll = self.context_status(cluster_id=cluster_id, context_id=context_id)
|
|
7882
7883
|
status = poll.status
|
|
7883
7884
|
status_message = f'current status: {status}'
|
|
7884
7885
|
if status in target_states:
|
|
@@ -7886,9 +7887,9 @@ class CommandExecutionAPI:
|
|
|
7886
7887
|
if callback:
|
|
7887
7888
|
callback(poll)
|
|
7888
7889
|
if status in failure_states:
|
|
7889
|
-
msg = f'failed to reach
|
|
7890
|
+
msg = f'failed to reach Running, got {status}: {status_message}'
|
|
7890
7891
|
raise OperationFailed(msg)
|
|
7891
|
-
prefix = f"cluster_id={cluster_id},
|
|
7892
|
+
prefix = f"cluster_id={cluster_id}, context_id={context_id}"
|
|
7892
7893
|
sleep = attempt
|
|
7893
7894
|
if sleep > 10:
|
|
7894
7895
|
# sleep 10s max per attempt
|
|
@@ -7898,19 +7899,20 @@ class CommandExecutionAPI:
|
|
|
7898
7899
|
attempt += 1
|
|
7899
7900
|
raise TimeoutError(f'timed out after {timeout}: {status_message}')
|
|
7900
7901
|
|
|
7901
|
-
def
|
|
7902
|
+
def wait_command_status_command_execution_finished_or_error(
|
|
7902
7903
|
self,
|
|
7903
7904
|
cluster_id: str,
|
|
7905
|
+
command_id: str,
|
|
7904
7906
|
context_id: str,
|
|
7905
7907
|
timeout=timedelta(minutes=20),
|
|
7906
|
-
callback: Optional[Callable[[
|
|
7908
|
+
callback: Optional[Callable[[CommandStatusResponse], None]] = None) -> CommandStatusResponse:
|
|
7907
7909
|
deadline = time.time() + timeout.total_seconds()
|
|
7908
|
-
target_states = (
|
|
7909
|
-
failure_states = (
|
|
7910
|
+
target_states = (CommandStatus.FINISHED, CommandStatus.ERROR, )
|
|
7911
|
+
failure_states = (CommandStatus.CANCELLED, CommandStatus.CANCELLING, )
|
|
7910
7912
|
status_message = 'polling...'
|
|
7911
7913
|
attempt = 1
|
|
7912
7914
|
while time.time() < deadline:
|
|
7913
|
-
poll = self.
|
|
7915
|
+
poll = self.command_status(cluster_id=cluster_id, command_id=command_id, context_id=context_id)
|
|
7914
7916
|
status = poll.status
|
|
7915
7917
|
status_message = f'current status: {status}'
|
|
7916
7918
|
if status in target_states:
|
|
@@ -7918,9 +7920,9 @@ class CommandExecutionAPI:
|
|
|
7918
7920
|
if callback:
|
|
7919
7921
|
callback(poll)
|
|
7920
7922
|
if status in failure_states:
|
|
7921
|
-
msg = f'failed to reach
|
|
7923
|
+
msg = f'failed to reach Finished or Error, got {status}: {status_message}'
|
|
7922
7924
|
raise OperationFailed(msg)
|
|
7923
|
-
prefix = f"cluster_id={cluster_id}, context_id={context_id}"
|
|
7925
|
+
prefix = f"cluster_id={cluster_id}, command_id={command_id}, context_id={context_id}"
|
|
7924
7926
|
sleep = attempt
|
|
7925
7927
|
if sleep > 10:
|
|
7926
7928
|
# sleep 10s max per attempt
|
|
@@ -8515,7 +8517,8 @@ class InstancePoolsAPI:
|
|
|
8515
8517
|
) -> InstancePoolPermissions:
|
|
8516
8518
|
"""Set instance pool permissions.
|
|
8517
8519
|
|
|
8518
|
-
Sets permissions on an
|
|
8520
|
+
Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct
|
|
8521
|
+
permissions if none are specified. Objects can inherit permissions from their root object.
|
|
8519
8522
|
|
|
8520
8523
|
:param instance_pool_id: str
|
|
8521
8524
|
The instance pool for which to get or manage permissions.
|
|
@@ -20,103 +20,6 @@ from databricks.sdk.service import sql
|
|
|
20
20
|
# all definitions in this file are in alphabetical order
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
@dataclass
|
|
24
|
-
class CreateDashboardRequest:
|
|
25
|
-
display_name: str
|
|
26
|
-
"""The display name of the dashboard."""
|
|
27
|
-
|
|
28
|
-
parent_path: Optional[str] = None
|
|
29
|
-
"""The workspace path of the folder containing the dashboard. Includes leading slash and no
|
|
30
|
-
trailing slash. This field is excluded in List Dashboards responses."""
|
|
31
|
-
|
|
32
|
-
serialized_dashboard: Optional[str] = None
|
|
33
|
-
"""The contents of the dashboard in serialized string form. This field is excluded in List
|
|
34
|
-
Dashboards responses. Use the [get dashboard API] to retrieve an example response, which
|
|
35
|
-
includes the `serialized_dashboard` field. This field provides the structure of the JSON string
|
|
36
|
-
that represents the dashboard's layout and components.
|
|
37
|
-
|
|
38
|
-
[get dashboard API]: https://docs.databricks.com/api/workspace/lakeview/get"""
|
|
39
|
-
|
|
40
|
-
warehouse_id: Optional[str] = None
|
|
41
|
-
"""The warehouse ID used to run the dashboard."""
|
|
42
|
-
|
|
43
|
-
def as_dict(self) -> dict:
|
|
44
|
-
"""Serializes the CreateDashboardRequest into a dictionary suitable for use as a JSON request body."""
|
|
45
|
-
body = {}
|
|
46
|
-
if self.display_name is not None: body['display_name'] = self.display_name
|
|
47
|
-
if self.parent_path is not None: body['parent_path'] = self.parent_path
|
|
48
|
-
if self.serialized_dashboard is not None: body['serialized_dashboard'] = self.serialized_dashboard
|
|
49
|
-
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
50
|
-
return body
|
|
51
|
-
|
|
52
|
-
@classmethod
|
|
53
|
-
def from_dict(cls, d: Dict[str, any]) -> CreateDashboardRequest:
|
|
54
|
-
"""Deserializes the CreateDashboardRequest from a dictionary."""
|
|
55
|
-
return cls(display_name=d.get('display_name', None),
|
|
56
|
-
parent_path=d.get('parent_path', None),
|
|
57
|
-
serialized_dashboard=d.get('serialized_dashboard', None),
|
|
58
|
-
warehouse_id=d.get('warehouse_id', None))
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
@dataclass
|
|
62
|
-
class CreateScheduleRequest:
|
|
63
|
-
cron_schedule: CronSchedule
|
|
64
|
-
"""The cron expression describing the frequency of the periodic refresh for this schedule."""
|
|
65
|
-
|
|
66
|
-
dashboard_id: Optional[str] = None
|
|
67
|
-
"""UUID identifying the dashboard to which the schedule belongs."""
|
|
68
|
-
|
|
69
|
-
display_name: Optional[str] = None
|
|
70
|
-
"""The display name for schedule."""
|
|
71
|
-
|
|
72
|
-
pause_status: Optional[SchedulePauseStatus] = None
|
|
73
|
-
"""The status indicates whether this schedule is paused or not."""
|
|
74
|
-
|
|
75
|
-
def as_dict(self) -> dict:
|
|
76
|
-
"""Serializes the CreateScheduleRequest into a dictionary suitable for use as a JSON request body."""
|
|
77
|
-
body = {}
|
|
78
|
-
if self.cron_schedule: body['cron_schedule'] = self.cron_schedule.as_dict()
|
|
79
|
-
if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id
|
|
80
|
-
if self.display_name is not None: body['display_name'] = self.display_name
|
|
81
|
-
if self.pause_status is not None: body['pause_status'] = self.pause_status.value
|
|
82
|
-
return body
|
|
83
|
-
|
|
84
|
-
@classmethod
|
|
85
|
-
def from_dict(cls, d: Dict[str, any]) -> CreateScheduleRequest:
|
|
86
|
-
"""Deserializes the CreateScheduleRequest from a dictionary."""
|
|
87
|
-
return cls(cron_schedule=_from_dict(d, 'cron_schedule', CronSchedule),
|
|
88
|
-
dashboard_id=d.get('dashboard_id', None),
|
|
89
|
-
display_name=d.get('display_name', None),
|
|
90
|
-
pause_status=_enum(d, 'pause_status', SchedulePauseStatus))
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
@dataclass
|
|
94
|
-
class CreateSubscriptionRequest:
|
|
95
|
-
subscriber: Subscriber
|
|
96
|
-
"""Subscriber details for users and destinations to be added as subscribers to the schedule."""
|
|
97
|
-
|
|
98
|
-
dashboard_id: Optional[str] = None
|
|
99
|
-
"""UUID identifying the dashboard to which the subscription belongs."""
|
|
100
|
-
|
|
101
|
-
schedule_id: Optional[str] = None
|
|
102
|
-
"""UUID identifying the schedule to which the subscription belongs."""
|
|
103
|
-
|
|
104
|
-
def as_dict(self) -> dict:
|
|
105
|
-
"""Serializes the CreateSubscriptionRequest into a dictionary suitable for use as a JSON request body."""
|
|
106
|
-
body = {}
|
|
107
|
-
if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id
|
|
108
|
-
if self.schedule_id is not None: body['schedule_id'] = self.schedule_id
|
|
109
|
-
if self.subscriber: body['subscriber'] = self.subscriber.as_dict()
|
|
110
|
-
return body
|
|
111
|
-
|
|
112
|
-
@classmethod
|
|
113
|
-
def from_dict(cls, d: Dict[str, any]) -> CreateSubscriptionRequest:
|
|
114
|
-
"""Deserializes the CreateSubscriptionRequest from a dictionary."""
|
|
115
|
-
return cls(dashboard_id=d.get('dashboard_id', None),
|
|
116
|
-
schedule_id=d.get('schedule_id', None),
|
|
117
|
-
subscriber=_from_dict(d, 'subscriber', Subscriber))
|
|
118
|
-
|
|
119
|
-
|
|
120
23
|
@dataclass
|
|
121
24
|
class CronSchedule:
|
|
122
25
|
quartz_cron_expression: str
|
|
@@ -607,6 +510,7 @@ class MessageErrorType(Enum):
|
|
|
607
510
|
LOCAL_CONTEXT_EXCEEDED_EXCEPTION = 'LOCAL_CONTEXT_EXCEEDED_EXCEPTION'
|
|
608
511
|
MESSAGE_DELETED_WHILE_EXECUTING_EXCEPTION = 'MESSAGE_DELETED_WHILE_EXECUTING_EXCEPTION'
|
|
609
512
|
MESSAGE_UPDATED_WHILE_EXECUTING_EXCEPTION = 'MESSAGE_UPDATED_WHILE_EXECUTING_EXCEPTION'
|
|
513
|
+
NO_DEPLOYMENTS_AVAILABLE_TO_WORKSPACE = 'NO_DEPLOYMENTS_AVAILABLE_TO_WORKSPACE'
|
|
610
514
|
NO_QUERY_TO_VISUALIZE_EXCEPTION = 'NO_QUERY_TO_VISUALIZE_EXCEPTION'
|
|
611
515
|
NO_TABLES_TO_QUERY_EXCEPTION = 'NO_TABLES_TO_QUERY_EXCEPTION'
|
|
612
516
|
RATE_LIMIT_EXCEEDED_GENERIC_EXCEPTION = 'RATE_LIMIT_EXCEEDED_GENERIC_EXCEPTION'
|
|
@@ -839,6 +743,9 @@ class Schedule:
|
|
|
839
743
|
update_time: Optional[str] = None
|
|
840
744
|
"""A timestamp indicating when the schedule was last updated."""
|
|
841
745
|
|
|
746
|
+
warehouse_id: Optional[str] = None
|
|
747
|
+
"""The warehouse id to run the dashboard with for the schedule."""
|
|
748
|
+
|
|
842
749
|
def as_dict(self) -> dict:
|
|
843
750
|
"""Serializes the Schedule into a dictionary suitable for use as a JSON request body."""
|
|
844
751
|
body = {}
|
|
@@ -850,6 +757,7 @@ class Schedule:
|
|
|
850
757
|
if self.pause_status is not None: body['pause_status'] = self.pause_status.value
|
|
851
758
|
if self.schedule_id is not None: body['schedule_id'] = self.schedule_id
|
|
852
759
|
if self.update_time is not None: body['update_time'] = self.update_time
|
|
760
|
+
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
853
761
|
return body
|
|
854
762
|
|
|
855
763
|
@classmethod
|
|
@@ -862,7 +770,8 @@ class Schedule:
|
|
|
862
770
|
etag=d.get('etag', None),
|
|
863
771
|
pause_status=_enum(d, 'pause_status', SchedulePauseStatus),
|
|
864
772
|
schedule_id=d.get('schedule_id', None),
|
|
865
|
-
update_time=d.get('update_time', None)
|
|
773
|
+
update_time=d.get('update_time', None),
|
|
774
|
+
warehouse_id=d.get('warehouse_id', None))
|
|
866
775
|
|
|
867
776
|
|
|
868
777
|
class SchedulePauseStatus(Enum):
|
|
@@ -1032,93 +941,6 @@ class UnpublishDashboardResponse:
|
|
|
1032
941
|
return cls()
|
|
1033
942
|
|
|
1034
943
|
|
|
1035
|
-
@dataclass
|
|
1036
|
-
class UpdateDashboardRequest:
|
|
1037
|
-
dashboard_id: Optional[str] = None
|
|
1038
|
-
"""UUID identifying the dashboard."""
|
|
1039
|
-
|
|
1040
|
-
display_name: Optional[str] = None
|
|
1041
|
-
"""The display name of the dashboard."""
|
|
1042
|
-
|
|
1043
|
-
etag: Optional[str] = None
|
|
1044
|
-
"""The etag for the dashboard. Can be optionally provided on updates to ensure that the dashboard
|
|
1045
|
-
has not been modified since the last read. This field is excluded in List Dashboards responses."""
|
|
1046
|
-
|
|
1047
|
-
serialized_dashboard: Optional[str] = None
|
|
1048
|
-
"""The contents of the dashboard in serialized string form. This field is excluded in List
|
|
1049
|
-
Dashboards responses. Use the [get dashboard API] to retrieve an example response, which
|
|
1050
|
-
includes the `serialized_dashboard` field. This field provides the structure of the JSON string
|
|
1051
|
-
that represents the dashboard's layout and components.
|
|
1052
|
-
|
|
1053
|
-
[get dashboard API]: https://docs.databricks.com/api/workspace/lakeview/get"""
|
|
1054
|
-
|
|
1055
|
-
warehouse_id: Optional[str] = None
|
|
1056
|
-
"""The warehouse ID used to run the dashboard."""
|
|
1057
|
-
|
|
1058
|
-
def as_dict(self) -> dict:
|
|
1059
|
-
"""Serializes the UpdateDashboardRequest into a dictionary suitable for use as a JSON request body."""
|
|
1060
|
-
body = {}
|
|
1061
|
-
if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id
|
|
1062
|
-
if self.display_name is not None: body['display_name'] = self.display_name
|
|
1063
|
-
if self.etag is not None: body['etag'] = self.etag
|
|
1064
|
-
if self.serialized_dashboard is not None: body['serialized_dashboard'] = self.serialized_dashboard
|
|
1065
|
-
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
1066
|
-
return body
|
|
1067
|
-
|
|
1068
|
-
@classmethod
|
|
1069
|
-
def from_dict(cls, d: Dict[str, any]) -> UpdateDashboardRequest:
|
|
1070
|
-
"""Deserializes the UpdateDashboardRequest from a dictionary."""
|
|
1071
|
-
return cls(dashboard_id=d.get('dashboard_id', None),
|
|
1072
|
-
display_name=d.get('display_name', None),
|
|
1073
|
-
etag=d.get('etag', None),
|
|
1074
|
-
serialized_dashboard=d.get('serialized_dashboard', None),
|
|
1075
|
-
warehouse_id=d.get('warehouse_id', None))
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
@dataclass
|
|
1079
|
-
class UpdateScheduleRequest:
|
|
1080
|
-
cron_schedule: CronSchedule
|
|
1081
|
-
"""The cron expression describing the frequency of the periodic refresh for this schedule."""
|
|
1082
|
-
|
|
1083
|
-
dashboard_id: Optional[str] = None
|
|
1084
|
-
"""UUID identifying the dashboard to which the schedule belongs."""
|
|
1085
|
-
|
|
1086
|
-
display_name: Optional[str] = None
|
|
1087
|
-
"""The display name for schedule."""
|
|
1088
|
-
|
|
1089
|
-
etag: Optional[str] = None
|
|
1090
|
-
"""The etag for the schedule. Must be left empty on create, must be provided on updates to ensure
|
|
1091
|
-
that the schedule has not been modified since the last read, and can be optionally provided on
|
|
1092
|
-
delete."""
|
|
1093
|
-
|
|
1094
|
-
pause_status: Optional[SchedulePauseStatus] = None
|
|
1095
|
-
"""The status indicates whether this schedule is paused or not."""
|
|
1096
|
-
|
|
1097
|
-
schedule_id: Optional[str] = None
|
|
1098
|
-
"""UUID identifying the schedule."""
|
|
1099
|
-
|
|
1100
|
-
def as_dict(self) -> dict:
|
|
1101
|
-
"""Serializes the UpdateScheduleRequest into a dictionary suitable for use as a JSON request body."""
|
|
1102
|
-
body = {}
|
|
1103
|
-
if self.cron_schedule: body['cron_schedule'] = self.cron_schedule.as_dict()
|
|
1104
|
-
if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id
|
|
1105
|
-
if self.display_name is not None: body['display_name'] = self.display_name
|
|
1106
|
-
if self.etag is not None: body['etag'] = self.etag
|
|
1107
|
-
if self.pause_status is not None: body['pause_status'] = self.pause_status.value
|
|
1108
|
-
if self.schedule_id is not None: body['schedule_id'] = self.schedule_id
|
|
1109
|
-
return body
|
|
1110
|
-
|
|
1111
|
-
@classmethod
|
|
1112
|
-
def from_dict(cls, d: Dict[str, any]) -> UpdateScheduleRequest:
|
|
1113
|
-
"""Deserializes the UpdateScheduleRequest from a dictionary."""
|
|
1114
|
-
return cls(cron_schedule=_from_dict(d, 'cron_schedule', CronSchedule),
|
|
1115
|
-
dashboard_id=d.get('dashboard_id', None),
|
|
1116
|
-
display_name=d.get('display_name', None),
|
|
1117
|
-
etag=d.get('etag', None),
|
|
1118
|
-
pause_status=_enum(d, 'pause_status', SchedulePauseStatus),
|
|
1119
|
-
schedule_id=d.get('schedule_id', None))
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
944
|
class GenieAPI:
|
|
1123
945
|
"""Genie provides a no-code experience for business users, powered by AI/BI. Analysts set up spaces that
|
|
1124
946
|
business users can use to ask questions using natural language. Genie uses data registered to Unity
|
|
@@ -1313,66 +1135,31 @@ class LakeviewAPI:
|
|
|
1313
1135
|
def __init__(self, api_client):
|
|
1314
1136
|
self._api = api_client
|
|
1315
1137
|
|
|
1316
|
-
def create(self,
|
|
1317
|
-
display_name: str,
|
|
1318
|
-
*,
|
|
1319
|
-
parent_path: Optional[str] = None,
|
|
1320
|
-
serialized_dashboard: Optional[str] = None,
|
|
1321
|
-
warehouse_id: Optional[str] = None) -> Dashboard:
|
|
1138
|
+
def create(self, *, dashboard: Optional[Dashboard] = None) -> Dashboard:
|
|
1322
1139
|
"""Create dashboard.
|
|
1323
1140
|
|
|
1324
1141
|
Create a draft dashboard.
|
|
1325
1142
|
|
|
1326
|
-
:param
|
|
1327
|
-
The display name of the dashboard.
|
|
1328
|
-
:param parent_path: str (optional)
|
|
1329
|
-
The workspace path of the folder containing the dashboard. Includes leading slash and no trailing
|
|
1330
|
-
slash. This field is excluded in List Dashboards responses.
|
|
1331
|
-
:param serialized_dashboard: str (optional)
|
|
1332
|
-
The contents of the dashboard in serialized string form. This field is excluded in List Dashboards
|
|
1333
|
-
responses. Use the [get dashboard API] to retrieve an example response, which includes the
|
|
1334
|
-
`serialized_dashboard` field. This field provides the structure of the JSON string that represents
|
|
1335
|
-
the dashboard's layout and components.
|
|
1336
|
-
|
|
1337
|
-
[get dashboard API]: https://docs.databricks.com/api/workspace/lakeview/get
|
|
1338
|
-
:param warehouse_id: str (optional)
|
|
1339
|
-
The warehouse ID used to run the dashboard.
|
|
1143
|
+
:param dashboard: :class:`Dashboard` (optional)
|
|
1340
1144
|
|
|
1341
1145
|
:returns: :class:`Dashboard`
|
|
1342
1146
|
"""
|
|
1343
|
-
body =
|
|
1344
|
-
if display_name is not None: body['display_name'] = display_name
|
|
1345
|
-
if parent_path is not None: body['parent_path'] = parent_path
|
|
1346
|
-
if serialized_dashboard is not None: body['serialized_dashboard'] = serialized_dashboard
|
|
1347
|
-
if warehouse_id is not None: body['warehouse_id'] = warehouse_id
|
|
1147
|
+
body = dashboard
|
|
1348
1148
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1349
1149
|
|
|
1350
1150
|
res = self._api.do('POST', '/api/2.0/lakeview/dashboards', body=body, headers=headers)
|
|
1351
1151
|
return Dashboard.from_dict(res)
|
|
1352
1152
|
|
|
1353
|
-
def create_schedule(self,
|
|
1354
|
-
dashboard_id: str,
|
|
1355
|
-
cron_schedule: CronSchedule,
|
|
1356
|
-
*,
|
|
1357
|
-
display_name: Optional[str] = None,
|
|
1358
|
-
pause_status: Optional[SchedulePauseStatus] = None) -> Schedule:
|
|
1153
|
+
def create_schedule(self, dashboard_id: str, *, schedule: Optional[Schedule] = None) -> Schedule:
|
|
1359
1154
|
"""Create dashboard schedule.
|
|
1360
1155
|
|
|
1361
1156
|
:param dashboard_id: str
|
|
1362
1157
|
UUID identifying the dashboard to which the schedule belongs.
|
|
1363
|
-
:param
|
|
1364
|
-
The cron expression describing the frequency of the periodic refresh for this schedule.
|
|
1365
|
-
:param display_name: str (optional)
|
|
1366
|
-
The display name for schedule.
|
|
1367
|
-
:param pause_status: :class:`SchedulePauseStatus` (optional)
|
|
1368
|
-
The status indicates whether this schedule is paused or not.
|
|
1158
|
+
:param schedule: :class:`Schedule` (optional)
|
|
1369
1159
|
|
|
1370
1160
|
:returns: :class:`Schedule`
|
|
1371
1161
|
"""
|
|
1372
|
-
body =
|
|
1373
|
-
if cron_schedule is not None: body['cron_schedule'] = cron_schedule.as_dict()
|
|
1374
|
-
if display_name is not None: body['display_name'] = display_name
|
|
1375
|
-
if pause_status is not None: body['pause_status'] = pause_status.value
|
|
1162
|
+
body = schedule
|
|
1376
1163
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1377
1164
|
|
|
1378
1165
|
res = self._api.do('POST',
|
|
@@ -1381,21 +1168,22 @@ class LakeviewAPI:
|
|
|
1381
1168
|
headers=headers)
|
|
1382
1169
|
return Schedule.from_dict(res)
|
|
1383
1170
|
|
|
1384
|
-
def create_subscription(self,
|
|
1385
|
-
|
|
1171
|
+
def create_subscription(self,
|
|
1172
|
+
dashboard_id: str,
|
|
1173
|
+
schedule_id: str,
|
|
1174
|
+
*,
|
|
1175
|
+
subscription: Optional[Subscription] = None) -> Subscription:
|
|
1386
1176
|
"""Create schedule subscription.
|
|
1387
1177
|
|
|
1388
1178
|
:param dashboard_id: str
|
|
1389
1179
|
UUID identifying the dashboard to which the subscription belongs.
|
|
1390
1180
|
:param schedule_id: str
|
|
1391
1181
|
UUID identifying the schedule to which the subscription belongs.
|
|
1392
|
-
:param
|
|
1393
|
-
Subscriber details for users and destinations to be added as subscribers to the schedule.
|
|
1182
|
+
:param subscription: :class:`Subscription` (optional)
|
|
1394
1183
|
|
|
1395
1184
|
:returns: :class:`Subscription`
|
|
1396
1185
|
"""
|
|
1397
|
-
body =
|
|
1398
|
-
if subscriber is not None: body['subscriber'] = subscriber.as_dict()
|
|
1186
|
+
body = subscription
|
|
1399
1187
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1400
1188
|
|
|
1401
1189
|
res = self._api.do(
|
|
@@ -1729,41 +1517,18 @@ class LakeviewAPI:
|
|
|
1729
1517
|
|
|
1730
1518
|
self._api.do('DELETE', f'/api/2.0/lakeview/dashboards/{dashboard_id}/published', headers=headers)
|
|
1731
1519
|
|
|
1732
|
-
def update(self,
|
|
1733
|
-
dashboard_id: str,
|
|
1734
|
-
*,
|
|
1735
|
-
display_name: Optional[str] = None,
|
|
1736
|
-
etag: Optional[str] = None,
|
|
1737
|
-
serialized_dashboard: Optional[str] = None,
|
|
1738
|
-
warehouse_id: Optional[str] = None) -> Dashboard:
|
|
1520
|
+
def update(self, dashboard_id: str, *, dashboard: Optional[Dashboard] = None) -> Dashboard:
|
|
1739
1521
|
"""Update dashboard.
|
|
1740
1522
|
|
|
1741
1523
|
Update a draft dashboard.
|
|
1742
1524
|
|
|
1743
1525
|
:param dashboard_id: str
|
|
1744
1526
|
UUID identifying the dashboard.
|
|
1745
|
-
:param
|
|
1746
|
-
The display name of the dashboard.
|
|
1747
|
-
:param etag: str (optional)
|
|
1748
|
-
The etag for the dashboard. Can be optionally provided on updates to ensure that the dashboard has
|
|
1749
|
-
not been modified since the last read. This field is excluded in List Dashboards responses.
|
|
1750
|
-
:param serialized_dashboard: str (optional)
|
|
1751
|
-
The contents of the dashboard in serialized string form. This field is excluded in List Dashboards
|
|
1752
|
-
responses. Use the [get dashboard API] to retrieve an example response, which includes the
|
|
1753
|
-
`serialized_dashboard` field. This field provides the structure of the JSON string that represents
|
|
1754
|
-
the dashboard's layout and components.
|
|
1755
|
-
|
|
1756
|
-
[get dashboard API]: https://docs.databricks.com/api/workspace/lakeview/get
|
|
1757
|
-
:param warehouse_id: str (optional)
|
|
1758
|
-
The warehouse ID used to run the dashboard.
|
|
1527
|
+
:param dashboard: :class:`Dashboard` (optional)
|
|
1759
1528
|
|
|
1760
1529
|
:returns: :class:`Dashboard`
|
|
1761
1530
|
"""
|
|
1762
|
-
body =
|
|
1763
|
-
if display_name is not None: body['display_name'] = display_name
|
|
1764
|
-
if etag is not None: body['etag'] = etag
|
|
1765
|
-
if serialized_dashboard is not None: body['serialized_dashboard'] = serialized_dashboard
|
|
1766
|
-
if warehouse_id is not None: body['warehouse_id'] = warehouse_id
|
|
1531
|
+
body = dashboard
|
|
1767
1532
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1768
1533
|
|
|
1769
1534
|
res = self._api.do('PATCH',
|
|
@@ -1775,34 +1540,19 @@ class LakeviewAPI:
|
|
|
1775
1540
|
def update_schedule(self,
|
|
1776
1541
|
dashboard_id: str,
|
|
1777
1542
|
schedule_id: str,
|
|
1778
|
-
cron_schedule: CronSchedule,
|
|
1779
1543
|
*,
|
|
1780
|
-
|
|
1781
|
-
etag: Optional[str] = None,
|
|
1782
|
-
pause_status: Optional[SchedulePauseStatus] = None) -> Schedule:
|
|
1544
|
+
schedule: Optional[Schedule] = None) -> Schedule:
|
|
1783
1545
|
"""Update dashboard schedule.
|
|
1784
1546
|
|
|
1785
1547
|
:param dashboard_id: str
|
|
1786
1548
|
UUID identifying the dashboard to which the schedule belongs.
|
|
1787
1549
|
:param schedule_id: str
|
|
1788
1550
|
UUID identifying the schedule.
|
|
1789
|
-
:param
|
|
1790
|
-
The cron expression describing the frequency of the periodic refresh for this schedule.
|
|
1791
|
-
:param display_name: str (optional)
|
|
1792
|
-
The display name for schedule.
|
|
1793
|
-
:param etag: str (optional)
|
|
1794
|
-
The etag for the schedule. Must be left empty on create, must be provided on updates to ensure that
|
|
1795
|
-
the schedule has not been modified since the last read, and can be optionally provided on delete.
|
|
1796
|
-
:param pause_status: :class:`SchedulePauseStatus` (optional)
|
|
1797
|
-
The status indicates whether this schedule is paused or not.
|
|
1551
|
+
:param schedule: :class:`Schedule` (optional)
|
|
1798
1552
|
|
|
1799
1553
|
:returns: :class:`Schedule`
|
|
1800
1554
|
"""
|
|
1801
|
-
body =
|
|
1802
|
-
if cron_schedule is not None: body['cron_schedule'] = cron_schedule.as_dict()
|
|
1803
|
-
if display_name is not None: body['display_name'] = display_name
|
|
1804
|
-
if etag is not None: body['etag'] = etag
|
|
1805
|
-
if pause_status is not None: body['pause_status'] = pause_status.value
|
|
1555
|
+
body = schedule
|
|
1806
1556
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1807
1557
|
|
|
1808
1558
|
res = self._api.do('PUT',
|
databricks/sdk/service/iam.py
CHANGED
|
@@ -2643,7 +2643,8 @@ class PermissionsAPI:
|
|
|
2643
2643
|
access_control_list: Optional[List[AccessControlRequest]] = None) -> ObjectPermissions:
|
|
2644
2644
|
"""Set object permissions.
|
|
2645
2645
|
|
|
2646
|
-
Sets permissions on an object
|
|
2646
|
+
Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct
|
|
2647
|
+
permissions if none are specified. Objects can inherit permissions from their parent objects or root
|
|
2647
2648
|
object.
|
|
2648
2649
|
|
|
2649
2650
|
:param request_object_type: str
|
|
@@ -3205,7 +3206,8 @@ class UsersAPI:
|
|
|
3205
3206
|
access_control_list: Optional[List[PasswordAccessControlRequest]] = None) -> PasswordPermissions:
|
|
3206
3207
|
"""Set password permissions.
|
|
3207
3208
|
|
|
3208
|
-
Sets permissions on
|
|
3209
|
+
Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct
|
|
3210
|
+
permissions if none are specified. Objects can inherit permissions from their root object.
|
|
3209
3211
|
|
|
3210
3212
|
:param access_control_list: List[:class:`PasswordAccessControlRequest`] (optional)
|
|
3211
3213
|
|