databricks-sdk 0.56.0__py3-none-any.whl → 0.57.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 +15 -9
- databricks/sdk/service/aibuilder.py +157 -16
- databricks/sdk/service/apps.py +14 -42
- databricks/sdk/service/billing.py +17 -51
- databricks/sdk/service/catalog.py +198 -399
- databricks/sdk/service/cleanrooms.py +11 -33
- databricks/sdk/service/compute.py +63 -189
- databricks/sdk/service/dashboards.py +21 -63
- databricks/sdk/service/database.py +45 -30
- databricks/sdk/service/files.py +18 -54
- databricks/sdk/service/iam.py +55 -165
- databricks/sdk/service/jobs.py +232 -85
- databricks/sdk/service/marketplace.py +46 -146
- databricks/sdk/service/ml.py +455 -216
- databricks/sdk/service/oauth2.py +17 -45
- databricks/sdk/service/pipelines.py +81 -40
- databricks/sdk/service/provisioning.py +30 -90
- databricks/sdk/service/qualitymonitorv2.py +5 -15
- databricks/sdk/service/serving.py +30 -42
- databricks/sdk/service/settings.py +103 -314
- databricks/sdk/service/sharing.py +30 -86
- databricks/sdk/service/sql.py +74 -184
- databricks/sdk/service/vectorsearch.py +13 -43
- databricks/sdk/service/workspace.py +35 -105
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.57.0.dist-info}/METADATA +1 -1
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.57.0.dist-info}/RECORD +31 -31
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.57.0.dist-info}/WHEEL +0 -0
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.57.0.dist-info}/licenses/LICENSE +0 -0
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.57.0.dist-info}/licenses/NOTICE +0 -0
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.57.0.dist-info}/top_level.txt +0 -0
databricks/sdk/service/sql.py
CHANGED
|
@@ -5719,12 +5719,16 @@ class QueryEditContent:
|
|
|
5719
5719
|
@dataclass
|
|
5720
5720
|
class QueryFilter:
|
|
5721
5721
|
query_start_time_range: Optional[TimeRange] = None
|
|
5722
|
-
"""A range filter for query submitted time. The time range must be
|
|
5722
|
+
"""A range filter for query submitted time. The time range must be less than or equal to 30 days."""
|
|
5723
5723
|
|
|
5724
5724
|
statement_ids: Optional[List[str]] = None
|
|
5725
5725
|
"""A list of statement IDs."""
|
|
5726
5726
|
|
|
5727
5727
|
statuses: Optional[List[QueryStatus]] = None
|
|
5728
|
+
"""A list of statuses (QUEUED, RUNNING, CANCELED, FAILED, FINISHED) to match query results.
|
|
5729
|
+
Corresponds to the `status` field in the response. Filtering for multiple statuses is not
|
|
5730
|
+
recommended. Instead, opt to filter by a single status multiple times and then combine the
|
|
5731
|
+
results."""
|
|
5728
5732
|
|
|
5729
5733
|
user_ids: Optional[List[int]] = None
|
|
5730
5734
|
"""A list of user IDs who ran the queries."""
|
|
@@ -5785,7 +5789,9 @@ class QueryInfo:
|
|
|
5785
5789
|
are expected to remain static over time, this cannot be guaranteed."""
|
|
5786
5790
|
|
|
5787
5791
|
duration: Optional[int] = None
|
|
5788
|
-
"""Total
|
|
5792
|
+
"""Total time of the statement execution. This value does not include the time taken to retrieve
|
|
5793
|
+
the results, which can result in a discrepancy between this value and the start-to-finish
|
|
5794
|
+
wall-clock time."""
|
|
5789
5795
|
|
|
5790
5796
|
endpoint_id: Optional[str] = None
|
|
5791
5797
|
"""Alias for `warehouse_id`."""
|
|
@@ -8669,9 +8675,7 @@ class AlertsAPI:
|
|
|
8669
8675
|
def create(
|
|
8670
8676
|
self, *, alert: Optional[CreateAlertRequestAlert] = None, auto_resolve_display_name: Optional[bool] = None
|
|
8671
8677
|
) -> Alert:
|
|
8672
|
-
"""
|
|
8673
|
-
|
|
8674
|
-
Creates an alert.
|
|
8678
|
+
"""Creates an alert.
|
|
8675
8679
|
|
|
8676
8680
|
:param alert: :class:`CreateAlertRequestAlert` (optional)
|
|
8677
8681
|
:param auto_resolve_display_name: bool (optional)
|
|
@@ -8694,9 +8698,7 @@ class AlertsAPI:
|
|
|
8694
8698
|
return Alert.from_dict(res)
|
|
8695
8699
|
|
|
8696
8700
|
def delete(self, id: str):
|
|
8697
|
-
"""
|
|
8698
|
-
|
|
8699
|
-
Moves an alert to the trash. Trashed alerts immediately disappear from searches and list views, and
|
|
8701
|
+
"""Moves an alert to the trash. Trashed alerts immediately disappear from searches and list views, and
|
|
8700
8702
|
can no longer trigger. You can restore a trashed alert through the UI. A trashed alert is permanently
|
|
8701
8703
|
deleted after 30 days.
|
|
8702
8704
|
|
|
@@ -8712,9 +8714,7 @@ class AlertsAPI:
|
|
|
8712
8714
|
self._api.do("DELETE", f"/api/2.0/sql/alerts/{id}", headers=headers)
|
|
8713
8715
|
|
|
8714
8716
|
def get(self, id: str) -> Alert:
|
|
8715
|
-
"""
|
|
8716
|
-
|
|
8717
|
-
Gets an alert.
|
|
8717
|
+
"""Gets an alert.
|
|
8718
8718
|
|
|
8719
8719
|
:param id: str
|
|
8720
8720
|
|
|
@@ -8731,9 +8731,7 @@ class AlertsAPI:
|
|
|
8731
8731
|
def list(
|
|
8732
8732
|
self, *, page_size: Optional[int] = None, page_token: Optional[str] = None
|
|
8733
8733
|
) -> Iterator[ListAlertsResponseAlert]:
|
|
8734
|
-
"""
|
|
8735
|
-
|
|
8736
|
-
Gets a list of alerts accessible to the user, ordered by creation time. **Warning:** Calling this API
|
|
8734
|
+
"""Gets a list of alerts accessible to the user, ordered by creation time. **Warning:** Calling this API
|
|
8737
8735
|
concurrently 10 or more times could result in throttling, service degradation, or a temporary ban.
|
|
8738
8736
|
|
|
8739
8737
|
:param page_size: int (optional)
|
|
@@ -8768,9 +8766,7 @@ class AlertsAPI:
|
|
|
8768
8766
|
alert: Optional[UpdateAlertRequestAlert] = None,
|
|
8769
8767
|
auto_resolve_display_name: Optional[bool] = None,
|
|
8770
8768
|
) -> Alert:
|
|
8771
|
-
"""
|
|
8772
|
-
|
|
8773
|
-
Updates an alert.
|
|
8769
|
+
"""Updates an alert.
|
|
8774
8770
|
|
|
8775
8771
|
:param id: str
|
|
8776
8772
|
:param update_mask: str
|
|
@@ -8829,9 +8825,7 @@ class AlertsLegacyAPI:
|
|
|
8829
8825
|
parent: Optional[str] = None,
|
|
8830
8826
|
rearm: Optional[int] = None,
|
|
8831
8827
|
) -> LegacyAlert:
|
|
8832
|
-
"""
|
|
8833
|
-
|
|
8834
|
-
Creates an alert. An alert is a Databricks SQL object that periodically runs a query, evaluates a
|
|
8828
|
+
"""Creates an alert. An alert is a Databricks SQL object that periodically runs a query, evaluates a
|
|
8835
8829
|
condition of its result, and notifies users or notification destinations if the condition was met.
|
|
8836
8830
|
|
|
8837
8831
|
**Note**: A new version of the Databricks SQL API is now available. Please use :method:alerts/create
|
|
@@ -8873,9 +8867,7 @@ class AlertsLegacyAPI:
|
|
|
8873
8867
|
return LegacyAlert.from_dict(res)
|
|
8874
8868
|
|
|
8875
8869
|
def delete(self, alert_id: str):
|
|
8876
|
-
"""
|
|
8877
|
-
|
|
8878
|
-
Deletes an alert. Deleted alerts are no longer accessible and cannot be restored. **Note**: Unlike
|
|
8870
|
+
"""Deletes an alert. Deleted alerts are no longer accessible and cannot be restored. **Note**: Unlike
|
|
8879
8871
|
queries and dashboards, alerts cannot be moved to the trash.
|
|
8880
8872
|
|
|
8881
8873
|
**Note**: A new version of the Databricks SQL API is now available. Please use :method:alerts/delete
|
|
@@ -8895,9 +8887,7 @@ class AlertsLegacyAPI:
|
|
|
8895
8887
|
self._api.do("DELETE", f"/api/2.0/preview/sql/alerts/{alert_id}", headers=headers)
|
|
8896
8888
|
|
|
8897
8889
|
def get(self, alert_id: str) -> LegacyAlert:
|
|
8898
|
-
"""
|
|
8899
|
-
|
|
8900
|
-
Gets an alert.
|
|
8890
|
+
"""Gets an alert.
|
|
8901
8891
|
|
|
8902
8892
|
**Note**: A new version of the Databricks SQL API is now available. Please use :method:alerts/get
|
|
8903
8893
|
instead. [Learn more]
|
|
@@ -8917,9 +8907,7 @@ class AlertsLegacyAPI:
|
|
|
8917
8907
|
return LegacyAlert.from_dict(res)
|
|
8918
8908
|
|
|
8919
8909
|
def list(self) -> Iterator[LegacyAlert]:
|
|
8920
|
-
"""
|
|
8921
|
-
|
|
8922
|
-
Gets a list of alerts.
|
|
8910
|
+
"""Gets a list of alerts.
|
|
8923
8911
|
|
|
8924
8912
|
**Note**: A new version of the Databricks SQL API is now available. Please use :method:alerts/list
|
|
8925
8913
|
instead. [Learn more]
|
|
@@ -8937,9 +8925,7 @@ class AlertsLegacyAPI:
|
|
|
8937
8925
|
return [LegacyAlert.from_dict(v) for v in res]
|
|
8938
8926
|
|
|
8939
8927
|
def update(self, alert_id: str, name: str, options: AlertOptions, query_id: str, *, rearm: Optional[int] = None):
|
|
8940
|
-
"""
|
|
8941
|
-
|
|
8942
|
-
Updates an alert.
|
|
8928
|
+
"""Updates an alert.
|
|
8943
8929
|
|
|
8944
8930
|
**Note**: A new version of the Databricks SQL API is now available. Please use :method:alerts/update
|
|
8945
8931
|
instead. [Learn more]
|
|
@@ -8983,9 +8969,7 @@ class AlertsV2API:
|
|
|
8983
8969
|
self._api = api_client
|
|
8984
8970
|
|
|
8985
8971
|
def create_alert(self, alert: AlertV2) -> AlertV2:
|
|
8986
|
-
"""Create
|
|
8987
|
-
|
|
8988
|
-
Create Alert
|
|
8972
|
+
"""Create Alert
|
|
8989
8973
|
|
|
8990
8974
|
:param alert: :class:`AlertV2`
|
|
8991
8975
|
|
|
@@ -9001,9 +8985,7 @@ class AlertsV2API:
|
|
|
9001
8985
|
return AlertV2.from_dict(res)
|
|
9002
8986
|
|
|
9003
8987
|
def get_alert(self, id: str) -> AlertV2:
|
|
9004
|
-
"""
|
|
9005
|
-
|
|
9006
|
-
Gets an alert.
|
|
8988
|
+
"""Gets an alert.
|
|
9007
8989
|
|
|
9008
8990
|
:param id: str
|
|
9009
8991
|
|
|
@@ -9018,9 +9000,7 @@ class AlertsV2API:
|
|
|
9018
9000
|
return AlertV2.from_dict(res)
|
|
9019
9001
|
|
|
9020
9002
|
def list_alerts(self, *, page_size: Optional[int] = None, page_token: Optional[str] = None) -> Iterator[AlertV2]:
|
|
9021
|
-
"""
|
|
9022
|
-
|
|
9023
|
-
Gets a list of alerts accessible to the user, ordered by creation time.
|
|
9003
|
+
"""Gets a list of alerts accessible to the user, ordered by creation time.
|
|
9024
9004
|
|
|
9025
9005
|
:param page_size: int (optional)
|
|
9026
9006
|
:param page_token: str (optional)
|
|
@@ -9047,9 +9027,7 @@ class AlertsV2API:
|
|
|
9047
9027
|
query["page_token"] = json["next_page_token"]
|
|
9048
9028
|
|
|
9049
9029
|
def trash_alert(self, id: str):
|
|
9050
|
-
"""
|
|
9051
|
-
|
|
9052
|
-
Moves an alert to the trash. Trashed alerts immediately disappear from list views, and can no longer
|
|
9030
|
+
"""Moves an alert to the trash. Trashed alerts immediately disappear from list views, and can no longer
|
|
9053
9031
|
trigger. You can restore a trashed alert through the UI. A trashed alert is permanently deleted after
|
|
9054
9032
|
30 days.
|
|
9055
9033
|
|
|
@@ -9065,9 +9043,7 @@ class AlertsV2API:
|
|
|
9065
9043
|
self._api.do("DELETE", f"/api/2.0/alerts/{id}", headers=headers)
|
|
9066
9044
|
|
|
9067
9045
|
def update_alert(self, id: str, alert: AlertV2, update_mask: str) -> AlertV2:
|
|
9068
|
-
"""Update
|
|
9069
|
-
|
|
9070
|
-
Update alert
|
|
9046
|
+
"""Update alert
|
|
9071
9047
|
|
|
9072
9048
|
:param id: str
|
|
9073
9049
|
UUID identifying the alert.
|
|
@@ -9114,7 +9090,7 @@ class DashboardWidgetsAPI:
|
|
|
9114
9090
|
text: Optional[str] = None,
|
|
9115
9091
|
visualization_id: Optional[str] = None,
|
|
9116
9092
|
) -> Widget:
|
|
9117
|
-
"""Add widget to a dashboard
|
|
9093
|
+
"""Add widget to a dashboard
|
|
9118
9094
|
|
|
9119
9095
|
:param dashboard_id: str
|
|
9120
9096
|
Dashboard ID returned by :method:dashboards/create.
|
|
@@ -9149,7 +9125,7 @@ class DashboardWidgetsAPI:
|
|
|
9149
9125
|
return Widget.from_dict(res)
|
|
9150
9126
|
|
|
9151
9127
|
def delete(self, id: str):
|
|
9152
|
-
"""Remove widget
|
|
9128
|
+
"""Remove widget
|
|
9153
9129
|
|
|
9154
9130
|
:param id: str
|
|
9155
9131
|
Widget ID returned by :method:dashboardwidgets/create
|
|
@@ -9173,7 +9149,7 @@ class DashboardWidgetsAPI:
|
|
|
9173
9149
|
text: Optional[str] = None,
|
|
9174
9150
|
visualization_id: Optional[str] = None,
|
|
9175
9151
|
) -> Widget:
|
|
9176
|
-
"""Update existing widget
|
|
9152
|
+
"""Update existing widget
|
|
9177
9153
|
|
|
9178
9154
|
:param id: str
|
|
9179
9155
|
Widget ID returned by :method:dashboardwidgets/create
|
|
@@ -9269,9 +9245,7 @@ class DashboardsAPI:
|
|
|
9269
9245
|
return Dashboard.from_dict(res)
|
|
9270
9246
|
|
|
9271
9247
|
def delete(self, dashboard_id: str):
|
|
9272
|
-
"""
|
|
9273
|
-
|
|
9274
|
-
Moves a dashboard to the trash. Trashed dashboards do not appear in list views or searches, and cannot
|
|
9248
|
+
"""Moves a dashboard to the trash. Trashed dashboards do not appear in list views or searches, and cannot
|
|
9275
9249
|
be shared.
|
|
9276
9250
|
|
|
9277
9251
|
:param dashboard_id: str
|
|
@@ -9286,9 +9260,7 @@ class DashboardsAPI:
|
|
|
9286
9260
|
self._api.do("DELETE", f"/api/2.0/preview/sql/dashboards/{dashboard_id}", headers=headers)
|
|
9287
9261
|
|
|
9288
9262
|
def get(self, dashboard_id: str) -> Dashboard:
|
|
9289
|
-
"""
|
|
9290
|
-
|
|
9291
|
-
Returns a JSON representation of a dashboard object, including its visualization and query objects.
|
|
9263
|
+
"""Returns a JSON representation of a dashboard object, including its visualization and query objects.
|
|
9292
9264
|
|
|
9293
9265
|
:param dashboard_id: str
|
|
9294
9266
|
|
|
@@ -9310,9 +9282,7 @@ class DashboardsAPI:
|
|
|
9310
9282
|
page_size: Optional[int] = None,
|
|
9311
9283
|
q: Optional[str] = None,
|
|
9312
9284
|
) -> Iterator[Dashboard]:
|
|
9313
|
-
"""
|
|
9314
|
-
|
|
9315
|
-
Fetch a paginated list of dashboard objects.
|
|
9285
|
+
"""Fetch a paginated list of dashboard objects.
|
|
9316
9286
|
|
|
9317
9287
|
**Warning**: Calling this API concurrently 10 or more times could result in throttling, service
|
|
9318
9288
|
degradation, or a temporary ban.
|
|
@@ -9359,9 +9329,7 @@ class DashboardsAPI:
|
|
|
9359
9329
|
query["page"] += 1
|
|
9360
9330
|
|
|
9361
9331
|
def restore(self, dashboard_id: str):
|
|
9362
|
-
"""
|
|
9363
|
-
|
|
9364
|
-
A restored dashboard appears in list views and searches and can be shared.
|
|
9332
|
+
"""A restored dashboard appears in list views and searches and can be shared.
|
|
9365
9333
|
|
|
9366
9334
|
:param dashboard_id: str
|
|
9367
9335
|
|
|
@@ -9382,9 +9350,7 @@ class DashboardsAPI:
|
|
|
9382
9350
|
run_as_role: Optional[RunAsRole] = None,
|
|
9383
9351
|
tags: Optional[List[str]] = None,
|
|
9384
9352
|
) -> Dashboard:
|
|
9385
|
-
"""
|
|
9386
|
-
|
|
9387
|
-
Modify this dashboard definition. This operation only affects attributes of the dashboard object. It
|
|
9353
|
+
"""Modify this dashboard definition. This operation only affects attributes of the dashboard object. It
|
|
9388
9354
|
does not add, modify, or remove widgets.
|
|
9389
9355
|
|
|
9390
9356
|
**Note**: You cannot undo this operation.
|
|
@@ -9432,9 +9398,7 @@ class DataSourcesAPI:
|
|
|
9432
9398
|
self._api = api_client
|
|
9433
9399
|
|
|
9434
9400
|
def list(self) -> Iterator[DataSource]:
|
|
9435
|
-
"""
|
|
9436
|
-
|
|
9437
|
-
Retrieves a full list of SQL warehouses available in this workspace. All fields that appear in this
|
|
9401
|
+
"""Retrieves a full list of SQL warehouses available in this workspace. All fields that appear in this
|
|
9438
9402
|
API response are enumerated for clarity. However, you need only a SQL warehouse's `id` to create new
|
|
9439
9403
|
queries against it.
|
|
9440
9404
|
|
|
@@ -9475,9 +9439,7 @@ class DbsqlPermissionsAPI:
|
|
|
9475
9439
|
self._api = api_client
|
|
9476
9440
|
|
|
9477
9441
|
def get(self, object_type: ObjectTypePlural, object_id: str) -> GetResponse:
|
|
9478
|
-
"""
|
|
9479
|
-
|
|
9480
|
-
Gets a JSON representation of the access control list (ACL) for a specified object.
|
|
9442
|
+
"""Gets a JSON representation of the access control list (ACL) for a specified object.
|
|
9481
9443
|
|
|
9482
9444
|
**Note**: A new version of the Databricks SQL API is now available. Please use
|
|
9483
9445
|
:method:workspace/getpermissions instead. [Learn more]
|
|
@@ -9506,9 +9468,7 @@ class DbsqlPermissionsAPI:
|
|
|
9506
9468
|
*,
|
|
9507
9469
|
access_control_list: Optional[List[AccessControl]] = None,
|
|
9508
9470
|
) -> SetResponse:
|
|
9509
|
-
"""
|
|
9510
|
-
|
|
9511
|
-
Sets the access control list (ACL) for a specified object. This operation will complete rewrite the
|
|
9471
|
+
"""Sets the access control list (ACL) for a specified object. This operation will complete rewrite the
|
|
9512
9472
|
ACL.
|
|
9513
9473
|
|
|
9514
9474
|
**Note**: A new version of the Databricks SQL API is now available. Please use
|
|
@@ -9540,9 +9500,7 @@ class DbsqlPermissionsAPI:
|
|
|
9540
9500
|
def transfer_ownership(
|
|
9541
9501
|
self, object_type: OwnableObjectType, object_id: TransferOwnershipObjectId, *, new_owner: Optional[str] = None
|
|
9542
9502
|
) -> Success:
|
|
9543
|
-
"""
|
|
9544
|
-
|
|
9545
|
-
Transfers ownership of a dashboard, query, or alert to an active user. Requires an admin API key.
|
|
9503
|
+
"""Transfers ownership of a dashboard, query, or alert to an active user. Requires an admin API key.
|
|
9546
9504
|
|
|
9547
9505
|
**Note**: A new version of the Databricks SQL API is now available. For queries and alerts, please use
|
|
9548
9506
|
:method:queries/update and :method:alerts/update respectively instead. [Learn more]
|
|
@@ -9586,9 +9544,7 @@ class QueriesAPI:
|
|
|
9586
9544
|
def create(
|
|
9587
9545
|
self, *, auto_resolve_display_name: Optional[bool] = None, query: Optional[CreateQueryRequestQuery] = None
|
|
9588
9546
|
) -> Query:
|
|
9589
|
-
"""
|
|
9590
|
-
|
|
9591
|
-
Creates a query.
|
|
9547
|
+
"""Creates a query.
|
|
9592
9548
|
|
|
9593
9549
|
:param auto_resolve_display_name: bool (optional)
|
|
9594
9550
|
If true, automatically resolve query display name conflicts. Otherwise, fail the request if the
|
|
@@ -9611,9 +9567,7 @@ class QueriesAPI:
|
|
|
9611
9567
|
return Query.from_dict(res)
|
|
9612
9568
|
|
|
9613
9569
|
def delete(self, id: str):
|
|
9614
|
-
"""
|
|
9615
|
-
|
|
9616
|
-
Moves a query to the trash. Trashed queries immediately disappear from searches and list views, and
|
|
9570
|
+
"""Moves a query to the trash. Trashed queries immediately disappear from searches and list views, and
|
|
9617
9571
|
cannot be used for alerts. You can restore a trashed query through the UI. A trashed query is
|
|
9618
9572
|
permanently deleted after 30 days.
|
|
9619
9573
|
|
|
@@ -9629,9 +9583,7 @@ class QueriesAPI:
|
|
|
9629
9583
|
self._api.do("DELETE", f"/api/2.0/sql/queries/{id}", headers=headers)
|
|
9630
9584
|
|
|
9631
9585
|
def get(self, id: str) -> Query:
|
|
9632
|
-
"""
|
|
9633
|
-
|
|
9634
|
-
Gets a query.
|
|
9586
|
+
"""Gets a query.
|
|
9635
9587
|
|
|
9636
9588
|
:param id: str
|
|
9637
9589
|
|
|
@@ -9648,9 +9600,7 @@ class QueriesAPI:
|
|
|
9648
9600
|
def list(
|
|
9649
9601
|
self, *, page_size: Optional[int] = None, page_token: Optional[str] = None
|
|
9650
9602
|
) -> Iterator[ListQueryObjectsResponseQuery]:
|
|
9651
|
-
"""
|
|
9652
|
-
|
|
9653
|
-
Gets a list of queries accessible to the user, ordered by creation time. **Warning:** Calling this API
|
|
9603
|
+
"""Gets a list of queries accessible to the user, ordered by creation time. **Warning:** Calling this API
|
|
9654
9604
|
concurrently 10 or more times could result in throttling, service degradation, or a temporary ban.
|
|
9655
9605
|
|
|
9656
9606
|
:param page_size: int (optional)
|
|
@@ -9680,9 +9630,7 @@ class QueriesAPI:
|
|
|
9680
9630
|
def list_visualizations(
|
|
9681
9631
|
self, id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None
|
|
9682
9632
|
) -> Iterator[Visualization]:
|
|
9683
|
-
"""
|
|
9684
|
-
|
|
9685
|
-
Gets a list of visualizations on a query.
|
|
9633
|
+
"""Gets a list of visualizations on a query.
|
|
9686
9634
|
|
|
9687
9635
|
:param id: str
|
|
9688
9636
|
:param page_size: int (optional)
|
|
@@ -9717,9 +9665,7 @@ class QueriesAPI:
|
|
|
9717
9665
|
auto_resolve_display_name: Optional[bool] = None,
|
|
9718
9666
|
query: Optional[UpdateQueryRequestQuery] = None,
|
|
9719
9667
|
) -> Query:
|
|
9720
|
-
"""
|
|
9721
|
-
|
|
9722
|
-
Updates a query.
|
|
9668
|
+
"""Updates a query.
|
|
9723
9669
|
|
|
9724
9670
|
:param id: str
|
|
9725
9671
|
:param update_mask: str
|
|
@@ -9780,9 +9726,7 @@ class QueriesLegacyAPI:
|
|
|
9780
9726
|
run_as_role: Optional[RunAsRole] = None,
|
|
9781
9727
|
tags: Optional[List[str]] = None,
|
|
9782
9728
|
) -> LegacyQuery:
|
|
9783
|
-
"""
|
|
9784
|
-
|
|
9785
|
-
Creates a new query definition. Queries created with this endpoint belong to the authenticated user
|
|
9729
|
+
"""Creates a new query definition. Queries created with this endpoint belong to the authenticated user
|
|
9786
9730
|
making the request.
|
|
9787
9731
|
|
|
9788
9732
|
The `data_source_id` field specifies the ID of the SQL warehouse to run this query against. You can
|
|
@@ -9846,9 +9790,7 @@ class QueriesLegacyAPI:
|
|
|
9846
9790
|
return LegacyQuery.from_dict(res)
|
|
9847
9791
|
|
|
9848
9792
|
def delete(self, query_id: str):
|
|
9849
|
-
"""
|
|
9850
|
-
|
|
9851
|
-
Moves a query to the trash. Trashed queries immediately disappear from searches and list views, and
|
|
9793
|
+
"""Moves a query to the trash. Trashed queries immediately disappear from searches and list views, and
|
|
9852
9794
|
they cannot be used for alerts. The trash is deleted after 30 days.
|
|
9853
9795
|
|
|
9854
9796
|
**Note**: A new version of the Databricks SQL API is now available. Please use :method:queries/delete
|
|
@@ -9868,9 +9810,7 @@ class QueriesLegacyAPI:
|
|
|
9868
9810
|
self._api.do("DELETE", f"/api/2.0/preview/sql/queries/{query_id}", headers=headers)
|
|
9869
9811
|
|
|
9870
9812
|
def get(self, query_id: str) -> LegacyQuery:
|
|
9871
|
-
"""
|
|
9872
|
-
|
|
9873
|
-
Retrieve a query object definition along with contextual permissions information about the currently
|
|
9813
|
+
"""Retrieve a query object definition along with contextual permissions information about the currently
|
|
9874
9814
|
authenticated user.
|
|
9875
9815
|
|
|
9876
9816
|
**Note**: A new version of the Databricks SQL API is now available. Please use :method:queries/get
|
|
@@ -9898,9 +9838,7 @@ class QueriesLegacyAPI:
|
|
|
9898
9838
|
page_size: Optional[int] = None,
|
|
9899
9839
|
q: Optional[str] = None,
|
|
9900
9840
|
) -> Iterator[LegacyQuery]:
|
|
9901
|
-
"""
|
|
9902
|
-
|
|
9903
|
-
Gets a list of queries. Optionally, this list can be filtered by a search term.
|
|
9841
|
+
"""Gets a list of queries. Optionally, this list can be filtered by a search term.
|
|
9904
9842
|
|
|
9905
9843
|
**Warning**: Calling this API concurrently 10 or more times could result in throttling, service
|
|
9906
9844
|
degradation, or a temporary ban.
|
|
@@ -9964,9 +9902,7 @@ class QueriesLegacyAPI:
|
|
|
9964
9902
|
query["page"] += 1
|
|
9965
9903
|
|
|
9966
9904
|
def restore(self, query_id: str):
|
|
9967
|
-
"""Restore a query.
|
|
9968
|
-
|
|
9969
|
-
Restore a query that has been moved to the trash. A restored query appears in list views and searches.
|
|
9905
|
+
"""Restore a query that has been moved to the trash. A restored query appears in list views and searches.
|
|
9970
9906
|
You can use restored queries for alerts.
|
|
9971
9907
|
|
|
9972
9908
|
**Note**: A new version of the Databricks SQL API is now available. Please see the latest version.
|
|
@@ -9997,9 +9933,7 @@ class QueriesLegacyAPI:
|
|
|
9997
9933
|
run_as_role: Optional[RunAsRole] = None,
|
|
9998
9934
|
tags: Optional[List[str]] = None,
|
|
9999
9935
|
) -> LegacyQuery:
|
|
10000
|
-
"""
|
|
10001
|
-
|
|
10002
|
-
Modify this query definition.
|
|
9936
|
+
"""Modify this query definition.
|
|
10003
9937
|
|
|
10004
9938
|
**Note**: You cannot undo this operation.
|
|
10005
9939
|
|
|
@@ -10070,16 +10004,16 @@ class QueryHistoryAPI:
|
|
|
10070
10004
|
max_results: Optional[int] = None,
|
|
10071
10005
|
page_token: Optional[str] = None,
|
|
10072
10006
|
) -> ListQueriesResponse:
|
|
10073
|
-
"""List
|
|
10074
|
-
|
|
10075
|
-
List the history of queries through SQL warehouses, and serverless compute.
|
|
10007
|
+
"""List the history of queries through SQL warehouses, and serverless compute.
|
|
10076
10008
|
|
|
10077
10009
|
You can filter by user ID, warehouse ID, status, and time range. Most recently started queries are
|
|
10078
10010
|
returned first (up to max_results in request). The pagination token returned in response can be used
|
|
10079
10011
|
to list subsequent query statuses.
|
|
10080
10012
|
|
|
10081
10013
|
:param filter_by: :class:`QueryFilter` (optional)
|
|
10082
|
-
|
|
10014
|
+
An optional filter object to limit query history results. Accepts parameters such as user IDs,
|
|
10015
|
+
endpoint IDs, and statuses to narrow the returned data. In a URL, the parameters of this filter are
|
|
10016
|
+
specified with dot notation. For example: `filter_by.statement_ids`.
|
|
10083
10017
|
:param include_metrics: bool (optional)
|
|
10084
10018
|
Whether to include the query metrics with each query. Only use this for a small subset of queries
|
|
10085
10019
|
(max_results). Defaults to false.
|
|
@@ -10118,9 +10052,7 @@ class QueryVisualizationsAPI:
|
|
|
10118
10052
|
self._api = api_client
|
|
10119
10053
|
|
|
10120
10054
|
def create(self, *, visualization: Optional[CreateVisualizationRequestVisualization] = None) -> Visualization:
|
|
10121
|
-
"""
|
|
10122
|
-
|
|
10123
|
-
Adds a visualization to a query.
|
|
10055
|
+
"""Adds a visualization to a query.
|
|
10124
10056
|
|
|
10125
10057
|
:param visualization: :class:`CreateVisualizationRequestVisualization` (optional)
|
|
10126
10058
|
|
|
@@ -10138,9 +10070,7 @@ class QueryVisualizationsAPI:
|
|
|
10138
10070
|
return Visualization.from_dict(res)
|
|
10139
10071
|
|
|
10140
10072
|
def delete(self, id: str):
|
|
10141
|
-
"""
|
|
10142
|
-
|
|
10143
|
-
Removes a visualization.
|
|
10073
|
+
"""Removes a visualization.
|
|
10144
10074
|
|
|
10145
10075
|
:param id: str
|
|
10146
10076
|
|
|
@@ -10156,9 +10086,7 @@ class QueryVisualizationsAPI:
|
|
|
10156
10086
|
def update(
|
|
10157
10087
|
self, id: str, update_mask: str, *, visualization: Optional[UpdateVisualizationRequestVisualization] = None
|
|
10158
10088
|
) -> Visualization:
|
|
10159
|
-
"""
|
|
10160
|
-
|
|
10161
|
-
Updates a visualization.
|
|
10089
|
+
"""Updates a visualization.
|
|
10162
10090
|
|
|
10163
10091
|
:param id: str
|
|
10164
10092
|
:param update_mask: str
|
|
@@ -10204,9 +10132,7 @@ class QueryVisualizationsLegacyAPI:
|
|
|
10204
10132
|
def create(
|
|
10205
10133
|
self, query_id: str, type: str, options: Any, *, description: Optional[str] = None, name: Optional[str] = None
|
|
10206
10134
|
) -> LegacyVisualization:
|
|
10207
|
-
"""
|
|
10208
|
-
|
|
10209
|
-
Creates visualization in the query.
|
|
10135
|
+
"""Creates visualization in the query.
|
|
10210
10136
|
|
|
10211
10137
|
**Note**: A new version of the Databricks SQL API is now available. Please use
|
|
10212
10138
|
:method:queryvisualizations/create instead. [Learn more]
|
|
@@ -10247,9 +10173,7 @@ class QueryVisualizationsLegacyAPI:
|
|
|
10247
10173
|
return LegacyVisualization.from_dict(res)
|
|
10248
10174
|
|
|
10249
10175
|
def delete(self, id: str):
|
|
10250
|
-
"""
|
|
10251
|
-
|
|
10252
|
-
Removes a visualization from the query.
|
|
10176
|
+
"""Removes a visualization from the query.
|
|
10253
10177
|
|
|
10254
10178
|
**Note**: A new version of the Databricks SQL API is now available. Please use
|
|
10255
10179
|
:method:queryvisualizations/delete instead. [Learn more]
|
|
@@ -10280,9 +10204,7 @@ class QueryVisualizationsLegacyAPI:
|
|
|
10280
10204
|
type: Optional[str] = None,
|
|
10281
10205
|
updated_at: Optional[str] = None,
|
|
10282
10206
|
) -> LegacyVisualization:
|
|
10283
|
-
"""
|
|
10284
|
-
|
|
10285
|
-
Updates visualization in the query.
|
|
10207
|
+
"""Updates visualization in the query.
|
|
10286
10208
|
|
|
10287
10209
|
**Note**: A new version of the Databricks SQL API is now available. Please use
|
|
10288
10210
|
:method:queryvisualizations/update instead. [Learn more]
|
|
@@ -10440,9 +10362,7 @@ class StatementExecutionAPI:
|
|
|
10440
10362
|
self._api = api_client
|
|
10441
10363
|
|
|
10442
10364
|
def cancel_execution(self, statement_id: str):
|
|
10443
|
-
"""
|
|
10444
|
-
|
|
10445
|
-
Requests that an executing statement be canceled. Callers must poll for status to see the terminal
|
|
10365
|
+
"""Requests that an executing statement be canceled. Callers must poll for status to see the terminal
|
|
10446
10366
|
state.
|
|
10447
10367
|
|
|
10448
10368
|
:param statement_id: str
|
|
@@ -10471,7 +10391,7 @@ class StatementExecutionAPI:
|
|
|
10471
10391
|
schema: Optional[str] = None,
|
|
10472
10392
|
wait_timeout: Optional[str] = None,
|
|
10473
10393
|
) -> StatementResponse:
|
|
10474
|
-
"""Execute a SQL statement
|
|
10394
|
+
"""Execute a SQL statement
|
|
10475
10395
|
|
|
10476
10396
|
:param statement: str
|
|
10477
10397
|
The SQL statement to execute. The statement can optionally be parameterized, see `parameters`.
|
|
@@ -10611,9 +10531,7 @@ class StatementExecutionAPI:
|
|
|
10611
10531
|
return StatementResponse.from_dict(res)
|
|
10612
10532
|
|
|
10613
10533
|
def get_statement(self, statement_id: str) -> StatementResponse:
|
|
10614
|
-
"""
|
|
10615
|
-
|
|
10616
|
-
This request can be used to poll for the statement's status. When the `status.state` field is
|
|
10534
|
+
"""This request can be used to poll for the statement's status. When the `status.state` field is
|
|
10617
10535
|
`SUCCEEDED` it will also return the result manifest and the first chunk of the result data. When the
|
|
10618
10536
|
statement is in the terminal states `CANCELED`, `CLOSED` or `FAILED`, it returns HTTP 200 with the
|
|
10619
10537
|
state set. After at least 12 hours in terminal state, the statement is removed from the warehouse and
|
|
@@ -10636,9 +10554,7 @@ class StatementExecutionAPI:
|
|
|
10636
10554
|
return StatementResponse.from_dict(res)
|
|
10637
10555
|
|
|
10638
10556
|
def get_statement_result_chunk_n(self, statement_id: str, chunk_index: int) -> ResultData:
|
|
10639
|
-
"""
|
|
10640
|
-
|
|
10641
|
-
After the statement execution has `SUCCEEDED`, this request can be used to fetch any chunk by index.
|
|
10557
|
+
"""After the statement execution has `SUCCEEDED`, this request can be used to fetch any chunk by index.
|
|
10642
10558
|
Whereas the first chunk with `chunk_index=0` is typically fetched with
|
|
10643
10559
|
:method:statementexecution/executeStatement or :method:statementexecution/getStatement, this request
|
|
10644
10560
|
can be used to fetch subsequent chunks. The response structure is identical to the nested `result`
|
|
@@ -10748,9 +10664,7 @@ class WarehousesAPI:
|
|
|
10748
10664
|
tags: Optional[EndpointTags] = None,
|
|
10749
10665
|
warehouse_type: Optional[CreateWarehouseRequestWarehouseType] = None,
|
|
10750
10666
|
) -> Wait[GetWarehouseResponse]:
|
|
10751
|
-
"""
|
|
10752
|
-
|
|
10753
|
-
Creates a new SQL warehouse.
|
|
10667
|
+
"""Creates a new SQL warehouse.
|
|
10754
10668
|
|
|
10755
10669
|
:param auto_stop_mins: int (optional)
|
|
10756
10670
|
The amount of time in minutes that a SQL warehouse must be idle (i.e., no RUNNING queries) before it
|
|
@@ -10886,9 +10800,7 @@ class WarehousesAPI:
|
|
|
10886
10800
|
).result(timeout=timeout)
|
|
10887
10801
|
|
|
10888
10802
|
def delete(self, id: str):
|
|
10889
|
-
"""
|
|
10890
|
-
|
|
10891
|
-
Deletes a SQL warehouse.
|
|
10803
|
+
"""Deletes a SQL warehouse.
|
|
10892
10804
|
|
|
10893
10805
|
:param id: str
|
|
10894
10806
|
Required. Id of the SQL warehouse.
|
|
@@ -10920,9 +10832,7 @@ class WarehousesAPI:
|
|
|
10920
10832
|
tags: Optional[EndpointTags] = None,
|
|
10921
10833
|
warehouse_type: Optional[EditWarehouseRequestWarehouseType] = None,
|
|
10922
10834
|
) -> Wait[GetWarehouseResponse]:
|
|
10923
|
-
"""
|
|
10924
|
-
|
|
10925
|
-
Updates the configuration for a SQL warehouse.
|
|
10835
|
+
"""Updates the configuration for a SQL warehouse.
|
|
10926
10836
|
|
|
10927
10837
|
:param id: str
|
|
10928
10838
|
Required. Id of the warehouse to configure.
|
|
@@ -11057,9 +10967,7 @@ class WarehousesAPI:
|
|
|
11057
10967
|
).result(timeout=timeout)
|
|
11058
10968
|
|
|
11059
10969
|
def get(self, id: str) -> GetWarehouseResponse:
|
|
11060
|
-
"""
|
|
11061
|
-
|
|
11062
|
-
Gets the information for a single SQL warehouse.
|
|
10970
|
+
"""Gets the information for a single SQL warehouse.
|
|
11063
10971
|
|
|
11064
10972
|
:param id: str
|
|
11065
10973
|
Required. Id of the SQL warehouse.
|
|
@@ -11075,9 +10983,7 @@ class WarehousesAPI:
|
|
|
11075
10983
|
return GetWarehouseResponse.from_dict(res)
|
|
11076
10984
|
|
|
11077
10985
|
def get_permission_levels(self, warehouse_id: str) -> GetWarehousePermissionLevelsResponse:
|
|
11078
|
-
"""
|
|
11079
|
-
|
|
11080
|
-
Gets the permission levels that a user can have on an object.
|
|
10986
|
+
"""Gets the permission levels that a user can have on an object.
|
|
11081
10987
|
|
|
11082
10988
|
:param warehouse_id: str
|
|
11083
10989
|
The SQL warehouse for which to get or manage permissions.
|
|
@@ -11093,9 +10999,7 @@ class WarehousesAPI:
|
|
|
11093
10999
|
return GetWarehousePermissionLevelsResponse.from_dict(res)
|
|
11094
11000
|
|
|
11095
11001
|
def get_permissions(self, warehouse_id: str) -> WarehousePermissions:
|
|
11096
|
-
"""
|
|
11097
|
-
|
|
11098
|
-
Gets the permissions of a SQL warehouse. SQL warehouses can inherit permissions from their root
|
|
11002
|
+
"""Gets the permissions of a SQL warehouse. SQL warehouses can inherit permissions from their root
|
|
11099
11003
|
object.
|
|
11100
11004
|
|
|
11101
11005
|
:param warehouse_id: str
|
|
@@ -11112,9 +11016,7 @@ class WarehousesAPI:
|
|
|
11112
11016
|
return WarehousePermissions.from_dict(res)
|
|
11113
11017
|
|
|
11114
11018
|
def get_workspace_warehouse_config(self) -> GetWorkspaceWarehouseConfigResponse:
|
|
11115
|
-
"""
|
|
11116
|
-
|
|
11117
|
-
Gets the workspace level configuration that is shared by all SQL warehouses in a workspace.
|
|
11019
|
+
"""Gets the workspace level configuration that is shared by all SQL warehouses in a workspace.
|
|
11118
11020
|
|
|
11119
11021
|
:returns: :class:`GetWorkspaceWarehouseConfigResponse`
|
|
11120
11022
|
"""
|
|
@@ -11127,9 +11029,7 @@ class WarehousesAPI:
|
|
|
11127
11029
|
return GetWorkspaceWarehouseConfigResponse.from_dict(res)
|
|
11128
11030
|
|
|
11129
11031
|
def list(self, *, run_as_user_id: Optional[int] = None) -> Iterator[EndpointInfo]:
|
|
11130
|
-
"""
|
|
11131
|
-
|
|
11132
|
-
Lists all SQL warehouses that a user has manager permissions on.
|
|
11032
|
+
"""Lists all SQL warehouses that a user has manager permissions on.
|
|
11133
11033
|
|
|
11134
11034
|
:param run_as_user_id: int (optional)
|
|
11135
11035
|
Service Principal which will be used to fetch the list of warehouses. If not specified, the user
|
|
@@ -11152,9 +11052,7 @@ class WarehousesAPI:
|
|
|
11152
11052
|
def set_permissions(
|
|
11153
11053
|
self, warehouse_id: str, *, access_control_list: Optional[List[WarehouseAccessControlRequest]] = None
|
|
11154
11054
|
) -> WarehousePermissions:
|
|
11155
|
-
"""
|
|
11156
|
-
|
|
11157
|
-
Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct
|
|
11055
|
+
"""Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct
|
|
11158
11056
|
permissions if none are specified. Objects can inherit permissions from their root object.
|
|
11159
11057
|
|
|
11160
11058
|
:param warehouse_id: str
|
|
@@ -11187,9 +11085,7 @@ class WarehousesAPI:
|
|
|
11187
11085
|
security_policy: Optional[SetWorkspaceWarehouseConfigRequestSecurityPolicy] = None,
|
|
11188
11086
|
sql_configuration_parameters: Optional[RepeatedEndpointConfPairs] = None,
|
|
11189
11087
|
):
|
|
11190
|
-
"""
|
|
11191
|
-
|
|
11192
|
-
Sets the workspace level configuration that is shared by all SQL warehouses in a workspace.
|
|
11088
|
+
"""Sets the workspace level configuration that is shared by all SQL warehouses in a workspace.
|
|
11193
11089
|
|
|
11194
11090
|
:param channel: :class:`Channel` (optional)
|
|
11195
11091
|
Optional: Channel selection details
|
|
@@ -11243,9 +11139,7 @@ class WarehousesAPI:
|
|
|
11243
11139
|
self._api.do("PUT", "/api/2.0/sql/config/warehouses", body=body, headers=headers)
|
|
11244
11140
|
|
|
11245
11141
|
def start(self, id: str) -> Wait[GetWarehouseResponse]:
|
|
11246
|
-
"""
|
|
11247
|
-
|
|
11248
|
-
Starts a SQL warehouse.
|
|
11142
|
+
"""Starts a SQL warehouse.
|
|
11249
11143
|
|
|
11250
11144
|
:param id: str
|
|
11251
11145
|
Required. Id of the SQL warehouse.
|
|
@@ -11266,9 +11160,7 @@ class WarehousesAPI:
|
|
|
11266
11160
|
return self.start(id=id).result(timeout=timeout)
|
|
11267
11161
|
|
|
11268
11162
|
def stop(self, id: str) -> Wait[GetWarehouseResponse]:
|
|
11269
|
-
"""
|
|
11270
|
-
|
|
11271
|
-
Stops a SQL warehouse.
|
|
11163
|
+
"""Stops a SQL warehouse.
|
|
11272
11164
|
|
|
11273
11165
|
:param id: str
|
|
11274
11166
|
Required. Id of the SQL warehouse.
|
|
@@ -11291,9 +11183,7 @@ class WarehousesAPI:
|
|
|
11291
11183
|
def update_permissions(
|
|
11292
11184
|
self, warehouse_id: str, *, access_control_list: Optional[List[WarehouseAccessControlRequest]] = None
|
|
11293
11185
|
) -> WarehousePermissions:
|
|
11294
|
-
"""
|
|
11295
|
-
|
|
11296
|
-
Updates the permissions on a SQL warehouse. SQL warehouses can inherit permissions from their root
|
|
11186
|
+
"""Updates the permissions on a SQL warehouse. SQL warehouses can inherit permissions from their root
|
|
11297
11187
|
object.
|
|
11298
11188
|
|
|
11299
11189
|
:param warehouse_id: str
|