a.metastore_assignments: Account Metastore Assignments¶
- class databricks.sdk.service.catalog.AccountMetastoreAssignmentsAPI¶
These APIs manage metastore assignments to a workspace.
- create(workspace_id: int, metastore_id: str [, metastore_assignment: Optional[CreateMetastoreAssignment]]) AccountsCreateMetastoreAssignmentResponse¶
Creates an assignment to a metastore for a workspace
- Parameters:
workspace_id – int Workspace ID.
metastore_id – str Unity Catalog metastore ID
metastore_assignment –
CreateMetastoreAssignment(optional)
- Returns:
- delete(workspace_id: int, metastore_id: str) AccountsDeleteMetastoreAssignmentResponse¶
Deletes a metastore assignment to a workspace, leaving the workspace with no metastore.
- Parameters:
workspace_id – int Workspace ID.
metastore_id – str Unity Catalog metastore ID
- Returns:
- get(workspace_id: int) AccountsMetastoreAssignment¶
Gets the metastore assignment, if any, for the workspace specified by ID. If the workspace is assigned a metastore, the mapping will be returned. If no metastore is assigned to the workspace, the assignment will not be found and a 404 returned.
- Parameters:
workspace_id – int Workspace ID.
- Returns:
- list(metastore_id: str) Iterator[int]¶
Usage:
import os from databricks.sdk import AccountClient a = AccountClient() ws = a.metastore_assignments.list(metastore_id=os.environ["TEST_METASTORE_ID"])
Gets a list of all Databricks workspace IDs that have been assigned to given metastore.
- Parameters:
metastore_id – str Unity Catalog metastore ID
- Returns:
Iterator over int
- update(workspace_id: int, metastore_id: str [, metastore_assignment: Optional[UpdateMetastoreAssignment]]) AccountsUpdateMetastoreAssignmentResponse¶
Updates an assignment to a metastore for a workspace. Currently, only the default catalog may be updated.
- Parameters:
workspace_id – int Workspace ID.
metastore_id – str Unity Catalog metastore ID
metastore_assignment –
UpdateMetastoreAssignment(optional)
- Returns: