Workspace Client¶
- class databricks.sdk.WorkspaceClient(*, host: str | None = None, account_id: str | None = None, username: str | None = None, password: str | None = None, client_id: str | None = None, client_secret: str | None = None, token: str | None = None, profile: str | None = None, config_file: str | None = None, azure_workspace_resource_id: str | None = None, azure_client_secret: str | None = None, azure_client_id: str | None = None, azure_tenant_id: str | None = None, azure_environment: str | None = None, auth_type: str | None = None, cluster_id: str | None = None, google_credentials: str | None = None, google_service_account: str | None = None, workspace_id: int | None = None, debug_truncate_bytes: int | None = None, debug_headers: bool | None = None, product='unknown', product_version='0.0.0', credentials_strategy: CredentialsStrategy | None = None, credentials_provider: CredentialsStrategy | None = None, token_audience: str | None = None, config: Config | None = None, scopes: List[str] | None = None, authorization_details: List[AuthorizationDetail] | None = None, custom_headers: dict | None = None)¶
The WorkspaceClient is a client for the workspace-level Databricks REST API.
- property config: Config¶
- property api_client: ApiClient¶
- property dbutils: RemoteDbUtils¶
- property access_control: AccessControlAPI¶
Rule based Access Control for Databricks Resources.
- property account_access_control_proxy: AccountAccessControlProxyAPI¶
These APIs manage access rules on resources in an account.
- property agent_bricks: AgentBricksAPI¶
The Custom LLMs service manages state and powers the UI for the Custom LLM product.
- property alerts_legacy: AlertsLegacyAPI¶
The alerts API can be used to perform CRUD operations on alerts.
- property alerts_v2: AlertsV2API¶
New version of SQL Alerts.
- property apps: AppsAPI¶
Apps run directly on a customer’s Databricks instance, integrate with their data, use and extend Databricks services, and enable users to interact through single sign-on.
- property apps_settings: AppsSettingsAPI¶
Apps Settings manage the settings for the Apps service on a customer’s Databricks instance.
- property artifact_allowlists: ArtifactAllowlistsAPI¶
In Databricks Runtime 13.3 and above, you can add libraries and init scripts to the allowlist in UC so that users can leverage these artifacts on compute configured with shared access mode.
- property catalogs: CatalogsAPI¶
A catalog is the first layer of Unity Catalog’s three-level namespace.
- property clean_room_asset_revisions: CleanRoomAssetRevisionsAPI¶
Clean Room Asset Revisions denote new versions of uploaded assets (e.g.
- property clean_room_assets: CleanRoomAssetsAPI¶
Clean room assets are data and code objects — Tables, volumes, and notebooks that are shared with the clean room.
- property clean_room_auto_approval_rules: CleanRoomAutoApprovalRulesAPI¶
Clean room auto-approval rules automatically create an approval on your behalf when an asset (e.g.
- property clean_room_task_runs: CleanRoomTaskRunsAPI¶
Clean room task runs are the executions of notebooks in a clean room.
- property clean_rooms: CleanRoomsAPI¶
A clean room uses Delta Sharing and serverless compute to provide a secure and privacy-protecting environment where multiple parties can work together on sensitive enterprise data without direct access to each other’s data.
- property cluster_policies: ClusterPoliciesAPI¶
You can use cluster policies to control users’ ability to configure clusters based on a set of rules.
- property clusters: ClustersExt¶
The Clusters API allows you to create, start, edit, list, terminate, and delete clusters.
- property command_execution: CommandExecutionAPI¶
This API allows execution of Python, Scala, SQL, or R commands on running Databricks Clusters.
- property connections: ConnectionsAPI¶
Connections allow for creating a connection to an external data source.
- property consumer_fulfillments: ConsumerFulfillmentsAPI¶
Fulfillments are entities that allow consumers to preview installations.
- property consumer_installations: ConsumerInstallationsAPI¶
Installations are entities that allow consumers to interact with Databricks Marketplace listings.
- property consumer_listings: ConsumerListingsAPI¶
Listings are the core entities in the Marketplace.
- property consumer_personalization_requests: ConsumerPersonalizationRequestsAPI¶
Personalization Requests allow customers to interact with the individualized Marketplace listing flow.
- property consumer_providers: ConsumerProvidersAPI¶
Providers are the entities that publish listings to the Marketplace.
- property credentials: CredentialsAPI¶
A credential represents an authentication and authorization mechanism for accessing services on your cloud tenant.
- property credentials_manager: CredentialsManagerAPI¶
Credentials manager interacts with with Identity Providers to to perform token exchanges using stored credentials and refresh tokens.
- property current_user: CurrentUserAPI¶
This API allows retrieving information about currently authenticated user or service principal.
- property dashboard_widgets: DashboardWidgetsAPI¶
This is an evolving API that facilitates the addition and removal of widgets from existing dashboards within the Databricks Workspace.
- property dashboards: DashboardsAPI¶
In general, there is little need to modify dashboards using the API.
- property data_classification: DataClassificationAPI¶
Manage data classification for Unity Catalog catalogs.
- property data_quality: DataQualityAPI¶
Manage the data quality of Unity Catalog objects (currently support schema and table).
- property data_sources: DataSourcesAPI¶
This API is provided to assist you in making new query objects.
- property database: DatabaseAPI¶
Database Instances provide access to a database via REST API or direct SQL.
- property dbfs: DbfsExt¶
DBFS API makes it simple to interact with various data sources without having to include a users credentials every time to read a file.
- property dbsql_permissions: DbsqlPermissionsAPI¶
The SQL Permissions API is similar to the endpoints of the :method:permissions/set.
- property entity_tag_assignments: EntityTagAssignmentsAPI¶
Tags are attributes that include keys and optional values that you can use to organize and categorize entities in Unity Catalog.
- property environments: EnvironmentsAPI¶
APIs to manage environment resources.
- property experiments: ExperimentsAPI¶
Experiments are the primary unit of organization in MLflow; all MLflow runs belong to an experiment.
- property external_lineage: ExternalLineageAPI¶
External Lineage APIs enable defining and managing lineage relationships between Databricks objects and external systems.
- property external_locations: ExternalLocationsAPI¶
An external location is an object that combines a cloud storage path with a storage credential that authorizes access to the cloud storage path.
- property external_metadata: ExternalMetadataAPI¶
External Metadata objects enable customers to register and manage metadata about external systems within Unity Catalog.
- property feature_engineering: FeatureEngineeringAPI¶
[description].
- property feature_store: FeatureStoreAPI¶
A feature store is a centralized repository that enables data scientists to find and share features.
- property forecasting: ForecastingAPI¶
The Forecasting API allows you to create and get serverless forecasting experiments.
- property functions: FunctionsAPI¶
Functions implement User-Defined Functions (UDFs) in Unity Catalog.
- property git_credentials: GitCredentialsAPI¶
Registers personal access token for Databricks to do operations on behalf of the user.
- property global_init_scripts: GlobalInitScriptsAPI¶
The Global Init Scripts API enables Workspace administrators to configure global initialization scripts for their workspace.
- property groups_v2: GroupsV2API¶
Groups simplify identity management, making it easier to assign access to Databricks workspace, data, and other securable objects.
- property instance_pools: InstancePoolsAPI¶
Instance Pools API are used to create, edit, delete and list instance pools by using ready-to-use cloud instances which reduces a cluster start and auto-scaling times.
- property instance_profiles: InstanceProfilesAPI¶
The Instance Profiles API allows admins to add, list, and remove instance profiles that users can launch clusters with.
- property ip_access_lists: IpAccessListsAPI¶
IP Access List enables admins to configure IP access lists.
- property jobs: JobsExt¶
The Jobs API allows you to create, edit, and delete jobs.
- property knowledge_assistants: KnowledgeAssistantsAPI¶
Manage Knowledge Assistants and related resources.
- property lakeview: LakeviewAPI¶
These APIs provide specific management operations for Lakeview dashboards.
- property lakeview_embedded: LakeviewEmbeddedAPI¶
Token-based Lakeview APIs for embedding dashboards in external applications.
- property libraries: LibrariesAPI¶
The Libraries API allows you to install and uninstall libraries and get the status of libraries on a cluster.
- property materialized_features: MaterializedFeaturesAPI¶
Materialized Features are columns in tables and views that can be directly used as features to train and serve ML models.
- property metastores: MetastoresAPI¶
A metastore is the top-level container of objects in Unity Catalog.
- property model_registry: ModelRegistryAPI¶
Note: This API reference documents APIs for the Workspace Model Registry.
- property model_versions: ModelVersionsAPI¶
Databricks provides a hosted version of MLflow Model Registry in Unity Catalog.
- property notification_destinations: NotificationDestinationsAPI¶
The notification destinations API lets you programmatically manage a workspace’s notification destinations.
- property online_tables: OnlineTablesAPI¶
Online tables provide lower latency and higher QPS access to data from Delta tables.
- property permission_migration: PermissionMigrationAPI¶
APIs for migrating acl permissions, used only by the ucx tool: https://github.com/databrickslabs/ucx.
- property permissions: PermissionsAPI¶
Permissions API are used to create read, write, edit, update and manage access for various users on different objects and endpoints.
- property pipelines: PipelinesAPI¶
The Lakeflow Spark Declarative Pipelines API allows you to create, edit, delete, start, and view details about pipelines.
- property policies: PoliciesAPI¶
Attribute-Based Access Control (ABAC) provides high leverage governance for enforcing compliance policies in Unity Catalog.
- property policy_compliance_for_clusters: PolicyComplianceForClustersAPI¶
The policy compliance APIs allow you to view and manage the policy compliance status of clusters in your workspace.
- property policy_compliance_for_jobs: PolicyComplianceForJobsAPI¶
The compliance APIs allow you to view and manage the policy compliance status of jobs in your workspace.
- property policy_families: PolicyFamiliesAPI¶
View available policy families.
- property postgres: PostgresAPI¶
Use the Postgres API to create and manage Lakebase Autoscaling Postgres infrastructure, including projects, branches, compute endpoints, and roles.
- property provider_exchange_filters: ProviderExchangeFiltersAPI¶
Marketplace exchanges filters curate which groups can access an exchange.
- property provider_exchanges: ProviderExchangesAPI¶
Marketplace exchanges allow providers to share their listings with a curated set of customers.
- property provider_files: ProviderFilesAPI¶
Marketplace offers a set of file APIs for various purposes such as preview notebooks and provider icons.
- property provider_listings: ProviderListingsAPI¶
Listings are the core entities in the Marketplace.
- property provider_personalization_requests: ProviderPersonalizationRequestsAPI¶
Personalization requests are an alternate to instantly available listings.
- property provider_provider_analytics_dashboards: ProviderProviderAnalyticsDashboardsAPI¶
Manage templated analytics solution for providers.
- property provider_providers: ProviderProvidersAPI¶
Providers are entities that manage assets in Marketplace.
- property providers: ProvidersAPI¶
A data provider is an object representing the organization in the real world who shares the data.
- property quality_monitor_v2: QualityMonitorV2API¶
Deprecated: Please use the Data Quality Monitoring API instead (REST: /api/data-quality/v1/monitors).
- property quality_monitors: QualityMonitorsAPI¶
Deprecated: Please use the Data Quality Monitors API instead (REST: /api/data-quality/v1/monitors), which manages both Data Profiling and Anomaly Detection.
- property queries: QueriesAPI¶
The queries API can be used to perform CRUD operations on queries.
- property queries_legacy: QueriesLegacyAPI¶
These endpoints are used for CRUD operations on query definitions.
- property query_history: QueryHistoryAPI¶
A service responsible for storing and retrieving the list of queries run against SQL endpoints and serverless compute.
- property query_visualizations: QueryVisualizationsAPI¶
This is an evolving API that facilitates the addition and removal of visualizations from existing queries in the Databricks Workspace.
- property query_visualizations_legacy: QueryVisualizationsLegacyAPI¶
This is an evolving API that facilitates the addition and removal of vizualisations from existing queries within the Databricks Workspace.
- property recipient_activation: RecipientActivationAPI¶
The Recipient Activation API is only applicable in the open sharing model where the recipient object has the authentication type of TOKEN.
- property recipient_federation_policies: RecipientFederationPoliciesAPI¶
The Recipient Federation Policies APIs are only applicable in the open sharing model where the recipient object has the authentication type of OIDC_RECIPIENT, enabling data sharing from Databricks to non-Databricks recipients.
- property recipients: RecipientsAPI¶
A recipient is an object you create using :method:recipients/create to represent an organization which you want to allow access shares.
- property redash_config: RedashConfigAPI¶
Redash V2 service for workspace configurations (internal).
- property registered_models: RegisteredModelsAPI¶
Databricks provides a hosted version of MLflow Model Registry in Unity Catalog.
- property resource_quotas: ResourceQuotasAPI¶
Unity Catalog enforces resource quotas on all securable objects, which limits the number of resources that can be created.
- property rfa: RfaAPI¶
Request for Access enables users to request access for Unity Catalog securables.
- property schemas: SchemasAPI¶
A schema (also called a database) is the second layer of Unity Catalog’s three-level namespace.
- property secrets: SecretsAPI¶
The Secrets API allows you to manage secrets, secret scopes, and access permissions.
- property secrets_uc: SecretsUcAPI¶
A secret is a Unity Catalog securable object that stores sensitive credential data (such as passwords, tokens, and keys) within a three-level namespace (catalog_name.schema_name.secret_name).
- property service_principal_secrets_proxy: ServicePrincipalSecretsProxyAPI¶
These APIs enable administrators to manage service principal secrets at the workspace level.
- property service_principals_v2: ServicePrincipalsV2API¶
Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms.
- property serving_endpoints: ServingEndpointsExt¶
The Serving Endpoints API allows you to create, update, and delete model serving endpoints.
- property serving_endpoints_data_plane: ServingEndpointsDataPlaneAPI¶
Serving endpoints DataPlane provides a set of operations to interact with data plane endpoints for Serving endpoints service.
- property settings: SettingsAPI¶
Workspace Settings API allows users to manage settings at the workspace level.
A share is a container instantiated with :method:shares/create.
- property statement_execution: StatementExecutionAPI¶
The Databricks SQL Statement Execution API can be used to execute SQL statements on a SQL warehouse and fetch the result.
- property storage_credentials: StorageCredentialsAPI¶
A storage credential represents an authentication and authorization mechanism for accessing data stored on your cloud tenant.
- property supervisor_agents: SupervisorAgentsAPI¶
Manage Supervisor Agents and related resources.
- property system_schemas: SystemSchemasAPI¶
A system schema is a schema that lives within the system catalog.
- property table_constraints: TableConstraintsAPI¶
Primary key and foreign key constraints encode relationships between fields in tables.
- property tables: TablesAPI¶
A table resides in the third layer of Unity Catalog’s three-level namespace.
- property tag_policies: TagPoliciesAPI¶
The Tag Policy API allows you to manage policies for governed tags in Databricks.
- property temporary_path_credentials: TemporaryPathCredentialsAPI¶
Temporary Path Credentials refer to short-lived, downscoped credentials used to access external cloud storage locations registered in Databricks.
- property temporary_table_credentials: TemporaryTableCredentialsAPI¶
Temporary Table Credentials refer to short-lived, downscoped credentials used to access cloud storage locations where table data is stored in Databricks.
- property temporary_volume_credentials: TemporaryVolumeCredentialsAPI¶
Temporary Volume Credentials refer to short-lived, downscoped credentials used to access cloud storage locations where volume data is stored in Databricks.
- property token_management: TokenManagementAPI¶
Enables administrators to get all tokens and delete tokens for other users.
- property tokens: TokensAPI¶
The Token API allows you to create, list, and revoke tokens that can be used to authenticate and access Databricks REST APIs.
- property users_v2: UsersV2API¶
User identities recognized by Databricks and represented by email addresses.
- property vector_search_endpoints: VectorSearchEndpointsAPI¶
Endpoint: Represents the compute resources to host AI Search indexes.
- property vector_search_indexes: VectorSearchIndexesAPI¶
Index: An efficient representation of your embedding vectors that supports real-time and efficient approximate nearest neighbor (ANN) search queries.
- property volumes: VolumesAPI¶
Volumes are a Unity Catalog (UC) capability for accessing, storing, governing, organizing and processing files.
- property warehouses: WarehousesAPI¶
A SQL warehouse is a compute resource that lets you run SQL commands on data objects within Databricks SQL.
- property workspace: WorkspaceExt¶
The Workspace API allows you to list, import, export, and delete workspace objects such as notebooks, files, folders, and dashboards.
- property workspace_bindings: WorkspaceBindingsAPI¶
A securable in Databricks can be configured as __OPEN__ or __ISOLATED__.
- property workspace_conf: WorkspaceConfAPI¶
This API allows updating known workspace settings for advanced users.
- property workspace_entity_tag_assignments: WorkspaceEntityTagAssignmentsAPI¶
Manage tag assignments on workspace-scoped objects.
- property workspace_iam_v2: WorkspaceIamV2API¶
These APIs are used to manage identities and the workspace access of these identities in <Databricks>.
- property workspace_settings_v2: WorkspaceSettingsV2API¶
APIs to manage workspace level settings.
- property groups: GroupsAPI¶
Groups simplify identity management, making it easier to assign access to Databricks workspace, data, and other securable objects.
- property service_principals: ServicePrincipalsAPI¶
Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms.
- property users: UsersAPI¶
User identities recognized by Databricks and represented by email addresses.
- property files: FilesExt¶
The Files API is a standard HTTP API that allows you to read, write, list, and delete files and directories by referring to their URI.
- get_workspace_id() int¶
Get the workspace ID of the workspace that this client is connected to.
If
Config.workspace_idis already set (from the databrickscfg profile, theDATABRICKS_WORKSPACE_IDenv var, host metadata, or a?o=query param), it is returned without an API round-trip. Otherwise the ID is fetched from theX-Databricks-Org-Idresponse header on/api/2.0/preview/scim/v2/Me.