databricks-sdk 0.61.0__py3-none-any.whl → 0.63.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 -2
- databricks/sdk/config.py +15 -2
- databricks/sdk/service/catalog.py +791 -22
- databricks/sdk/service/cleanrooms.py +21 -14
- databricks/sdk/service/compute.py +14 -0
- databricks/sdk/service/dashboards.py +8 -0
- databricks/sdk/service/database.py +214 -3
- databricks/sdk/service/jobs.py +104 -1
- databricks/sdk/service/ml.py +3 -4
- databricks/sdk/service/serving.py +102 -14
- databricks/sdk/service/settings.py +36 -1
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.61.0.dist-info → databricks_sdk-0.63.0.dist-info}/METADATA +1 -1
- {databricks_sdk-0.61.0.dist-info → databricks_sdk-0.63.0.dist-info}/RECORD +18 -18
- {databricks_sdk-0.61.0.dist-info → databricks_sdk-0.63.0.dist-info}/WHEEL +0 -0
- {databricks_sdk-0.61.0.dist-info → databricks_sdk-0.63.0.dist-info}/licenses/LICENSE +0 -0
- {databricks_sdk-0.61.0.dist-info → databricks_sdk-0.63.0.dist-info}/licenses/NOTICE +0 -0
- {databricks_sdk-0.61.0.dist-info → databricks_sdk-0.63.0.dist-info}/top_level.txt +0 -0
|
@@ -142,7 +142,8 @@ class CleanRoomAsset:
|
|
|
142
142
|
For UC securable assets (tables, volumes, etc.), the format is
|
|
143
143
|
*shared_catalog*.*shared_schema*.*asset_name*
|
|
144
144
|
|
|
145
|
-
For notebooks, the name is the notebook file name.
|
|
145
|
+
For notebooks, the name is the notebook file name. For jar analyses, the name is the jar
|
|
146
|
+
analysis name."""
|
|
146
147
|
|
|
147
148
|
asset_type: CleanRoomAssetAssetType
|
|
148
149
|
"""The type of the asset."""
|
|
@@ -351,7 +352,7 @@ class CleanRoomAssetNotebook:
|
|
|
351
352
|
"""Server generated etag that represents the notebook version."""
|
|
352
353
|
|
|
353
354
|
review_state: Optional[CleanRoomNotebookReviewNotebookReviewState] = None
|
|
354
|
-
"""
|
|
355
|
+
"""Top-level status derived from all reviews"""
|
|
355
356
|
|
|
356
357
|
reviews: Optional[List[CleanRoomNotebookReview]] = None
|
|
357
358
|
"""All existing approvals or rejections"""
|
|
@@ -546,8 +547,12 @@ class CleanRoomAssetVolumeLocalDetails:
|
|
|
546
547
|
@dataclass
|
|
547
548
|
class CleanRoomAutoApprovalRule:
|
|
548
549
|
author_collaborator_alias: Optional[str] = None
|
|
550
|
+
"""Collaborator alias of the author covered by the rule. Only one of `author_collaborator_alias`
|
|
551
|
+
and `author_scope` can be set."""
|
|
549
552
|
|
|
550
553
|
author_scope: Optional[CleanRoomAutoApprovalRuleAuthorScope] = None
|
|
554
|
+
"""Scope of authors covered by the rule. Only one of `author_collaborator_alias` and `author_scope`
|
|
555
|
+
can be set."""
|
|
551
556
|
|
|
552
557
|
clean_room_name: Optional[str] = None
|
|
553
558
|
"""The name of the clean room this auto-approval rule belongs to."""
|
|
@@ -562,6 +567,7 @@ class CleanRoomAutoApprovalRule:
|
|
|
562
567
|
"""The owner of the rule to whom the rule applies."""
|
|
563
568
|
|
|
564
569
|
runner_collaborator_alias: Optional[str] = None
|
|
570
|
+
"""Collaborator alias of the runner covered by the rule."""
|
|
565
571
|
|
|
566
572
|
def as_dict(self) -> dict:
|
|
567
573
|
"""Serializes the CleanRoomAutoApprovalRule into a dictionary suitable for use as a JSON request body."""
|
|
@@ -704,19 +710,19 @@ class CleanRoomCollaborator:
|
|
|
704
710
|
@dataclass
|
|
705
711
|
class CleanRoomNotebookReview:
|
|
706
712
|
comment: Optional[str] = None
|
|
707
|
-
"""
|
|
713
|
+
"""Review comment"""
|
|
708
714
|
|
|
709
715
|
created_at_millis: Optional[int] = None
|
|
710
|
-
"""
|
|
716
|
+
"""When the review was submitted, in epoch milliseconds"""
|
|
711
717
|
|
|
712
718
|
review_state: Optional[CleanRoomNotebookReviewNotebookReviewState] = None
|
|
713
|
-
"""
|
|
719
|
+
"""Review outcome"""
|
|
714
720
|
|
|
715
721
|
review_sub_reason: Optional[CleanRoomNotebookReviewNotebookReviewSubReason] = None
|
|
716
|
-
"""
|
|
722
|
+
"""Specified when the review was not explicitly made by a user"""
|
|
717
723
|
|
|
718
724
|
reviewer_collaborator_alias: Optional[str] = None
|
|
719
|
-
"""
|
|
725
|
+
"""Collaborator alias of the reviewer"""
|
|
720
726
|
|
|
721
727
|
def as_dict(self) -> dict:
|
|
722
728
|
"""Serializes the CleanRoomNotebookReview into a dictionary suitable for use as a JSON request body."""
|
|
@@ -1100,7 +1106,7 @@ class ComplianceSecurityProfile:
|
|
|
1100
1106
|
@dataclass
|
|
1101
1107
|
class CreateCleanRoomAssetReviewResponse:
|
|
1102
1108
|
notebook_review_state: Optional[CleanRoomNotebookReviewNotebookReviewState] = None
|
|
1103
|
-
"""
|
|
1109
|
+
"""Top-level status derived from all reviews"""
|
|
1104
1110
|
|
|
1105
1111
|
notebook_reviews: Optional[List[CleanRoomNotebookReview]] = None
|
|
1106
1112
|
"""All existing notebook approvals or rejections"""
|
|
@@ -1348,13 +1354,13 @@ class ListCleanRoomsResponse:
|
|
|
1348
1354
|
@dataclass
|
|
1349
1355
|
class NotebookVersionReview:
|
|
1350
1356
|
etag: str
|
|
1351
|
-
"""
|
|
1357
|
+
"""Etag identifying the notebook version"""
|
|
1352
1358
|
|
|
1353
1359
|
review_state: CleanRoomNotebookReviewNotebookReviewState
|
|
1354
|
-
"""
|
|
1360
|
+
"""Review outcome"""
|
|
1355
1361
|
|
|
1356
1362
|
comment: Optional[str] = None
|
|
1357
|
-
"""
|
|
1363
|
+
"""Review comment"""
|
|
1358
1364
|
|
|
1359
1365
|
def as_dict(self) -> dict:
|
|
1360
1366
|
"""Serializes the NotebookVersionReview into a dictionary suitable for use as a JSON request body."""
|
|
@@ -1505,12 +1511,12 @@ class CleanRoomAssetsAPI:
|
|
|
1505
1511
|
name: str,
|
|
1506
1512
|
notebook_review: NotebookVersionReview,
|
|
1507
1513
|
) -> CreateCleanRoomAssetReviewResponse:
|
|
1508
|
-
"""
|
|
1514
|
+
"""Submit an asset review
|
|
1509
1515
|
|
|
1510
1516
|
:param clean_room_name: str
|
|
1511
1517
|
Name of the clean room
|
|
1512
1518
|
:param asset_type: :class:`CleanRoomAssetAssetType`
|
|
1513
|
-
|
|
1519
|
+
Asset type. Can only be NOTEBOOK_FILE.
|
|
1514
1520
|
:param name: str
|
|
1515
1521
|
Name of the asset
|
|
1516
1522
|
:param notebook_review: :class:`NotebookVersionReview`
|
|
@@ -1620,7 +1626,8 @@ class CleanRoomAssetsAPI:
|
|
|
1620
1626
|
For UC securable assets (tables, volumes, etc.), the format is
|
|
1621
1627
|
*shared_catalog*.*shared_schema*.*asset_name*
|
|
1622
1628
|
|
|
1623
|
-
For notebooks, the name is the notebook file name.
|
|
1629
|
+
For notebooks, the name is the notebook file name. For jar analyses, the name is the jar analysis
|
|
1630
|
+
name.
|
|
1624
1631
|
:param asset: :class:`CleanRoomAsset`
|
|
1625
1632
|
The asset to update. The asset's `name` and `asset_type` fields are used to identify the asset to
|
|
1626
1633
|
update.
|
|
@@ -3410,6 +3410,15 @@ class GcpAttributes:
|
|
|
3410
3410
|
boot_disk_size: Optional[int] = None
|
|
3411
3411
|
"""Boot disk size in GB"""
|
|
3412
3412
|
|
|
3413
|
+
first_on_demand: Optional[int] = None
|
|
3414
|
+
"""The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. This
|
|
3415
|
+
value should be greater than 0, to make sure the cluster driver node is placed on an on-demand
|
|
3416
|
+
instance. If this value is greater than or equal to the current cluster size, all nodes will be
|
|
3417
|
+
placed on on-demand instances. If this value is less than the current cluster size,
|
|
3418
|
+
`first_on_demand` nodes will be placed on on-demand instances and the remainder will be placed
|
|
3419
|
+
on `availability` instances. Note that this value does not affect cluster size and cannot
|
|
3420
|
+
currently be mutated over the lifetime of a cluster."""
|
|
3421
|
+
|
|
3413
3422
|
google_service_account: Optional[str] = None
|
|
3414
3423
|
"""If provided, the cluster will impersonate the google service account when accessing gcloud
|
|
3415
3424
|
services (like GCS). The google service account must have previously been added to the
|
|
@@ -3441,6 +3450,8 @@ class GcpAttributes:
|
|
|
3441
3450
|
body["availability"] = self.availability.value
|
|
3442
3451
|
if self.boot_disk_size is not None:
|
|
3443
3452
|
body["boot_disk_size"] = self.boot_disk_size
|
|
3453
|
+
if self.first_on_demand is not None:
|
|
3454
|
+
body["first_on_demand"] = self.first_on_demand
|
|
3444
3455
|
if self.google_service_account is not None:
|
|
3445
3456
|
body["google_service_account"] = self.google_service_account
|
|
3446
3457
|
if self.local_ssd_count is not None:
|
|
@@ -3458,6 +3469,8 @@ class GcpAttributes:
|
|
|
3458
3469
|
body["availability"] = self.availability
|
|
3459
3470
|
if self.boot_disk_size is not None:
|
|
3460
3471
|
body["boot_disk_size"] = self.boot_disk_size
|
|
3472
|
+
if self.first_on_demand is not None:
|
|
3473
|
+
body["first_on_demand"] = self.first_on_demand
|
|
3461
3474
|
if self.google_service_account is not None:
|
|
3462
3475
|
body["google_service_account"] = self.google_service_account
|
|
3463
3476
|
if self.local_ssd_count is not None:
|
|
@@ -3474,6 +3487,7 @@ class GcpAttributes:
|
|
|
3474
3487
|
return cls(
|
|
3475
3488
|
availability=_enum(d, "availability", GcpAvailability),
|
|
3476
3489
|
boot_disk_size=d.get("boot_disk_size", None),
|
|
3490
|
+
first_on_demand=d.get("first_on_demand", None),
|
|
3477
3491
|
google_service_account=d.get("google_service_account", None),
|
|
3478
3492
|
local_ssd_count=d.get("local_ssd_count", None),
|
|
3479
3493
|
use_preemptible_executors=d.get("use_preemptible_executors", None),
|
|
@@ -1148,6 +1148,9 @@ class Result:
|
|
|
1148
1148
|
"""Statement Execution API statement id. Use [Get status, manifest, and result first
|
|
1149
1149
|
chunk](:method:statementexecution/getstatement) to get the full result data."""
|
|
1150
1150
|
|
|
1151
|
+
statement_id_signature: Optional[str] = None
|
|
1152
|
+
"""JWT corresponding to the statement contained in this result"""
|
|
1153
|
+
|
|
1151
1154
|
def as_dict(self) -> dict:
|
|
1152
1155
|
"""Serializes the Result into a dictionary suitable for use as a JSON request body."""
|
|
1153
1156
|
body = {}
|
|
@@ -1157,6 +1160,8 @@ class Result:
|
|
|
1157
1160
|
body["row_count"] = self.row_count
|
|
1158
1161
|
if self.statement_id is not None:
|
|
1159
1162
|
body["statement_id"] = self.statement_id
|
|
1163
|
+
if self.statement_id_signature is not None:
|
|
1164
|
+
body["statement_id_signature"] = self.statement_id_signature
|
|
1160
1165
|
return body
|
|
1161
1166
|
|
|
1162
1167
|
def as_shallow_dict(self) -> dict:
|
|
@@ -1168,6 +1173,8 @@ class Result:
|
|
|
1168
1173
|
body["row_count"] = self.row_count
|
|
1169
1174
|
if self.statement_id is not None:
|
|
1170
1175
|
body["statement_id"] = self.statement_id
|
|
1176
|
+
if self.statement_id_signature is not None:
|
|
1177
|
+
body["statement_id_signature"] = self.statement_id_signature
|
|
1171
1178
|
return body
|
|
1172
1179
|
|
|
1173
1180
|
@classmethod
|
|
@@ -1177,6 +1184,7 @@ class Result:
|
|
|
1177
1184
|
is_truncated=d.get("is_truncated", None),
|
|
1178
1185
|
row_count=d.get("row_count", None),
|
|
1179
1186
|
statement_id=d.get("statement_id", None),
|
|
1187
|
+
statement_id_signature=d.get("statement_id_signature", None),
|
|
1180
1188
|
)
|
|
1181
1189
|
|
|
1182
1190
|
|
|
@@ -589,6 +589,40 @@ class DeltaTableSyncInfo:
|
|
|
589
589
|
)
|
|
590
590
|
|
|
591
591
|
|
|
592
|
+
@dataclass
|
|
593
|
+
class ListDatabaseCatalogsResponse:
|
|
594
|
+
database_catalogs: Optional[List[DatabaseCatalog]] = None
|
|
595
|
+
|
|
596
|
+
next_page_token: Optional[str] = None
|
|
597
|
+
"""Pagination token to request the next page of database catalogs."""
|
|
598
|
+
|
|
599
|
+
def as_dict(self) -> dict:
|
|
600
|
+
"""Serializes the ListDatabaseCatalogsResponse into a dictionary suitable for use as a JSON request body."""
|
|
601
|
+
body = {}
|
|
602
|
+
if self.database_catalogs:
|
|
603
|
+
body["database_catalogs"] = [v.as_dict() for v in self.database_catalogs]
|
|
604
|
+
if self.next_page_token is not None:
|
|
605
|
+
body["next_page_token"] = self.next_page_token
|
|
606
|
+
return body
|
|
607
|
+
|
|
608
|
+
def as_shallow_dict(self) -> dict:
|
|
609
|
+
"""Serializes the ListDatabaseCatalogsResponse into a shallow dictionary of its immediate attributes."""
|
|
610
|
+
body = {}
|
|
611
|
+
if self.database_catalogs:
|
|
612
|
+
body["database_catalogs"] = self.database_catalogs
|
|
613
|
+
if self.next_page_token is not None:
|
|
614
|
+
body["next_page_token"] = self.next_page_token
|
|
615
|
+
return body
|
|
616
|
+
|
|
617
|
+
@classmethod
|
|
618
|
+
def from_dict(cls, d: Dict[str, Any]) -> ListDatabaseCatalogsResponse:
|
|
619
|
+
"""Deserializes the ListDatabaseCatalogsResponse from a dictionary."""
|
|
620
|
+
return cls(
|
|
621
|
+
database_catalogs=_repeated_dict(d, "database_catalogs", DatabaseCatalog),
|
|
622
|
+
next_page_token=d.get("next_page_token", None),
|
|
623
|
+
)
|
|
624
|
+
|
|
625
|
+
|
|
592
626
|
@dataclass
|
|
593
627
|
class ListDatabaseInstanceRolesResponse:
|
|
594
628
|
database_instance_roles: Optional[List[DatabaseInstanceRole]] = None
|
|
@@ -659,6 +693,40 @@ class ListDatabaseInstancesResponse:
|
|
|
659
693
|
)
|
|
660
694
|
|
|
661
695
|
|
|
696
|
+
@dataclass
|
|
697
|
+
class ListSyncedDatabaseTablesResponse:
|
|
698
|
+
next_page_token: Optional[str] = None
|
|
699
|
+
"""Pagination token to request the next page of synced tables."""
|
|
700
|
+
|
|
701
|
+
synced_tables: Optional[List[SyncedDatabaseTable]] = None
|
|
702
|
+
|
|
703
|
+
def as_dict(self) -> dict:
|
|
704
|
+
"""Serializes the ListSyncedDatabaseTablesResponse into a dictionary suitable for use as a JSON request body."""
|
|
705
|
+
body = {}
|
|
706
|
+
if self.next_page_token is not None:
|
|
707
|
+
body["next_page_token"] = self.next_page_token
|
|
708
|
+
if self.synced_tables:
|
|
709
|
+
body["synced_tables"] = [v.as_dict() for v in self.synced_tables]
|
|
710
|
+
return body
|
|
711
|
+
|
|
712
|
+
def as_shallow_dict(self) -> dict:
|
|
713
|
+
"""Serializes the ListSyncedDatabaseTablesResponse into a shallow dictionary of its immediate attributes."""
|
|
714
|
+
body = {}
|
|
715
|
+
if self.next_page_token is not None:
|
|
716
|
+
body["next_page_token"] = self.next_page_token
|
|
717
|
+
if self.synced_tables:
|
|
718
|
+
body["synced_tables"] = self.synced_tables
|
|
719
|
+
return body
|
|
720
|
+
|
|
721
|
+
@classmethod
|
|
722
|
+
def from_dict(cls, d: Dict[str, Any]) -> ListSyncedDatabaseTablesResponse:
|
|
723
|
+
"""Deserializes the ListSyncedDatabaseTablesResponse from a dictionary."""
|
|
724
|
+
return cls(
|
|
725
|
+
next_page_token=d.get("next_page_token", None),
|
|
726
|
+
synced_tables=_repeated_dict(d, "synced_tables", SyncedDatabaseTable),
|
|
727
|
+
)
|
|
728
|
+
|
|
729
|
+
|
|
662
730
|
@dataclass
|
|
663
731
|
class NewPipelineSpec:
|
|
664
732
|
"""Custom fields that user can set for pipeline while creating SyncedDatabaseTable. Note that other
|
|
@@ -790,7 +858,7 @@ class RequestedResource:
|
|
|
790
858
|
|
|
791
859
|
@dataclass
|
|
792
860
|
class SyncedDatabaseTable:
|
|
793
|
-
"""Next field marker:
|
|
861
|
+
"""Next field marker: 14"""
|
|
794
862
|
|
|
795
863
|
name: str
|
|
796
864
|
"""Full three-part (catalog, schema, table) name of the table."""
|
|
@@ -805,6 +873,14 @@ class SyncedDatabaseTable:
|
|
|
805
873
|
database instance name MUST match that of the registered catalog (or the request will be
|
|
806
874
|
rejected)."""
|
|
807
875
|
|
|
876
|
+
effective_database_instance_name: Optional[str] = None
|
|
877
|
+
"""The name of the database instance that this table is registered to. This field is always
|
|
878
|
+
returned, and for tables inside database catalogs is inferred database instance associated with
|
|
879
|
+
the catalog."""
|
|
880
|
+
|
|
881
|
+
effective_logical_database_name: Optional[str] = None
|
|
882
|
+
"""The name of the logical database that this table is registered to."""
|
|
883
|
+
|
|
808
884
|
logical_database_name: Optional[str] = None
|
|
809
885
|
"""Target Postgres database object (logical database) name for this table.
|
|
810
886
|
|
|
@@ -831,6 +907,10 @@ class SyncedDatabaseTable:
|
|
|
831
907
|
body["data_synchronization_status"] = self.data_synchronization_status.as_dict()
|
|
832
908
|
if self.database_instance_name is not None:
|
|
833
909
|
body["database_instance_name"] = self.database_instance_name
|
|
910
|
+
if self.effective_database_instance_name is not None:
|
|
911
|
+
body["effective_database_instance_name"] = self.effective_database_instance_name
|
|
912
|
+
if self.effective_logical_database_name is not None:
|
|
913
|
+
body["effective_logical_database_name"] = self.effective_logical_database_name
|
|
834
914
|
if self.logical_database_name is not None:
|
|
835
915
|
body["logical_database_name"] = self.logical_database_name
|
|
836
916
|
if self.name is not None:
|
|
@@ -848,6 +928,10 @@ class SyncedDatabaseTable:
|
|
|
848
928
|
body["data_synchronization_status"] = self.data_synchronization_status
|
|
849
929
|
if self.database_instance_name is not None:
|
|
850
930
|
body["database_instance_name"] = self.database_instance_name
|
|
931
|
+
if self.effective_database_instance_name is not None:
|
|
932
|
+
body["effective_database_instance_name"] = self.effective_database_instance_name
|
|
933
|
+
if self.effective_logical_database_name is not None:
|
|
934
|
+
body["effective_logical_database_name"] = self.effective_logical_database_name
|
|
851
935
|
if self.logical_database_name is not None:
|
|
852
936
|
body["logical_database_name"] = self.logical_database_name
|
|
853
937
|
if self.name is not None:
|
|
@@ -864,6 +948,8 @@ class SyncedDatabaseTable:
|
|
|
864
948
|
return cls(
|
|
865
949
|
data_synchronization_status=_from_dict(d, "data_synchronization_status", SyncedTableStatus),
|
|
866
950
|
database_instance_name=d.get("database_instance_name", None),
|
|
951
|
+
effective_database_instance_name=d.get("effective_database_instance_name", None),
|
|
952
|
+
effective_logical_database_name=d.get("effective_logical_database_name", None),
|
|
867
953
|
logical_database_name=d.get("logical_database_name", None),
|
|
868
954
|
name=d.get("name", None),
|
|
869
955
|
spec=_from_dict(d, "spec", SyncedTableSpec),
|
|
@@ -1715,10 +1801,47 @@ class DatabaseAPI:
|
|
|
1715
1801
|
res = self._api.do("GET", f"/api/2.0/database/synced_tables/{name}", headers=headers)
|
|
1716
1802
|
return SyncedDatabaseTable.from_dict(res)
|
|
1717
1803
|
|
|
1804
|
+
def list_database_catalogs(
|
|
1805
|
+
self, instance_name: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None
|
|
1806
|
+
) -> Iterator[DatabaseCatalog]:
|
|
1807
|
+
"""This API is currently unimplemented, but exposed for Terraform support.
|
|
1808
|
+
|
|
1809
|
+
:param instance_name: str
|
|
1810
|
+
Name of the instance to get database catalogs for.
|
|
1811
|
+
:param page_size: int (optional)
|
|
1812
|
+
Upper bound for items returned.
|
|
1813
|
+
:param page_token: str (optional)
|
|
1814
|
+
Pagination token to go to the next page of synced database tables. Requests first page if absent.
|
|
1815
|
+
|
|
1816
|
+
:returns: Iterator over :class:`DatabaseCatalog`
|
|
1817
|
+
"""
|
|
1818
|
+
|
|
1819
|
+
query = {}
|
|
1820
|
+
if page_size is not None:
|
|
1821
|
+
query["page_size"] = page_size
|
|
1822
|
+
if page_token is not None:
|
|
1823
|
+
query["page_token"] = page_token
|
|
1824
|
+
headers = {
|
|
1825
|
+
"Accept": "application/json",
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
while True:
|
|
1829
|
+
json = self._api.do(
|
|
1830
|
+
"GET", f"/api/2.0/database/instances/{instance_name}/catalogs", query=query, headers=headers
|
|
1831
|
+
)
|
|
1832
|
+
if "database_catalogs" in json:
|
|
1833
|
+
for v in json["database_catalogs"]:
|
|
1834
|
+
yield DatabaseCatalog.from_dict(v)
|
|
1835
|
+
if "next_page_token" not in json or not json["next_page_token"]:
|
|
1836
|
+
return
|
|
1837
|
+
query["page_token"] = json["next_page_token"]
|
|
1838
|
+
|
|
1718
1839
|
def list_database_instance_roles(
|
|
1719
1840
|
self, instance_name: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None
|
|
1720
1841
|
) -> Iterator[DatabaseInstanceRole]:
|
|
1721
|
-
"""START OF PG ROLE APIs Section
|
|
1842
|
+
"""START OF PG ROLE APIs Section These APIs are marked a PUBLIC with stage < PUBLIC_PREVIEW. With more
|
|
1843
|
+
recent Lakebase V2 plans, we don't plan to ever advance these to PUBLIC_PREVIEW. These APIs will
|
|
1844
|
+
remain effectively undocumented/UI-only and we'll aim for a new public roles API as part of V2 PuPr.
|
|
1722
1845
|
|
|
1723
1846
|
:param instance_name: str
|
|
1724
1847
|
:param page_size: int (optional)
|
|
@@ -1780,6 +1903,67 @@ class DatabaseAPI:
|
|
|
1780
1903
|
return
|
|
1781
1904
|
query["page_token"] = json["next_page_token"]
|
|
1782
1905
|
|
|
1906
|
+
def list_synced_database_tables(
|
|
1907
|
+
self, instance_name: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None
|
|
1908
|
+
) -> Iterator[SyncedDatabaseTable]:
|
|
1909
|
+
"""This API is currently unimplemented, but exposed for Terraform support.
|
|
1910
|
+
|
|
1911
|
+
:param instance_name: str
|
|
1912
|
+
Name of the instance to get synced tables for.
|
|
1913
|
+
:param page_size: int (optional)
|
|
1914
|
+
Upper bound for items returned.
|
|
1915
|
+
:param page_token: str (optional)
|
|
1916
|
+
Pagination token to go to the next page of synced database tables. Requests first page if absent.
|
|
1917
|
+
|
|
1918
|
+
:returns: Iterator over :class:`SyncedDatabaseTable`
|
|
1919
|
+
"""
|
|
1920
|
+
|
|
1921
|
+
query = {}
|
|
1922
|
+
if page_size is not None:
|
|
1923
|
+
query["page_size"] = page_size
|
|
1924
|
+
if page_token is not None:
|
|
1925
|
+
query["page_token"] = page_token
|
|
1926
|
+
headers = {
|
|
1927
|
+
"Accept": "application/json",
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
while True:
|
|
1931
|
+
json = self._api.do(
|
|
1932
|
+
"GET", f"/api/2.0/database/instances/{instance_name}/synced_tables", query=query, headers=headers
|
|
1933
|
+
)
|
|
1934
|
+
if "synced_tables" in json:
|
|
1935
|
+
for v in json["synced_tables"]:
|
|
1936
|
+
yield SyncedDatabaseTable.from_dict(v)
|
|
1937
|
+
if "next_page_token" not in json or not json["next_page_token"]:
|
|
1938
|
+
return
|
|
1939
|
+
query["page_token"] = json["next_page_token"]
|
|
1940
|
+
|
|
1941
|
+
def update_database_catalog(
|
|
1942
|
+
self, name: str, database_catalog: DatabaseCatalog, update_mask: str
|
|
1943
|
+
) -> DatabaseCatalog:
|
|
1944
|
+
"""This API is currently unimplemented, but exposed for Terraform support.
|
|
1945
|
+
|
|
1946
|
+
:param name: str
|
|
1947
|
+
The name of the catalog in UC.
|
|
1948
|
+
:param database_catalog: :class:`DatabaseCatalog`
|
|
1949
|
+
Note that updating a database catalog is not yet supported.
|
|
1950
|
+
:param update_mask: str
|
|
1951
|
+
The list of fields to update. Setting this field is not yet supported.
|
|
1952
|
+
|
|
1953
|
+
:returns: :class:`DatabaseCatalog`
|
|
1954
|
+
"""
|
|
1955
|
+
body = database_catalog.as_dict()
|
|
1956
|
+
query = {}
|
|
1957
|
+
if update_mask is not None:
|
|
1958
|
+
query["update_mask"] = update_mask
|
|
1959
|
+
headers = {
|
|
1960
|
+
"Accept": "application/json",
|
|
1961
|
+
"Content-Type": "application/json",
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
res = self._api.do("PATCH", f"/api/2.0/database/catalogs/{name}", query=query, body=body, headers=headers)
|
|
1965
|
+
return DatabaseCatalog.from_dict(res)
|
|
1966
|
+
|
|
1783
1967
|
def update_database_instance(
|
|
1784
1968
|
self, name: str, database_instance: DatabaseInstance, update_mask: str
|
|
1785
1969
|
) -> DatabaseInstance:
|
|
@@ -1789,7 +1973,8 @@ class DatabaseAPI:
|
|
|
1789
1973
|
The name of the instance. This is the unique identifier for the instance.
|
|
1790
1974
|
:param database_instance: :class:`DatabaseInstance`
|
|
1791
1975
|
:param update_mask: str
|
|
1792
|
-
The list of fields to update.
|
|
1976
|
+
The list of fields to update. If unspecified, all fields will be updated when possible. To wipe out
|
|
1977
|
+
custom_tags, specify custom_tags in the update_mask with an empty custom_tags map.
|
|
1793
1978
|
|
|
1794
1979
|
:returns: :class:`DatabaseInstance`
|
|
1795
1980
|
"""
|
|
@@ -1804,3 +1989,29 @@ class DatabaseAPI:
|
|
|
1804
1989
|
|
|
1805
1990
|
res = self._api.do("PATCH", f"/api/2.0/database/instances/{name}", query=query, body=body, headers=headers)
|
|
1806
1991
|
return DatabaseInstance.from_dict(res)
|
|
1992
|
+
|
|
1993
|
+
def update_synced_database_table(
|
|
1994
|
+
self, name: str, synced_table: SyncedDatabaseTable, update_mask: str
|
|
1995
|
+
) -> SyncedDatabaseTable:
|
|
1996
|
+
"""This API is currently unimplemented, but exposed for Terraform support.
|
|
1997
|
+
|
|
1998
|
+
:param name: str
|
|
1999
|
+
Full three-part (catalog, schema, table) name of the table.
|
|
2000
|
+
:param synced_table: :class:`SyncedDatabaseTable`
|
|
2001
|
+
Note that updating a synced database table is not yet supported.
|
|
2002
|
+
:param update_mask: str
|
|
2003
|
+
The list of fields to update. Setting this field is not yet supported.
|
|
2004
|
+
|
|
2005
|
+
:returns: :class:`SyncedDatabaseTable`
|
|
2006
|
+
"""
|
|
2007
|
+
body = synced_table.as_dict()
|
|
2008
|
+
query = {}
|
|
2009
|
+
if update_mask is not None:
|
|
2010
|
+
query["update_mask"] = update_mask
|
|
2011
|
+
headers = {
|
|
2012
|
+
"Accept": "application/json",
|
|
2013
|
+
"Content-Type": "application/json",
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
res = self._api.do("PATCH", f"/api/2.0/database/synced_tables/{name}", query=query, body=body, headers=headers)
|
|
2017
|
+
return SyncedDatabaseTable.from_dict(res)
|