databricks-sdk 0.56.0__py3-none-any.whl → 0.58.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 +38 -11
- databricks/sdk/service/aibuilder.py +122 -17
- databricks/sdk/service/apps.py +15 -45
- databricks/sdk/service/billing.py +70 -74
- databricks/sdk/service/catalog.py +1898 -557
- databricks/sdk/service/cleanrooms.py +14 -55
- databricks/sdk/service/compute.py +305 -508
- databricks/sdk/service/dashboards.py +148 -223
- databricks/sdk/service/database.py +657 -127
- databricks/sdk/service/files.py +18 -54
- databricks/sdk/service/iam.py +55 -165
- databricks/sdk/service/jobs.py +238 -214
- databricks/sdk/service/marketplace.py +47 -146
- databricks/sdk/service/ml.py +1137 -447
- databricks/sdk/service/oauth2.py +17 -46
- databricks/sdk/service/pipelines.py +93 -69
- databricks/sdk/service/provisioning.py +34 -212
- databricks/sdk/service/qualitymonitorv2.py +5 -33
- databricks/sdk/service/serving.py +69 -55
- databricks/sdk/service/settings.py +106 -434
- databricks/sdk/service/sharing.py +33 -95
- databricks/sdk/service/sql.py +164 -254
- databricks/sdk/service/vectorsearch.py +13 -62
- databricks/sdk/service/workspace.py +36 -110
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.58.0.dist-info}/METADATA +1 -1
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.58.0.dist-info}/RECORD +31 -31
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.58.0.dist-info}/WHEEL +0 -0
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.58.0.dist-info}/licenses/LICENSE +0 -0
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.58.0.dist-info}/licenses/NOTICE +0 -0
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.58.0.dist-info}/top_level.txt +0 -0
|
@@ -253,42 +253,6 @@ class DashboardView(Enum):
|
|
|
253
253
|
DASHBOARD_VIEW_BASIC = "DASHBOARD_VIEW_BASIC"
|
|
254
254
|
|
|
255
255
|
|
|
256
|
-
@dataclass
|
|
257
|
-
class DeleteScheduleResponse:
|
|
258
|
-
def as_dict(self) -> dict:
|
|
259
|
-
"""Serializes the DeleteScheduleResponse into a dictionary suitable for use as a JSON request body."""
|
|
260
|
-
body = {}
|
|
261
|
-
return body
|
|
262
|
-
|
|
263
|
-
def as_shallow_dict(self) -> dict:
|
|
264
|
-
"""Serializes the DeleteScheduleResponse into a shallow dictionary of its immediate attributes."""
|
|
265
|
-
body = {}
|
|
266
|
-
return body
|
|
267
|
-
|
|
268
|
-
@classmethod
|
|
269
|
-
def from_dict(cls, d: Dict[str, Any]) -> DeleteScheduleResponse:
|
|
270
|
-
"""Deserializes the DeleteScheduleResponse from a dictionary."""
|
|
271
|
-
return cls()
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
@dataclass
|
|
275
|
-
class DeleteSubscriptionResponse:
|
|
276
|
-
def as_dict(self) -> dict:
|
|
277
|
-
"""Serializes the DeleteSubscriptionResponse into a dictionary suitable for use as a JSON request body."""
|
|
278
|
-
body = {}
|
|
279
|
-
return body
|
|
280
|
-
|
|
281
|
-
def as_shallow_dict(self) -> dict:
|
|
282
|
-
"""Serializes the DeleteSubscriptionResponse into a shallow dictionary of its immediate attributes."""
|
|
283
|
-
body = {}
|
|
284
|
-
return body
|
|
285
|
-
|
|
286
|
-
@classmethod
|
|
287
|
-
def from_dict(cls, d: Dict[str, Any]) -> DeleteSubscriptionResponse:
|
|
288
|
-
"""Deserializes the DeleteSubscriptionResponse from a dictionary."""
|
|
289
|
-
return cls()
|
|
290
|
-
|
|
291
|
-
|
|
292
256
|
@dataclass
|
|
293
257
|
class GenieAttachment:
|
|
294
258
|
"""Genie AI Response"""
|
|
@@ -409,6 +373,46 @@ class GenieConversation:
|
|
|
409
373
|
)
|
|
410
374
|
|
|
411
375
|
|
|
376
|
+
@dataclass
|
|
377
|
+
class GenieConversationSummary:
|
|
378
|
+
conversation_id: str
|
|
379
|
+
|
|
380
|
+
title: str
|
|
381
|
+
|
|
382
|
+
created_timestamp: int
|
|
383
|
+
|
|
384
|
+
def as_dict(self) -> dict:
|
|
385
|
+
"""Serializes the GenieConversationSummary into a dictionary suitable for use as a JSON request body."""
|
|
386
|
+
body = {}
|
|
387
|
+
if self.conversation_id is not None:
|
|
388
|
+
body["conversation_id"] = self.conversation_id
|
|
389
|
+
if self.created_timestamp is not None:
|
|
390
|
+
body["created_timestamp"] = self.created_timestamp
|
|
391
|
+
if self.title is not None:
|
|
392
|
+
body["title"] = self.title
|
|
393
|
+
return body
|
|
394
|
+
|
|
395
|
+
def as_shallow_dict(self) -> dict:
|
|
396
|
+
"""Serializes the GenieConversationSummary into a shallow dictionary of its immediate attributes."""
|
|
397
|
+
body = {}
|
|
398
|
+
if self.conversation_id is not None:
|
|
399
|
+
body["conversation_id"] = self.conversation_id
|
|
400
|
+
if self.created_timestamp is not None:
|
|
401
|
+
body["created_timestamp"] = self.created_timestamp
|
|
402
|
+
if self.title is not None:
|
|
403
|
+
body["title"] = self.title
|
|
404
|
+
return body
|
|
405
|
+
|
|
406
|
+
@classmethod
|
|
407
|
+
def from_dict(cls, d: Dict[str, Any]) -> GenieConversationSummary:
|
|
408
|
+
"""Deserializes the GenieConversationSummary from a dictionary."""
|
|
409
|
+
return cls(
|
|
410
|
+
conversation_id=d.get("conversation_id", None),
|
|
411
|
+
created_timestamp=d.get("created_timestamp", None),
|
|
412
|
+
title=d.get("title", None),
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
|
|
412
416
|
@dataclass
|
|
413
417
|
class GenieCreateConversationMessageRequest:
|
|
414
418
|
content: str
|
|
@@ -453,80 +457,64 @@ class GenieCreateConversationMessageRequest:
|
|
|
453
457
|
|
|
454
458
|
|
|
455
459
|
@dataclass
|
|
456
|
-
class
|
|
457
|
-
download_id: Optional[str] = None
|
|
458
|
-
"""Download ID. Use this ID to track the download request in subsequent polling calls"""
|
|
459
|
-
|
|
460
|
-
def as_dict(self) -> dict:
|
|
461
|
-
"""Serializes the GenieGenerateDownloadFullQueryResultResponse into a dictionary suitable for use as a JSON request body."""
|
|
462
|
-
body = {}
|
|
463
|
-
if self.download_id is not None:
|
|
464
|
-
body["download_id"] = self.download_id
|
|
465
|
-
return body
|
|
466
|
-
|
|
467
|
-
def as_shallow_dict(self) -> dict:
|
|
468
|
-
"""Serializes the GenieGenerateDownloadFullQueryResultResponse into a shallow dictionary of its immediate attributes."""
|
|
469
|
-
body = {}
|
|
470
|
-
if self.download_id is not None:
|
|
471
|
-
body["download_id"] = self.download_id
|
|
472
|
-
return body
|
|
473
|
-
|
|
474
|
-
@classmethod
|
|
475
|
-
def from_dict(cls, d: Dict[str, Any]) -> GenieGenerateDownloadFullQueryResultResponse:
|
|
476
|
-
"""Deserializes the GenieGenerateDownloadFullQueryResultResponse from a dictionary."""
|
|
477
|
-
return cls(download_id=d.get("download_id", None))
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
@dataclass
|
|
481
|
-
class GenieGetDownloadFullQueryResultResponse:
|
|
460
|
+
class GenieGetMessageQueryResultResponse:
|
|
482
461
|
statement_response: Optional[sql.StatementResponse] = None
|
|
483
462
|
"""SQL Statement Execution response. See [Get status, manifest, and result first
|
|
484
463
|
chunk](:method:statementexecution/getstatement) for more details."""
|
|
485
464
|
|
|
486
465
|
def as_dict(self) -> dict:
|
|
487
|
-
"""Serializes the
|
|
466
|
+
"""Serializes the GenieGetMessageQueryResultResponse into a dictionary suitable for use as a JSON request body."""
|
|
488
467
|
body = {}
|
|
489
468
|
if self.statement_response:
|
|
490
469
|
body["statement_response"] = self.statement_response.as_dict()
|
|
491
470
|
return body
|
|
492
471
|
|
|
493
472
|
def as_shallow_dict(self) -> dict:
|
|
494
|
-
"""Serializes the
|
|
473
|
+
"""Serializes the GenieGetMessageQueryResultResponse into a shallow dictionary of its immediate attributes."""
|
|
495
474
|
body = {}
|
|
496
475
|
if self.statement_response:
|
|
497
476
|
body["statement_response"] = self.statement_response
|
|
498
477
|
return body
|
|
499
478
|
|
|
500
479
|
@classmethod
|
|
501
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
502
|
-
"""Deserializes the
|
|
480
|
+
def from_dict(cls, d: Dict[str, Any]) -> GenieGetMessageQueryResultResponse:
|
|
481
|
+
"""Deserializes the GenieGetMessageQueryResultResponse from a dictionary."""
|
|
503
482
|
return cls(statement_response=_from_dict(d, "statement_response", sql.StatementResponse))
|
|
504
483
|
|
|
505
484
|
|
|
506
485
|
@dataclass
|
|
507
|
-
class
|
|
508
|
-
|
|
509
|
-
"""
|
|
510
|
-
|
|
486
|
+
class GenieListConversationsResponse:
|
|
487
|
+
conversations: Optional[List[GenieConversationSummary]] = None
|
|
488
|
+
"""List of conversations in the Genie space"""
|
|
489
|
+
|
|
490
|
+
next_page_token: Optional[str] = None
|
|
491
|
+
"""Token to get the next page of results"""
|
|
511
492
|
|
|
512
493
|
def as_dict(self) -> dict:
|
|
513
|
-
"""Serializes the
|
|
494
|
+
"""Serializes the GenieListConversationsResponse into a dictionary suitable for use as a JSON request body."""
|
|
514
495
|
body = {}
|
|
515
|
-
if self.
|
|
516
|
-
body["
|
|
496
|
+
if self.conversations:
|
|
497
|
+
body["conversations"] = [v.as_dict() for v in self.conversations]
|
|
498
|
+
if self.next_page_token is not None:
|
|
499
|
+
body["next_page_token"] = self.next_page_token
|
|
517
500
|
return body
|
|
518
501
|
|
|
519
502
|
def as_shallow_dict(self) -> dict:
|
|
520
|
-
"""Serializes the
|
|
503
|
+
"""Serializes the GenieListConversationsResponse into a shallow dictionary of its immediate attributes."""
|
|
521
504
|
body = {}
|
|
522
|
-
if self.
|
|
523
|
-
body["
|
|
505
|
+
if self.conversations:
|
|
506
|
+
body["conversations"] = self.conversations
|
|
507
|
+
if self.next_page_token is not None:
|
|
508
|
+
body["next_page_token"] = self.next_page_token
|
|
524
509
|
return body
|
|
525
510
|
|
|
526
511
|
@classmethod
|
|
527
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
528
|
-
"""Deserializes the
|
|
529
|
-
return cls(
|
|
512
|
+
def from_dict(cls, d: Dict[str, Any]) -> GenieListConversationsResponse:
|
|
513
|
+
"""Deserializes the GenieListConversationsResponse from a dictionary."""
|
|
514
|
+
return cls(
|
|
515
|
+
conversations=_repeated_dict(d, "conversations", GenieConversationSummary),
|
|
516
|
+
next_page_token=d.get("next_page_token", None),
|
|
517
|
+
)
|
|
530
518
|
|
|
531
519
|
|
|
532
520
|
@dataclass
|
|
@@ -595,20 +583,6 @@ class GenieMessage:
|
|
|
595
583
|
`query_result_metadata` in `GenieQueryAttachment` instead."""
|
|
596
584
|
|
|
597
585
|
status: Optional[MessageStatus] = None
|
|
598
|
-
"""MessageStatus. The possible values are: * `FETCHING_METADATA`: Fetching metadata from the data
|
|
599
|
-
sources. * `FILTERING_CONTEXT`: Running smart context step to determine relevant context. *
|
|
600
|
-
`ASKING_AI`: Waiting for the LLM to respond to the user's question. * `PENDING_WAREHOUSE`:
|
|
601
|
-
Waiting for warehouse before the SQL query can start executing. * `EXECUTING_QUERY`: Executing a
|
|
602
|
-
generated SQL query. Get the SQL query result by calling
|
|
603
|
-
[getMessageAttachmentQueryResult](:method:genie/getMessageAttachmentQueryResult) API. *
|
|
604
|
-
`FAILED`: The response generation or query execution failed. See `error` field. * `COMPLETED`:
|
|
605
|
-
Message processing is completed. Results are in the `attachments` field. Get the SQL query
|
|
606
|
-
result by calling
|
|
607
|
-
[getMessageAttachmentQueryResult](:method:genie/getMessageAttachmentQueryResult) API. *
|
|
608
|
-
`SUBMITTED`: Message has been submitted. * `QUERY_RESULT_EXPIRED`: SQL result is not available
|
|
609
|
-
anymore. The user needs to rerun the query. Rerun the SQL query result by calling
|
|
610
|
-
[executeMessageAttachmentQuery](:method:genie/executeMessageAttachmentQuery) API. * `CANCELLED`:
|
|
611
|
-
Message has been cancelled."""
|
|
612
586
|
|
|
613
587
|
user_id: Optional[int] = None
|
|
614
588
|
"""ID of the user who created the message"""
|
|
@@ -1758,9 +1732,7 @@ class GenieAPI:
|
|
|
1758
1732
|
raise TimeoutError(f"timed out after {timeout}: {status_message}")
|
|
1759
1733
|
|
|
1760
1734
|
def create_message(self, space_id: str, conversation_id: str, content: str) -> Wait[GenieMessage]:
|
|
1761
|
-
"""Create
|
|
1762
|
-
|
|
1763
|
-
Create new message in a [conversation](:method:genie/startconversation). The AI response uses all
|
|
1735
|
+
"""Create new message in a [conversation](:method:genie/startconversation). The AI response uses all
|
|
1764
1736
|
previously created messages in the conversation to respond.
|
|
1765
1737
|
|
|
1766
1738
|
:param space_id: str
|
|
@@ -1803,12 +1775,27 @@ class GenieAPI:
|
|
|
1803
1775
|
timeout=timeout
|
|
1804
1776
|
)
|
|
1805
1777
|
|
|
1778
|
+
def delete_conversation(self, space_id: str, conversation_id: str):
|
|
1779
|
+
"""Delete a conversation.
|
|
1780
|
+
|
|
1781
|
+
:param space_id: str
|
|
1782
|
+
The ID associated with the Genie space where the conversation is located.
|
|
1783
|
+
:param conversation_id: str
|
|
1784
|
+
The ID of the conversation to delete.
|
|
1785
|
+
|
|
1786
|
+
|
|
1787
|
+
"""
|
|
1788
|
+
|
|
1789
|
+
headers = {
|
|
1790
|
+
"Accept": "application/json",
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
self._api.do("DELETE", f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}", headers=headers)
|
|
1794
|
+
|
|
1806
1795
|
def execute_message_attachment_query(
|
|
1807
1796
|
self, space_id: str, conversation_id: str, message_id: str, attachment_id: str
|
|
1808
1797
|
) -> GenieGetMessageQueryResultResponse:
|
|
1809
|
-
"""Execute message attachment
|
|
1810
|
-
|
|
1811
|
-
Execute the SQL for a message query attachment. Use this API when the query attachment has expired and
|
|
1798
|
+
"""Execute the SQL for a message query attachment. Use this API when the query attachment has expired and
|
|
1812
1799
|
needs to be re-executed.
|
|
1813
1800
|
|
|
1814
1801
|
:param space_id: str
|
|
@@ -1837,9 +1824,7 @@ class GenieAPI:
|
|
|
1837
1824
|
def execute_message_query(
|
|
1838
1825
|
self, space_id: str, conversation_id: str, message_id: str
|
|
1839
1826
|
) -> GenieGetMessageQueryResultResponse:
|
|
1840
|
-
"""
|
|
1841
|
-
|
|
1842
|
-
Execute the SQL query in the message.
|
|
1827
|
+
"""Execute the SQL query in the message.
|
|
1843
1828
|
|
|
1844
1829
|
:param space_id: str
|
|
1845
1830
|
Genie space ID
|
|
@@ -1862,83 +1847,8 @@ class GenieAPI:
|
|
|
1862
1847
|
)
|
|
1863
1848
|
return GenieGetMessageQueryResultResponse.from_dict(res)
|
|
1864
1849
|
|
|
1865
|
-
def generate_download_full_query_result(
|
|
1866
|
-
self, space_id: str, conversation_id: str, message_id: str, attachment_id: str
|
|
1867
|
-
) -> GenieGenerateDownloadFullQueryResultResponse:
|
|
1868
|
-
"""Generate full query result download.
|
|
1869
|
-
|
|
1870
|
-
Initiates a new SQL execution and returns a `download_id` that you can use to track the progress of
|
|
1871
|
-
the download. The query result is stored in an external link and can be retrieved using the [Get
|
|
1872
|
-
Download Full Query Result](:method:genie/getdownloadfullqueryresult) API. Warning: Databricks
|
|
1873
|
-
strongly recommends that you protect the URLs that are returned by the `EXTERNAL_LINKS` disposition.
|
|
1874
|
-
See [Execute Statement](:method:statementexecution/executestatement) for more details.
|
|
1875
|
-
|
|
1876
|
-
:param space_id: str
|
|
1877
|
-
Genie space ID
|
|
1878
|
-
:param conversation_id: str
|
|
1879
|
-
Conversation ID
|
|
1880
|
-
:param message_id: str
|
|
1881
|
-
Message ID
|
|
1882
|
-
:param attachment_id: str
|
|
1883
|
-
Attachment ID
|
|
1884
|
-
|
|
1885
|
-
:returns: :class:`GenieGenerateDownloadFullQueryResultResponse`
|
|
1886
|
-
"""
|
|
1887
|
-
|
|
1888
|
-
headers = {
|
|
1889
|
-
"Accept": "application/json",
|
|
1890
|
-
}
|
|
1891
|
-
|
|
1892
|
-
res = self._api.do(
|
|
1893
|
-
"POST",
|
|
1894
|
-
f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}/messages/{message_id}/attachments/{attachment_id}/downloads",
|
|
1895
|
-
headers=headers,
|
|
1896
|
-
)
|
|
1897
|
-
return GenieGenerateDownloadFullQueryResultResponse.from_dict(res)
|
|
1898
|
-
|
|
1899
|
-
def get_download_full_query_result(
|
|
1900
|
-
self, space_id: str, conversation_id: str, message_id: str, attachment_id: str, download_id: str
|
|
1901
|
-
) -> GenieGetDownloadFullQueryResultResponse:
|
|
1902
|
-
"""Get download full query result.
|
|
1903
|
-
|
|
1904
|
-
After [Generating a Full Query Result Download](:method:genie/getdownloadfullqueryresult) and
|
|
1905
|
-
successfully receiving a `download_id`, use this API to poll the download progress. When the download
|
|
1906
|
-
is complete, the API returns one or more external links to the query result files. Warning: Databricks
|
|
1907
|
-
strongly recommends that you protect the URLs that are returned by the `EXTERNAL_LINKS` disposition.
|
|
1908
|
-
You must not set an Authorization header in download requests. When using the `EXTERNAL_LINKS`
|
|
1909
|
-
disposition, Databricks returns presigned URLs that grant temporary access to data. See [Execute
|
|
1910
|
-
Statement](:method:statementexecution/executestatement) for more details.
|
|
1911
|
-
|
|
1912
|
-
:param space_id: str
|
|
1913
|
-
Genie space ID
|
|
1914
|
-
:param conversation_id: str
|
|
1915
|
-
Conversation ID
|
|
1916
|
-
:param message_id: str
|
|
1917
|
-
Message ID
|
|
1918
|
-
:param attachment_id: str
|
|
1919
|
-
Attachment ID
|
|
1920
|
-
:param download_id: str
|
|
1921
|
-
Download ID. This ID is provided by the [Generate Download
|
|
1922
|
-
endpoint](:method:genie/generateDownloadFullQueryResult)
|
|
1923
|
-
|
|
1924
|
-
:returns: :class:`GenieGetDownloadFullQueryResultResponse`
|
|
1925
|
-
"""
|
|
1926
|
-
|
|
1927
|
-
headers = {
|
|
1928
|
-
"Accept": "application/json",
|
|
1929
|
-
}
|
|
1930
|
-
|
|
1931
|
-
res = self._api.do(
|
|
1932
|
-
"GET",
|
|
1933
|
-
f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}/messages/{message_id}/attachments/{attachment_id}/downloads/{download_id}",
|
|
1934
|
-
headers=headers,
|
|
1935
|
-
)
|
|
1936
|
-
return GenieGetDownloadFullQueryResultResponse.from_dict(res)
|
|
1937
|
-
|
|
1938
1850
|
def get_message(self, space_id: str, conversation_id: str, message_id: str) -> GenieMessage:
|
|
1939
|
-
"""Get conversation
|
|
1940
|
-
|
|
1941
|
-
Get message from conversation.
|
|
1851
|
+
"""Get message from conversation.
|
|
1942
1852
|
|
|
1943
1853
|
:param space_id: str
|
|
1944
1854
|
The ID associated with the Genie space where the target conversation is located.
|
|
@@ -1964,9 +1874,7 @@ class GenieAPI:
|
|
|
1964
1874
|
def get_message_attachment_query_result(
|
|
1965
1875
|
self, space_id: str, conversation_id: str, message_id: str, attachment_id: str
|
|
1966
1876
|
) -> GenieGetMessageQueryResultResponse:
|
|
1967
|
-
"""Get
|
|
1968
|
-
|
|
1969
|
-
Get the result of SQL query if the message has a query attachment. This is only available if a message
|
|
1877
|
+
"""Get the result of SQL query if the message has a query attachment. This is only available if a message
|
|
1970
1878
|
has a query attachment and the message status is `EXECUTING_QUERY` OR `COMPLETED`.
|
|
1971
1879
|
|
|
1972
1880
|
:param space_id: str
|
|
@@ -1995,9 +1903,7 @@ class GenieAPI:
|
|
|
1995
1903
|
def get_message_query_result(
|
|
1996
1904
|
self, space_id: str, conversation_id: str, message_id: str
|
|
1997
1905
|
) -> GenieGetMessageQueryResultResponse:
|
|
1998
|
-
"""
|
|
1999
|
-
|
|
2000
|
-
Get the result of SQL query if the message has a query attachment. This is only available if a message
|
|
1906
|
+
"""Get the result of SQL query if the message has a query attachment. This is only available if a message
|
|
2001
1907
|
has a query attachment and the message status is `EXECUTING_QUERY`.
|
|
2002
1908
|
|
|
2003
1909
|
:param space_id: str
|
|
@@ -2024,9 +1930,7 @@ class GenieAPI:
|
|
|
2024
1930
|
def get_message_query_result_by_attachment(
|
|
2025
1931
|
self, space_id: str, conversation_id: str, message_id: str, attachment_id: str
|
|
2026
1932
|
) -> GenieGetMessageQueryResultResponse:
|
|
2027
|
-
"""
|
|
2028
|
-
|
|
2029
|
-
Get the result of SQL query if the message has a query attachment. This is only available if a message
|
|
1933
|
+
"""Get the result of SQL query if the message has a query attachment. This is only available if a message
|
|
2030
1934
|
has a query attachment and the message status is `EXECUTING_QUERY` OR `COMPLETED`.
|
|
2031
1935
|
|
|
2032
1936
|
:param space_id: str
|
|
@@ -2053,9 +1957,7 @@ class GenieAPI:
|
|
|
2053
1957
|
return GenieGetMessageQueryResultResponse.from_dict(res)
|
|
2054
1958
|
|
|
2055
1959
|
def get_space(self, space_id: str) -> GenieSpace:
|
|
2056
|
-
"""Get Genie Space.
|
|
2057
|
-
|
|
2058
|
-
Get details of a Genie Space.
|
|
1960
|
+
"""Get details of a Genie Space.
|
|
2059
1961
|
|
|
2060
1962
|
:param space_id: str
|
|
2061
1963
|
The ID associated with the Genie space
|
|
@@ -2070,12 +1972,37 @@ class GenieAPI:
|
|
|
2070
1972
|
res = self._api.do("GET", f"/api/2.0/genie/spaces/{space_id}", headers=headers)
|
|
2071
1973
|
return GenieSpace.from_dict(res)
|
|
2072
1974
|
|
|
1975
|
+
def list_conversations(
|
|
1976
|
+
self, space_id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None
|
|
1977
|
+
) -> GenieListConversationsResponse:
|
|
1978
|
+
"""Get a list of conversations in a Genie Space.
|
|
1979
|
+
|
|
1980
|
+
:param space_id: str
|
|
1981
|
+
The ID of the Genie space to retrieve conversations from.
|
|
1982
|
+
:param page_size: int (optional)
|
|
1983
|
+
Maximum number of conversations to return per page
|
|
1984
|
+
:param page_token: str (optional)
|
|
1985
|
+
Token to get the next page of results
|
|
1986
|
+
|
|
1987
|
+
:returns: :class:`GenieListConversationsResponse`
|
|
1988
|
+
"""
|
|
1989
|
+
|
|
1990
|
+
query = {}
|
|
1991
|
+
if page_size is not None:
|
|
1992
|
+
query["page_size"] = page_size
|
|
1993
|
+
if page_token is not None:
|
|
1994
|
+
query["page_token"] = page_token
|
|
1995
|
+
headers = {
|
|
1996
|
+
"Accept": "application/json",
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
res = self._api.do("GET", f"/api/2.0/genie/spaces/{space_id}/conversations", query=query, headers=headers)
|
|
2000
|
+
return GenieListConversationsResponse.from_dict(res)
|
|
2001
|
+
|
|
2073
2002
|
def list_spaces(
|
|
2074
2003
|
self, *, page_size: Optional[int] = None, page_token: Optional[str] = None
|
|
2075
2004
|
) -> GenieListSpacesResponse:
|
|
2076
|
-
"""
|
|
2077
|
-
|
|
2078
|
-
Get list of Genie Spaces.
|
|
2005
|
+
"""Get list of Genie Spaces.
|
|
2079
2006
|
|
|
2080
2007
|
:param page_size: int (optional)
|
|
2081
2008
|
Maximum number of spaces to return per page
|
|
@@ -2098,9 +2025,7 @@ class GenieAPI:
|
|
|
2098
2025
|
return GenieListSpacesResponse.from_dict(res)
|
|
2099
2026
|
|
|
2100
2027
|
def start_conversation(self, space_id: str, content: str) -> Wait[GenieMessage]:
|
|
2101
|
-
"""Start conversation.
|
|
2102
|
-
|
|
2103
|
-
Start a new conversation.
|
|
2028
|
+
"""Start a new conversation.
|
|
2104
2029
|
|
|
2105
2030
|
:param space_id: str
|
|
2106
2031
|
The ID associated with the Genie space where you want to start a conversation.
|
|
@@ -2133,6 +2058,21 @@ class GenieAPI:
|
|
|
2133
2058
|
def start_conversation_and_wait(self, space_id: str, content: str, timeout=timedelta(minutes=20)) -> GenieMessage:
|
|
2134
2059
|
return self.start_conversation(content=content, space_id=space_id).result(timeout=timeout)
|
|
2135
2060
|
|
|
2061
|
+
def trash_space(self, space_id: str):
|
|
2062
|
+
"""Move a Genie Space to the trash.
|
|
2063
|
+
|
|
2064
|
+
:param space_id: str
|
|
2065
|
+
The ID associated with the Genie space to be sent to the trash.
|
|
2066
|
+
|
|
2067
|
+
|
|
2068
|
+
"""
|
|
2069
|
+
|
|
2070
|
+
headers = {
|
|
2071
|
+
"Accept": "application/json",
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
self._api.do("DELETE", f"/api/2.0/genie/spaces/{space_id}", headers=headers)
|
|
2075
|
+
|
|
2136
2076
|
|
|
2137
2077
|
class LakeviewAPI:
|
|
2138
2078
|
"""These APIs provide specific management operations for Lakeview dashboards. Generic resource management can
|
|
@@ -2142,9 +2082,7 @@ class LakeviewAPI:
|
|
|
2142
2082
|
self._api = api_client
|
|
2143
2083
|
|
|
2144
2084
|
def create(self, dashboard: Dashboard) -> Dashboard:
|
|
2145
|
-
"""Create dashboard.
|
|
2146
|
-
|
|
2147
|
-
Create a draft dashboard.
|
|
2085
|
+
"""Create a draft dashboard.
|
|
2148
2086
|
|
|
2149
2087
|
:param dashboard: :class:`Dashboard`
|
|
2150
2088
|
|
|
@@ -2165,6 +2103,7 @@ class LakeviewAPI:
|
|
|
2165
2103
|
:param dashboard_id: str
|
|
2166
2104
|
UUID identifying the dashboard to which the schedule belongs.
|
|
2167
2105
|
:param schedule: :class:`Schedule`
|
|
2106
|
+
The schedule to create. A dashboard is limited to 10 schedules.
|
|
2168
2107
|
|
|
2169
2108
|
:returns: :class:`Schedule`
|
|
2170
2109
|
"""
|
|
@@ -2185,6 +2124,7 @@ class LakeviewAPI:
|
|
|
2185
2124
|
:param schedule_id: str
|
|
2186
2125
|
UUID identifying the schedule to which the subscription belongs.
|
|
2187
2126
|
:param subscription: :class:`Subscription`
|
|
2127
|
+
The subscription to create. A schedule is limited to 100 subscriptions.
|
|
2188
2128
|
|
|
2189
2129
|
:returns: :class:`Subscription`
|
|
2190
2130
|
"""
|
|
@@ -2263,9 +2203,7 @@ class LakeviewAPI:
|
|
|
2263
2203
|
)
|
|
2264
2204
|
|
|
2265
2205
|
def get(self, dashboard_id: str) -> Dashboard:
|
|
2266
|
-
"""Get dashboard.
|
|
2267
|
-
|
|
2268
|
-
Get a draft dashboard.
|
|
2206
|
+
"""Get a draft dashboard.
|
|
2269
2207
|
|
|
2270
2208
|
:param dashboard_id: str
|
|
2271
2209
|
UUID identifying the dashboard.
|
|
@@ -2281,9 +2219,7 @@ class LakeviewAPI:
|
|
|
2281
2219
|
return Dashboard.from_dict(res)
|
|
2282
2220
|
|
|
2283
2221
|
def get_published(self, dashboard_id: str) -> PublishedDashboard:
|
|
2284
|
-
"""Get published dashboard.
|
|
2285
|
-
|
|
2286
|
-
Get the current published dashboard.
|
|
2222
|
+
"""Get the current published dashboard.
|
|
2287
2223
|
|
|
2288
2224
|
:param dashboard_id: str
|
|
2289
2225
|
UUID identifying the published dashboard.
|
|
@@ -2473,9 +2409,7 @@ class LakeviewAPI:
|
|
|
2473
2409
|
parent_path: Optional[str] = None,
|
|
2474
2410
|
update_parameter_syntax: Optional[bool] = None,
|
|
2475
2411
|
) -> Dashboard:
|
|
2476
|
-
"""
|
|
2477
|
-
|
|
2478
|
-
Migrates a classic SQL dashboard to Lakeview.
|
|
2412
|
+
"""Migrates a classic SQL dashboard to Lakeview.
|
|
2479
2413
|
|
|
2480
2414
|
:param source_dashboard_id: str
|
|
2481
2415
|
UUID of the dashboard to be migrated.
|
|
@@ -2509,9 +2443,7 @@ class LakeviewAPI:
|
|
|
2509
2443
|
def publish(
|
|
2510
2444
|
self, dashboard_id: str, *, embed_credentials: Optional[bool] = None, warehouse_id: Optional[str] = None
|
|
2511
2445
|
) -> PublishedDashboard:
|
|
2512
|
-
"""Publish dashboard.
|
|
2513
|
-
|
|
2514
|
-
Publish the current draft dashboard.
|
|
2446
|
+
"""Publish the current draft dashboard.
|
|
2515
2447
|
|
|
2516
2448
|
:param dashboard_id: str
|
|
2517
2449
|
UUID identifying the dashboard to be published.
|
|
@@ -2537,9 +2469,7 @@ class LakeviewAPI:
|
|
|
2537
2469
|
return PublishedDashboard.from_dict(res)
|
|
2538
2470
|
|
|
2539
2471
|
def trash(self, dashboard_id: str):
|
|
2540
|
-
"""Trash dashboard.
|
|
2541
|
-
|
|
2542
|
-
Trash a dashboard.
|
|
2472
|
+
"""Trash a dashboard.
|
|
2543
2473
|
|
|
2544
2474
|
:param dashboard_id: str
|
|
2545
2475
|
UUID identifying the dashboard.
|
|
@@ -2554,9 +2484,7 @@ class LakeviewAPI:
|
|
|
2554
2484
|
self._api.do("DELETE", f"/api/2.0/lakeview/dashboards/{dashboard_id}", headers=headers)
|
|
2555
2485
|
|
|
2556
2486
|
def unpublish(self, dashboard_id: str):
|
|
2557
|
-
"""Unpublish dashboard.
|
|
2558
|
-
|
|
2559
|
-
Unpublish the dashboard.
|
|
2487
|
+
"""Unpublish the dashboard.
|
|
2560
2488
|
|
|
2561
2489
|
:param dashboard_id: str
|
|
2562
2490
|
UUID identifying the published dashboard.
|
|
@@ -2571,9 +2499,7 @@ class LakeviewAPI:
|
|
|
2571
2499
|
self._api.do("DELETE", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published", headers=headers)
|
|
2572
2500
|
|
|
2573
2501
|
def update(self, dashboard_id: str, dashboard: Dashboard) -> Dashboard:
|
|
2574
|
-
"""Update dashboard.
|
|
2575
|
-
|
|
2576
|
-
Update a draft dashboard.
|
|
2502
|
+
"""Update a draft dashboard.
|
|
2577
2503
|
|
|
2578
2504
|
:param dashboard_id: str
|
|
2579
2505
|
UUID identifying the dashboard.
|
|
@@ -2598,6 +2524,7 @@ class LakeviewAPI:
|
|
|
2598
2524
|
:param schedule_id: str
|
|
2599
2525
|
UUID identifying the schedule.
|
|
2600
2526
|
:param schedule: :class:`Schedule`
|
|
2527
|
+
The schedule to update.
|
|
2601
2528
|
|
|
2602
2529
|
:returns: :class:`Schedule`
|
|
2603
2530
|
"""
|
|
@@ -2622,9 +2549,7 @@ class LakeviewEmbeddedAPI:
|
|
|
2622
2549
|
def get_published_dashboard_token_info(
|
|
2623
2550
|
self, dashboard_id: str, *, external_value: Optional[str] = None, external_viewer_id: Optional[str] = None
|
|
2624
2551
|
) -> GetPublishedDashboardTokenInfoResponse:
|
|
2625
|
-
"""
|
|
2626
|
-
|
|
2627
|
-
Get a required authorization details and scopes of a published dashboard to mint an OAuth token. The
|
|
2552
|
+
"""Get a required authorization details and scopes of a published dashboard to mint an OAuth token. The
|
|
2628
2553
|
`authorization_details` can be enriched to apply additional restriction.
|
|
2629
2554
|
|
|
2630
2555
|
Example: Adding the following `authorization_details` object to downscope the viewer permission to
|