databricks-sdk 0.19.0__py3-none-any.whl → 0.20.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 +16 -2
- databricks/sdk/casing.py +38 -0
- databricks/sdk/config.py +5 -0
- databricks/sdk/core.py +27 -14
- databricks/sdk/mixins/workspace.py +2 -1
- databricks/sdk/service/billing.py +22 -1
- databricks/sdk/service/catalog.py +557 -46
- databricks/sdk/service/compute.py +57 -0
- databricks/sdk/service/dashboards.py +1 -0
- databricks/sdk/service/files.py +147 -15
- databricks/sdk/service/iam.py +53 -0
- databricks/sdk/service/jobs.py +147 -135
- databricks/sdk/service/ml.py +57 -0
- databricks/sdk/service/oauth2.py +13 -0
- databricks/sdk/service/pipelines.py +12 -0
- databricks/sdk/service/provisioning.py +30 -0
- databricks/sdk/service/serving.py +73 -35
- databricks/sdk/service/settings.py +41 -0
- databricks/sdk/service/sharing.py +38 -18
- databricks/sdk/service/sql.py +92 -2
- databricks/sdk/service/vectorsearch.py +10 -0
- databricks/sdk/service/workspace.py +34 -0
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.19.0.dist-info → databricks_sdk-0.20.0.dist-info}/METADATA +1 -1
- databricks_sdk-0.20.0.dist-info/RECORD +54 -0
- databricks_sdk-0.19.0.dist-info/RECORD +0 -53
- {databricks_sdk-0.19.0.dist-info → databricks_sdk-0.20.0.dist-info}/LICENSE +0 -0
- {databricks_sdk-0.19.0.dist-info → databricks_sdk-0.20.0.dist-info}/NOTICE +0 -0
- {databricks_sdk-0.19.0.dist-info → databricks_sdk-0.20.0.dist-info}/WHEEL +0 -0
- {databricks_sdk-0.19.0.dist-info → databricks_sdk-0.20.0.dist-info}/top_level.txt +0 -0
|
@@ -794,6 +794,41 @@ class ConnectionType(Enum):
|
|
|
794
794
|
SQLSERVER = 'SQLSERVER'
|
|
795
795
|
|
|
796
796
|
|
|
797
|
+
@dataclass
|
|
798
|
+
class ContinuousUpdateStatus:
|
|
799
|
+
"""Detailed status of an online table. Shown if the online table is in the ONLINE_CONTINUOUS_UPDATE
|
|
800
|
+
or the ONLINE_UPDATING_PIPELINE_RESOURCES state."""
|
|
801
|
+
|
|
802
|
+
initial_pipeline_sync_progress: Optional[PipelineProgress] = None
|
|
803
|
+
"""Progress of the initial data synchronization."""
|
|
804
|
+
|
|
805
|
+
last_processed_commit_version: Optional[int] = None
|
|
806
|
+
"""The last source table Delta version that was synced to the online table. Note that this Delta
|
|
807
|
+
version may not be completely synced to the online table yet."""
|
|
808
|
+
|
|
809
|
+
timestamp: Optional[str] = None
|
|
810
|
+
"""The timestamp of the last time any data was synchronized from the source table to the online
|
|
811
|
+
table."""
|
|
812
|
+
|
|
813
|
+
def as_dict(self) -> dict:
|
|
814
|
+
"""Serializes the ContinuousUpdateStatus into a dictionary suitable for use as a JSON request body."""
|
|
815
|
+
body = {}
|
|
816
|
+
if self.initial_pipeline_sync_progress:
|
|
817
|
+
body['initial_pipeline_sync_progress'] = self.initial_pipeline_sync_progress.as_dict()
|
|
818
|
+
if self.last_processed_commit_version is not None:
|
|
819
|
+
body['last_processed_commit_version'] = self.last_processed_commit_version
|
|
820
|
+
if self.timestamp is not None: body['timestamp'] = self.timestamp
|
|
821
|
+
return body
|
|
822
|
+
|
|
823
|
+
@classmethod
|
|
824
|
+
def from_dict(cls, d: Dict[str, any]) -> ContinuousUpdateStatus:
|
|
825
|
+
"""Deserializes the ContinuousUpdateStatus from a dictionary."""
|
|
826
|
+
return cls(initial_pipeline_sync_progress=_from_dict(d, 'initial_pipeline_sync_progress',
|
|
827
|
+
PipelineProgress),
|
|
828
|
+
last_processed_commit_version=d.get('last_processed_commit_version', None),
|
|
829
|
+
timestamp=d.get('timestamp', None))
|
|
830
|
+
|
|
831
|
+
|
|
797
832
|
@dataclass
|
|
798
833
|
class CreateCatalog:
|
|
799
834
|
name: str
|
|
@@ -1808,6 +1843,35 @@ class ExternalLocationInfo:
|
|
|
1808
1843
|
url=d.get('url', None))
|
|
1809
1844
|
|
|
1810
1845
|
|
|
1846
|
+
@dataclass
|
|
1847
|
+
class FailedStatus:
|
|
1848
|
+
"""Detailed status of an online table. Shown if the online table is in the OFFLINE_FAILED or the
|
|
1849
|
+
ONLINE_PIPELINE_FAILED state."""
|
|
1850
|
+
|
|
1851
|
+
last_processed_commit_version: Optional[int] = None
|
|
1852
|
+
"""The last source table Delta version that was synced to the online table. Note that this Delta
|
|
1853
|
+
version may only be partially synced to the online table. Only populated if the table is still
|
|
1854
|
+
online and available for serving."""
|
|
1855
|
+
|
|
1856
|
+
timestamp: Optional[str] = None
|
|
1857
|
+
"""The timestamp of the last time any data was synchronized from the source table to the online
|
|
1858
|
+
table. Only populated if the table is still online and available for serving."""
|
|
1859
|
+
|
|
1860
|
+
def as_dict(self) -> dict:
|
|
1861
|
+
"""Serializes the FailedStatus into a dictionary suitable for use as a JSON request body."""
|
|
1862
|
+
body = {}
|
|
1863
|
+
if self.last_processed_commit_version is not None:
|
|
1864
|
+
body['last_processed_commit_version'] = self.last_processed_commit_version
|
|
1865
|
+
if self.timestamp is not None: body['timestamp'] = self.timestamp
|
|
1866
|
+
return body
|
|
1867
|
+
|
|
1868
|
+
@classmethod
|
|
1869
|
+
def from_dict(cls, d: Dict[str, any]) -> FailedStatus:
|
|
1870
|
+
"""Deserializes the FailedStatus from a dictionary."""
|
|
1871
|
+
return cls(last_processed_commit_version=d.get('last_processed_commit_version', None),
|
|
1872
|
+
timestamp=d.get('timestamp', None))
|
|
1873
|
+
|
|
1874
|
+
|
|
1811
1875
|
@dataclass
|
|
1812
1876
|
class ForeignKeyConstraint:
|
|
1813
1877
|
name: str
|
|
@@ -2548,18 +2612,25 @@ class ListTablesResponse:
|
|
|
2548
2612
|
|
|
2549
2613
|
@dataclass
|
|
2550
2614
|
class ListVolumesResponseContent:
|
|
2615
|
+
next_page_token: Optional[str] = None
|
|
2616
|
+
"""Opaque token to retrieve the next page of results. Absent if there are no more pages.
|
|
2617
|
+
__page_token__ should be set to this value for the next request to retrieve the next page of
|
|
2618
|
+
results."""
|
|
2619
|
+
|
|
2551
2620
|
volumes: Optional[List[VolumeInfo]] = None
|
|
2552
2621
|
|
|
2553
2622
|
def as_dict(self) -> dict:
|
|
2554
2623
|
"""Serializes the ListVolumesResponseContent into a dictionary suitable for use as a JSON request body."""
|
|
2555
2624
|
body = {}
|
|
2625
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
2556
2626
|
if self.volumes: body['volumes'] = [v.as_dict() for v in self.volumes]
|
|
2557
2627
|
return body
|
|
2558
2628
|
|
|
2559
2629
|
@classmethod
|
|
2560
2630
|
def from_dict(cls, d: Dict[str, any]) -> ListVolumesResponseContent:
|
|
2561
2631
|
"""Deserializes the ListVolumesResponseContent from a dictionary."""
|
|
2562
|
-
return cls(
|
|
2632
|
+
return cls(next_page_token=d.get('next_page_token', None),
|
|
2633
|
+
volumes=_repeated_dict(d, 'volumes', VolumeInfo))
|
|
2563
2634
|
|
|
2564
2635
|
|
|
2565
2636
|
class MatchType(Enum):
|
|
@@ -3223,6 +3294,158 @@ class NamedTableConstraint:
|
|
|
3223
3294
|
return cls(name=d.get('name', None))
|
|
3224
3295
|
|
|
3225
3296
|
|
|
3297
|
+
@dataclass
|
|
3298
|
+
class OnlineTable:
|
|
3299
|
+
"""Online Table information."""
|
|
3300
|
+
|
|
3301
|
+
name: Optional[str] = None
|
|
3302
|
+
"""Full three-part (catalog, schema, table) name of the table."""
|
|
3303
|
+
|
|
3304
|
+
spec: Optional[OnlineTableSpec] = None
|
|
3305
|
+
"""Specification of the online table."""
|
|
3306
|
+
|
|
3307
|
+
status: Optional[OnlineTableStatus] = None
|
|
3308
|
+
"""Online Table status"""
|
|
3309
|
+
|
|
3310
|
+
def as_dict(self) -> dict:
|
|
3311
|
+
"""Serializes the OnlineTable into a dictionary suitable for use as a JSON request body."""
|
|
3312
|
+
body = {}
|
|
3313
|
+
if self.name is not None: body['name'] = self.name
|
|
3314
|
+
if self.spec: body['spec'] = self.spec.as_dict()
|
|
3315
|
+
if self.status: body['status'] = self.status.as_dict()
|
|
3316
|
+
return body
|
|
3317
|
+
|
|
3318
|
+
@classmethod
|
|
3319
|
+
def from_dict(cls, d: Dict[str, any]) -> OnlineTable:
|
|
3320
|
+
"""Deserializes the OnlineTable from a dictionary."""
|
|
3321
|
+
return cls(name=d.get('name', None),
|
|
3322
|
+
spec=_from_dict(d, 'spec', OnlineTableSpec),
|
|
3323
|
+
status=_from_dict(d, 'status', OnlineTableStatus))
|
|
3324
|
+
|
|
3325
|
+
|
|
3326
|
+
@dataclass
|
|
3327
|
+
class OnlineTableSpec:
|
|
3328
|
+
"""Specification of an online table."""
|
|
3329
|
+
|
|
3330
|
+
perform_full_copy: Optional[bool] = None
|
|
3331
|
+
"""Whether to create a full-copy pipeline -- a pipeline that stops after creates a full copy of the
|
|
3332
|
+
source table upon initialization and does not process any change data feeds (CDFs) afterwards.
|
|
3333
|
+
The pipeline can still be manually triggered afterwards, but it always perform a full copy of
|
|
3334
|
+
the source table and there are no incremental updates. This mode is useful for syncing views or
|
|
3335
|
+
tables without CDFs to online tables. Note that the full-copy pipeline only supports "triggered"
|
|
3336
|
+
scheduling policy."""
|
|
3337
|
+
|
|
3338
|
+
pipeline_id: Optional[str] = None
|
|
3339
|
+
"""ID of the associated pipeline. Generated by the server - cannot be set by the caller."""
|
|
3340
|
+
|
|
3341
|
+
primary_key_columns: Optional[List[str]] = None
|
|
3342
|
+
"""Primary Key columns to be used for data insert/update in the destination."""
|
|
3343
|
+
|
|
3344
|
+
run_continuously: Optional[Any] = None
|
|
3345
|
+
"""Pipeline runs continuously after generating the initial data."""
|
|
3346
|
+
|
|
3347
|
+
run_triggered: Optional[Any] = None
|
|
3348
|
+
"""Pipeline stops after generating the initial data and can be triggered later (manually, through a
|
|
3349
|
+
cron job or through data triggers)"""
|
|
3350
|
+
|
|
3351
|
+
source_table_full_name: Optional[str] = None
|
|
3352
|
+
"""Three-part (catalog, schema, table) name of the source Delta table."""
|
|
3353
|
+
|
|
3354
|
+
timeseries_key: Optional[str] = None
|
|
3355
|
+
"""Time series key to deduplicate (tie-break) rows with the same primary key."""
|
|
3356
|
+
|
|
3357
|
+
def as_dict(self) -> dict:
|
|
3358
|
+
"""Serializes the OnlineTableSpec into a dictionary suitable for use as a JSON request body."""
|
|
3359
|
+
body = {}
|
|
3360
|
+
if self.perform_full_copy is not None: body['perform_full_copy'] = self.perform_full_copy
|
|
3361
|
+
if self.pipeline_id is not None: body['pipeline_id'] = self.pipeline_id
|
|
3362
|
+
if self.primary_key_columns: body['primary_key_columns'] = [v for v in self.primary_key_columns]
|
|
3363
|
+
if self.run_continuously: body['run_continuously'] = self.run_continuously
|
|
3364
|
+
if self.run_triggered: body['run_triggered'] = self.run_triggered
|
|
3365
|
+
if self.source_table_full_name is not None:
|
|
3366
|
+
body['source_table_full_name'] = self.source_table_full_name
|
|
3367
|
+
if self.timeseries_key is not None: body['timeseries_key'] = self.timeseries_key
|
|
3368
|
+
return body
|
|
3369
|
+
|
|
3370
|
+
@classmethod
|
|
3371
|
+
def from_dict(cls, d: Dict[str, any]) -> OnlineTableSpec:
|
|
3372
|
+
"""Deserializes the OnlineTableSpec from a dictionary."""
|
|
3373
|
+
return cls(perform_full_copy=d.get('perform_full_copy', None),
|
|
3374
|
+
pipeline_id=d.get('pipeline_id', None),
|
|
3375
|
+
primary_key_columns=d.get('primary_key_columns', None),
|
|
3376
|
+
run_continuously=d.get('run_continuously', None),
|
|
3377
|
+
run_triggered=d.get('run_triggered', None),
|
|
3378
|
+
source_table_full_name=d.get('source_table_full_name', None),
|
|
3379
|
+
timeseries_key=d.get('timeseries_key', None))
|
|
3380
|
+
|
|
3381
|
+
|
|
3382
|
+
class OnlineTableState(Enum):
|
|
3383
|
+
"""The state of an online table."""
|
|
3384
|
+
|
|
3385
|
+
OFFLINE = 'OFFLINE'
|
|
3386
|
+
OFFLINE_FAILED = 'OFFLINE_FAILED'
|
|
3387
|
+
ONLINE = 'ONLINE'
|
|
3388
|
+
ONLINE_CONTINUOUS_UPDATE = 'ONLINE_CONTINUOUS_UPDATE'
|
|
3389
|
+
ONLINE_NO_PENDING_UPDATE = 'ONLINE_NO_PENDING_UPDATE'
|
|
3390
|
+
ONLINE_PIPELINE_FAILED = 'ONLINE_PIPELINE_FAILED'
|
|
3391
|
+
ONLINE_TABLE_STATE_UNSPECIFIED = 'ONLINE_TABLE_STATE_UNSPECIFIED'
|
|
3392
|
+
ONLINE_TRIGGERED_UPDATE = 'ONLINE_TRIGGERED_UPDATE'
|
|
3393
|
+
ONLINE_UPDATING_PIPELINE_RESOURCES = 'ONLINE_UPDATING_PIPELINE_RESOURCES'
|
|
3394
|
+
PROVISIONING = 'PROVISIONING'
|
|
3395
|
+
PROVISIONING_INITIAL_SNAPSHOT = 'PROVISIONING_INITIAL_SNAPSHOT'
|
|
3396
|
+
PROVISIONING_PIPELINE_RESOURCES = 'PROVISIONING_PIPELINE_RESOURCES'
|
|
3397
|
+
|
|
3398
|
+
|
|
3399
|
+
@dataclass
|
|
3400
|
+
class OnlineTableStatus:
|
|
3401
|
+
"""Status of an online table."""
|
|
3402
|
+
|
|
3403
|
+
continuous_update_status: Optional[ContinuousUpdateStatus] = None
|
|
3404
|
+
"""Detailed status of an online table. Shown if the online table is in the ONLINE_CONTINUOUS_UPDATE
|
|
3405
|
+
or the ONLINE_UPDATING_PIPELINE_RESOURCES state."""
|
|
3406
|
+
|
|
3407
|
+
detailed_state: Optional[OnlineTableState] = None
|
|
3408
|
+
"""The state of the online table."""
|
|
3409
|
+
|
|
3410
|
+
failed_status: Optional[FailedStatus] = None
|
|
3411
|
+
"""Detailed status of an online table. Shown if the online table is in the OFFLINE_FAILED or the
|
|
3412
|
+
ONLINE_PIPELINE_FAILED state."""
|
|
3413
|
+
|
|
3414
|
+
message: Optional[str] = None
|
|
3415
|
+
"""A text description of the current state of the online table."""
|
|
3416
|
+
|
|
3417
|
+
provisioning_status: Optional[ProvisioningStatus] = None
|
|
3418
|
+
"""Detailed status of an online table. Shown if the online table is in the
|
|
3419
|
+
PROVISIONING_PIPELINE_RESOURCES or the PROVISIONING_INITIAL_SNAPSHOT state."""
|
|
3420
|
+
|
|
3421
|
+
triggered_update_status: Optional[TriggeredUpdateStatus] = None
|
|
3422
|
+
"""Detailed status of an online table. Shown if the online table is in the ONLINE_TRIGGERED_UPDATE
|
|
3423
|
+
or the ONLINE_NO_PENDING_UPDATE state."""
|
|
3424
|
+
|
|
3425
|
+
def as_dict(self) -> dict:
|
|
3426
|
+
"""Serializes the OnlineTableStatus into a dictionary suitable for use as a JSON request body."""
|
|
3427
|
+
body = {}
|
|
3428
|
+
if self.continuous_update_status:
|
|
3429
|
+
body['continuous_update_status'] = self.continuous_update_status.as_dict()
|
|
3430
|
+
if self.detailed_state is not None: body['detailed_state'] = self.detailed_state.value
|
|
3431
|
+
if self.failed_status: body['failed_status'] = self.failed_status.as_dict()
|
|
3432
|
+
if self.message is not None: body['message'] = self.message
|
|
3433
|
+
if self.provisioning_status: body['provisioning_status'] = self.provisioning_status.as_dict()
|
|
3434
|
+
if self.triggered_update_status:
|
|
3435
|
+
body['triggered_update_status'] = self.triggered_update_status.as_dict()
|
|
3436
|
+
return body
|
|
3437
|
+
|
|
3438
|
+
@classmethod
|
|
3439
|
+
def from_dict(cls, d: Dict[str, any]) -> OnlineTableStatus:
|
|
3440
|
+
"""Deserializes the OnlineTableStatus from a dictionary."""
|
|
3441
|
+
return cls(continuous_update_status=_from_dict(d, 'continuous_update_status', ContinuousUpdateStatus),
|
|
3442
|
+
detailed_state=_enum(d, 'detailed_state', OnlineTableState),
|
|
3443
|
+
failed_status=_from_dict(d, 'failed_status', FailedStatus),
|
|
3444
|
+
message=d.get('message', None),
|
|
3445
|
+
provisioning_status=_from_dict(d, 'provisioning_status', ProvisioningStatus),
|
|
3446
|
+
triggered_update_status=_from_dict(d, 'triggered_update_status', TriggeredUpdateStatus))
|
|
3447
|
+
|
|
3448
|
+
|
|
3226
3449
|
@dataclass
|
|
3227
3450
|
class PermissionsChange:
|
|
3228
3451
|
add: Optional[List[Privilege]] = None
|
|
@@ -3268,6 +3491,49 @@ class PermissionsList:
|
|
|
3268
3491
|
return cls(privilege_assignments=_repeated_dict(d, 'privilege_assignments', PrivilegeAssignment))
|
|
3269
3492
|
|
|
3270
3493
|
|
|
3494
|
+
@dataclass
|
|
3495
|
+
class PipelineProgress:
|
|
3496
|
+
"""Progress information of the Online Table data synchronization pipeline."""
|
|
3497
|
+
|
|
3498
|
+
estimated_completion_time_seconds: Optional[float] = None
|
|
3499
|
+
"""The estimated time remaining to complete this update in seconds."""
|
|
3500
|
+
|
|
3501
|
+
latest_version_currently_processing: Optional[int] = None
|
|
3502
|
+
"""The source table Delta version that was last processed by the pipeline. The pipeline may not
|
|
3503
|
+
have completely processed this version yet."""
|
|
3504
|
+
|
|
3505
|
+
sync_progress_completion: Optional[float] = None
|
|
3506
|
+
"""The completion ratio of this update. This is a number between 0 and 1."""
|
|
3507
|
+
|
|
3508
|
+
synced_row_count: Optional[int] = None
|
|
3509
|
+
"""The number of rows that have been synced in this update."""
|
|
3510
|
+
|
|
3511
|
+
total_row_count: Optional[int] = None
|
|
3512
|
+
"""The total number of rows that need to be synced in this update. This number may be an estimate."""
|
|
3513
|
+
|
|
3514
|
+
def as_dict(self) -> dict:
|
|
3515
|
+
"""Serializes the PipelineProgress into a dictionary suitable for use as a JSON request body."""
|
|
3516
|
+
body = {}
|
|
3517
|
+
if self.estimated_completion_time_seconds is not None:
|
|
3518
|
+
body['estimated_completion_time_seconds'] = self.estimated_completion_time_seconds
|
|
3519
|
+
if self.latest_version_currently_processing is not None:
|
|
3520
|
+
body['latest_version_currently_processing'] = self.latest_version_currently_processing
|
|
3521
|
+
if self.sync_progress_completion is not None:
|
|
3522
|
+
body['sync_progress_completion'] = self.sync_progress_completion
|
|
3523
|
+
if self.synced_row_count is not None: body['synced_row_count'] = self.synced_row_count
|
|
3524
|
+
if self.total_row_count is not None: body['total_row_count'] = self.total_row_count
|
|
3525
|
+
return body
|
|
3526
|
+
|
|
3527
|
+
@classmethod
|
|
3528
|
+
def from_dict(cls, d: Dict[str, any]) -> PipelineProgress:
|
|
3529
|
+
"""Deserializes the PipelineProgress from a dictionary."""
|
|
3530
|
+
return cls(estimated_completion_time_seconds=d.get('estimated_completion_time_seconds', None),
|
|
3531
|
+
latest_version_currently_processing=d.get('latest_version_currently_processing', None),
|
|
3532
|
+
sync_progress_completion=d.get('sync_progress_completion', None),
|
|
3533
|
+
synced_row_count=d.get('synced_row_count', None),
|
|
3534
|
+
total_row_count=d.get('total_row_count', None))
|
|
3535
|
+
|
|
3536
|
+
|
|
3271
3537
|
@dataclass
|
|
3272
3538
|
class PrimaryKeyConstraint:
|
|
3273
3539
|
name: str
|
|
@@ -3385,6 +3651,29 @@ class ProvisioningInfoState(Enum):
|
|
|
3385
3651
|
STATE_UNSPECIFIED = 'STATE_UNSPECIFIED'
|
|
3386
3652
|
|
|
3387
3653
|
|
|
3654
|
+
@dataclass
|
|
3655
|
+
class ProvisioningStatus:
|
|
3656
|
+
"""Detailed status of an online table. Shown if the online table is in the
|
|
3657
|
+
PROVISIONING_PIPELINE_RESOURCES or the PROVISIONING_INITIAL_SNAPSHOT state."""
|
|
3658
|
+
|
|
3659
|
+
initial_pipeline_sync_progress: Optional[PipelineProgress] = None
|
|
3660
|
+
"""Details about initial data synchronization. Only populated when in the
|
|
3661
|
+
PROVISIONING_INITIAL_SNAPSHOT state."""
|
|
3662
|
+
|
|
3663
|
+
def as_dict(self) -> dict:
|
|
3664
|
+
"""Serializes the ProvisioningStatus into a dictionary suitable for use as a JSON request body."""
|
|
3665
|
+
body = {}
|
|
3666
|
+
if self.initial_pipeline_sync_progress:
|
|
3667
|
+
body['initial_pipeline_sync_progress'] = self.initial_pipeline_sync_progress.as_dict()
|
|
3668
|
+
return body
|
|
3669
|
+
|
|
3670
|
+
@classmethod
|
|
3671
|
+
def from_dict(cls, d: Dict[str, any]) -> ProvisioningStatus:
|
|
3672
|
+
"""Deserializes the ProvisioningStatus from a dictionary."""
|
|
3673
|
+
return cls(
|
|
3674
|
+
initial_pipeline_sync_progress=_from_dict(d, 'initial_pipeline_sync_progress', PipelineProgress))
|
|
3675
|
+
|
|
3676
|
+
|
|
3388
3677
|
@dataclass
|
|
3389
3678
|
class RegisteredModelAlias:
|
|
3390
3679
|
"""Registered model alias."""
|
|
@@ -4109,6 +4398,40 @@ class TableType(Enum):
|
|
|
4109
4398
|
VIEW = 'VIEW'
|
|
4110
4399
|
|
|
4111
4400
|
|
|
4401
|
+
@dataclass
|
|
4402
|
+
class TriggeredUpdateStatus:
|
|
4403
|
+
"""Detailed status of an online table. Shown if the online table is in the ONLINE_TRIGGERED_UPDATE
|
|
4404
|
+
or the ONLINE_NO_PENDING_UPDATE state."""
|
|
4405
|
+
|
|
4406
|
+
last_processed_commit_version: Optional[int] = None
|
|
4407
|
+
"""The last source table Delta version that was synced to the online table. Note that this Delta
|
|
4408
|
+
version may not be completely synced to the online table yet."""
|
|
4409
|
+
|
|
4410
|
+
timestamp: Optional[str] = None
|
|
4411
|
+
"""The timestamp of the last time any data was synchronized from the source table to the online
|
|
4412
|
+
table."""
|
|
4413
|
+
|
|
4414
|
+
triggered_update_progress: Optional[PipelineProgress] = None
|
|
4415
|
+
"""Progress of the active data synchronization pipeline."""
|
|
4416
|
+
|
|
4417
|
+
def as_dict(self) -> dict:
|
|
4418
|
+
"""Serializes the TriggeredUpdateStatus into a dictionary suitable for use as a JSON request body."""
|
|
4419
|
+
body = {}
|
|
4420
|
+
if self.last_processed_commit_version is not None:
|
|
4421
|
+
body['last_processed_commit_version'] = self.last_processed_commit_version
|
|
4422
|
+
if self.timestamp is not None: body['timestamp'] = self.timestamp
|
|
4423
|
+
if self.triggered_update_progress:
|
|
4424
|
+
body['triggered_update_progress'] = self.triggered_update_progress.as_dict()
|
|
4425
|
+
return body
|
|
4426
|
+
|
|
4427
|
+
@classmethod
|
|
4428
|
+
def from_dict(cls, d: Dict[str, any]) -> TriggeredUpdateStatus:
|
|
4429
|
+
"""Deserializes the TriggeredUpdateStatus from a dictionary."""
|
|
4430
|
+
return cls(last_processed_commit_version=d.get('last_processed_commit_version', None),
|
|
4431
|
+
timestamp=d.get('timestamp', None),
|
|
4432
|
+
triggered_update_progress=_from_dict(d, 'triggered_update_progress', PipelineProgress))
|
|
4433
|
+
|
|
4434
|
+
|
|
4112
4435
|
@dataclass
|
|
4113
4436
|
class UpdateCatalog:
|
|
4114
4437
|
comment: Optional[str] = None
|
|
@@ -4163,7 +4486,7 @@ class UpdateConnection:
|
|
|
4163
4486
|
options: Dict[str, str]
|
|
4164
4487
|
"""A map of key-value properties attached to the securable."""
|
|
4165
4488
|
|
|
4166
|
-
|
|
4489
|
+
name: Optional[str] = None
|
|
4167
4490
|
"""Name of the connection."""
|
|
4168
4491
|
|
|
4169
4492
|
new_name: Optional[str] = None
|
|
@@ -4175,7 +4498,7 @@ class UpdateConnection:
|
|
|
4175
4498
|
def as_dict(self) -> dict:
|
|
4176
4499
|
"""Serializes the UpdateConnection into a dictionary suitable for use as a JSON request body."""
|
|
4177
4500
|
body = {}
|
|
4178
|
-
if self.
|
|
4501
|
+
if self.name is not None: body['name'] = self.name
|
|
4179
4502
|
if self.new_name is not None: body['new_name'] = self.new_name
|
|
4180
4503
|
if self.options: body['options'] = self.options
|
|
4181
4504
|
if self.owner is not None: body['owner'] = self.owner
|
|
@@ -4184,7 +4507,7 @@ class UpdateConnection:
|
|
|
4184
4507
|
@classmethod
|
|
4185
4508
|
def from_dict(cls, d: Dict[str, any]) -> UpdateConnection:
|
|
4186
4509
|
"""Deserializes the UpdateConnection from a dictionary."""
|
|
4187
|
-
return cls(
|
|
4510
|
+
return cls(name=d.get('name', None),
|
|
4188
4511
|
new_name=d.get('new_name', None),
|
|
4189
4512
|
options=d.get('options', None),
|
|
4190
4513
|
owner=d.get('owner', None))
|
|
@@ -4401,9 +4724,6 @@ class UpdateModelVersionRequest:
|
|
|
4401
4724
|
|
|
4402
4725
|
@dataclass
|
|
4403
4726
|
class UpdateMonitor:
|
|
4404
|
-
assets_dir: str
|
|
4405
|
-
"""The directory to store monitoring assets (e.g. dashboard, metric tables)."""
|
|
4406
|
-
|
|
4407
4727
|
output_schema_name: str
|
|
4408
4728
|
"""Schema where output metric tables are created."""
|
|
4409
4729
|
|
|
@@ -4445,7 +4765,6 @@ class UpdateMonitor:
|
|
|
4445
4765
|
def as_dict(self) -> dict:
|
|
4446
4766
|
"""Serializes the UpdateMonitor into a dictionary suitable for use as a JSON request body."""
|
|
4447
4767
|
body = {}
|
|
4448
|
-
if self.assets_dir is not None: body['assets_dir'] = self.assets_dir
|
|
4449
4768
|
if self.baseline_table_name is not None: body['baseline_table_name'] = self.baseline_table_name
|
|
4450
4769
|
if self.custom_metrics: body['custom_metrics'] = [v.as_dict() for v in self.custom_metrics]
|
|
4451
4770
|
if self.data_classification_config:
|
|
@@ -4463,8 +4782,7 @@ class UpdateMonitor:
|
|
|
4463
4782
|
@classmethod
|
|
4464
4783
|
def from_dict(cls, d: Dict[str, any]) -> UpdateMonitor:
|
|
4465
4784
|
"""Deserializes the UpdateMonitor from a dictionary."""
|
|
4466
|
-
return cls(
|
|
4467
|
-
baseline_table_name=d.get('baseline_table_name', None),
|
|
4785
|
+
return cls(baseline_table_name=d.get('baseline_table_name', None),
|
|
4468
4786
|
custom_metrics=_repeated_dict(d, 'custom_metrics', MonitorCustomMetric),
|
|
4469
4787
|
data_classification_config=_from_dict(d, 'data_classification_config',
|
|
4470
4788
|
MonitorDataClassificationConfig),
|
|
@@ -4660,7 +4978,7 @@ class UpdateVolumeRequestContent:
|
|
|
4660
4978
|
comment: Optional[str] = None
|
|
4661
4979
|
"""The comment attached to the volume"""
|
|
4662
4980
|
|
|
4663
|
-
|
|
4981
|
+
name: Optional[str] = None
|
|
4664
4982
|
"""The three-level (fully qualified) name of the volume"""
|
|
4665
4983
|
|
|
4666
4984
|
new_name: Optional[str] = None
|
|
@@ -4673,7 +4991,7 @@ class UpdateVolumeRequestContent:
|
|
|
4673
4991
|
"""Serializes the UpdateVolumeRequestContent into a dictionary suitable for use as a JSON request body."""
|
|
4674
4992
|
body = {}
|
|
4675
4993
|
if self.comment is not None: body['comment'] = self.comment
|
|
4676
|
-
if self.
|
|
4994
|
+
if self.name is not None: body['name'] = self.name
|
|
4677
4995
|
if self.new_name is not None: body['new_name'] = self.new_name
|
|
4678
4996
|
if self.owner is not None: body['owner'] = self.owner
|
|
4679
4997
|
return body
|
|
@@ -4682,7 +5000,7 @@ class UpdateVolumeRequestContent:
|
|
|
4682
5000
|
def from_dict(cls, d: Dict[str, any]) -> UpdateVolumeRequestContent:
|
|
4683
5001
|
"""Deserializes the UpdateVolumeRequestContent from a dictionary."""
|
|
4684
5002
|
return cls(comment=d.get('comment', None),
|
|
4685
|
-
|
|
5003
|
+
name=d.get('name', None),
|
|
4686
5004
|
new_name=d.get('new_name', None),
|
|
4687
5005
|
owner=d.get('owner', None))
|
|
4688
5006
|
|
|
@@ -4871,6 +5189,29 @@ class ValidationResultResult(Enum):
|
|
|
4871
5189
|
SKIP = 'SKIP'
|
|
4872
5190
|
|
|
4873
5191
|
|
|
5192
|
+
@dataclass
|
|
5193
|
+
class ViewData:
|
|
5194
|
+
"""Online Table information."""
|
|
5195
|
+
|
|
5196
|
+
name: Optional[str] = None
|
|
5197
|
+
"""Full three-part (catalog, schema, table) name of the table."""
|
|
5198
|
+
|
|
5199
|
+
spec: Optional[OnlineTableSpec] = None
|
|
5200
|
+
"""Specification of the online table."""
|
|
5201
|
+
|
|
5202
|
+
def as_dict(self) -> dict:
|
|
5203
|
+
"""Serializes the ViewData into a dictionary suitable for use as a JSON request body."""
|
|
5204
|
+
body = {}
|
|
5205
|
+
if self.name is not None: body['name'] = self.name
|
|
5206
|
+
if self.spec: body['spec'] = self.spec.as_dict()
|
|
5207
|
+
return body
|
|
5208
|
+
|
|
5209
|
+
@classmethod
|
|
5210
|
+
def from_dict(cls, d: Dict[str, any]) -> ViewData:
|
|
5211
|
+
"""Deserializes the ViewData from a dictionary."""
|
|
5212
|
+
return cls(name=d.get('name', None), spec=_from_dict(d, 'spec', OnlineTableSpec))
|
|
5213
|
+
|
|
5214
|
+
|
|
4874
5215
|
@dataclass
|
|
4875
5216
|
class VolumeInfo:
|
|
4876
5217
|
access_point: Optional[str] = None
|
|
@@ -5037,6 +5378,7 @@ class AccountMetastoreAssignmentsAPI:
|
|
|
5037
5378
|
body = {}
|
|
5038
5379
|
if metastore_assignment is not None: body['metastore_assignment'] = metastore_assignment.as_dict()
|
|
5039
5380
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
5381
|
+
|
|
5040
5382
|
self._api.do(
|
|
5041
5383
|
'POST',
|
|
5042
5384
|
f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}/metastores/{metastore_id}',
|
|
@@ -5057,6 +5399,7 @@ class AccountMetastoreAssignmentsAPI:
|
|
|
5057
5399
|
"""
|
|
5058
5400
|
|
|
5059
5401
|
headers = {'Accept': 'application/json', }
|
|
5402
|
+
|
|
5060
5403
|
self._api.do(
|
|
5061
5404
|
'DELETE',
|
|
5062
5405
|
f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}/metastores/{metastore_id}',
|
|
@@ -5076,6 +5419,7 @@ class AccountMetastoreAssignmentsAPI:
|
|
|
5076
5419
|
"""
|
|
5077
5420
|
|
|
5078
5421
|
headers = {'Accept': 'application/json', }
|
|
5422
|
+
|
|
5079
5423
|
res = self._api.do('GET',
|
|
5080
5424
|
f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}/metastore',
|
|
5081
5425
|
headers=headers)
|
|
@@ -5093,6 +5437,7 @@ class AccountMetastoreAssignmentsAPI:
|
|
|
5093
5437
|
"""
|
|
5094
5438
|
|
|
5095
5439
|
headers = {'Accept': 'application/json', }
|
|
5440
|
+
|
|
5096
5441
|
json = self._api.do('GET',
|
|
5097
5442
|
f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}/workspaces',
|
|
5098
5443
|
headers=headers)
|
|
@@ -5120,6 +5465,7 @@ class AccountMetastoreAssignmentsAPI:
|
|
|
5120
5465
|
body = {}
|
|
5121
5466
|
if metastore_assignment is not None: body['metastore_assignment'] = metastore_assignment.as_dict()
|
|
5122
5467
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
5468
|
+
|
|
5123
5469
|
self._api.do(
|
|
5124
5470
|
'PUT',
|
|
5125
5471
|
f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}/metastores/{metastore_id}',
|
|
@@ -5146,6 +5492,7 @@ class AccountMetastoresAPI:
|
|
|
5146
5492
|
body = {}
|
|
5147
5493
|
if metastore_info is not None: body['metastore_info'] = metastore_info.as_dict()
|
|
5148
5494
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
5495
|
+
|
|
5149
5496
|
res = self._api.do('POST',
|
|
5150
5497
|
f'/api/2.0/accounts/{self._api.account_id}/metastores',
|
|
5151
5498
|
body=body,
|
|
@@ -5168,6 +5515,7 @@ class AccountMetastoresAPI:
|
|
|
5168
5515
|
query = {}
|
|
5169
5516
|
if force is not None: query['force'] = force
|
|
5170
5517
|
headers = {'Accept': 'application/json', }
|
|
5518
|
+
|
|
5171
5519
|
self._api.do('DELETE',
|
|
5172
5520
|
f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}',
|
|
5173
5521
|
query=query,
|
|
@@ -5185,6 +5533,7 @@ class AccountMetastoresAPI:
|
|
|
5185
5533
|
"""
|
|
5186
5534
|
|
|
5187
5535
|
headers = {'Accept': 'application/json', }
|
|
5536
|
+
|
|
5188
5537
|
res = self._api.do('GET',
|
|
5189
5538
|
f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}',
|
|
5190
5539
|
headers=headers)
|
|
@@ -5199,6 +5548,7 @@ class AccountMetastoresAPI:
|
|
|
5199
5548
|
"""
|
|
5200
5549
|
|
|
5201
5550
|
headers = {'Accept': 'application/json', }
|
|
5551
|
+
|
|
5202
5552
|
json = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/metastores', headers=headers)
|
|
5203
5553
|
parsed = ListMetastoresResponse.from_dict(json).metastores
|
|
5204
5554
|
return parsed if parsed is not None else []
|
|
@@ -5220,6 +5570,7 @@ class AccountMetastoresAPI:
|
|
|
5220
5570
|
body = {}
|
|
5221
5571
|
if metastore_info is not None: body['metastore_info'] = metastore_info.as_dict()
|
|
5222
5572
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
5573
|
+
|
|
5223
5574
|
res = self._api.do('PUT',
|
|
5224
5575
|
f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}',
|
|
5225
5576
|
body=body,
|
|
@@ -5256,6 +5607,7 @@ class AccountStorageCredentialsAPI:
|
|
|
5256
5607
|
body = {}
|
|
5257
5608
|
if credential_info is not None: body['credential_info'] = credential_info.as_dict()
|
|
5258
5609
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
5610
|
+
|
|
5259
5611
|
res = self._api.do(
|
|
5260
5612
|
'POST',
|
|
5261
5613
|
f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}/storage-credentials',
|
|
@@ -5282,6 +5634,7 @@ class AccountStorageCredentialsAPI:
|
|
|
5282
5634
|
query = {}
|
|
5283
5635
|
if force is not None: query['force'] = force
|
|
5284
5636
|
headers = {'Accept': 'application/json', }
|
|
5637
|
+
|
|
5285
5638
|
self._api.do(
|
|
5286
5639
|
'DELETE',
|
|
5287
5640
|
f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}/storage-credentials/{storage_credential_name}',
|
|
@@ -5303,6 +5656,7 @@ class AccountStorageCredentialsAPI:
|
|
|
5303
5656
|
"""
|
|
5304
5657
|
|
|
5305
5658
|
headers = {'Accept': 'application/json', }
|
|
5659
|
+
|
|
5306
5660
|
res = self._api.do(
|
|
5307
5661
|
'GET',
|
|
5308
5662
|
f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}/storage-credentials/{storage_credential_name}',
|
|
@@ -5321,6 +5675,7 @@ class AccountStorageCredentialsAPI:
|
|
|
5321
5675
|
"""
|
|
5322
5676
|
|
|
5323
5677
|
headers = {'Accept': 'application/json', }
|
|
5678
|
+
|
|
5324
5679
|
res = self._api.do(
|
|
5325
5680
|
'GET',
|
|
5326
5681
|
f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}/storage-credentials',
|
|
@@ -5348,6 +5703,7 @@ class AccountStorageCredentialsAPI:
|
|
|
5348
5703
|
body = {}
|
|
5349
5704
|
if credential_info is not None: body['credential_info'] = credential_info.as_dict()
|
|
5350
5705
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
5706
|
+
|
|
5351
5707
|
res = self._api.do(
|
|
5352
5708
|
'PUT',
|
|
5353
5709
|
f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}/storage-credentials/{storage_credential_name}',
|
|
@@ -5376,6 +5732,7 @@ class ArtifactAllowlistsAPI:
|
|
|
5376
5732
|
"""
|
|
5377
5733
|
|
|
5378
5734
|
headers = {'Accept': 'application/json', }
|
|
5735
|
+
|
|
5379
5736
|
res = self._api.do('GET',
|
|
5380
5737
|
f'/api/2.1/unity-catalog/artifact-allowlists/{artifact_type.value}',
|
|
5381
5738
|
headers=headers)
|
|
@@ -5399,6 +5756,7 @@ class ArtifactAllowlistsAPI:
|
|
|
5399
5756
|
body = {}
|
|
5400
5757
|
if artifact_matchers is not None: body['artifact_matchers'] = [v.as_dict() for v in artifact_matchers]
|
|
5401
5758
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
5759
|
+
|
|
5402
5760
|
res = self._api.do('PUT',
|
|
5403
5761
|
f'/api/2.1/unity-catalog/artifact-allowlists/{artifact_type.value}',
|
|
5404
5762
|
body=body,
|
|
@@ -5463,6 +5821,7 @@ class CatalogsAPI:
|
|
|
5463
5821
|
if share_name is not None: body['share_name'] = share_name
|
|
5464
5822
|
if storage_root is not None: body['storage_root'] = storage_root
|
|
5465
5823
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
5824
|
+
|
|
5466
5825
|
res = self._api.do('POST', '/api/2.1/unity-catalog/catalogs', body=body, headers=headers)
|
|
5467
5826
|
return CatalogInfo.from_dict(res)
|
|
5468
5827
|
|
|
@@ -5483,6 +5842,7 @@ class CatalogsAPI:
|
|
|
5483
5842
|
query = {}
|
|
5484
5843
|
if force is not None: query['force'] = force
|
|
5485
5844
|
headers = {'Accept': 'application/json', }
|
|
5845
|
+
|
|
5486
5846
|
self._api.do('DELETE', f'/api/2.1/unity-catalog/catalogs/{name}', query=query, headers=headers)
|
|
5487
5847
|
|
|
5488
5848
|
def get(self, name: str) -> CatalogInfo:
|
|
@@ -5498,6 +5858,7 @@ class CatalogsAPI:
|
|
|
5498
5858
|
"""
|
|
5499
5859
|
|
|
5500
5860
|
headers = {'Accept': 'application/json', }
|
|
5861
|
+
|
|
5501
5862
|
res = self._api.do('GET', f'/api/2.1/unity-catalog/catalogs/{name}', headers=headers)
|
|
5502
5863
|
return CatalogInfo.from_dict(res)
|
|
5503
5864
|
|
|
@@ -5513,6 +5874,7 @@ class CatalogsAPI:
|
|
|
5513
5874
|
"""
|
|
5514
5875
|
|
|
5515
5876
|
headers = {'Accept': 'application/json', }
|
|
5877
|
+
|
|
5516
5878
|
json = self._api.do('GET', '/api/2.1/unity-catalog/catalogs', headers=headers)
|
|
5517
5879
|
parsed = ListCatalogsResponse.from_dict(json).catalogs
|
|
5518
5880
|
return parsed if parsed is not None else []
|
|
@@ -5557,6 +5919,7 @@ class CatalogsAPI:
|
|
|
5557
5919
|
if owner is not None: body['owner'] = owner
|
|
5558
5920
|
if properties is not None: body['properties'] = properties
|
|
5559
5921
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
5922
|
+
|
|
5560
5923
|
res = self._api.do('PATCH', f'/api/2.1/unity-catalog/catalogs/{name}', body=body, headers=headers)
|
|
5561
5924
|
return CatalogInfo.from_dict(res)
|
|
5562
5925
|
|
|
@@ -5612,36 +5975,39 @@ class ConnectionsAPI:
|
|
|
5612
5975
|
if properties is not None: body['properties'] = properties
|
|
5613
5976
|
if read_only is not None: body['read_only'] = read_only
|
|
5614
5977
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
5978
|
+
|
|
5615
5979
|
res = self._api.do('POST', '/api/2.1/unity-catalog/connections', body=body, headers=headers)
|
|
5616
5980
|
return ConnectionInfo.from_dict(res)
|
|
5617
5981
|
|
|
5618
|
-
def delete(self,
|
|
5982
|
+
def delete(self, name: str):
|
|
5619
5983
|
"""Delete a connection.
|
|
5620
5984
|
|
|
5621
5985
|
Deletes the connection that matches the supplied name.
|
|
5622
5986
|
|
|
5623
|
-
:param
|
|
5987
|
+
:param name: str
|
|
5624
5988
|
The name of the connection to be deleted.
|
|
5625
5989
|
|
|
5626
5990
|
|
|
5627
5991
|
"""
|
|
5628
5992
|
|
|
5629
5993
|
headers = {'Accept': 'application/json', }
|
|
5630
|
-
self._api.do('DELETE', f'/api/2.1/unity-catalog/connections/{name_arg}', headers=headers)
|
|
5631
5994
|
|
|
5632
|
-
|
|
5995
|
+
self._api.do('DELETE', f'/api/2.1/unity-catalog/connections/{name}', headers=headers)
|
|
5996
|
+
|
|
5997
|
+
def get(self, name: str) -> ConnectionInfo:
|
|
5633
5998
|
"""Get a connection.
|
|
5634
5999
|
|
|
5635
6000
|
Gets a connection from it's name.
|
|
5636
6001
|
|
|
5637
|
-
:param
|
|
6002
|
+
:param name: str
|
|
5638
6003
|
Name of the connection.
|
|
5639
6004
|
|
|
5640
6005
|
:returns: :class:`ConnectionInfo`
|
|
5641
6006
|
"""
|
|
5642
6007
|
|
|
5643
6008
|
headers = {'Accept': 'application/json', }
|
|
5644
|
-
|
|
6009
|
+
|
|
6010
|
+
res = self._api.do('GET', f'/api/2.1/unity-catalog/connections/{name}', headers=headers)
|
|
5645
6011
|
return ConnectionInfo.from_dict(res)
|
|
5646
6012
|
|
|
5647
6013
|
def list(self) -> Iterator[ConnectionInfo]:
|
|
@@ -5653,12 +6019,13 @@ class ConnectionsAPI:
|
|
|
5653
6019
|
"""
|
|
5654
6020
|
|
|
5655
6021
|
headers = {'Accept': 'application/json', }
|
|
6022
|
+
|
|
5656
6023
|
json = self._api.do('GET', '/api/2.1/unity-catalog/connections', headers=headers)
|
|
5657
6024
|
parsed = ListConnectionsResponse.from_dict(json).connections
|
|
5658
6025
|
return parsed if parsed is not None else []
|
|
5659
6026
|
|
|
5660
6027
|
def update(self,
|
|
5661
|
-
|
|
6028
|
+
name: str,
|
|
5662
6029
|
options: Dict[str, str],
|
|
5663
6030
|
*,
|
|
5664
6031
|
new_name: Optional[str] = None,
|
|
@@ -5667,7 +6034,7 @@ class ConnectionsAPI:
|
|
|
5667
6034
|
|
|
5668
6035
|
Updates the connection that matches the supplied name.
|
|
5669
6036
|
|
|
5670
|
-
:param
|
|
6037
|
+
:param name: str
|
|
5671
6038
|
Name of the connection.
|
|
5672
6039
|
:param options: Dict[str,str]
|
|
5673
6040
|
A map of key-value properties attached to the securable.
|
|
@@ -5683,10 +6050,8 @@ class ConnectionsAPI:
|
|
|
5683
6050
|
if options is not None: body['options'] = options
|
|
5684
6051
|
if owner is not None: body['owner'] = owner
|
|
5685
6052
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
body=body,
|
|
5689
|
-
headers=headers)
|
|
6053
|
+
|
|
6054
|
+
res = self._api.do('PATCH', f'/api/2.1/unity-catalog/connections/{name}', body=body, headers=headers)
|
|
5690
6055
|
return ConnectionInfo.from_dict(res)
|
|
5691
6056
|
|
|
5692
6057
|
|
|
@@ -5750,6 +6115,7 @@ class ExternalLocationsAPI:
|
|
|
5750
6115
|
if skip_validation is not None: body['skip_validation'] = skip_validation
|
|
5751
6116
|
if url is not None: body['url'] = url
|
|
5752
6117
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
6118
|
+
|
|
5753
6119
|
res = self._api.do('POST', '/api/2.1/unity-catalog/external-locations', body=body, headers=headers)
|
|
5754
6120
|
return ExternalLocationInfo.from_dict(res)
|
|
5755
6121
|
|
|
@@ -5770,6 +6136,7 @@ class ExternalLocationsAPI:
|
|
|
5770
6136
|
query = {}
|
|
5771
6137
|
if force is not None: query['force'] = force
|
|
5772
6138
|
headers = {'Accept': 'application/json', }
|
|
6139
|
+
|
|
5773
6140
|
self._api.do('DELETE',
|
|
5774
6141
|
f'/api/2.1/unity-catalog/external-locations/{name}',
|
|
5775
6142
|
query=query,
|
|
@@ -5788,6 +6155,7 @@ class ExternalLocationsAPI:
|
|
|
5788
6155
|
"""
|
|
5789
6156
|
|
|
5790
6157
|
headers = {'Accept': 'application/json', }
|
|
6158
|
+
|
|
5791
6159
|
res = self._api.do('GET', f'/api/2.1/unity-catalog/external-locations/{name}', headers=headers)
|
|
5792
6160
|
return ExternalLocationInfo.from_dict(res)
|
|
5793
6161
|
|
|
@@ -5886,6 +6254,7 @@ class ExternalLocationsAPI:
|
|
|
5886
6254
|
if skip_validation is not None: body['skip_validation'] = skip_validation
|
|
5887
6255
|
if url is not None: body['url'] = url
|
|
5888
6256
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
6257
|
+
|
|
5889
6258
|
res = self._api.do('PATCH',
|
|
5890
6259
|
f'/api/2.1/unity-catalog/external-locations/{name}',
|
|
5891
6260
|
body=body,
|
|
@@ -5920,6 +6289,7 @@ class FunctionsAPI:
|
|
|
5920
6289
|
body = {}
|
|
5921
6290
|
if function_info is not None: body['function_info'] = function_info.as_dict()
|
|
5922
6291
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
6292
|
+
|
|
5923
6293
|
res = self._api.do('POST', '/api/2.1/unity-catalog/functions', body=body, headers=headers)
|
|
5924
6294
|
return FunctionInfo.from_dict(res)
|
|
5925
6295
|
|
|
@@ -5944,6 +6314,7 @@ class FunctionsAPI:
|
|
|
5944
6314
|
query = {}
|
|
5945
6315
|
if force is not None: query['force'] = force
|
|
5946
6316
|
headers = {'Accept': 'application/json', }
|
|
6317
|
+
|
|
5947
6318
|
self._api.do('DELETE', f'/api/2.1/unity-catalog/functions/{name}', query=query, headers=headers)
|
|
5948
6319
|
|
|
5949
6320
|
def get(self, name: str) -> FunctionInfo:
|
|
@@ -5964,6 +6335,7 @@ class FunctionsAPI:
|
|
|
5964
6335
|
"""
|
|
5965
6336
|
|
|
5966
6337
|
headers = {'Accept': 'application/json', }
|
|
6338
|
+
|
|
5967
6339
|
res = self._api.do('GET', f'/api/2.1/unity-catalog/functions/{name}', headers=headers)
|
|
5968
6340
|
return FunctionInfo.from_dict(res)
|
|
5969
6341
|
|
|
@@ -6034,6 +6406,7 @@ class FunctionsAPI:
|
|
|
6034
6406
|
body = {}
|
|
6035
6407
|
if owner is not None: body['owner'] = owner
|
|
6036
6408
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
6409
|
+
|
|
6037
6410
|
res = self._api.do('PATCH', f'/api/2.1/unity-catalog/functions/{name}', body=body, headers=headers)
|
|
6038
6411
|
return FunctionInfo.from_dict(res)
|
|
6039
6412
|
|
|
@@ -6074,6 +6447,7 @@ class GrantsAPI:
|
|
|
6074
6447
|
query = {}
|
|
6075
6448
|
if principal is not None: query['principal'] = principal
|
|
6076
6449
|
headers = {'Accept': 'application/json', }
|
|
6450
|
+
|
|
6077
6451
|
res = self._api.do('GET',
|
|
6078
6452
|
f'/api/2.1/unity-catalog/permissions/{securable_type.value}/{full_name}',
|
|
6079
6453
|
query=query,
|
|
@@ -6103,6 +6477,7 @@ class GrantsAPI:
|
|
|
6103
6477
|
query = {}
|
|
6104
6478
|
if principal is not None: query['principal'] = principal
|
|
6105
6479
|
headers = {'Accept': 'application/json', }
|
|
6480
|
+
|
|
6106
6481
|
res = self._api.do('GET',
|
|
6107
6482
|
f'/api/2.1/unity-catalog/effective-permissions/{securable_type.value}/{full_name}',
|
|
6108
6483
|
query=query,
|
|
@@ -6130,6 +6505,7 @@ class GrantsAPI:
|
|
|
6130
6505
|
body = {}
|
|
6131
6506
|
if changes is not None: body['changes'] = [v.as_dict() for v in changes]
|
|
6132
6507
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
6508
|
+
|
|
6133
6509
|
res = self._api.do('PATCH',
|
|
6134
6510
|
f'/api/2.1/unity-catalog/permissions/{securable_type.value}/{full_name}',
|
|
6135
6511
|
body=body,
|
|
@@ -6169,6 +6545,7 @@ class LakehouseMonitorsAPI:
|
|
|
6169
6545
|
"""
|
|
6170
6546
|
|
|
6171
6547
|
headers = {}
|
|
6548
|
+
|
|
6172
6549
|
self._api.do('POST',
|
|
6173
6550
|
f'/api/2.1/unity-catalog/tables/{full_name}/monitor/refreshes/{refresh_id}/cancel',
|
|
6174
6551
|
headers=headers)
|
|
@@ -6253,6 +6630,7 @@ class LakehouseMonitorsAPI:
|
|
|
6253
6630
|
if time_series is not None: body['time_series'] = time_series.as_dict()
|
|
6254
6631
|
if warehouse_id is not None: body['warehouse_id'] = warehouse_id
|
|
6255
6632
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
6633
|
+
|
|
6256
6634
|
res = self._api.do('POST',
|
|
6257
6635
|
f'/api/2.1/unity-catalog/tables/{full_name}/monitor',
|
|
6258
6636
|
body=body,
|
|
@@ -6281,6 +6659,7 @@ class LakehouseMonitorsAPI:
|
|
|
6281
6659
|
"""
|
|
6282
6660
|
|
|
6283
6661
|
headers = {}
|
|
6662
|
+
|
|
6284
6663
|
self._api.do('DELETE', f'/api/2.1/unity-catalog/tables/{full_name}/monitor', headers=headers)
|
|
6285
6664
|
|
|
6286
6665
|
def get(self, full_name: str) -> MonitorInfo:
|
|
@@ -6304,6 +6683,7 @@ class LakehouseMonitorsAPI:
|
|
|
6304
6683
|
"""
|
|
6305
6684
|
|
|
6306
6685
|
headers = {'Accept': 'application/json', }
|
|
6686
|
+
|
|
6307
6687
|
res = self._api.do('GET', f'/api/2.1/unity-catalog/tables/{full_name}/monitor', headers=headers)
|
|
6308
6688
|
return MonitorInfo.from_dict(res)
|
|
6309
6689
|
|
|
@@ -6328,6 +6708,7 @@ class LakehouseMonitorsAPI:
|
|
|
6328
6708
|
"""
|
|
6329
6709
|
|
|
6330
6710
|
headers = {'Accept': 'application/json', }
|
|
6711
|
+
|
|
6331
6712
|
res = self._api.do('GET',
|
|
6332
6713
|
f'/api/2.1/unity-catalog/tables/{full_name}/monitor/refreshes/{refresh_id}',
|
|
6333
6714
|
headers=headers)
|
|
@@ -6352,6 +6733,7 @@ class LakehouseMonitorsAPI:
|
|
|
6352
6733
|
"""
|
|
6353
6734
|
|
|
6354
6735
|
headers = {'Accept': 'application/json', }
|
|
6736
|
+
|
|
6355
6737
|
res = self._api.do('GET',
|
|
6356
6738
|
f'/api/2.1/unity-catalog/tables/{full_name}/monitor/refreshes',
|
|
6357
6739
|
headers=headers)
|
|
@@ -6377,6 +6759,7 @@ class LakehouseMonitorsAPI:
|
|
|
6377
6759
|
"""
|
|
6378
6760
|
|
|
6379
6761
|
headers = {'Accept': 'application/json', }
|
|
6762
|
+
|
|
6380
6763
|
res = self._api.do('POST',
|
|
6381
6764
|
f'/api/2.1/unity-catalog/tables/{full_name}/monitor/refreshes',
|
|
6382
6765
|
headers=headers)
|
|
@@ -6384,7 +6767,6 @@ class LakehouseMonitorsAPI:
|
|
|
6384
6767
|
|
|
6385
6768
|
def update(self,
|
|
6386
6769
|
full_name: str,
|
|
6387
|
-
assets_dir: str,
|
|
6388
6770
|
output_schema_name: str,
|
|
6389
6771
|
*,
|
|
6390
6772
|
baseline_table_name: Optional[str] = None,
|
|
@@ -6412,8 +6794,6 @@ class LakehouseMonitorsAPI:
|
|
|
6412
6794
|
|
|
6413
6795
|
:param full_name: str
|
|
6414
6796
|
Full name of the table.
|
|
6415
|
-
:param assets_dir: str
|
|
6416
|
-
The directory to store monitoring assets (e.g. dashboard, metric tables).
|
|
6417
6797
|
:param output_schema_name: str
|
|
6418
6798
|
Schema where output metric tables are created.
|
|
6419
6799
|
:param baseline_table_name: str (optional)
|
|
@@ -6442,7 +6822,6 @@ class LakehouseMonitorsAPI:
|
|
|
6442
6822
|
:returns: :class:`MonitorInfo`
|
|
6443
6823
|
"""
|
|
6444
6824
|
body = {}
|
|
6445
|
-
if assets_dir is not None: body['assets_dir'] = assets_dir
|
|
6446
6825
|
if baseline_table_name is not None: body['baseline_table_name'] = baseline_table_name
|
|
6447
6826
|
if custom_metrics is not None: body['custom_metrics'] = [v.as_dict() for v in custom_metrics]
|
|
6448
6827
|
if data_classification_config is not None:
|
|
@@ -6455,6 +6834,7 @@ class LakehouseMonitorsAPI:
|
|
|
6455
6834
|
if snapshot is not None: body['snapshot'] = snapshot
|
|
6456
6835
|
if time_series is not None: body['time_series'] = time_series.as_dict()
|
|
6457
6836
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
6837
|
+
|
|
6458
6838
|
res = self._api.do('PUT',
|
|
6459
6839
|
f'/api/2.1/unity-catalog/tables/{full_name}/monitor',
|
|
6460
6840
|
body=body,
|
|
@@ -6498,6 +6878,7 @@ class MetastoresAPI:
|
|
|
6498
6878
|
if default_catalog_name is not None: body['default_catalog_name'] = default_catalog_name
|
|
6499
6879
|
if metastore_id is not None: body['metastore_id'] = metastore_id
|
|
6500
6880
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
6881
|
+
|
|
6501
6882
|
self._api.do('PUT',
|
|
6502
6883
|
f'/api/2.1/unity-catalog/workspaces/{workspace_id}/metastore',
|
|
6503
6884
|
body=body,
|
|
@@ -6530,6 +6911,7 @@ class MetastoresAPI:
|
|
|
6530
6911
|
if region is not None: body['region'] = region
|
|
6531
6912
|
if storage_root is not None: body['storage_root'] = storage_root
|
|
6532
6913
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
6914
|
+
|
|
6533
6915
|
res = self._api.do('POST', '/api/2.1/unity-catalog/metastores', body=body, headers=headers)
|
|
6534
6916
|
return MetastoreInfo.from_dict(res)
|
|
6535
6917
|
|
|
@@ -6542,6 +6924,7 @@ class MetastoresAPI:
|
|
|
6542
6924
|
"""
|
|
6543
6925
|
|
|
6544
6926
|
headers = {'Accept': 'application/json', }
|
|
6927
|
+
|
|
6545
6928
|
res = self._api.do('GET', '/api/2.1/unity-catalog/current-metastore-assignment', headers=headers)
|
|
6546
6929
|
return MetastoreAssignment.from_dict(res)
|
|
6547
6930
|
|
|
@@ -6561,6 +6944,7 @@ class MetastoresAPI:
|
|
|
6561
6944
|
query = {}
|
|
6562
6945
|
if force is not None: query['force'] = force
|
|
6563
6946
|
headers = {'Accept': 'application/json', }
|
|
6947
|
+
|
|
6564
6948
|
self._api.do('DELETE', f'/api/2.1/unity-catalog/metastores/{id}', query=query, headers=headers)
|
|
6565
6949
|
|
|
6566
6950
|
def get(self, id: str) -> MetastoreInfo:
|
|
@@ -6576,6 +6960,7 @@ class MetastoresAPI:
|
|
|
6576
6960
|
"""
|
|
6577
6961
|
|
|
6578
6962
|
headers = {'Accept': 'application/json', }
|
|
6963
|
+
|
|
6579
6964
|
res = self._api.do('GET', f'/api/2.1/unity-catalog/metastores/{id}', headers=headers)
|
|
6580
6965
|
return MetastoreInfo.from_dict(res)
|
|
6581
6966
|
|
|
@@ -6589,6 +6974,7 @@ class MetastoresAPI:
|
|
|
6589
6974
|
"""
|
|
6590
6975
|
|
|
6591
6976
|
headers = {'Accept': 'application/json', }
|
|
6977
|
+
|
|
6592
6978
|
json = self._api.do('GET', '/api/2.1/unity-catalog/metastores', headers=headers)
|
|
6593
6979
|
parsed = ListMetastoresResponse.from_dict(json).metastores
|
|
6594
6980
|
return parsed if parsed is not None else []
|
|
@@ -6603,6 +6989,7 @@ class MetastoresAPI:
|
|
|
6603
6989
|
"""
|
|
6604
6990
|
|
|
6605
6991
|
headers = {'Accept': 'application/json', }
|
|
6992
|
+
|
|
6606
6993
|
res = self._api.do('GET', '/api/2.1/unity-catalog/metastore_summary', headers=headers)
|
|
6607
6994
|
return GetMetastoreSummaryResponse.from_dict(res)
|
|
6608
6995
|
|
|
@@ -6622,6 +7009,7 @@ class MetastoresAPI:
|
|
|
6622
7009
|
query = {}
|
|
6623
7010
|
if metastore_id is not None: query['metastore_id'] = metastore_id
|
|
6624
7011
|
headers = {'Accept': 'application/json', }
|
|
7012
|
+
|
|
6625
7013
|
self._api.do('DELETE',
|
|
6626
7014
|
f'/api/2.1/unity-catalog/workspaces/{workspace_id}/metastore',
|
|
6627
7015
|
query=query,
|
|
@@ -6675,6 +7063,7 @@ class MetastoresAPI:
|
|
|
6675
7063
|
if storage_root_credential_id is not None:
|
|
6676
7064
|
body['storage_root_credential_id'] = storage_root_credential_id
|
|
6677
7065
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
7066
|
+
|
|
6678
7067
|
res = self._api.do('PATCH', f'/api/2.1/unity-catalog/metastores/{id}', body=body, headers=headers)
|
|
6679
7068
|
return MetastoreInfo.from_dict(res)
|
|
6680
7069
|
|
|
@@ -6703,6 +7092,7 @@ class MetastoresAPI:
|
|
|
6703
7092
|
if default_catalog_name is not None: body['default_catalog_name'] = default_catalog_name
|
|
6704
7093
|
if metastore_id is not None: body['metastore_id'] = metastore_id
|
|
6705
7094
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
7095
|
+
|
|
6706
7096
|
self._api.do('PATCH',
|
|
6707
7097
|
f'/api/2.1/unity-catalog/workspaces/{workspace_id}/metastore',
|
|
6708
7098
|
body=body,
|
|
@@ -6739,6 +7129,7 @@ class ModelVersionsAPI:
|
|
|
6739
7129
|
"""
|
|
6740
7130
|
|
|
6741
7131
|
headers = {}
|
|
7132
|
+
|
|
6742
7133
|
self._api.do('DELETE',
|
|
6743
7134
|
f'/api/2.1/unity-catalog/models/{full_name}/versions/{version}',
|
|
6744
7135
|
headers=headers)
|
|
@@ -6761,6 +7152,7 @@ class ModelVersionsAPI:
|
|
|
6761
7152
|
"""
|
|
6762
7153
|
|
|
6763
7154
|
headers = {'Accept': 'application/json', }
|
|
7155
|
+
|
|
6764
7156
|
res = self._api.do('GET',
|
|
6765
7157
|
f'/api/2.1/unity-catalog/models/{full_name}/versions/{version}',
|
|
6766
7158
|
headers=headers)
|
|
@@ -6784,6 +7176,7 @@ class ModelVersionsAPI:
|
|
|
6784
7176
|
"""
|
|
6785
7177
|
|
|
6786
7178
|
headers = {'Accept': 'application/json', }
|
|
7179
|
+
|
|
6787
7180
|
res = self._api.do('GET',
|
|
6788
7181
|
f'/api/2.1/unity-catalog/models/{full_name}/aliases/{alias}',
|
|
6789
7182
|
headers=headers)
|
|
@@ -6861,6 +7254,7 @@ class ModelVersionsAPI:
|
|
|
6861
7254
|
body = {}
|
|
6862
7255
|
if comment is not None: body['comment'] = comment
|
|
6863
7256
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
7257
|
+
|
|
6864
7258
|
res = self._api.do('PATCH',
|
|
6865
7259
|
f'/api/2.1/unity-catalog/models/{full_name}/versions/{version}',
|
|
6866
7260
|
body=body,
|
|
@@ -6868,6 +7262,66 @@ class ModelVersionsAPI:
|
|
|
6868
7262
|
return ModelVersionInfo.from_dict(res)
|
|
6869
7263
|
|
|
6870
7264
|
|
|
7265
|
+
class OnlineTablesAPI:
|
|
7266
|
+
"""Online tables provide lower latency and higher QPS access to data from Delta tables."""
|
|
7267
|
+
|
|
7268
|
+
def __init__(self, api_client):
|
|
7269
|
+
self._api = api_client
|
|
7270
|
+
|
|
7271
|
+
def create(self, *, name: Optional[str] = None, spec: Optional[OnlineTableSpec] = None) -> OnlineTable:
|
|
7272
|
+
"""Create an Online Table.
|
|
7273
|
+
|
|
7274
|
+
Create a new Online Table.
|
|
7275
|
+
|
|
7276
|
+
:param name: str (optional)
|
|
7277
|
+
Full three-part (catalog, schema, table) name of the table.
|
|
7278
|
+
:param spec: :class:`OnlineTableSpec` (optional)
|
|
7279
|
+
Specification of the online table.
|
|
7280
|
+
|
|
7281
|
+
:returns: :class:`OnlineTable`
|
|
7282
|
+
"""
|
|
7283
|
+
body = {}
|
|
7284
|
+
if name is not None: body['name'] = name
|
|
7285
|
+
if spec is not None: body['spec'] = spec.as_dict()
|
|
7286
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
7287
|
+
|
|
7288
|
+
res = self._api.do('POST', '/api/2.0/online-tables', body=body, headers=headers)
|
|
7289
|
+
return OnlineTable.from_dict(res)
|
|
7290
|
+
|
|
7291
|
+
def delete(self, name: str):
|
|
7292
|
+
"""Delete an Online Table.
|
|
7293
|
+
|
|
7294
|
+
Delete an online table. Warning: This will delete all the data in the online table. If the source
|
|
7295
|
+
Delta table was deleted or modified since this Online Table was created, this will lose the data
|
|
7296
|
+
forever!
|
|
7297
|
+
|
|
7298
|
+
:param name: str
|
|
7299
|
+
Full three-part (catalog, schema, table) name of the table.
|
|
7300
|
+
|
|
7301
|
+
|
|
7302
|
+
"""
|
|
7303
|
+
|
|
7304
|
+
headers = {'Accept': 'application/json', }
|
|
7305
|
+
|
|
7306
|
+
self._api.do('DELETE', f'/api/2.0/online-tables/{name}', headers=headers)
|
|
7307
|
+
|
|
7308
|
+
def get(self, name: str) -> OnlineTable:
|
|
7309
|
+
"""Get an Online Table.
|
|
7310
|
+
|
|
7311
|
+
Get information about an existing online table and its status.
|
|
7312
|
+
|
|
7313
|
+
:param name: str
|
|
7314
|
+
Full three-part (catalog, schema, table) name of the table.
|
|
7315
|
+
|
|
7316
|
+
:returns: :class:`OnlineTable`
|
|
7317
|
+
"""
|
|
7318
|
+
|
|
7319
|
+
headers = {'Accept': 'application/json', }
|
|
7320
|
+
|
|
7321
|
+
res = self._api.do('GET', f'/api/2.0/online-tables/{name}', headers=headers)
|
|
7322
|
+
return OnlineTable.from_dict(res)
|
|
7323
|
+
|
|
7324
|
+
|
|
6871
7325
|
class RegisteredModelsAPI:
|
|
6872
7326
|
"""Databricks provides a hosted version of MLflow Model Registry in Unity Catalog. Models in Unity Catalog
|
|
6873
7327
|
provide centralized access control, auditing, lineage, and discovery of ML models across Databricks
|
|
@@ -6936,6 +7390,7 @@ class RegisteredModelsAPI:
|
|
|
6936
7390
|
if schema_name is not None: body['schema_name'] = schema_name
|
|
6937
7391
|
if storage_location is not None: body['storage_location'] = storage_location
|
|
6938
7392
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
7393
|
+
|
|
6939
7394
|
res = self._api.do('POST', '/api/2.1/unity-catalog/models', body=body, headers=headers)
|
|
6940
7395
|
return RegisteredModelInfo.from_dict(res)
|
|
6941
7396
|
|
|
@@ -6955,6 +7410,7 @@ class RegisteredModelsAPI:
|
|
|
6955
7410
|
"""
|
|
6956
7411
|
|
|
6957
7412
|
headers = {}
|
|
7413
|
+
|
|
6958
7414
|
self._api.do('DELETE', f'/api/2.1/unity-catalog/models/{full_name}', headers=headers)
|
|
6959
7415
|
|
|
6960
7416
|
def delete_alias(self, full_name: str, alias: str):
|
|
@@ -6975,6 +7431,7 @@ class RegisteredModelsAPI:
|
|
|
6975
7431
|
"""
|
|
6976
7432
|
|
|
6977
7433
|
headers = {}
|
|
7434
|
+
|
|
6978
7435
|
self._api.do('DELETE', f'/api/2.1/unity-catalog/models/{full_name}/aliases/{alias}', headers=headers)
|
|
6979
7436
|
|
|
6980
7437
|
def get(self, full_name: str) -> RegisteredModelInfo:
|
|
@@ -6993,6 +7450,7 @@ class RegisteredModelsAPI:
|
|
|
6993
7450
|
"""
|
|
6994
7451
|
|
|
6995
7452
|
headers = {'Accept': 'application/json', }
|
|
7453
|
+
|
|
6996
7454
|
res = self._api.do('GET', f'/api/2.1/unity-catalog/models/{full_name}', headers=headers)
|
|
6997
7455
|
return RegisteredModelInfo.from_dict(res)
|
|
6998
7456
|
|
|
@@ -7068,6 +7526,7 @@ class RegisteredModelsAPI:
|
|
|
7068
7526
|
body = {}
|
|
7069
7527
|
if version_num is not None: body['version_num'] = version_num
|
|
7070
7528
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
7529
|
+
|
|
7071
7530
|
res = self._api.do('PUT',
|
|
7072
7531
|
f'/api/2.1/unity-catalog/models/{full_name}/aliases/{alias}',
|
|
7073
7532
|
body=body,
|
|
@@ -7106,6 +7565,7 @@ class RegisteredModelsAPI:
|
|
|
7106
7565
|
if new_name is not None: body['new_name'] = new_name
|
|
7107
7566
|
if owner is not None: body['owner'] = owner
|
|
7108
7567
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
7568
|
+
|
|
7109
7569
|
res = self._api.do('PATCH', f'/api/2.1/unity-catalog/models/{full_name}', body=body, headers=headers)
|
|
7110
7570
|
return RegisteredModelInfo.from_dict(res)
|
|
7111
7571
|
|
|
@@ -7151,6 +7611,7 @@ class SchemasAPI:
|
|
|
7151
7611
|
if properties is not None: body['properties'] = properties
|
|
7152
7612
|
if storage_root is not None: body['storage_root'] = storage_root
|
|
7153
7613
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
7614
|
+
|
|
7154
7615
|
res = self._api.do('POST', '/api/2.1/unity-catalog/schemas', body=body, headers=headers)
|
|
7155
7616
|
return SchemaInfo.from_dict(res)
|
|
7156
7617
|
|
|
@@ -7167,6 +7628,7 @@ class SchemasAPI:
|
|
|
7167
7628
|
"""
|
|
7168
7629
|
|
|
7169
7630
|
headers = {'Accept': 'application/json', }
|
|
7631
|
+
|
|
7170
7632
|
self._api.do('DELETE', f'/api/2.1/unity-catalog/schemas/{full_name}', headers=headers)
|
|
7171
7633
|
|
|
7172
7634
|
def get(self, full_name: str) -> SchemaInfo:
|
|
@@ -7182,6 +7644,7 @@ class SchemasAPI:
|
|
|
7182
7644
|
"""
|
|
7183
7645
|
|
|
7184
7646
|
headers = {'Accept': 'application/json', }
|
|
7647
|
+
|
|
7185
7648
|
res = self._api.do('GET', f'/api/2.1/unity-catalog/schemas/{full_name}', headers=headers)
|
|
7186
7649
|
return SchemaInfo.from_dict(res)
|
|
7187
7650
|
|
|
@@ -7264,6 +7727,7 @@ class SchemasAPI:
|
|
|
7264
7727
|
if owner is not None: body['owner'] = owner
|
|
7265
7728
|
if properties is not None: body['properties'] = properties
|
|
7266
7729
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
7730
|
+
|
|
7267
7731
|
res = self._api.do('PATCH', f'/api/2.1/unity-catalog/schemas/{full_name}', body=body, headers=headers)
|
|
7268
7732
|
return SchemaInfo.from_dict(res)
|
|
7269
7733
|
|
|
@@ -7333,6 +7797,7 @@ class StorageCredentialsAPI:
|
|
|
7333
7797
|
if read_only is not None: body['read_only'] = read_only
|
|
7334
7798
|
if skip_validation is not None: body['skip_validation'] = skip_validation
|
|
7335
7799
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
7800
|
+
|
|
7336
7801
|
res = self._api.do('POST', '/api/2.1/unity-catalog/storage-credentials', body=body, headers=headers)
|
|
7337
7802
|
return StorageCredentialInfo.from_dict(res)
|
|
7338
7803
|
|
|
@@ -7353,6 +7818,7 @@ class StorageCredentialsAPI:
|
|
|
7353
7818
|
query = {}
|
|
7354
7819
|
if force is not None: query['force'] = force
|
|
7355
7820
|
headers = {'Accept': 'application/json', }
|
|
7821
|
+
|
|
7356
7822
|
self._api.do('DELETE',
|
|
7357
7823
|
f'/api/2.1/unity-catalog/storage-credentials/{name}',
|
|
7358
7824
|
query=query,
|
|
@@ -7371,6 +7837,7 @@ class StorageCredentialsAPI:
|
|
|
7371
7837
|
"""
|
|
7372
7838
|
|
|
7373
7839
|
headers = {'Accept': 'application/json', }
|
|
7840
|
+
|
|
7374
7841
|
res = self._api.do('GET', f'/api/2.1/unity-catalog/storage-credentials/{name}', headers=headers)
|
|
7375
7842
|
return StorageCredentialInfo.from_dict(res)
|
|
7376
7843
|
|
|
@@ -7476,6 +7943,7 @@ class StorageCredentialsAPI:
|
|
|
7476
7943
|
if read_only is not None: body['read_only'] = read_only
|
|
7477
7944
|
if skip_validation is not None: body['skip_validation'] = skip_validation
|
|
7478
7945
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
7946
|
+
|
|
7479
7947
|
res = self._api.do('PATCH',
|
|
7480
7948
|
f'/api/2.1/unity-catalog/storage-credentials/{name}',
|
|
7481
7949
|
body=body,
|
|
@@ -7540,6 +8008,7 @@ class StorageCredentialsAPI:
|
|
|
7540
8008
|
if storage_credential_name is not None: body['storage_credential_name'] = storage_credential_name
|
|
7541
8009
|
if url is not None: body['url'] = url
|
|
7542
8010
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
8011
|
+
|
|
7543
8012
|
res = self._api.do('POST',
|
|
7544
8013
|
'/api/2.1/unity-catalog/validate-storage-credentials',
|
|
7545
8014
|
body=body,
|
|
@@ -7569,6 +8038,7 @@ class SystemSchemasAPI:
|
|
|
7569
8038
|
"""
|
|
7570
8039
|
|
|
7571
8040
|
headers = {'Accept': 'application/json', }
|
|
8041
|
+
|
|
7572
8042
|
self._api.do('DELETE',
|
|
7573
8043
|
f'/api/2.1/unity-catalog/metastores/{metastore_id}/systemschemas/{schema_name.value}',
|
|
7574
8044
|
headers=headers)
|
|
@@ -7588,6 +8058,7 @@ class SystemSchemasAPI:
|
|
|
7588
8058
|
"""
|
|
7589
8059
|
|
|
7590
8060
|
headers = {'Accept': 'application/json', }
|
|
8061
|
+
|
|
7591
8062
|
self._api.do('PUT',
|
|
7592
8063
|
f'/api/2.1/unity-catalog/metastores/{metastore_id}/systemschemas/{schema_name.value}',
|
|
7593
8064
|
headers=headers)
|
|
@@ -7605,6 +8076,7 @@ class SystemSchemasAPI:
|
|
|
7605
8076
|
"""
|
|
7606
8077
|
|
|
7607
8078
|
headers = {'Accept': 'application/json', }
|
|
8079
|
+
|
|
7608
8080
|
json = self._api.do('GET',
|
|
7609
8081
|
f'/api/2.1/unity-catalog/metastores/{metastore_id}/systemschemas',
|
|
7610
8082
|
headers=headers)
|
|
@@ -7651,6 +8123,7 @@ class TableConstraintsAPI:
|
|
|
7651
8123
|
if constraint is not None: body['constraint'] = constraint.as_dict()
|
|
7652
8124
|
if full_name_arg is not None: body['full_name_arg'] = full_name_arg
|
|
7653
8125
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
8126
|
+
|
|
7654
8127
|
res = self._api.do('POST', '/api/2.1/unity-catalog/constraints', body=body, headers=headers)
|
|
7655
8128
|
return TableConstraint.from_dict(res)
|
|
7656
8129
|
|
|
@@ -7681,6 +8154,7 @@ class TableConstraintsAPI:
|
|
|
7681
8154
|
if cascade is not None: query['cascade'] = cascade
|
|
7682
8155
|
if constraint_name is not None: query['constraint_name'] = constraint_name
|
|
7683
8156
|
headers = {'Accept': 'application/json', }
|
|
8157
|
+
|
|
7684
8158
|
self._api.do('DELETE',
|
|
7685
8159
|
f'/api/2.1/unity-catalog/constraints/{full_name}',
|
|
7686
8160
|
query=query,
|
|
@@ -7715,6 +8189,7 @@ class TablesAPI:
|
|
|
7715
8189
|
"""
|
|
7716
8190
|
|
|
7717
8191
|
headers = {'Accept': 'application/json', }
|
|
8192
|
+
|
|
7718
8193
|
self._api.do('DELETE', f'/api/2.1/unity-catalog/tables/{full_name}', headers=headers)
|
|
7719
8194
|
|
|
7720
8195
|
def exists(self, full_name: str) -> TableExistsResponse:
|
|
@@ -7734,6 +8209,7 @@ class TablesAPI:
|
|
|
7734
8209
|
"""
|
|
7735
8210
|
|
|
7736
8211
|
headers = {'Accept': 'application/json', }
|
|
8212
|
+
|
|
7737
8213
|
res = self._api.do('GET', f'/api/2.1/unity-catalog/tables/{full_name}/exists', headers=headers)
|
|
7738
8214
|
return TableExistsResponse.from_dict(res)
|
|
7739
8215
|
|
|
@@ -7757,6 +8233,7 @@ class TablesAPI:
|
|
|
7757
8233
|
query = {}
|
|
7758
8234
|
if include_delta_metadata is not None: query['include_delta_metadata'] = include_delta_metadata
|
|
7759
8235
|
headers = {'Accept': 'application/json', }
|
|
8236
|
+
|
|
7760
8237
|
res = self._api.do('GET', f'/api/2.1/unity-catalog/tables/{full_name}', query=query, headers=headers)
|
|
7761
8238
|
return TableInfo.from_dict(res)
|
|
7762
8239
|
|
|
@@ -7889,6 +8366,7 @@ class TablesAPI:
|
|
|
7889
8366
|
body = {}
|
|
7890
8367
|
if owner is not None: body['owner'] = owner
|
|
7891
8368
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
8369
|
+
|
|
7892
8370
|
self._api.do('PATCH', f'/api/2.1/unity-catalog/tables/{full_name}', body=body, headers=headers)
|
|
7893
8371
|
|
|
7894
8372
|
|
|
@@ -7951,10 +8429,11 @@ class VolumesAPI:
|
|
|
7951
8429
|
if storage_location is not None: body['storage_location'] = storage_location
|
|
7952
8430
|
if volume_type is not None: body['volume_type'] = volume_type.value
|
|
7953
8431
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
8432
|
+
|
|
7954
8433
|
res = self._api.do('POST', '/api/2.1/unity-catalog/volumes', body=body, headers=headers)
|
|
7955
8434
|
return VolumeInfo.from_dict(res)
|
|
7956
8435
|
|
|
7957
|
-
def delete(self,
|
|
8436
|
+
def delete(self, name: str):
|
|
7958
8437
|
"""Delete a Volume.
|
|
7959
8438
|
|
|
7960
8439
|
Deletes a volume from the specified parent catalog and schema.
|
|
@@ -7963,19 +8442,25 @@ class VolumesAPI:
|
|
|
7963
8442
|
also be the owner or have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA**
|
|
7964
8443
|
privilege on the parent schema.
|
|
7965
8444
|
|
|
7966
|
-
:param
|
|
8445
|
+
:param name: str
|
|
7967
8446
|
The three-level (fully qualified) name of the volume
|
|
7968
8447
|
|
|
7969
8448
|
|
|
7970
8449
|
"""
|
|
7971
8450
|
|
|
7972
8451
|
headers = {}
|
|
7973
|
-
self._api.do('DELETE', f'/api/2.1/unity-catalog/volumes/{full_name_arg}', headers=headers)
|
|
7974
8452
|
|
|
7975
|
-
|
|
8453
|
+
self._api.do('DELETE', f'/api/2.1/unity-catalog/volumes/{name}', headers=headers)
|
|
8454
|
+
|
|
8455
|
+
def list(self,
|
|
8456
|
+
catalog_name: str,
|
|
8457
|
+
schema_name: str,
|
|
8458
|
+
*,
|
|
8459
|
+
max_results: Optional[int] = None,
|
|
8460
|
+
page_token: Optional[str] = None) -> Iterator[VolumeInfo]:
|
|
7976
8461
|
"""List Volumes.
|
|
7977
8462
|
|
|
7978
|
-
Gets an array of
|
|
8463
|
+
Gets an array of volumes for the current metastore under the parent catalog and schema.
|
|
7979
8464
|
|
|
7980
8465
|
The returned volumes are filtered based on the privileges of the calling user. For example, the
|
|
7981
8466
|
metastore admin is able to list all the volumes. A regular user needs to be the owner or have the
|
|
@@ -7989,19 +8474,42 @@ class VolumesAPI:
|
|
|
7989
8474
|
The identifier of the catalog
|
|
7990
8475
|
:param schema_name: str
|
|
7991
8476
|
The identifier of the schema
|
|
8477
|
+
:param max_results: int (optional)
|
|
8478
|
+
Maximum number of volumes to return (page length).
|
|
8479
|
+
|
|
8480
|
+
If not set, the page length is set to a server configured value (10000, as of 1/29/2024). - when set
|
|
8481
|
+
to a value greater than 0, the page length is the minimum of this value and a server configured
|
|
8482
|
+
value (10000, as of 1/29/2024); - when set to 0, the page length is set to a server configured value
|
|
8483
|
+
(10000, as of 1/29/2024) (recommended); - when set to a value less than 0, an invalid parameter
|
|
8484
|
+
error is returned;
|
|
8485
|
+
|
|
8486
|
+
Note: this parameter controls only the maximum number of volumes to return. The actual number of
|
|
8487
|
+
volumes returned in a page may be smaller than this value, including 0, even if there are more
|
|
8488
|
+
pages.
|
|
8489
|
+
:param page_token: str (optional)
|
|
8490
|
+
Opaque token returned by a previous request. It must be included in the request to retrieve the next
|
|
8491
|
+
page of results (pagination).
|
|
7992
8492
|
|
|
7993
8493
|
:returns: Iterator over :class:`VolumeInfo`
|
|
7994
8494
|
"""
|
|
7995
8495
|
|
|
7996
8496
|
query = {}
|
|
7997
8497
|
if catalog_name is not None: query['catalog_name'] = catalog_name
|
|
8498
|
+
if max_results is not None: query['max_results'] = max_results
|
|
8499
|
+
if page_token is not None: query['page_token'] = page_token
|
|
7998
8500
|
if schema_name is not None: query['schema_name'] = schema_name
|
|
7999
8501
|
headers = {'Accept': 'application/json', }
|
|
8000
|
-
json = self._api.do('GET', '/api/2.1/unity-catalog/volumes', query=query, headers=headers)
|
|
8001
|
-
parsed = ListVolumesResponseContent.from_dict(json).volumes
|
|
8002
|
-
return parsed if parsed is not None else []
|
|
8003
8502
|
|
|
8004
|
-
|
|
8503
|
+
while True:
|
|
8504
|
+
json = self._api.do('GET', '/api/2.1/unity-catalog/volumes', query=query, headers=headers)
|
|
8505
|
+
if 'volumes' in json:
|
|
8506
|
+
for v in json['volumes']:
|
|
8507
|
+
yield VolumeInfo.from_dict(v)
|
|
8508
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
8509
|
+
return
|
|
8510
|
+
query['page_token'] = json['next_page_token']
|
|
8511
|
+
|
|
8512
|
+
def read(self, name: str) -> VolumeInfo:
|
|
8005
8513
|
"""Get a Volume.
|
|
8006
8514
|
|
|
8007
8515
|
Gets a volume from the metastore for a specific catalog and schema.
|
|
@@ -8010,18 +8518,19 @@ class VolumesAPI:
|
|
|
8010
8518
|
volume. For the latter case, the caller must also be the owner or have the **USE_CATALOG** privilege
|
|
8011
8519
|
on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.
|
|
8012
8520
|
|
|
8013
|
-
:param
|
|
8521
|
+
:param name: str
|
|
8014
8522
|
The three-level (fully qualified) name of the volume
|
|
8015
8523
|
|
|
8016
8524
|
:returns: :class:`VolumeInfo`
|
|
8017
8525
|
"""
|
|
8018
8526
|
|
|
8019
8527
|
headers = {'Accept': 'application/json', }
|
|
8020
|
-
|
|
8528
|
+
|
|
8529
|
+
res = self._api.do('GET', f'/api/2.1/unity-catalog/volumes/{name}', headers=headers)
|
|
8021
8530
|
return VolumeInfo.from_dict(res)
|
|
8022
8531
|
|
|
8023
8532
|
def update(self,
|
|
8024
|
-
|
|
8533
|
+
name: str,
|
|
8025
8534
|
*,
|
|
8026
8535
|
comment: Optional[str] = None,
|
|
8027
8536
|
new_name: Optional[str] = None,
|
|
@@ -8036,7 +8545,7 @@ class VolumesAPI:
|
|
|
8036
8545
|
|
|
8037
8546
|
Currently only the name, the owner or the comment of the volume could be updated.
|
|
8038
8547
|
|
|
8039
|
-
:param
|
|
8548
|
+
:param name: str
|
|
8040
8549
|
The three-level (fully qualified) name of the volume
|
|
8041
8550
|
:param comment: str (optional)
|
|
8042
8551
|
The comment attached to the volume
|
|
@@ -8052,10 +8561,8 @@ class VolumesAPI:
|
|
|
8052
8561
|
if new_name is not None: body['new_name'] = new_name
|
|
8053
8562
|
if owner is not None: body['owner'] = owner
|
|
8054
8563
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
8055
|
-
|
|
8056
|
-
|
|
8057
|
-
body=body,
|
|
8058
|
-
headers=headers)
|
|
8564
|
+
|
|
8565
|
+
res = self._api.do('PATCH', f'/api/2.1/unity-catalog/volumes/{name}', body=body, headers=headers)
|
|
8059
8566
|
return VolumeInfo.from_dict(res)
|
|
8060
8567
|
|
|
8061
8568
|
|
|
@@ -8091,6 +8598,7 @@ class WorkspaceBindingsAPI:
|
|
|
8091
8598
|
"""
|
|
8092
8599
|
|
|
8093
8600
|
headers = {'Accept': 'application/json', }
|
|
8601
|
+
|
|
8094
8602
|
res = self._api.do('GET',
|
|
8095
8603
|
f'/api/2.1/unity-catalog/workspace-bindings/catalogs/{name}',
|
|
8096
8604
|
headers=headers)
|
|
@@ -8111,6 +8619,7 @@ class WorkspaceBindingsAPI:
|
|
|
8111
8619
|
"""
|
|
8112
8620
|
|
|
8113
8621
|
headers = {'Accept': 'application/json', }
|
|
8622
|
+
|
|
8114
8623
|
res = self._api.do('GET',
|
|
8115
8624
|
f'/api/2.1/unity-catalog/bindings/{securable_type}/{securable_name}',
|
|
8116
8625
|
headers=headers)
|
|
@@ -8139,6 +8648,7 @@ class WorkspaceBindingsAPI:
|
|
|
8139
8648
|
if assign_workspaces is not None: body['assign_workspaces'] = [v for v in assign_workspaces]
|
|
8140
8649
|
if unassign_workspaces is not None: body['unassign_workspaces'] = [v for v in unassign_workspaces]
|
|
8141
8650
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
8651
|
+
|
|
8142
8652
|
res = self._api.do('PATCH',
|
|
8143
8653
|
f'/api/2.1/unity-catalog/workspace-bindings/catalogs/{name}',
|
|
8144
8654
|
body=body,
|
|
@@ -8171,6 +8681,7 @@ class WorkspaceBindingsAPI:
|
|
|
8171
8681
|
if add is not None: body['add'] = [v.as_dict() for v in add]
|
|
8172
8682
|
if remove is not None: body['remove'] = [v.as_dict() for v in remove]
|
|
8173
8683
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
8684
|
+
|
|
8174
8685
|
res = self._api.do('PATCH',
|
|
8175
8686
|
f'/api/2.1/unity-catalog/bindings/{securable_type}/{securable_name}',
|
|
8176
8687
|
body=body,
|