diff --git a/.claude/commands/write-pr-description.md b/.claude/commands/write-pr-description.md new file mode 100644 index 000000000..6889c809c --- /dev/null +++ b/.claude/commands/write-pr-description.md @@ -0,0 +1,77 @@ +--- +description: > + Write or improve a GitHub pull request description. Use when the user asks + to "write a PR description", "improve the PR description", "update the PR + body", or provides a PR URL and asks for a better description. + Keywords: PR description, pull request summary, PR body, PR writeup. +allowed-tools: [Read, Glob, Grep, Bash, ToolSearch] +--- + +# Write PR Description + +Generate a structured PR description that explains **why** the change exists, +not just what files were touched. + +## When to use + +- The user provides a PR URL and asks to write or improve its description. +- The user asks to draft a PR description for the current branch. +- An agent needs to open a PR and wants a high-quality description. + +## Workflow + +### Phase 1: Gather context + +Collect all the information needed to understand the change: + +1. **Read the PR metadata** — title, current description, author, branch name. +2. **Read the full diff** — understand every file changed, every function added + or removed, every signature change. Do not skip files. +3. **Read surrounding code when needed** — if the diff modifies an interface or + a struct, read the full file to understand how the change fits into the + existing architecture. +4. **Check for linked issues or docs** — the PR or commit messages may + reference issues, design docs, or RFCs that explain motivation. + +### Phase 2: Analyze the change + +Before writing, answer these questions internally: + +- **What was the status quo before this PR?** What limitation, bug, or missing + capability existed? +- **Why is this change needed now?** What concrete problem does it solve? Who + benefits? +- **What are the key design decisions?** Why was this approach chosen over + alternatives? +- **What is the new API surface?** Any new public types, functions, or + configuration options? +- **What are the architectural changes?** How does the internal structure + change? What moves where? What gets refactored? +- **Are there behavioral changes?** If not, say so explicitly — this reassures + reviewers. + +### Phase 3: Write the description + +Use the structure defined in `.github/PULL_REQUEST_TEMPLATE.md` as the +template. The tone should be direct and technical. Write for a reviewer who is +familiar with the codebase but has not seen this change before. + +**Key principles:** + +- **Lead with why, not what.** The diff already shows the what. The description + should explain the reasoning that is not visible in the code. +- **Be specific.** Instead of "improves extensibility", say "allows internal + tools to compose their own auth chain from individual credential strategies". +- **Name things.** Reference actual types, functions, files, and config fields. + Use backticks for code references. +- **State non-changes explicitly.** If the PR is a refactor with no behavioral + change, say "No behavioral changes. Existing users are unaffected." This is + valuable information for reviewers. +- **Keep the summary to one or two sentences.** It should be scannable. +- **Use the motivation section to tell a story.** What was the problem? Why + couldn't it be solved before? What does this PR unlock? + +### Phase 4: Update the PR + +Use the GitHub MCP tools or `gh` CLI to update the PR body with the new +description. Confirm with the user before pushing if unsure. diff --git a/.codegen.json b/.codegen.json deleted file mode 100644 index 1626d2f43..000000000 --- a/.codegen.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "mode": "py_v0", - "api_changelog": false, - "version": { - "databricks/sdk/version.py": "__version__ = \"$VERSION\"" - }, - "sync": { - "skip_from_source": [ - "BUILD.bazel", - "CLAUDE.md", - ".claude", - ".codegen", - ".cursor", - ".cursorrules", - ".nextchanges", - "changelog_validate", - "next-changelog.yml", - "README.universe.md", - "tagging.py" - ] - }, - "toolchain": { - "required": ["python3.12", "uv"], - "pre_setup": [ - "python3.12 -m venv .databricks" - ], - "prepend_path": ".databricks/bin", - "setup": [ - "pip install '.[dev]'" - ], - "post_generate": [ - "make fmt", - "pip install .", - "python3.12 docs/gen-client-docs.py" - ] - } -} diff --git a/CHANGELOG.md b/CHANGELOG.md index 8509eeed1..382a307c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Version changelog +## Release v0.118.0 (2026-06-18) + +### API Changes +* Add `create_data_api()`, `delete_data_api()`, `get_data_api()` and `update_data_api()` methods for [w.postgres](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/postgres/postgres.html) workspace-level service. +* Add `capacity_reservation_group` field for `databricks.sdk.service.compute.AzureAttributes`. +* Add `serverless_compute_id` field for `databricks.sdk.service.pipelines.ClonePipelineRequest`. +* Add `serverless_compute_id` field for `databricks.sdk.service.pipelines.CreatePipeline`. +* Add `serverless_compute_id` field for `databricks.sdk.service.pipelines.EditPipeline`. +* Add `serverless_compute_id` field for `databricks.sdk.service.pipelines.PipelineSpec`. +* Add `endpoint_id` field for `databricks.sdk.service.vectorsearch.MiniVectorIndex`. +* Add `endpoint_id` field for `databricks.sdk.service.vectorsearch.VectorIndex`. +* Add `dynamics365` enum value for `databricks.sdk.service.catalog.ConnectionType`. + ## Release v0.117.0 (2026-06-11) ### API Changes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c398f43f8..2b604d5aa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,25 @@ -We happily welcome contributions to the Databricks SDK for Python. We use [GitHub Issues](github.com/databricks/databricks-sdk-py/issues) to track community reported issues and [GitHub Pull Requests](https://github.com/databricks/databricks-sdk-py/pulls) for accepting changes. +We happily welcome contributions to the Databricks SDK for Python. We use [GitHub Issues](https://github.com/databricks/databricks-sdk-py/issues) to track community reported issues and [GitHub Pull Requests](https://github.com/databricks/databricks-sdk-py/pulls) to collect proposed changes. Contributions are licensed on a license-in/license-out basis. # Contributing Guide +## This repository is a mirror + +This repository is a read-only mirror: the source of truth for the SDK +lives in Databricks' internal repository, and the contents here are +published from it as part of each release. What this means for you: + +- **Issues** are tracked publicly + [here](https://github.com/databricks/databricks-sdk-py/issues). +- **External contributors:** pull requests with potential improvements + should be made against this repository. These pull requests will be + reviewed here, but will not be merged directly once approved. + Rather, a maintainer will re-apply the changes in the Databricks + internal repository and publish them as part of the next release. +- **Databricks employees:** do not open pull requests against this + repository. Make your change in the internal repository following the + internal SDK contribution procedure. + ## Communication Before starting work on a major feature, please open a GitHub issue. We will make sure no one else is already working on it and that it is aligned with the goals of the project. A "major feature" is defined as any change that is > 100 LOC altered (not including tests), or changes any user-facing behavior. diff --git a/README.md b/README.md index 141709514..83d90d8cf 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ [![codecov](https://codecov.io/gh/databricks/databricks-sdk-py/branch/main/graph/badge.svg?token=GU63K7WDBE)](https://codecov.io/gh/databricks/databricks-sdk-py) [![lines of code](https://tokei.rs/b1/github/databricks/databricks-sdk-py)]([https://codecov.io/github/databricks/databricks-sdk-py](https://github.com/databricks/databricks-sdk-py)) +> This repository is a read-only mirror, published from Databricks' +> internal repository with each release. Pull requests are reviewed +> here but merged internally (see [CONTRIBUTING.md](CONTRIBUTING.md)). + [Beta](https://docs.databricks.com/release-notes/release-types.html): This SDK is supported for production use cases, but we do expect future releases to have some interface changes; see [Interface stability](#interface-stability). We are keen to hear feedback from you on these SDKs. Please [file issues](https://github.com/databricks/databricks-sdk-py/issues), and we will address them. diff --git a/databricks/sdk/__init__.py b/databricks/sdk/__init__.py index 9e3215152..8dee259f3 100755 --- a/databricks/sdk/__init__.py +++ b/databricks/sdk/__init__.py @@ -565,7 +565,7 @@ def apps_settings(self) -> pkg_apps.AppsSettingsAPI: @property def artifact_allowlists(self) -> pkg_catalog.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.""" + """In Databricks Runtime 13.3 and above, you can add libraries and init scripts to the `allowlist` in UC so that users can use these artifacts on compute configured with shared access mode.""" return self._artifact_allowlists @property @@ -620,7 +620,7 @@ def command_execution(self) -> pkg_compute.CommandExecutionAPI: @property def connections(self) -> pkg_catalog.ConnectionsAPI: - """Connections allow for creating a connection to an external data source.""" + """A connection represents an external data source for use within Databricks.""" return self._connections @property @@ -1085,17 +1085,17 @@ def tag_policies(self) -> pkg_tags.TagPoliciesAPI: @property def temporary_path_credentials(self) -> pkg_catalog.TemporaryPathCredentialsAPI: - """Temporary Path Credentials refer to short-lived, downscoped credentials used to access external cloud storage locations registered in Databricks.""" + """Temporary Path Credentials are short-lived, downscoped credentials used to access external cloud storage locations registered in Databricks.""" return self._temporary_path_credentials @property def temporary_table_credentials(self) -> pkg_catalog.TemporaryTableCredentialsAPI: - """Temporary Table Credentials refer to short-lived, downscoped credentials used to access cloud storage locations where table data is stored in Databricks.""" + """Temporary Table Credentials are short-lived, downscoped credentials used to access cloud storage locations where table data is stored in Databricks.""" return self._temporary_table_credentials @property def temporary_volume_credentials(self) -> pkg_catalog.TemporaryVolumeCredentialsAPI: - """Temporary Volume Credentials refer to short-lived, downscoped credentials used to access cloud storage locations where volume data is stored in Databricks.""" + """Temporary Volume Credentials are short-lived, downscoped credentials used to access cloud storage locations where volume data is stored in Databricks.""" return self._temporary_volume_credentials @property @@ -1125,7 +1125,7 @@ def vector_search_indexes(self) -> pkg_vectorsearch.VectorSearchIndexesAPI: @property def volumes(self) -> pkg_catalog.VolumesAPI: - """Volumes are a Unity Catalog (UC) capability for accessing, storing, governing, organizing and processing files.""" + """Volumes are a Unity Catalog (UC) capability for accessing, storing, governing, organizing, and processing files.""" return self._volumes @property diff --git a/databricks/sdk/service/catalog.py b/databricks/sdk/service/catalog.py index b7810b3c4..a3c648980 100755 --- a/databricks/sdk/service/catalog.py +++ b/databricks/sdk/service/catalog.py @@ -1858,6 +1858,7 @@ class ConnectionType(Enum): BIGQUERY = "BIGQUERY" CONFLUENCE = "CONFLUENCE" DATABRICKS = "DATABRICKS" + DYNAMICS365 = "DYNAMICS365" GA4_RAW_DATA = "GA4_RAW_DATA" GITHUB = "GITHUB" GLUE = "GLUE" @@ -2668,7 +2669,7 @@ class CredentialPurpose(Enum): class CredentialType(Enum): - """Next Id: 19""" + """Next Id: 20""" ANY_STATIC_CREDENTIAL = "ANY_STATIC_CREDENTIAL" BEARER_TOKEN = "BEARER_TOKEN" @@ -9290,9 +9291,9 @@ def from_dict(cls, d: Dict[str, Any]) -> Securable: class SecurableKind(Enum): - """Latest kind: CONNECTION_CONFLUENT_SCHEMA_REGISTRY_BASIC = 346; Next id: 347. Reserved numbers: - 316, 317, 327, 330, 341 (former ENDPOINT_LLM_*, MODEL_SERVICE_STANDARD, - MODEL_SERVICE_SYSTEM_DELTASHARING, MCP_SERVICE_STANDARD).""" + """Latest kind: CONNECTION_MARKETO_OAUTH_M2M = 347; Next id: 348. Reserved numbers: 316, 317, 327, + 330, 341 (former ENDPOINT_LLM_*, MODEL_SERVICE_STANDARD, MODEL_SERVICE_SYSTEM_DELTASHARING, + MCP_SERVICE_STANDARD).""" TABLE_DB_STORAGE = "TABLE_DB_STORAGE" TABLE_DELTA = "TABLE_DELTA" @@ -11553,7 +11554,7 @@ def update( class 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.""" + that users can use these artifacts on compute configured with shared access mode.""" def __init__(self, api_client): self._api = api_client @@ -11911,14 +11912,13 @@ def update( class ConnectionsAPI: - """Connections allow for creating a connection to an external data source. + """A connection represents an external data source for use within Databricks. - A connection is an abstraction of an external data source that can be connected from Databricks Compute. - Creating a connection object is the first step to managing external data sources within Unity Catalog, - with the second step being creating a data object (catalog, schema, or table) using the connection. Data - objects derived from a connection can be written to or read from similar to other Unity Catalog data - objects based on cloud storage. Users may create different types of connections with each connection - having a unique set of configuration options to support credential management and other settings.""" + Creating a connection object is the first step to managing external data sources within Unity Catalog. The + second step is creating a data object (catalog, schema, or table) using the connection. Data objects + derived from a connection can be written to or read from similar to other Unity Catalog data objects based + on cloud storage. You can create different types of connections, and each connection has a unique set of + configuration options to support credential management and other settings.""" def __init__(self, api_client): self._api = api_client @@ -12508,9 +12508,9 @@ def validate_credential( class EntityTagAssignmentsAPI: """Tags are attributes that include keys and optional values that you can use to organize and categorize - entities in Unity Catalog. Entity tagging is currently supported on catalogs, schemas, tables (including - views), columns, volumes. With these APIs, users can create, update, delete, and list tag assignments - across Unity Catalog entities""" + entities in Unity Catalog. Entity tagging is supported on catalogs, schemas, tables (including views), + columns, and volumes. With these APIs, you can create, update, delete, and list tag assignments across + Unity Catalog entities.""" def __init__(self, api_client): self._api = api_client @@ -13562,10 +13562,9 @@ class GrantsAPI: schema that contains the object. Securable objects in Unity Catalog are hierarchical and privileges are inherited downward. - Securable objects in Unity Catalog are hierarchical and privileges are inherited downward. This means that - granting a privilege on the catalog automatically grants the privilege to all current and future objects - within the catalog. Similarly, privileges granted on a schema are inherited by all current and future - objects within that schema.""" + This means that granting a privilege on the catalog automatically grants the privilege to all current and + future objects within the catalog. Similarly, privileges granted on a schema are inherited by all current + and future objects within that schema.""" def __init__(self, api_client): self._api = api_client @@ -14212,7 +14211,7 @@ def list( The returned models are filtered based on the privileges of the calling user. For example, the metastore admin is able to list all the model versions. A regular user needs to be the owner or have - the **EXECUTE** privilege on the parent registered model to recieve the model versions in the + the **EXECUTE** privilege on the parent registered model to receive the model versions in the response. For the latter case, the caller must also be the owner or have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema. @@ -15164,9 +15163,9 @@ class RegisteredModelsAPI: An MLflow registered model resides in the third layer of Unity Catalog’s three-level namespace. Registered models contain model versions, which correspond to actual ML models (MLflow models). Creating - new model versions currently requires use of the MLflow Python client. Once model versions are created, - you can load them for batch inference using MLflow Python client APIs, or deploy them for real-time - serving using Databricks Model Serving. + new model versions requires use of the MLflow Python client. After model versions are created, you can + load them for batch inference using MLflow Python client APIs, or deploy them for real-time serving using + Databricks Model Serving. All operations on registered models and model versions require USE_CATALOG permissions on the enclosing catalog and USE_SCHEMA permissions on the enclosing schema. In addition, the following additional @@ -15180,8 +15179,8 @@ class RegisteredModelsAPI: new model version, or update permissions on the registered model, users must be owners of the registered model. - Note: The securable type for models is FUNCTION. When using REST APIs (e.g. tagging, grants) that specify - a securable type, use FUNCTION as the securable type.""" + Note: The securable type for models is FUNCTION. When using REST APIs (for example, tagging, grants) that + specify a securable type, use FUNCTION as the securable type.""" def __init__(self, api_client): self._api = api_client @@ -15382,7 +15381,7 @@ def list( The returned models are filtered based on the privileges of the calling user. For example, the metastore admin is able to list all the registered models. A regular user needs to be the owner or - have the **EXECUTE** privilege on the registered model to recieve the registered models in the + have the **EXECUTE** privilege on the registered model to receive the registered models in the response. For the latter case, the caller must also be the owner or have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema. @@ -15791,7 +15790,7 @@ def update_access_request_destinations( class SchemasAPI: """A schema (also called a database) is the second layer of Unity Catalog’s three-level namespace. A schema - organizes tables, views and functions. To access (or list) a table or view in a schema, users must have + organizes tables, views, and functions. To access (or list) a table or view in a schema, users must have the USE_SCHEMA data permission on the schema and its parent catalog, and they must have the SELECT permission on the table or view.""" @@ -16596,7 +16595,7 @@ def validate( class SystemSchemasAPI: """A system schema is a schema that lives within the system catalog. A system schema may contain information - about customer usage of Unity Catalog such as audit-logs, billing-logs, lineage information, etc.""" + about customer usage of Unity Catalog such as audit logs, billing logs, and lineage information.""" def __init__(self, api_client): self._api = api_client @@ -16715,9 +16714,9 @@ class TableConstraintsAPI: """Primary key and foreign key constraints encode relationships between fields in tables. Primary and foreign keys are informational only and are not enforced. Foreign keys must reference a - primary key in another table. This primary key is the parent constraint of the foreign key and the table + primary key in another table. This primary key is the parent constraint of the foreign key, and the table this primary key is on is the parent table of the foreign key. Similarly, the foreign key is the child - constraint of its referenced primary key; the table of the foreign key is the child table of the primary + constraint of its referenced primary key. The table of the foreign key is the child table of the primary key. You can declare primary keys and foreign keys as part of the table specification during table creation. @@ -17178,23 +17177,23 @@ def update(self, full_name: str, *, owner: Optional[str] = None): class TemporaryPathCredentialsAPI: - """Temporary Path Credentials refer to short-lived, downscoped credentials used to access external cloud - storage locations registered in Databricks. These credentials are employed to provide secure and - time-limited access to data in cloud environments such as AWS, Azure, and Google Cloud. Each cloud - provider has its own type of credentials: AWS uses temporary session tokens via AWS Security Token Service - (STS), Azure utilizes Shared Access Signatures (SAS) for its data storage services, and Google Cloud - supports temporary credentials through OAuth 2.0. + """Temporary Path Credentials are short-lived, downscoped credentials used to access external cloud storage + locations registered in Databricks. These credentials provide secure and time-limited access to data in + cloud environments such as AWS, Azure, and Google Cloud. Each cloud provider has its own type of + credentials: AWS uses temporary session tokens through AWS Security Token Service (STS), Azure uses Shared + Access Signatures (SAS) for its data storage services, and Google Cloud supports temporary credentials + through OAuth 2.0. Temporary path credentials ensure that data access is limited in scope and duration, reducing the risk of - unauthorized access or misuse. To use the temporary path credentials API, a metastore admin needs to - enable the external_access_enabled flag (off by default) at the metastore level. A user needs to be - granted the EXTERNAL USE LOCATION permission by external location owner. For requests on existing external - tables and external volumes, user also needs to be granted the EXTERNAL USE SCHEMA permission at the - schema level by catalog owner. + unauthorized access or misuse. To use the temporary path credentials API, a metastore admin must enable + the external_access_enabled flag (off by default) at the metastore level. A user must be granted the + EXTERNAL USE LOCATION permission by the external location owner. For requests on existing external tables + and external volumes, the user must also be granted the EXTERNAL USE SCHEMA permission at the schema level + by the catalog owner. - Note that EXTERNAL USE SCHEMA is a schema level permission that can only be granted by catalog owner + Note that EXTERNAL USE SCHEMA is a schema level permission that can only be granted by the catalog owner explicitly and is not included in schema ownership or ALL PRIVILEGES on the schema for security reasons. - Similarly, EXTERNAL USE LOCATION is an external location level permission that can only be granted by + Similarly, EXTERNAL USE LOCATION is an external location level permission that can only be granted by the external location owner explicitly and is not included in external location ownership or ALL PRIVILEGES on the external location for security reasons.""" @@ -17246,19 +17245,19 @@ def generate_temporary_path_credentials( class TemporaryTableCredentialsAPI: - """Temporary Table Credentials refer to short-lived, downscoped credentials used to access cloud storage - locations where table data is stored in Databricks. These credentials are employed to provide secure and - time-limited access to data in cloud environments such as AWS, Azure, and Google Cloud. Each cloud - provider has its own type of credentials: AWS uses temporary session tokens via AWS Security Token Service - (STS), Azure utilizes Shared Access Signatures (SAS) for its data storage services, and Google Cloud - supports temporary credentials through OAuth 2.0. + """Temporary Table Credentials are short-lived, downscoped credentials used to access cloud storage locations + where table data is stored in Databricks. These credentials provide secure and time-limited access to data + in cloud environments such as AWS, Azure, and Google Cloud. Each cloud provider has its own type of + credentials: AWS uses temporary session tokens through AWS Security Token Service (STS), Azure uses Shared + Access Signatures (SAS) for its data storage services, and Google Cloud supports temporary credentials + through OAuth 2.0. Temporary table credentials ensure that data access is limited in scope and duration, reducing the risk of - unauthorized access or misuse. To use the temporary table credentials API, a metastore admin needs to - enable the external_access_enabled flag (off by default) at the metastore level, and user needs to be - granted the EXTERNAL USE SCHEMA permission at the schema level by catalog owner. Note that EXTERNAL USE - SCHEMA is a schema level permission that can only be granted by catalog owner explicitly and is not - included in schema ownership or ALL PRIVILEGES on the schema for security reasons.""" + unauthorized access or misuse. To use the temporary table credentials API, a metastore admin must enable + the external_access_enabled flag (off by default) at the metastore level, and the user must be granted the + EXTERNAL USE SCHEMA permission at the schema level by the catalog owner. Note that EXTERNAL USE SCHEMA is + a schema level permission that can only be granted by the catalog owner explicitly and is not included in + schema ownership or ALL PRIVILEGES on the schema for security reasons.""" def __init__(self, api_client): self._api = api_client @@ -17299,19 +17298,19 @@ def generate_temporary_table_credentials( class TemporaryVolumeCredentialsAPI: - """Temporary Volume Credentials refer to short-lived, downscoped credentials used to access cloud storage - locations where volume data is stored in Databricks. These credentials are employed to provide secure and - time-limited access to data in cloud environments such as AWS, Azure, and Google Cloud. Each cloud - provider has its own type of credentials: AWS uses temporary session tokens via AWS Security Token Service - (STS), Azure utilizes Shared Access Signatures (SAS) for its data storage services, and Google Cloud - supports temporary credentials through OAuth 2.0. + """Temporary Volume Credentials are short-lived, downscoped credentials used to access cloud storage + locations where volume data is stored in Databricks. These credentials provide secure and time-limited + access to data in cloud environments such as AWS, Azure, and Google Cloud. Each cloud provider has its own + type of credentials: AWS uses temporary session tokens through AWS Security Token Service (STS), Azure + uses Shared Access Signatures (SAS) for its data storage services, and Google Cloud supports temporary + credentials through OAuth 2.0. Temporary volume credentials ensure that data access is limited in scope and duration, reducing the risk - of unauthorized access or misuse. To use the temporary volume credentials API, a metastore admin needs to - enable the external_access_enabled flag (off by default) at the metastore level, and user needs to be - granted the EXTERNAL USE SCHEMA permission at the schema level by catalog owner. Note that EXTERNAL USE - SCHEMA is a schema level permission that can only be granted by catalog owner explicitly and is not - included in schema ownership or ALL PRIVILEGES on the schema for security reasons.""" + of unauthorized access or misuse. To use the temporary volume credentials API, a metastore admin must + enable the external_access_enabled flag (off by default) at the metastore level, and the user must be + granted the EXTERNAL USE SCHEMA permission at the schema level by the catalog owner. Note that EXTERNAL + USE SCHEMA is a schema level permission that can only be granted by the catalog owner explicitly and is + not included in schema ownership or ALL PRIVILEGES on the schema for security reasons.""" def __init__(self, api_client): self._api = api_client @@ -17352,12 +17351,12 @@ def generate_temporary_volume_credentials( class VolumesAPI: - """Volumes are a Unity Catalog (UC) capability for accessing, storing, governing, organizing and processing + """Volumes are a Unity Catalog (UC) capability for accessing, storing, governing, organizing, and processing files. Use cases include running machine learning on unstructured data such as image, audio, video, or PDF files, organizing data sets during the data exploration stages in data science, working with libraries that require access to the local file system on cluster machines, storing library and config files of - arbitrary formats such as .whl or .txt centrally and providing secure access across workspaces to it, or - transforming and querying non-tabular data files in ETL.""" + arbitrary formats such as .whl or .txt centrally and providing secure access to those files across + workspaces, or transforming and querying non-tabular data files in ETL.""" def __init__(self, api_client): self._api = api_client @@ -17614,9 +17613,9 @@ class WorkspaceBindingsAPI: A securable's workspace bindings can be configured by a metastore admin or the owner of the securable. - The original path (/api/2.1/unity-catalog/workspace-bindings/catalogs/{name}) is deprecated. Please use - the new path (/api/2.1/unity-catalog/bindings/{securable_type}/{securable_name}) which introduces the - ability to bind a securable in READ_ONLY mode (catalogs only). + The original path (/api/2.1/unity-catalog/workspace-bindings/catalogs/{name}) is deprecated. Use the new + path (/api/2.1/unity-catalog/bindings/{securable_type}/{securable_name}), which introduces the ability to + bind a securable in READ_ONLY mode (catalogs only). Securable types that support binding: - catalog - storage_credential - credential - external_location""" diff --git a/databricks/sdk/service/compute.py b/databricks/sdk/service/compute.py index 2a570e0d6..20bc1e23b 100755 --- a/databricks/sdk/service/compute.py +++ b/databricks/sdk/service/compute.py @@ -271,6 +271,20 @@ class AzureAttributes: """Availability type used for all subsequent nodes past the `first_on_demand` ones. Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + capacity_reservation_group: Optional[str] = None + """The Azure capacity reservation group resource ID to use for launching VMs. When specified, VMs + will be launched using the provided capacity reservation. + + Capacity reservations can only be specified when the workspace uses injected vnet (i.e. customer + defined vnet not managed by databricks). Ensure the databricks-login-prod Enterprise Application + is granted the following four permissions: 1. Microsoft.Compute/capacityReservationGroups/read + 2. Microsoft.Compute/capacityReservationGroups/deploy/action 3. + Microsoft.Compute/capacityReservationGroups/capacityReservations/read 4. + Microsoft.Compute/capacityReservationGroups/capacityReservations/deploy/action + + Format: + `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}`""" + first_on_demand: Optional[int] = None """The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. This value should be greater than 0, to make sure the cluster driver node is placed on an on-demand @@ -294,6 +308,8 @@ def as_dict(self) -> dict: body = {} if self.availability is not None: body["availability"] = self.availability.value + if self.capacity_reservation_group is not None: + body["capacity_reservation_group"] = self.capacity_reservation_group if self.first_on_demand is not None: body["first_on_demand"] = self.first_on_demand if self.log_analytics_info: @@ -307,6 +323,8 @@ def as_shallow_dict(self) -> dict: body = {} if self.availability is not None: body["availability"] = self.availability + if self.capacity_reservation_group is not None: + body["capacity_reservation_group"] = self.capacity_reservation_group if self.first_on_demand is not None: body["first_on_demand"] = self.first_on_demand if self.log_analytics_info: @@ -320,6 +338,7 @@ def from_dict(cls, d: Dict[str, Any]) -> AzureAttributes: """Deserializes the AzureAttributes from a dictionary.""" return cls( availability=_enum(d, "availability", AzureAvailability), + capacity_reservation_group=d.get("capacity_reservation_group", None), first_on_demand=d.get("first_on_demand", None), log_analytics_info=_from_dict(d, "log_analytics_info", LogAnalyticsInfo), spot_bid_max_price=d.get("spot_bid_max_price", None), @@ -4394,7 +4413,7 @@ class InitScriptExecutionDetailsInitScriptExecutionStatus(Enum): @dataclass class InitScriptInfo: - """Config for an individual init script Next ID: 11""" + """Config for an individual init script""" abfss: Optional[Adlsgen2Info] = None """destination needs to be provided, e.g. @@ -6189,7 +6208,7 @@ class NodeType: num_cores: float """Number of CPU cores available for this node type. Note that this can be fractional, e.g., 2.5 - cores, if the the number of cores on a machine instance is not divisible by the number of Spark + cores, if the number of cores on a machine instance is not divisible by the number of Spark nodes on that machine.""" description: str diff --git a/databricks/sdk/service/database.py b/databricks/sdk/service/database.py index 15e8a216e..eff954098 100755 --- a/databricks/sdk/service/database.py +++ b/databricks/sdk/service/database.py @@ -68,7 +68,7 @@ class DatabaseCatalog: """The name of the DatabaseInstance housing the database.""" database_name: str - """The name of the database (in a instance) associated with the catalog.""" + """The name of the database (in an instance) associated with the catalog.""" create_database_if_not_exists: Optional[bool] = None @@ -1824,7 +1824,7 @@ def delete_database_instance(self, name: str, *, force: Optional[bool] = None, p :param name: str Name of the instance to delete. :param force: bool (optional) - By default, a instance cannot be deleted if it has descendant instances created via PITR. If this + By default, an instance cannot be deleted if it has descendant instances created via PITR. If this flag is specified as true, all descendent instances will be deleted as well. :param purge: bool (optional) Deprecated. Omitting the field or setting it to true will result in the field being hard deleted. diff --git a/databricks/sdk/service/files.py b/databricks/sdk/service/files.py index fcc6ba07b..c99ddf07a 100755 --- a/databricks/sdk/service/files.py +++ b/databricks/sdk/service/files.py @@ -943,8 +943,8 @@ def get_metadata(self, file_path: str) -> GetMetadataResponse: def list_directory_contents( self, directory_path: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None ) -> Iterator[DirectoryEntry]: - """Returns the contents of a directory. If there is no directory at the specified path, the API returns a - HTTP 404 error. + """Returns the contents of a directory. If there is no directory at the specified path, the API returns + an HTTP 404 error. :param directory_path: str The absolute path of a directory. diff --git a/databricks/sdk/service/iamv2.py b/databricks/sdk/service/iamv2.py index 560d5db6f..e9d160c75 100755 --- a/databricks/sdk/service/iamv2.py +++ b/databricks/sdk/service/iamv2.py @@ -480,6 +480,10 @@ class WorkspaceAssignmentDetail: """The account ID parent of the workspace where the principal is assigned""" entitlements: Optional[List[Entitlement]] = None + """Entitlements granted directly to the principal on this workspace. The only client-settable + field: create and update manage exactly this set (including entitlements the principal also + holds via a group). Not populated by ListWorkspaceAssignmentDetails (omitted for scalability); + call GetWorkspaceAssignmentDetail to read the entitlements for a single principal.""" principal_type: Optional[PrincipalType] = None @@ -657,7 +661,9 @@ def get_workspace_assignment_detail(self, workspace_id: int, principal_id: int) def list_workspace_assignment_details( self, workspace_id: int, *, page_size: Optional[int] = None, page_token: Optional[str] = None ) -> ListWorkspaceAssignmentDetailsResponse: - """Lists workspace assignment details for a workspace. + """Lists workspace assignment details for a workspace. For scalability, the response omits the + per-principal entitlement fields (`entitlements` and `effective_entitlements`); call + GetWorkspaceAssignmentDetail to read entitlements for a single principal. :param workspace_id: int Required. The workspace ID for which the workspace assignment details are being fetched. @@ -925,7 +931,9 @@ def get_workspace_assignment_detail_proxy(self, principal_id: int) -> WorkspaceA def list_workspace_assignment_details_proxy( self, *, page_size: Optional[int] = None, page_token: Optional[str] = None ) -> ListWorkspaceAssignmentDetailsResponse: - """Lists workspace assignment details for a workspace (workspace-level proxy). + """Lists workspace assignment details for a workspace (workspace-level proxy). For scalability, the + response omits the per-principal entitlement fields (`entitlements` and `effective_entitlements`); + call GetWorkspaceAssignmentDetailProxy to read entitlements for a single principal. :param page_size: int (optional) The maximum number of workspace assignment details to return. The service may return fewer than this diff --git a/databricks/sdk/service/jobs.py b/databricks/sdk/service/jobs.py index 75e4e5782..92d11f24a 100755 --- a/databricks/sdk/service/jobs.py +++ b/databricks/sdk/service/jobs.py @@ -381,7 +381,7 @@ class BaseRun: tasks: Optional[List[RunTask]] = None """The list of tasks performed by the run. Each task has its own `run_id` which you can use to call - `JobsGetOutput` to retrieve the run resutls. If more than 100 tasks are available, you can + `JobsGetOutput` to retrieve the run results. If more than 100 tasks are available, you can paginate through them using :method:jobs/getrun. Use the `next_page_token` field at the object root to determine if more results are available.""" @@ -1926,7 +1926,7 @@ class ForEachTaskErrorMessageStats: """Describes the count of such error message encountered during the iterations.""" error_message: Optional[str] = None - """Describes the error message occured during the iterations.""" + """Describes the error message occurred during the iterations.""" termination_category: Optional[str] = None """Describes the termination reason for the error message.""" @@ -5017,7 +5017,7 @@ class Run: tasks: Optional[List[RunTask]] = None """The list of tasks performed by the run. Each task has its own `run_id` which you can use to call - `JobsGetOutput` to retrieve the run resutls. If more than 100 tasks are available, you can + `JobsGetOutput` to retrieve the run results. If more than 100 tasks are available, you can paginate through them using :method:jobs/getrun. Use the `next_page_token` field at the object root to determine if more results are available.""" @@ -5297,8 +5297,8 @@ class RunForEachTask: be able to execute multiple runs of the task concurrently.""" stats: Optional[ForEachStats] = None - """Read only field. Populated for GetRun and ListRuns RPC calls and stores the execution stats of - an For each task""" + """Read only field. Populated for GetRun and ListRuns RPC calls and stores the execution stats of a + `For each` task.""" def as_dict(self) -> dict: """Serializes the RunForEachTask into a dictionary suitable for use as a JSON request body.""" diff --git a/databricks/sdk/service/ml.py b/databricks/sdk/service/ml.py index 1264fb15e..25f6ea6d6 100755 --- a/databricks/sdk/service/ml.py +++ b/databricks/sdk/service/ml.py @@ -3401,9 +3401,12 @@ class KafkaStreamConfig: """Options to configure which Kafka topics to pull data from.""" extra_options: Optional[Dict[str, str]] = None - """Miscellaneous source options. Accepted keys are source options or Kafka consumer options - (kafka.*), validated against an allow-list at request time. All auth configuration goes through - the underlying UC Connection(s) or configs and should not be stored here.""" + """Optional Kafka source or consumer options, validated against a server-side allowlist at request + time. Allowed keys: - `maxOffsetsPerTrigger` - `startingOffsets` - `includeHeaders` - + `kafka.request.timeout.ms` - `kafka.session.timeout.ms` - `kafka.max.partition.fetch.bytes` The + following keys are ingestion-only and are stripped before being forwarded to the materialization + pipeline: - `maxOffsetsPerTrigger` - `startingOffsets` Auth and connection details belong on the + parent Stream's `connection_config`, not here.""" def as_dict(self) -> dict: """Serializes the KafkaStreamConfig into a dictionary suitable for use as a JSON request body.""" diff --git a/databricks/sdk/service/pipelines.py b/databricks/sdk/service/pipelines.py index 16b192170..5ac42cce4 100755 --- a/databricks/sdk/service/pipelines.py +++ b/databricks/sdk/service/pipelines.py @@ -3189,6 +3189,9 @@ class PipelineSpec: serverless: Optional[bool] = None """Whether serverless compute is enabled for this pipeline.""" + serverless_compute_id: Optional[str] = None + """Serverless compute ID specified by the user for serverless pipelines.""" + storage: Optional[str] = None """DBFS root directory for storing checkpoints and tables.""" @@ -3257,6 +3260,8 @@ def as_dict(self) -> dict: body["schema"] = self.schema if self.serverless is not None: body["serverless"] = self.serverless + if self.serverless_compute_id is not None: + body["serverless_compute_id"] = self.serverless_compute_id if self.storage is not None: body["storage"] = self.storage if self.tags: @@ -3318,6 +3323,8 @@ def as_shallow_dict(self) -> dict: body["schema"] = self.schema if self.serverless is not None: body["serverless"] = self.serverless + if self.serverless_compute_id is not None: + body["serverless_compute_id"] = self.serverless_compute_id if self.storage is not None: body["storage"] = self.storage if self.tags: @@ -3357,6 +3364,7 @@ def from_dict(cls, d: Dict[str, Any]) -> PipelineSpec: root_path=d.get("root_path", None), schema=d.get("schema", None), serverless=d.get("serverless", None), + serverless_compute_id=d.get("serverless_compute_id", None), storage=d.get("storage", None), tags=d.get("tags", None), target=d.get("target", None), @@ -5066,6 +5074,7 @@ def clone( root_path: Optional[str] = None, schema: Optional[str] = None, serverless: Optional[bool] = None, + serverless_compute_id: Optional[str] = None, storage: Optional[str] = None, tags: Optional[Dict[str, str]] = None, target: Optional[str] = None, @@ -5136,6 +5145,8 @@ def clone( The default schema (database) where tables are read from or published to. :param serverless: bool (optional) Whether serverless compute is enabled for this pipeline. + :param serverless_compute_id: str (optional) + Serverless compute ID specified by the user for serverless pipelines. :param storage: str (optional) DBFS root directory for storing checkpoints and tables. :param tags: Dict[str,str] (optional) @@ -5206,6 +5217,8 @@ def clone( body["schema"] = schema if serverless is not None: body["serverless"] = serverless + if serverless_compute_id is not None: + body["serverless_compute_id"] = serverless_compute_id if storage is not None: body["storage"] = storage if tags is not None: @@ -5258,6 +5271,7 @@ def create( run_as: Optional[RunAs] = None, schema: Optional[str] = None, serverless: Optional[bool] = None, + serverless_compute_id: Optional[str] = None, storage: Optional[str] = None, tags: Optional[Dict[str, str]] = None, target: Optional[str] = None, @@ -5325,6 +5339,8 @@ def create( The default schema (database) where tables are read from or published to. :param serverless: bool (optional) Whether serverless compute is enabled for this pipeline. + :param serverless_compute_id: str (optional) + Serverless compute ID specified by the user for serverless pipelines. :param storage: str (optional) DBFS root directory for storing checkpoints and tables. :param tags: Dict[str,str] (optional) @@ -5397,6 +5413,8 @@ def create( body["schema"] = schema if serverless is not None: body["serverless"] = serverless + if serverless_compute_id is not None: + body["serverless_compute_id"] = serverless_compute_id if storage is not None: body["storage"] = storage if tags is not None: @@ -5851,6 +5869,7 @@ def update( run_as: Optional[RunAs] = None, schema: Optional[str] = None, serverless: Optional[bool] = None, + serverless_compute_id: Optional[str] = None, storage: Optional[str] = None, tags: Optional[Dict[str, str]] = None, target: Optional[str] = None, @@ -5921,6 +5940,8 @@ def update( The default schema (database) where tables are read from or published to. :param serverless: bool (optional) Whether serverless compute is enabled for this pipeline. + :param serverless_compute_id: str (optional) + Serverless compute ID specified by the user for serverless pipelines. :param storage: str (optional) DBFS root directory for storing checkpoints and tables. :param tags: Dict[str,str] (optional) @@ -5993,6 +6014,8 @@ def update( body["schema"] = schema if serverless is not None: body["serverless"] = serverless + if serverless_compute_id is not None: + body["serverless_compute_id"] = serverless_compute_id if storage is not None: body["storage"] = storage if tags is not None: diff --git a/databricks/sdk/service/postgres.py b/databricks/sdk/service/postgres.py index 38261e8ce..018ca3439 100755 --- a/databricks/sdk/service/postgres.py +++ b/databricks/sdk/service/postgres.py @@ -564,6 +564,300 @@ def from_dict(cls, d: Dict[str, Any]) -> CatalogOperationMetadata: return cls() +@dataclass +class DataApi: + """DataApi represents the Data API (PostgREST) configuration for a Database. At most one DataApi + per database. Create enables Data API, Delete disables it.""" + + create_time: Optional[Timestamp] = None + """A timestamp indicating when the Data API was first enabled.""" + + name: Optional[str] = None + """Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api""" + + parent: Optional[str] = None + """The database containing this Data API configuration. Format: + projects/{project_id}/branches/{branch_id}/databases/{database_id}""" + + spec: Optional[DataApiDataApiSpec] = None + """The desired Data API configuration.""" + + status: Optional[DataApiDataApiStatus] = None + """The observed Data API state (read-only).""" + + update_time: Optional[Timestamp] = None + """A timestamp indicating when the Data API configuration was last updated.""" + + def as_dict(self) -> dict: + """Serializes the DataApi into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.create_time is not None: + body["create_time"] = self.create_time.ToJsonString() + if self.name is not None: + body["name"] = self.name + if self.parent is not None: + body["parent"] = self.parent + if self.spec: + body["spec"] = self.spec.as_dict() + if self.status: + body["status"] = self.status.as_dict() + if self.update_time is not None: + body["update_time"] = self.update_time.ToJsonString() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DataApi into a shallow dictionary of its immediate attributes.""" + body = {} + if self.create_time is not None: + body["create_time"] = self.create_time + if self.name is not None: + body["name"] = self.name + if self.parent is not None: + body["parent"] = self.parent + if self.spec: + body["spec"] = self.spec + if self.status: + body["status"] = self.status + if self.update_time is not None: + body["update_time"] = self.update_time + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DataApi: + """Deserializes the DataApi from a dictionary.""" + return cls( + create_time=_timestamp(d, "create_time"), + name=d.get("name", None), + parent=d.get("parent", None), + spec=_from_dict(d, "spec", DataApiDataApiSpec), + status=_from_dict(d, "status", DataApiDataApiStatus), + update_time=_timestamp(d, "update_time"), + ) + + +@dataclass +class DataApiDataApiSpec: + """Desired PostgREST configuration (input).""" + + db_aggregates_enabled: Optional[bool] = None + """Enable aggregate functions (count, sum, avg, etc.) in Data API responses. Default: true.""" + + db_extra_search_path: Optional[List[str]] = None + """Additional schemas to include in the PostgreSQL search path. Each entry must be a valid + PostgreSQL schema name.""" + + db_max_rows: Optional[int] = None + """Maximum number of rows returned in a single Data API response. Must be a positive integer.""" + + db_schemas: Optional[List[str]] = None + """Database schemas exposed through the Data API. Each entry must be a valid PostgreSQL schema name + (1-63 chars, [a-zA-Z_][a-zA-Z0-9_$]*). Maximum 100 entries. Default: ["public"].""" + + jwt_cache_max_lifetime: Optional[Duration] = None + """Maximum lifetime for cached JWT tokens. Zero duration disables caching.""" + + jwt_role_claim_key: Optional[str] = None + """JSON path to the role claim in JWT tokens (e.g., ".sub"). Default: ".sub".""" + + openapi_mode: Optional[OpenApiMode] = None + """OpenAPI documentation mode for the Data API endpoint.""" + + server_cors_allowed_origins: Optional[List[str]] = None + """Allowed origins for CORS requests. Each entry should be a valid origin URL, or use "*" to allow + all origins.""" + + server_timing_enabled: Optional[bool] = None + """Enable the Server-Timing header in Data API responses.""" + + def as_dict(self) -> dict: + """Serializes the DataApiDataApiSpec into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.db_aggregates_enabled is not None: + body["db_aggregates_enabled"] = self.db_aggregates_enabled + if self.db_extra_search_path: + body["db_extra_search_path"] = [v for v in self.db_extra_search_path] + if self.db_max_rows is not None: + body["db_max_rows"] = self.db_max_rows + if self.db_schemas: + body["db_schemas"] = [v for v in self.db_schemas] + if self.jwt_cache_max_lifetime is not None: + body["jwt_cache_max_lifetime"] = self.jwt_cache_max_lifetime.ToJsonString() + if self.jwt_role_claim_key is not None: + body["jwt_role_claim_key"] = self.jwt_role_claim_key + if self.openapi_mode is not None: + body["openapi_mode"] = self.openapi_mode.value + if self.server_cors_allowed_origins: + body["server_cors_allowed_origins"] = [v for v in self.server_cors_allowed_origins] + if self.server_timing_enabled is not None: + body["server_timing_enabled"] = self.server_timing_enabled + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DataApiDataApiSpec into a shallow dictionary of its immediate attributes.""" + body = {} + if self.db_aggregates_enabled is not None: + body["db_aggregates_enabled"] = self.db_aggregates_enabled + if self.db_extra_search_path: + body["db_extra_search_path"] = self.db_extra_search_path + if self.db_max_rows is not None: + body["db_max_rows"] = self.db_max_rows + if self.db_schemas: + body["db_schemas"] = self.db_schemas + if self.jwt_cache_max_lifetime is not None: + body["jwt_cache_max_lifetime"] = self.jwt_cache_max_lifetime + if self.jwt_role_claim_key is not None: + body["jwt_role_claim_key"] = self.jwt_role_claim_key + if self.openapi_mode is not None: + body["openapi_mode"] = self.openapi_mode + if self.server_cors_allowed_origins: + body["server_cors_allowed_origins"] = self.server_cors_allowed_origins + if self.server_timing_enabled is not None: + body["server_timing_enabled"] = self.server_timing_enabled + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DataApiDataApiSpec: + """Deserializes the DataApiDataApiSpec from a dictionary.""" + return cls( + db_aggregates_enabled=d.get("db_aggregates_enabled", None), + db_extra_search_path=d.get("db_extra_search_path", None), + db_max_rows=d.get("db_max_rows", None), + db_schemas=d.get("db_schemas", None), + jwt_cache_max_lifetime=_duration(d, "jwt_cache_max_lifetime"), + jwt_role_claim_key=d.get("jwt_role_claim_key", None), + openapi_mode=_enum(d, "openapi_mode", OpenApiMode), + server_cors_allowed_origins=d.get("server_cors_allowed_origins", None), + server_timing_enabled=d.get("server_timing_enabled", None), + ) + + +@dataclass +class DataApiDataApiStatus: + """Observed state (output-only).""" + + available_schemas: Optional[List[str]] = None + """Schemas available in the database (for reference when configuring db_schemas).""" + + db_aggregates_enabled: Optional[bool] = None + """Actual aggregate function setting read from the database.""" + + db_extra_search_path: Optional[List[str]] = None + """Actual extra search path schemas read from the database.""" + + db_max_rows: Optional[int] = None + """Actual max rows setting read from the database.""" + + db_schemas: Optional[List[str]] = None + """Actual exposed schemas read from the database.""" + + jwt_cache_max_lifetime: Optional[Duration] = None + """Actual JWT cache max lifetime read from the database.""" + + jwt_role_claim_key: Optional[str] = None + """Actual JWT role claim key read from the database.""" + + openapi_mode: Optional[OpenApiMode] = None + """Actual OpenAPI mode read from the database.""" + + server_cors_allowed_origins: Optional[List[str]] = None + """Actual CORS allowed origins read from the database.""" + + server_timing_enabled: Optional[bool] = None + """Actual Server-Timing header setting read from the database.""" + + url: Optional[str] = None + """Data API endpoint URL.""" + + def as_dict(self) -> dict: + """Serializes the DataApiDataApiStatus into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.available_schemas: + body["available_schemas"] = [v for v in self.available_schemas] + if self.db_aggregates_enabled is not None: + body["db_aggregates_enabled"] = self.db_aggregates_enabled + if self.db_extra_search_path: + body["db_extra_search_path"] = [v for v in self.db_extra_search_path] + if self.db_max_rows is not None: + body["db_max_rows"] = self.db_max_rows + if self.db_schemas: + body["db_schemas"] = [v for v in self.db_schemas] + if self.jwt_cache_max_lifetime is not None: + body["jwt_cache_max_lifetime"] = self.jwt_cache_max_lifetime.ToJsonString() + if self.jwt_role_claim_key is not None: + body["jwt_role_claim_key"] = self.jwt_role_claim_key + if self.openapi_mode is not None: + body["openapi_mode"] = self.openapi_mode.value + if self.server_cors_allowed_origins: + body["server_cors_allowed_origins"] = [v for v in self.server_cors_allowed_origins] + if self.server_timing_enabled is not None: + body["server_timing_enabled"] = self.server_timing_enabled + if self.url is not None: + body["url"] = self.url + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DataApiDataApiStatus into a shallow dictionary of its immediate attributes.""" + body = {} + if self.available_schemas: + body["available_schemas"] = self.available_schemas + if self.db_aggregates_enabled is not None: + body["db_aggregates_enabled"] = self.db_aggregates_enabled + if self.db_extra_search_path: + body["db_extra_search_path"] = self.db_extra_search_path + if self.db_max_rows is not None: + body["db_max_rows"] = self.db_max_rows + if self.db_schemas: + body["db_schemas"] = self.db_schemas + if self.jwt_cache_max_lifetime is not None: + body["jwt_cache_max_lifetime"] = self.jwt_cache_max_lifetime + if self.jwt_role_claim_key is not None: + body["jwt_role_claim_key"] = self.jwt_role_claim_key + if self.openapi_mode is not None: + body["openapi_mode"] = self.openapi_mode + if self.server_cors_allowed_origins: + body["server_cors_allowed_origins"] = self.server_cors_allowed_origins + if self.server_timing_enabled is not None: + body["server_timing_enabled"] = self.server_timing_enabled + if self.url is not None: + body["url"] = self.url + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DataApiDataApiStatus: + """Deserializes the DataApiDataApiStatus from a dictionary.""" + return cls( + available_schemas=d.get("available_schemas", None), + db_aggregates_enabled=d.get("db_aggregates_enabled", None), + db_extra_search_path=d.get("db_extra_search_path", None), + db_max_rows=d.get("db_max_rows", None), + db_schemas=d.get("db_schemas", None), + jwt_cache_max_lifetime=_duration(d, "jwt_cache_max_lifetime"), + jwt_role_claim_key=d.get("jwt_role_claim_key", None), + openapi_mode=_enum(d, "openapi_mode", OpenApiMode), + server_cors_allowed_origins=d.get("server_cors_allowed_origins", None), + server_timing_enabled=d.get("server_timing_enabled", None), + url=d.get("url", None), + ) + + +@dataclass +class DataApiOperationMetadata: + def as_dict(self) -> dict: + """Serializes the DataApiOperationMetadata into a dictionary suitable for use as a JSON request body.""" + body = {} + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DataApiOperationMetadata into a shallow dictionary of its immediate attributes.""" + body = {} + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DataApiOperationMetadata: + """Deserializes the DataApiOperationMetadata from a dictionary.""" + return cls() + + @dataclass class Database: """Database represents a Postgres database within a Branch.""" @@ -1660,6 +1954,15 @@ def from_dict(cls, d: Dict[str, Any]) -> NewPipelineSpec: ) +class OpenApiMode(Enum): + """Controls how the Data API exposes the OpenAPI documentation endpoint. Only IGNORE_PRIVILEGES and + DISABLED are supported today; "follow-privileges" is not implemented yet (it may be added later + as value 3 — adding new enum values is backward-compatible).""" + + OPEN_API_MODE_DISABLED = "OPEN_API_MODE_DISABLED" + OPEN_API_MODE_IGNORE_PRIVILEGES = "OPEN_API_MODE_IGNORE_PRIVILEGES" + + @dataclass class Operation: """This resource represents a long-running operation that is the result of a network API call.""" @@ -3142,6 +3445,32 @@ def create_catalog(self, catalog: Catalog, catalog_id: str) -> CreateCatalogOper operation = Operation.from_dict(res) return CreateCatalogOperation(self, operation) + def create_data_api(self, parent: str, data_api: DataApi) -> CreateDataApiOperation: + """Enable Data API for a database. + + :param parent: str + Parent database: projects/{project_id}/branches/{branch_id}/databases/{database_id} + :param data_api: :class:`DataApi` + The Data API configuration to create. + + :returns: :class:`Operation` + """ + + body = data_api.as_dict() + query = {} + headers = { + "Accept": "application/json", + "Content-Type": "application/json", + } + + cfg = self._api._cfg + if cfg.workspace_id: + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id + + res = self._api.do("POST", f"/api/2.0/postgres/{parent}/data-api", body=body, headers=headers) + operation = Operation.from_dict(res) + return CreateDataApiOperation(self, operation) + def create_database( self, parent: str, database: Database, *, database_id: Optional[str] = None ) -> CreateDatabaseOperation: @@ -3373,6 +3702,27 @@ def delete_catalog(self, name: str) -> DeleteCatalogOperation: operation = Operation.from_dict(res) return DeleteCatalogOperation(self, operation) + def delete_data_api(self, name: str) -> DeleteDataApiOperation: + """Disable Data API for a database. + + :param name: str + Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api + + :returns: :class:`Operation` + """ + + headers = { + "Accept": "application/json", + } + + cfg = self._api._cfg + if cfg.workspace_id: + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id + + res = self._api.do("DELETE", f"/api/2.0/postgres/{name}", headers=headers) + operation = Operation.from_dict(res) + return DeleteDataApiOperation(self, operation) + def delete_database(self, name: str) -> DeleteDatabaseOperation: """Delete a Database. @@ -3568,6 +3918,26 @@ def get_catalog(self, name: str) -> Catalog: res = self._api.do("GET", f"/api/2.0/postgres/{name}", headers=headers) return Catalog.from_dict(res) + def get_data_api(self, name: str) -> DataApi: + """Get Data API configuration for a database. + + :param name: str + Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api + + :returns: :class:`DataApi` + """ + + headers = { + "Accept": "application/json", + } + + cfg = self._api._cfg + if cfg.workspace_id: + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id + + res = self._api.do("GET", f"/api/2.0/postgres/{name}", headers=headers) + return DataApi.from_dict(res) + def get_database(self, name: str) -> Database: """Get a Database. @@ -3973,6 +4343,36 @@ def update_branch(self, name: str, branch: Branch, update_mask: FieldMask) -> Up operation = Operation.from_dict(res) return UpdateBranchOperation(self, operation) + def update_data_api(self, name: str, data_api: DataApi, update_mask: FieldMask) -> UpdateDataApiOperation: + """Update Data API configuration for a database. + + :param name: str + Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api + :param data_api: :class:`DataApi` + The Data API configuration to update. The data_api's `name` field identifies the resource. + :param update_mask: FieldMask + The list of fields to update. If unspecified, all fields will be updated when possible. + + :returns: :class:`Operation` + """ + + body = data_api.as_dict() + query = {} + if update_mask is not None: + query["update_mask"] = update_mask.ToJsonString() + headers = { + "Accept": "application/json", + "Content-Type": "application/json", + } + + cfg = self._api._cfg + if cfg.workspace_id: + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id + + res = self._api.do("PATCH", f"/api/2.0/postgres/{name}", query=query, body=body, headers=headers) + operation = Operation.from_dict(res) + return UpdateDataApiOperation(self, operation) + def update_database(self, name: str, database: Database, update_mask: FieldMask) -> UpdateDatabaseOperation: """Update a Database. @@ -4264,6 +4664,83 @@ def done(self) -> bool: return operation.done +class CreateDataApiOperation: + """Long-running operation for create_data_api""" + + def __init__(self, impl: PostgresAPI, operation: Operation): + self._impl = impl + self._operation = operation + + def wait(self, opts: Optional[lro.LroOptions] = None) -> DataApi: + """Wait blocks until the long-running operation is completed. If no timeout is + specified, this will poll indefinitely. If a timeout is provided and the operation + didn't finish within the timeout, this function will raise an error of type + TimeoutError, otherwise returns successful response and any errors encountered. + + :param opts: :class:`LroOptions` + Timeout options (default: polls indefinitely) + + :returns: :class:`DataApi` + """ + + def poll_operation(): + operation = self._impl.get_operation(name=self._operation.name) + + # Update local operation state + self._operation = operation + + if not operation.done: + return None, RetryError.continues("operation still in progress") + + if operation.error: + error_msg = operation.error.message if operation.error.message else "unknown error" + if operation.error.error_code: + error_msg = f"[{operation.error.error_code}] {error_msg}" + return None, RetryError.halt(Exception(f"operation failed: {error_msg}")) + + # Operation completed successfully, unmarshal response. + if operation.response is None: + return None, RetryError.halt(Exception("operation completed but no response available")) + + data_api = DataApi.from_dict(operation.response) + + return data_api, None + + return poll(poll_operation, timeout=opts.timeout if opts is not None else None) + + def name(self) -> str: + """Name returns the name of the long-running operation. The name is assigned + by the server and is unique within the service from which the operation is created. + + :returns: str + """ + return self._operation.name + + def metadata(self) -> DataApiOperationMetadata: + """Metadata returns metadata associated with the long-running operation. + If the metadata is not available, the returned metadata is None. + + :returns: :class:`DataApiOperationMetadata` or None + """ + if self._operation.metadata is None: + return None + + return DataApiOperationMetadata.from_dict(self._operation.metadata) + + def done(self) -> bool: + """Done reports whether the long-running operation has completed. + + :returns: bool + """ + # Refresh the operation state first + operation = self._impl.get_operation(name=self._operation.name) + + # Update local operation state + self._operation = operation + + return operation.done + + class CreateDatabaseOperation: """Long-running operation for create_database""" @@ -4799,6 +5276,81 @@ def done(self) -> bool: return operation.done +class DeleteDataApiOperation: + """Long-running operation for delete_data_api""" + + def __init__(self, impl: PostgresAPI, operation: Operation): + self._impl = impl + self._operation = operation + + def wait(self, opts: Optional[lro.LroOptions] = None): + """Wait blocks until the long-running operation is completed. If no timeout is + specified, this will poll indefinitely. If a timeout is provided and the operation + didn't finish within the timeout, this function will raise an error of type + TimeoutError, otherwise returns successful response and any errors encountered. + + :param opts: :class:`LroOptions` + Timeout options (default: polls indefinitely) + + :returns: :class:`Any /* MISSING TYPE */` + """ + + def poll_operation(): + operation = self._impl.get_operation(name=self._operation.name) + + # Update local operation state + self._operation = operation + + if not operation.done: + return None, RetryError.continues("operation still in progress") + + if operation.error: + error_msg = operation.error.message if operation.error.message else "unknown error" + if operation.error.error_code: + error_msg = f"[{operation.error.error_code}] {error_msg}" + return None, RetryError.halt(Exception(f"operation failed: {error_msg}")) + + # Operation completed successfully, unmarshal response. + if operation.response is None: + return None, RetryError.halt(Exception("operation completed but no response available")) + + return {}, None + + poll(poll_operation, timeout=opts.timeout if opts is not None else None) + + def name(self) -> str: + """Name returns the name of the long-running operation. The name is assigned + by the server and is unique within the service from which the operation is created. + + :returns: str + """ + return self._operation.name + + def metadata(self) -> DataApiOperationMetadata: + """Metadata returns metadata associated with the long-running operation. + If the metadata is not available, the returned metadata is None. + + :returns: :class:`DataApiOperationMetadata` or None + """ + if self._operation.metadata is None: + return None + + return DataApiOperationMetadata.from_dict(self._operation.metadata) + + def done(self) -> bool: + """Done reports whether the long-running operation has completed. + + :returns: bool + """ + # Refresh the operation state first + operation = self._impl.get_operation(name=self._operation.name) + + # Update local operation state + self._operation = operation + + return operation.done + + class DeleteDatabaseOperation: """Long-running operation for delete_database""" @@ -5401,6 +5953,83 @@ def done(self) -> bool: return operation.done +class UpdateDataApiOperation: + """Long-running operation for update_data_api""" + + def __init__(self, impl: PostgresAPI, operation: Operation): + self._impl = impl + self._operation = operation + + def wait(self, opts: Optional[lro.LroOptions] = None) -> DataApi: + """Wait blocks until the long-running operation is completed. If no timeout is + specified, this will poll indefinitely. If a timeout is provided and the operation + didn't finish within the timeout, this function will raise an error of type + TimeoutError, otherwise returns successful response and any errors encountered. + + :param opts: :class:`LroOptions` + Timeout options (default: polls indefinitely) + + :returns: :class:`DataApi` + """ + + def poll_operation(): + operation = self._impl.get_operation(name=self._operation.name) + + # Update local operation state + self._operation = operation + + if not operation.done: + return None, RetryError.continues("operation still in progress") + + if operation.error: + error_msg = operation.error.message if operation.error.message else "unknown error" + if operation.error.error_code: + error_msg = f"[{operation.error.error_code}] {error_msg}" + return None, RetryError.halt(Exception(f"operation failed: {error_msg}")) + + # Operation completed successfully, unmarshal response. + if operation.response is None: + return None, RetryError.halt(Exception("operation completed but no response available")) + + data_api = DataApi.from_dict(operation.response) + + return data_api, None + + return poll(poll_operation, timeout=opts.timeout if opts is not None else None) + + def name(self) -> str: + """Name returns the name of the long-running operation. The name is assigned + by the server and is unique within the service from which the operation is created. + + :returns: str + """ + return self._operation.name + + def metadata(self) -> DataApiOperationMetadata: + """Metadata returns metadata associated with the long-running operation. + If the metadata is not available, the returned metadata is None. + + :returns: :class:`DataApiOperationMetadata` or None + """ + if self._operation.metadata is None: + return None + + return DataApiOperationMetadata.from_dict(self._operation.metadata) + + def done(self) -> bool: + """Done reports whether the long-running operation has completed. + + :returns: bool + """ + # Refresh the operation state first + operation = self._impl.get_operation(name=self._operation.name) + + # Update local operation state + self._operation = operation + + return operation.done + + class UpdateDatabaseOperation: """Long-running operation for update_database""" diff --git a/databricks/sdk/service/provisioning.py b/databricks/sdk/service/provisioning.py index bf82e9b24..53d8f53c2 100755 --- a/databricks/sdk/service/provisioning.py +++ b/databricks/sdk/service/provisioning.py @@ -1812,8 +1812,7 @@ class WorkspaceNetwork: gcp_managed_network_config: Optional[GcpManagedNetworkConfig] = None """The mutually exclusive network deployment modes. The option decides which network mode the workspace will use. The network config for GCP workspace with Databricks managed network. This - object is input-only and will not be provided when listing workspaces. See - go/gcp-byovpc-alpha-design for interface decisions.""" + object is input-only and will not be provided when listing workspaces.""" network_id: Optional[str] = None """The ID of the network object, if the workspace is a BYOVPC workspace. This should apply to @@ -1858,8 +1857,7 @@ class WorkspaceStatus(Enum): transitions from status to status: NOT_PROVISIONED -> PROVISIONING -> CANCELLED PROVISIONING -> RUNNING -> FAILED -> CANCELLED (note that this transition is disallowed in the MultiWorkspace Project) RUNNING -> PROVISIONING -> BANNED -> CANCELLED FAILED -> PROVISIONING -> CANCELLED - BANNED -> RUNNING -> CANCELLED Note that a transition from any state to itself is also valid. - TODO(PLAT-5867): add a transition from CANCELLED to some other value (e.g. RECOVERING)""" + BANNED -> RUNNING -> CANCELLED Note that a transition from any state to itself is also valid.""" BANNED = "BANNED" CANCELLING = "CANCELLING" diff --git a/databricks/sdk/service/serving.py b/databricks/sdk/service/serving.py index 36da5cf71..a88c3c8c0 100755 --- a/databricks/sdk/service/serving.py +++ b/databricks/sdk/service/serving.py @@ -3113,7 +3113,7 @@ def from_dict(cls, d: Dict[str, Any]) -> ServedModelInput: class ServedModelInputWorkloadType(Enum): - """Please keep this in sync with with workload types in InferenceEndpointEntities.scala""" + """Please keep this in sync with workload types in InferenceEndpointEntities.scala.""" CPU = "CPU" GPU_LARGE = "GPU_LARGE" @@ -3912,7 +3912,7 @@ def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointPermissionsDescription: class ServingModelWorkloadType(Enum): - """Please keep this in sync with with workload types in InferenceEndpointEntities.scala""" + """Please keep this in sync with workload types in InferenceEndpointEntities.scala.""" CPU = "CPU" GPU_LARGE = "GPU_LARGE" diff --git a/databricks/sdk/service/settings.py b/databricks/sdk/service/settings.py index 4e86b0ed2..f9a038005 100755 --- a/databricks/sdk/service/settings.py +++ b/databricks/sdk/service/settings.py @@ -1115,6 +1115,8 @@ def from_dict(cls, d: Dict[str, Any]) -> CustomerFacingIngressNetworkPolicy: @dataclass class CustomerFacingIngressNetworkPolicyAccountApiDestination: + """Matches account-level Databricks API endpoints for an ingress network policy rule.""" + scope_qualifier: Optional[CustomerFacingIngressNetworkPolicyApiScopeQualifier] = None """Qualifies the breadth of API access for the listed scopes. See ApiScopeQualifier.""" @@ -1883,6 +1885,8 @@ def from_dict(cls, d: Dict[str, Any]) -> CustomerFacingIngressNetworkPolicyReque @dataclass class CustomerFacingIngressNetworkPolicyWorkspaceApiDestination: + """Matches workspace-level Databricks API endpoints for an ingress network policy rule.""" + scope_qualifier: Optional[CustomerFacingIngressNetworkPolicyApiScopeQualifier] = None """Qualifies the breadth of API access for the listed scopes. See ApiScopeQualifier.""" diff --git a/databricks/sdk/service/sql.py b/databricks/sdk/service/sql.py index 5f193aa45..aef0af4ea 100755 --- a/databricks/sdk/service/sql.py +++ b/databricks/sdk/service/sql.py @@ -7293,8 +7293,8 @@ class WarehouseTypePair: workspace.""" enabled: Optional[bool] = None - """If set to false the specific warehouse type will not be be allowed as a value for warehouse_type - in CreateWarehouse and EditWarehouse""" + """If set to false the specific warehouse type will not be allowed as a value for warehouse_type in + CreateWarehouse and EditWarehouse""" warehouse_type: Optional[WarehouseTypePairWarehouseType] = None diff --git a/databricks/sdk/service/vectorsearch.py b/databricks/sdk/service/vectorsearch.py index 9d38c06cb..f3bf3e33d 100755 --- a/databricks/sdk/service/vectorsearch.py +++ b/databricks/sdk/service/vectorsearch.py @@ -1057,6 +1057,9 @@ class MiniVectorIndex: creator: Optional[str] = None """The user who created the index.""" + endpoint_id: Optional[str] = None + """ID of the endpoint associated with the index.""" + endpoint_name: Optional[str] = None """Name of the endpoint associated with the index""" @@ -1076,6 +1079,8 @@ def as_dict(self) -> dict: body = {} if self.creator is not None: body["creator"] = self.creator + if self.endpoint_id is not None: + body["endpoint_id"] = self.endpoint_id if self.endpoint_name is not None: body["endpoint_name"] = self.endpoint_name if self.index_subtype is not None: @@ -1093,6 +1098,8 @@ def as_shallow_dict(self) -> dict: body = {} if self.creator is not None: body["creator"] = self.creator + if self.endpoint_id is not None: + body["endpoint_id"] = self.endpoint_id if self.endpoint_name is not None: body["endpoint_name"] = self.endpoint_name if self.index_subtype is not None: @@ -1110,6 +1117,7 @@ def from_dict(cls, d: Dict[str, Any]) -> MiniVectorIndex: """Deserializes the MiniVectorIndex from a dictionary.""" return cls( creator=d.get("creator", None), + endpoint_id=d.get("endpoint_id", None), endpoint_name=d.get("endpoint_name", None), index_subtype=_enum(d, "index_subtype", IndexSubtype), index_type=_enum(d, "index_type", VectorIndexType), @@ -1648,6 +1656,9 @@ class VectorIndex: direct_access_index_spec: Optional[DirectAccessVectorIndexSpec] = None + endpoint_id: Optional[str] = None + """ID of the endpoint associated with the index.""" + endpoint_name: Optional[str] = None """Name of the endpoint associated with the index""" @@ -1673,6 +1684,8 @@ def as_dict(self) -> dict: body["delta_sync_index_spec"] = self.delta_sync_index_spec.as_dict() if self.direct_access_index_spec: body["direct_access_index_spec"] = self.direct_access_index_spec.as_dict() + if self.endpoint_id is not None: + body["endpoint_id"] = self.endpoint_id if self.endpoint_name is not None: body["endpoint_name"] = self.endpoint_name if self.index_subtype is not None: @@ -1696,6 +1709,8 @@ def as_shallow_dict(self) -> dict: body["delta_sync_index_spec"] = self.delta_sync_index_spec if self.direct_access_index_spec: body["direct_access_index_spec"] = self.direct_access_index_spec + if self.endpoint_id is not None: + body["endpoint_id"] = self.endpoint_id if self.endpoint_name is not None: body["endpoint_name"] = self.endpoint_name if self.index_subtype is not None: @@ -1717,6 +1732,7 @@ def from_dict(cls, d: Dict[str, Any]) -> VectorIndex: creator=d.get("creator", None), delta_sync_index_spec=_from_dict(d, "delta_sync_index_spec", DeltaSyncVectorIndexSpecResponse), direct_access_index_spec=_from_dict(d, "direct_access_index_spec", DirectAccessVectorIndexSpec), + endpoint_id=d.get("endpoint_id", None), endpoint_name=d.get("endpoint_name", None), index_subtype=_enum(d, "index_subtype", IndexSubtype), index_type=_enum(d, "index_type", VectorIndexType), diff --git a/databricks/sdk/version.py b/databricks/sdk/version.py index edbb23462..cc8b2f720 100644 --- a/databricks/sdk/version.py +++ b/databricks/sdk/version.py @@ -1 +1 @@ -__version__ = "0.117.0" +__version__ = "0.118.0" diff --git a/docs/account/iam/workspace_assignment.rst b/docs/account/iam/workspace_assignment.rst index ca78b86df..133b16f3d 100755 --- a/docs/account/iam/workspace_assignment.rst +++ b/docs/account/iam/workspace_assignment.rst @@ -74,9 +74,9 @@ spn_id = spn.id - workspace_id = os.environ["TEST_WORKSPACE_ID"] + workspace_id = os.environ["DUMMY_WORKSPACE_ID"] - a.workspace_assignment.update( + _ = a.workspace_assignment.update( workspace_id=workspace_id, principal_id=spn_id, permissions=[iam.WorkspacePermission.USER], diff --git a/docs/account/iamv2/iam_v2.rst b/docs/account/iamv2/iam_v2.rst index 176da324d..cf5c83743 100755 --- a/docs/account/iamv2/iam_v2.rst +++ b/docs/account/iamv2/iam_v2.rst @@ -70,7 +70,9 @@ .. py:method:: list_workspace_assignment_details(workspace_id: int [, page_size: Optional[int], page_token: Optional[str]]) -> ListWorkspaceAssignmentDetailsResponse - Lists workspace assignment details for a workspace. + Lists workspace assignment details for a workspace. For scalability, the response omits the + per-principal entitlement fields (`entitlements` and `effective_entitlements`); call + GetWorkspaceAssignmentDetail to read entitlements for a single principal. :param workspace_id: int Required. The workspace ID for which the workspace assignment details are being fetched. diff --git a/docs/account/provisioning/storage.rst b/docs/account/provisioning/storage.rst index 25ee5abaa..b9f080e36 100644 --- a/docs/account/provisioning/storage.rst +++ b/docs/account/provisioning/storage.rst @@ -16,6 +16,7 @@ .. code-block:: + import os import time from databricks.sdk import AccountClient @@ -25,8 +26,11 @@ storage = a.storage.create( storage_configuration_name=f"sdk-{time.time_ns()}", - root_bucket_info=provisioning.RootBucketInfo(bucket_name=f"sdk-{time.time_ns()}"), + root_bucket_info=provisioning.RootBucketInfo(bucket_name=os.environ["TEST_ROOT_BUCKET"]), ) + + # cleanup + a.storage.delete(storage_configuration_id=storage.storage_configuration_id) Creates a Databricks storage configuration for an account. diff --git a/docs/dbdataclasses/catalog.rst b/docs/dbdataclasses/catalog.rst index f4237f40a..e6eece4a5 100755 --- a/docs/dbdataclasses/catalog.rst +++ b/docs/dbdataclasses/catalog.rst @@ -294,6 +294,9 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: DATABRICKS :value: "DATABRICKS" + .. py:attribute:: DYNAMICS365 + :value: "DYNAMICS365" + .. py:attribute:: GA4_RAW_DATA :value: "GA4_RAW_DATA" @@ -445,7 +448,7 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: CredentialType - Next Id: 19 + Next Id: 20 .. py:attribute:: ANY_STATIC_CREDENTIAL :value: "ANY_STATIC_CREDENTIAL" @@ -1552,7 +1555,7 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: SecurableKind - Latest kind: CONNECTION_CONFLUENT_SCHEMA_REGISTRY_BASIC = 346; Next id: 347. Reserved numbers: 316, 317, 327, 330, 341 (former ENDPOINT_LLM_*, MODEL_SERVICE_STANDARD, MODEL_SERVICE_SYSTEM_DELTASHARING, MCP_SERVICE_STANDARD). + Latest kind: CONNECTION_MARKETO_OAUTH_M2M = 347; Next id: 348. Reserved numbers: 316, 317, 327, 330, 341 (former ENDPOINT_LLM_*, MODEL_SERVICE_STANDARD, MODEL_SERVICE_SYSTEM_DELTASHARING, MCP_SERVICE_STANDARD). .. py:attribute:: TABLE_DB_STORAGE :value: "TABLE_DB_STORAGE" diff --git a/docs/dbdataclasses/postgres.rst b/docs/dbdataclasses/postgres.rst index 29403c35f..43ba14e2b 100755 --- a/docs/dbdataclasses/postgres.rst +++ b/docs/dbdataclasses/postgres.rst @@ -58,6 +58,22 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: DataApi + :members: + :undoc-members: + +.. autoclass:: DataApiDataApiSpec + :members: + :undoc-members: + +.. autoclass:: DataApiDataApiStatus + :members: + :undoc-members: + +.. autoclass:: DataApiOperationMetadata + :members: + :undoc-members: + .. autoclass:: Database :members: :undoc-members: @@ -419,6 +435,16 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. py:class:: OpenApiMode + + Controls how the Data API exposes the OpenAPI documentation endpoint. Only IGNORE_PRIVILEGES and DISABLED are supported today; "follow-privileges" is not implemented yet (it may be added later as value 3 — adding new enum values is backward-compatible). + + .. py:attribute:: OPEN_API_MODE_DISABLED + :value: "OPEN_API_MODE_DISABLED" + + .. py:attribute:: OPEN_API_MODE_IGNORE_PRIVILEGES + :value: "OPEN_API_MODE_IGNORE_PRIVILEGES" + .. autoclass:: Operation :members: :undoc-members: diff --git a/docs/dbdataclasses/provisioning.rst b/docs/dbdataclasses/provisioning.rst index 9970daeda..abd2b8d32 100755 --- a/docs/dbdataclasses/provisioning.rst +++ b/docs/dbdataclasses/provisioning.rst @@ -252,7 +252,7 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: WorkspaceStatus - The different statuses of a workspace. The following represents the current set of valid transitions from status to status: NOT_PROVISIONED -> PROVISIONING -> CANCELLED PROVISIONING -> RUNNING -> FAILED -> CANCELLED (note that this transition is disallowed in the MultiWorkspace Project) RUNNING -> PROVISIONING -> BANNED -> CANCELLED FAILED -> PROVISIONING -> CANCELLED BANNED -> RUNNING -> CANCELLED Note that a transition from any state to itself is also valid. TODO(PLAT-5867): add a transition from CANCELLED to some other value (e.g. RECOVERING) + The different statuses of a workspace. The following represents the current set of valid transitions from status to status: NOT_PROVISIONED -> PROVISIONING -> CANCELLED PROVISIONING -> RUNNING -> FAILED -> CANCELLED (note that this transition is disallowed in the MultiWorkspace Project) RUNNING -> PROVISIONING -> BANNED -> CANCELLED FAILED -> PROVISIONING -> CANCELLED BANNED -> RUNNING -> CANCELLED Note that a transition from any state to itself is also valid. .. py:attribute:: BANNED :value: "BANNED" diff --git a/docs/dbdataclasses/serving.rst b/docs/dbdataclasses/serving.rst index 38ff28526..738921152 100755 --- a/docs/dbdataclasses/serving.rst +++ b/docs/dbdataclasses/serving.rst @@ -388,7 +388,7 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: ServedModelInputWorkloadType - Please keep this in sync with with workload types in InferenceEndpointEntities.scala + Please keep this in sync with workload types in InferenceEndpointEntities.scala. .. py:attribute:: CPU :value: "CPU" @@ -495,7 +495,7 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: ServingModelWorkloadType - Please keep this in sync with with workload types in InferenceEndpointEntities.scala + Please keep this in sync with workload types in InferenceEndpointEntities.scala. .. py:attribute:: CPU :value: "CPU" diff --git a/docs/workspace/catalog/artifact_allowlists.rst b/docs/workspace/catalog/artifact_allowlists.rst index af5a0b28b..3c9af2753 100644 --- a/docs/workspace/catalog/artifact_allowlists.rst +++ b/docs/workspace/catalog/artifact_allowlists.rst @@ -5,7 +5,7 @@ .. py:class:: 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. + that users can use these artifacts on compute configured with shared access mode. .. py:method:: get(artifact_type: ArtifactType) -> ArtifactAllowlistInfo diff --git a/docs/workspace/catalog/catalogs.rst b/docs/workspace/catalog/catalogs.rst index e5410c43d..de2330320 100755 --- a/docs/workspace/catalog/catalogs.rst +++ b/docs/workspace/catalog/catalogs.rst @@ -24,10 +24,10 @@ w = WorkspaceClient() - created_catalog = w.catalogs.create(name=f"sdk-{time.time_ns()}") + created = w.catalogs.create(name=f"sdk-{time.time_ns()}") # cleanup - w.catalogs.delete(name=created_catalog.name, force=True) + w.catalogs.delete(name=created.name, force=True) Creates a new catalog instance in the parent metastore if the caller is a metastore admin or has the **CREATE_CATALOG** privilege. @@ -159,13 +159,12 @@ import time from databricks.sdk import WorkspaceClient - from databricks.sdk.service import catalog w = WorkspaceClient() created = w.catalogs.create(name=f"sdk-{time.time_ns()}") - _ = w.catalogs.update(name=created.name, isolation_mode=catalog.CatalogIsolationMode.ISOLATED) + _ = w.catalogs.update(name=created.name, comment="updated") # cleanup w.catalogs.delete(name=created.name, force=True) diff --git a/docs/workspace/catalog/connections.rst b/docs/workspace/catalog/connections.rst index 0674d749d..09689bed1 100644 --- a/docs/workspace/catalog/connections.rst +++ b/docs/workspace/catalog/connections.rst @@ -4,14 +4,13 @@ .. py:class:: ConnectionsAPI - Connections allow for creating a connection to an external data source. - - A connection is an abstraction of an external data source that can be connected from Databricks Compute. - Creating a connection object is the first step to managing external data sources within Unity Catalog, - with the second step being creating a data object (catalog, schema, or table) using the connection. Data - objects derived from a connection can be written to or read from similar to other Unity Catalog data - objects based on cloud storage. Users may create different types of connections with each connection - having a unique set of configuration options to support credential management and other settings. + A connection represents an external data source for use within Databricks. + + Creating a connection object is the first step to managing external data sources within Unity Catalog. The + second step is creating a data object (catalog, schema, or table) using the connection. Data objects + derived from a connection can be written to or read from similar to other Unity Catalog data objects based + on cloud storage. You can create different types of connections, and each connection has a unique set of + configuration options to support credential management and other settings. .. py:method:: create(name: str, connection_type: ConnectionType, options: Dict[str, str] [, comment: Optional[str], environment_settings: Optional[EnvironmentSettings], properties: Optional[Dict[str, str]], read_only: Optional[bool]]) -> ConnectionInfo diff --git a/docs/workspace/catalog/entity_tag_assignments.rst b/docs/workspace/catalog/entity_tag_assignments.rst index fd6aedcb0..fdcbc84c9 100644 --- a/docs/workspace/catalog/entity_tag_assignments.rst +++ b/docs/workspace/catalog/entity_tag_assignments.rst @@ -5,9 +5,9 @@ .. py:class:: EntityTagAssignmentsAPI Tags are attributes that include keys and optional values that you can use to organize and categorize - entities in Unity Catalog. Entity tagging is currently supported on catalogs, schemas, tables (including - views), columns, volumes. With these APIs, users can create, update, delete, and list tag assignments - across Unity Catalog entities + entities in Unity Catalog. Entity tagging is supported on catalogs, schemas, tables (including views), + columns, and volumes. With these APIs, you can create, update, delete, and list tag assignments across + Unity Catalog entities. .. py:method:: create(tag_assignment: EntityTagAssignment) -> EntityTagAssignment diff --git a/docs/workspace/catalog/external_locations.rst b/docs/workspace/catalog/external_locations.rst index f8dbf9fe2..1ddc9ab58 100755 --- a/docs/workspace/catalog/external_locations.rst +++ b/docs/workspace/catalog/external_locations.rst @@ -30,20 +30,22 @@ w = WorkspaceClient() - credential = w.storage_credentials.create( + storage_credential = w.storage_credentials.create( name=f"sdk-{time.time_ns()}", aws_iam_role=catalog.AwsIamRoleRequest(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), + comment="created via SDK", ) - created = w.external_locations.create( + external_location = w.external_locations.create( name=f"sdk-{time.time_ns()}", - credential_name=credential.name, - url="s3://%s/%s" % (os.environ["TEST_BUCKET"], f"sdk-{time.time_ns()}"), + credential_name=storage_credential.name, + comment="created via SDK", + url="s3://" + os.environ["TEST_BUCKET"] + "/" + f"sdk-{time.time_ns()}", ) # cleanup - w.storage_credentials.delete(name=credential.name) - w.external_locations.delete(name=created.name) + w.storage_credentials.delete(name=storage_credential.name) + w.external_locations.delete(name=external_location.name) Creates a new external location entry in the metastore. The caller must be a metastore admin or have the **CREATE_EXTERNAL_LOCATION** privilege on both the metastore and the associated storage @@ -113,20 +115,20 @@ credential = w.storage_credentials.create( name=f"sdk-{time.time_ns()}", - aws_iam_role=catalog.AwsIamRoleRequest(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), + aws_iam_role=catalog.AwsIamRole(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), ) created = w.external_locations.create( name=f"sdk-{time.time_ns()}", credential_name=credential.name, - url="s3://%s/%s" % (os.environ["TEST_BUCKET"], f"sdk-{time.time_ns()}"), + url=f's3://{os.environ["TEST_BUCKET"]}/sdk-{time.time_ns()}', ) - _ = w.external_locations.get(name=created.name) + _ = w.external_locations.get(get=created.name) # cleanup - w.storage_credentials.delete(name=credential.name) - w.external_locations.delete(name=created.name) + w.storage_credentials.delete(delete=credential.name) + w.external_locations.delete(delete=created.name) Gets an external location from the metastore. The caller must be either a metastore admin, the owner of the external location, or a user that has some privilege on the external location. @@ -199,24 +201,24 @@ credential = w.storage_credentials.create( name=f"sdk-{time.time_ns()}", - aws_iam_role=catalog.AwsIamRole(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), + aws_iam_role=catalog.AwsIamRoleRequest(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), ) created = w.external_locations.create( name=f"sdk-{time.time_ns()}", credential_name=credential.name, - url=f's3://{os.environ["TEST_BUCKET"]}/sdk-{time.time_ns()}', + url="s3://%s/%s" % (os.environ["TEST_BUCKET"], f"sdk-{time.time_ns()}"), ) _ = w.external_locations.update( name=created.name, credential_name=credential.name, - url=f's3://{os.environ["TEST_BUCKET"]}/sdk-{time.time_ns()}', + url="s3://%s/%s" % (os.environ["TEST_BUCKET"], f"sdk-{time.time_ns()}"), ) # cleanup - w.storage_credentials.delete(delete=credential.name) - w.external_locations.delete(delete=created.name) + w.storage_credentials.delete(name=credential.name) + w.external_locations.delete(name=created.name) Updates an external location in the metastore. The caller must be the owner of the external location, or be a metastore admin. In the second case, the admin can only update the name of the external diff --git a/docs/workspace/catalog/grants.rst b/docs/workspace/catalog/grants.rst index 69f2dd6c5..3e1f1bc6f 100644 --- a/docs/workspace/catalog/grants.rst +++ b/docs/workspace/catalog/grants.rst @@ -9,10 +9,9 @@ schema that contains the object. Securable objects in Unity Catalog are hierarchical and privileges are inherited downward. - Securable objects in Unity Catalog are hierarchical and privileges are inherited downward. This means that - granting a privilege on the catalog automatically grants the privilege to all current and future objects - within the catalog. Similarly, privileges granted on a schema are inherited by all current and future - objects within that schema. + This means that granting a privilege on the catalog automatically grants the privilege to all current and + future objects within the catalog. Similarly, privileges granted on a schema are inherited by all current + and future objects within that schema. .. py:method:: get(securable_type: str, full_name: str [, max_results: Optional[int], page_token: Optional[str], principal: Optional[str]]) -> GetPermissionsResponse diff --git a/docs/workspace/catalog/model_versions.rst b/docs/workspace/catalog/model_versions.rst index f7432e1e5..60a4519d7 100644 --- a/docs/workspace/catalog/model_versions.rst +++ b/docs/workspace/catalog/model_versions.rst @@ -74,7 +74,7 @@ The returned models are filtered based on the privileges of the calling user. For example, the metastore admin is able to list all the model versions. A regular user needs to be the owner or have - the **EXECUTE** privilege on the parent registered model to recieve the model versions in the + the **EXECUTE** privilege on the parent registered model to receive the model versions in the response. For the latter case, the caller must also be the owner or have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema. diff --git a/docs/workspace/catalog/registered_models.rst b/docs/workspace/catalog/registered_models.rst index 9628d7942..135c37118 100644 --- a/docs/workspace/catalog/registered_models.rst +++ b/docs/workspace/catalog/registered_models.rst @@ -10,9 +10,9 @@ An MLflow registered model resides in the third layer of Unity Catalog’s three-level namespace. Registered models contain model versions, which correspond to actual ML models (MLflow models). Creating - new model versions currently requires use of the MLflow Python client. Once model versions are created, - you can load them for batch inference using MLflow Python client APIs, or deploy them for real-time - serving using Databricks Model Serving. + new model versions requires use of the MLflow Python client. After model versions are created, you can + load them for batch inference using MLflow Python client APIs, or deploy them for real-time serving using + Databricks Model Serving. All operations on registered models and model versions require USE_CATALOG permissions on the enclosing catalog and USE_SCHEMA permissions on the enclosing schema. In addition, the following additional @@ -26,8 +26,8 @@ new model version, or update permissions on the registered model, users must be owners of the registered model. - Note: The securable type for models is FUNCTION. When using REST APIs (e.g. tagging, grants) that specify - a securable type, use FUNCTION as the securable type. + Note: The securable type for models is FUNCTION. When using REST APIs (for example, tagging, grants) that + specify a securable type, use FUNCTION as the securable type. .. py:method:: create( [, aliases: Optional[List[RegisteredModelAlias]], browse_only: Optional[bool], catalog_name: Optional[str], comment: Optional[str], created_at: Optional[int], created_by: Optional[str], full_name: Optional[str], metastore_id: Optional[str], name: Optional[str], owner: Optional[str], schema_name: Optional[str], storage_location: Optional[str], updated_at: Optional[int], updated_by: Optional[str]]) -> RegisteredModelInfo @@ -130,7 +130,7 @@ The returned models are filtered based on the privileges of the calling user. For example, the metastore admin is able to list all the registered models. A regular user needs to be the owner or - have the **EXECUTE** privilege on the registered model to recieve the registered models in the + have the **EXECUTE** privilege on the registered model to receive the registered models in the response. For the latter case, the caller must also be the owner or have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema. diff --git a/docs/workspace/catalog/schemas.rst b/docs/workspace/catalog/schemas.rst index fbe7dbab0..04f344ebe 100755 --- a/docs/workspace/catalog/schemas.rst +++ b/docs/workspace/catalog/schemas.rst @@ -5,7 +5,7 @@ .. py:class:: SchemasAPI A schema (also called a database) is the second layer of Unity Catalog’s three-level namespace. A schema - organizes tables, views and functions. To access (or list) a table or view in a schema, users must have + organizes tables, views, and functions. To access (or list) a table or view in a schema, users must have the USE_SCHEMA data permission on the schema and its parent catalog, and they must have the SELECT permission on the table or view. diff --git a/docs/workspace/catalog/storage_credentials.rst b/docs/workspace/catalog/storage_credentials.rst index 2eacfda5e..ad6e4ebe5 100755 --- a/docs/workspace/catalog/storage_credentials.rst +++ b/docs/workspace/catalog/storage_credentials.rst @@ -98,13 +98,13 @@ created = w.storage_credentials.create( name=f"sdk-{time.time_ns()}", - aws_iam_role=catalog.AwsIamRole(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), + aws_iam_role=catalog.AwsIamRoleRequest(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), ) - by_name = w.storage_credentials.get(get=created.name) + by_name = w.storage_credentials.get(name=created.name) # cleanup - w.storage_credentials.delete(delete=created.name) + w.storage_credentials.delete(name=created.name) Gets a storage credential from the metastore. The caller must be a metastore admin, the owner of the storage credential, or have some permission on the storage credential. @@ -123,11 +123,10 @@ .. code-block:: from databricks.sdk import WorkspaceClient - from databricks.sdk.service import catalog w = WorkspaceClient() - all = w.storage_credentials.list(catalog.ListStorageCredentialsRequest()) + all = w.storage_credentials.list() Gets an array of storage credentials (as __StorageCredentialInfo__ objects). The array is limited to only those storage credentials the caller has permission to access. If the caller is a metastore diff --git a/docs/workspace/catalog/system_schemas.rst b/docs/workspace/catalog/system_schemas.rst index ef6c8f30f..5a81df8b4 100644 --- a/docs/workspace/catalog/system_schemas.rst +++ b/docs/workspace/catalog/system_schemas.rst @@ -5,7 +5,7 @@ .. py:class:: SystemSchemasAPI A system schema is a schema that lives within the system catalog. A system schema may contain information - about customer usage of Unity Catalog such as audit-logs, billing-logs, lineage information, etc. + about customer usage of Unity Catalog such as audit logs, billing logs, and lineage information. .. py:method:: disable(metastore_id: str, schema_name: str) diff --git a/docs/workspace/catalog/table_constraints.rst b/docs/workspace/catalog/table_constraints.rst index 2813e6835..dfc96370d 100644 --- a/docs/workspace/catalog/table_constraints.rst +++ b/docs/workspace/catalog/table_constraints.rst @@ -7,9 +7,9 @@ Primary key and foreign key constraints encode relationships between fields in tables. Primary and foreign keys are informational only and are not enforced. Foreign keys must reference a - primary key in another table. This primary key is the parent constraint of the foreign key and the table + primary key in another table. This primary key is the parent constraint of the foreign key, and the table this primary key is on is the parent table of the foreign key. Similarly, the foreign key is the child - constraint of its referenced primary key; the table of the foreign key is the child table of the primary + constraint of its referenced primary key. The table of the foreign key is the child table of the primary key. You can declare primary keys and foreign keys as part of the table specification during table creation. diff --git a/docs/workspace/catalog/tables.rst b/docs/workspace/catalog/tables.rst index 009b4bbd2..089b1b7f1 100755 --- a/docs/workspace/catalog/tables.rst +++ b/docs/workspace/catalog/tables.rst @@ -156,7 +156,7 @@ created_schema = w.schemas.create(name=f"sdk-{time.time_ns()}", catalog_name=created_catalog.name) - summaries = w.tables.list_summaries(catalog_name=created_catalog.name, schema_name_pattern=created_schema.name) + all_tables = w.tables.list(catalog_name=created_catalog.name, schema_name=created_schema.name) # cleanup w.schemas.delete(full_name=created_schema.full_name) diff --git a/docs/workspace/catalog/temporary_path_credentials.rst b/docs/workspace/catalog/temporary_path_credentials.rst index 646076c64..d13c7ffe4 100755 --- a/docs/workspace/catalog/temporary_path_credentials.rst +++ b/docs/workspace/catalog/temporary_path_credentials.rst @@ -4,23 +4,23 @@ .. py:class:: TemporaryPathCredentialsAPI - Temporary Path Credentials refer to short-lived, downscoped credentials used to access external cloud - storage locations registered in Databricks. These credentials are employed to provide secure and - time-limited access to data in cloud environments such as AWS, Azure, and Google Cloud. Each cloud - provider has its own type of credentials: AWS uses temporary session tokens via AWS Security Token Service - (STS), Azure utilizes Shared Access Signatures (SAS) for its data storage services, and Google Cloud - supports temporary credentials through OAuth 2.0. + Temporary Path Credentials are short-lived, downscoped credentials used to access external cloud storage + locations registered in Databricks. These credentials provide secure and time-limited access to data in + cloud environments such as AWS, Azure, and Google Cloud. Each cloud provider has its own type of + credentials: AWS uses temporary session tokens through AWS Security Token Service (STS), Azure uses Shared + Access Signatures (SAS) for its data storage services, and Google Cloud supports temporary credentials + through OAuth 2.0. Temporary path credentials ensure that data access is limited in scope and duration, reducing the risk of - unauthorized access or misuse. To use the temporary path credentials API, a metastore admin needs to - enable the external_access_enabled flag (off by default) at the metastore level. A user needs to be - granted the EXTERNAL USE LOCATION permission by external location owner. For requests on existing external - tables and external volumes, user also needs to be granted the EXTERNAL USE SCHEMA permission at the - schema level by catalog owner. + unauthorized access or misuse. To use the temporary path credentials API, a metastore admin must enable + the external_access_enabled flag (off by default) at the metastore level. A user must be granted the + EXTERNAL USE LOCATION permission by the external location owner. For requests on existing external tables + and external volumes, the user must also be granted the EXTERNAL USE SCHEMA permission at the schema level + by the catalog owner. - Note that EXTERNAL USE SCHEMA is a schema level permission that can only be granted by catalog owner + Note that EXTERNAL USE SCHEMA is a schema level permission that can only be granted by the catalog owner explicitly and is not included in schema ownership or ALL PRIVILEGES on the schema for security reasons. - Similarly, EXTERNAL USE LOCATION is an external location level permission that can only be granted by + Similarly, EXTERNAL USE LOCATION is an external location level permission that can only be granted by the external location owner explicitly and is not included in external location ownership or ALL PRIVILEGES on the external location for security reasons. diff --git a/docs/workspace/catalog/temporary_table_credentials.rst b/docs/workspace/catalog/temporary_table_credentials.rst index 36a31c29f..a0adf7bc2 100755 --- a/docs/workspace/catalog/temporary_table_credentials.rst +++ b/docs/workspace/catalog/temporary_table_credentials.rst @@ -4,19 +4,19 @@ .. py:class:: TemporaryTableCredentialsAPI - Temporary Table Credentials refer to short-lived, downscoped credentials used to access cloud storage - locations where table data is stored in Databricks. These credentials are employed to provide secure and - time-limited access to data in cloud environments such as AWS, Azure, and Google Cloud. Each cloud - provider has its own type of credentials: AWS uses temporary session tokens via AWS Security Token Service - (STS), Azure utilizes Shared Access Signatures (SAS) for its data storage services, and Google Cloud - supports temporary credentials through OAuth 2.0. + Temporary Table Credentials are short-lived, downscoped credentials used to access cloud storage locations + where table data is stored in Databricks. These credentials provide secure and time-limited access to data + in cloud environments such as AWS, Azure, and Google Cloud. Each cloud provider has its own type of + credentials: AWS uses temporary session tokens through AWS Security Token Service (STS), Azure uses Shared + Access Signatures (SAS) for its data storage services, and Google Cloud supports temporary credentials + through OAuth 2.0. Temporary table credentials ensure that data access is limited in scope and duration, reducing the risk of - unauthorized access or misuse. To use the temporary table credentials API, a metastore admin needs to - enable the external_access_enabled flag (off by default) at the metastore level, and user needs to be - granted the EXTERNAL USE SCHEMA permission at the schema level by catalog owner. Note that EXTERNAL USE - SCHEMA is a schema level permission that can only be granted by catalog owner explicitly and is not - included in schema ownership or ALL PRIVILEGES on the schema for security reasons. + unauthorized access or misuse. To use the temporary table credentials API, a metastore admin must enable + the external_access_enabled flag (off by default) at the metastore level, and the user must be granted the + EXTERNAL USE SCHEMA permission at the schema level by the catalog owner. Note that EXTERNAL USE SCHEMA is + a schema level permission that can only be granted by the catalog owner explicitly and is not included in + schema ownership or ALL PRIVILEGES on the schema for security reasons. .. py:method:: generate_temporary_table_credentials( [, operation: Optional[TableOperation], table_id: Optional[str]]) -> GenerateTemporaryTableCredentialResponse diff --git a/docs/workspace/catalog/temporary_volume_credentials.rst b/docs/workspace/catalog/temporary_volume_credentials.rst index 8a5412a5c..3e35e6e02 100755 --- a/docs/workspace/catalog/temporary_volume_credentials.rst +++ b/docs/workspace/catalog/temporary_volume_credentials.rst @@ -4,19 +4,19 @@ .. py:class:: TemporaryVolumeCredentialsAPI - Temporary Volume Credentials refer to short-lived, downscoped credentials used to access cloud storage - locations where volume data is stored in Databricks. These credentials are employed to provide secure and - time-limited access to data in cloud environments such as AWS, Azure, and Google Cloud. Each cloud - provider has its own type of credentials: AWS uses temporary session tokens via AWS Security Token Service - (STS), Azure utilizes Shared Access Signatures (SAS) for its data storage services, and Google Cloud - supports temporary credentials through OAuth 2.0. + Temporary Volume Credentials are short-lived, downscoped credentials used to access cloud storage + locations where volume data is stored in Databricks. These credentials provide secure and time-limited + access to data in cloud environments such as AWS, Azure, and Google Cloud. Each cloud provider has its own + type of credentials: AWS uses temporary session tokens through AWS Security Token Service (STS), Azure + uses Shared Access Signatures (SAS) for its data storage services, and Google Cloud supports temporary + credentials through OAuth 2.0. Temporary volume credentials ensure that data access is limited in scope and duration, reducing the risk - of unauthorized access or misuse. To use the temporary volume credentials API, a metastore admin needs to - enable the external_access_enabled flag (off by default) at the metastore level, and user needs to be - granted the EXTERNAL USE SCHEMA permission at the schema level by catalog owner. Note that EXTERNAL USE - SCHEMA is a schema level permission that can only be granted by catalog owner explicitly and is not - included in schema ownership or ALL PRIVILEGES on the schema for security reasons. + of unauthorized access or misuse. To use the temporary volume credentials API, a metastore admin must + enable the external_access_enabled flag (off by default) at the metastore level, and the user must be + granted the EXTERNAL USE SCHEMA permission at the schema level by the catalog owner. Note that EXTERNAL + USE SCHEMA is a schema level permission that can only be granted by the catalog owner explicitly and is + not included in schema ownership or ALL PRIVILEGES on the schema for security reasons. .. py:method:: generate_temporary_volume_credentials( [, operation: Optional[VolumeOperation], volume_id: Optional[str]]) -> GenerateTemporaryVolumeCredentialResponse diff --git a/docs/workspace/catalog/volumes.rst b/docs/workspace/catalog/volumes.rst index 5566e3e8f..58ad1e80e 100644 --- a/docs/workspace/catalog/volumes.rst +++ b/docs/workspace/catalog/volumes.rst @@ -4,12 +4,12 @@ .. py:class:: VolumesAPI - Volumes are a Unity Catalog (UC) capability for accessing, storing, governing, organizing and processing + Volumes are a Unity Catalog (UC) capability for accessing, storing, governing, organizing, and processing files. Use cases include running machine learning on unstructured data such as image, audio, video, or PDF files, organizing data sets during the data exploration stages in data science, working with libraries that require access to the local file system on cluster machines, storing library and config files of - arbitrary formats such as .whl or .txt centrally and providing secure access across workspaces to it, or - transforming and querying non-tabular data files in ETL. + arbitrary formats such as .whl or .txt centrally and providing secure access to those files across + workspaces, or transforming and querying non-tabular data files in ETL. .. py:method:: create(catalog_name: str, schema_name: str, name: str, volume_type: VolumeType [, comment: Optional[str], storage_location: Optional[str]]) -> VolumeInfo diff --git a/docs/workspace/catalog/workspace_bindings.rst b/docs/workspace/catalog/workspace_bindings.rst index eb76a4c37..369eb550d 100644 --- a/docs/workspace/catalog/workspace_bindings.rst +++ b/docs/workspace/catalog/workspace_bindings.rst @@ -13,9 +13,9 @@ A securable's workspace bindings can be configured by a metastore admin or the owner of the securable. - The original path (/api/2.1/unity-catalog/workspace-bindings/catalogs/{name}) is deprecated. Please use - the new path (/api/2.1/unity-catalog/bindings/{securable_type}/{securable_name}) which introduces the - ability to bind a securable in READ_ONLY mode (catalogs only). + The original path (/api/2.1/unity-catalog/workspace-bindings/catalogs/{name}) is deprecated. Use the new + path (/api/2.1/unity-catalog/bindings/{securable_type}/{securable_name}), which introduces the ability to + bind a securable in READ_ONLY mode (catalogs only). Securable types that support binding: - catalog - storage_credential - credential - external_location diff --git a/docs/workspace/compute/clusters.rst b/docs/workspace/compute/clusters.rst index f162b4edf..d92941b48 100644 --- a/docs/workspace/compute/clusters.rst +++ b/docs/workspace/compute/clusters.rst @@ -653,10 +653,11 @@ .. code-block:: from databricks.sdk import WorkspaceClient + from databricks.sdk.service import compute w = WorkspaceClient() - nodes = w.clusters.list_node_types() + all = w.clusters.list(compute.ListClustersRequest()) Return information about all pinned and active clusters, and all clusters terminated within the last 30 days. Clusters terminated prior to this period are not included. diff --git a/docs/workspace/database/database.rst b/docs/workspace/database/database.rst index 9ce91817f..23f65db27 100755 --- a/docs/workspace/database/database.rst +++ b/docs/workspace/database/database.rst @@ -76,7 +76,7 @@ :param name: str Name of the instance to delete. :param force: bool (optional) - By default, a instance cannot be deleted if it has descendant instances created via PITR. If this + By default, an instance cannot be deleted if it has descendant instances created via PITR. If this flag is specified as true, all descendent instances will be deleted as well. :param purge: bool (optional) Deprecated. Omitting the field or setting it to true will result in the field being hard deleted. diff --git a/docs/workspace/files/files.rst b/docs/workspace/files/files.rst index 279788e75..ef8fc92e2 100755 --- a/docs/workspace/files/files.rst +++ b/docs/workspace/files/files.rst @@ -121,8 +121,8 @@ .. py:method:: list_directory_contents(directory_path: str [, page_size: Optional[int], page_token: Optional[str]]) -> Iterator[DirectoryEntry] - Returns the contents of a directory. If there is no directory at the specified path, the API returns a - HTTP 404 error. + Returns the contents of a directory. If there is no directory at the specified path, the API returns + an HTTP 404 error. :param directory_path: str The absolute path of a directory. diff --git a/docs/workspace/iam/permissions.rst b/docs/workspace/iam/permissions.rst index 1f836a4b1..531208e2f 100755 --- a/docs/workspace/iam/permissions.rst +++ b/docs/workspace/iam/permissions.rst @@ -44,7 +44,7 @@ obj = w.workspace.get_status(path=notebook_path) - _ = w.permissions.get(request_object_type="notebooks", request_object_id="%d" % (obj.object_id)) + levels = w.permissions.get_permission_levels(request_object_type="notebooks", request_object_id="%d" % (obj.object_id)) Gets the permissions of an object. Objects can inherit permissions from their parent objects or root object. diff --git a/docs/workspace/iamv2/workspace_iam_v2.rst b/docs/workspace/iamv2/workspace_iam_v2.rst index 376ab2bf2..b6f401489 100755 --- a/docs/workspace/iamv2/workspace_iam_v2.rst +++ b/docs/workspace/iamv2/workspace_iam_v2.rst @@ -62,7 +62,9 @@ .. py:method:: list_workspace_assignment_details_proxy( [, page_size: Optional[int], page_token: Optional[str]]) -> ListWorkspaceAssignmentDetailsResponse - Lists workspace assignment details for a workspace (workspace-level proxy). + Lists workspace assignment details for a workspace (workspace-level proxy). For scalability, the + response omits the per-principal entitlement fields (`entitlements` and `effective_entitlements`); + call GetWorkspaceAssignmentDetailProxy to read entitlements for a single principal. :param page_size: int (optional) The maximum number of workspace assignment details to return. The service may return fewer than this diff --git a/docs/workspace/jobs/jobs.rst b/docs/workspace/jobs/jobs.rst index ea5f34dc8..b8dd2e902 100755 --- a/docs/workspace/jobs/jobs.rst +++ b/docs/workspace/jobs/jobs.rst @@ -359,23 +359,21 @@ w.clusters.ensure_cluster_is_running(os.environ["DATABRICKS_CLUSTER_ID"]) and os.environ["DATABRICKS_CLUSTER_ID"] ) - created_job = w.jobs.create( - name=f"sdk-{time.time_ns()}", + run = w.jobs.submit( + run_name=f"sdk-{time.time_ns()}", tasks=[ - jobs.Task( - description="test", + jobs.SubmitTask( existing_cluster_id=cluster_id, notebook_task=jobs.NotebookTask(notebook_path=notebook_path), - task_key="test", - timeout_seconds=0, + task_key=f"sdk-{time.time_ns()}", ) ], - ) + ).result() - by_id = w.jobs.get(job_id=created_job.job_id) + output = w.jobs.get_run_output(run_id=run.tasks[0].run_id) # cleanup - w.jobs.delete(job_id=created_job.job_id) + w.jobs.delete_run(run_id=run.run_id) Get a single job. @@ -524,11 +522,37 @@ .. code-block:: + import os + import time + from databricks.sdk import WorkspaceClient + from databricks.sdk.service import jobs w = WorkspaceClient() - job_list = w.jobs.list(expand_tasks=False) + notebook_path = f"/Users/{w.current_user.me().user_name}/sdk-{time.time_ns()}" + + cluster_id = ( + w.clusters.ensure_cluster_is_running(os.environ["DATABRICKS_CLUSTER_ID"]) and os.environ["DATABRICKS_CLUSTER_ID"] + ) + + created_job = w.jobs.create( + name=f"sdk-{time.time_ns()}", + tasks=[ + jobs.Task( + description="test", + existing_cluster_id=cluster_id, + notebook_task=jobs.NotebookTask(notebook_path=notebook_path), + task_key="test", + timeout_seconds=0, + ) + ], + ) + + run_list = w.jobs.list_runs(job_id=created_job.job_id) + + # cleanup + w.jobs.delete(job_id=created_job.job_id) List jobs. diff --git a/docs/workspace/ml/model_registry.rst b/docs/workspace/ml/model_registry.rst index 601ffd87d..2d34256e4 100755 --- a/docs/workspace/ml/model_registry.rst +++ b/docs/workspace/ml/model_registry.rst @@ -91,8 +91,6 @@ w = WorkspaceClient() model = w.model_registry.create_model(name=f"sdk-{time.time_ns()}") - - created = w.model_registry.create_model_version(name=model.registered_model.name, source="dbfs:/tmp") Creates a new registered model with the name specified in the request body. Throws `RESOURCE_ALREADY_EXISTS` if a registered model with the given name exists. @@ -122,7 +120,7 @@ model = w.model_registry.create_model(name=f"sdk-{time.time_ns()}") - created = w.model_registry.create_model_version(name=model.registered_model.name, source="dbfs:/tmp") + mv = w.model_registry.create_model_version(name=model.registered_model.name, source="dbfs:/tmp") Creates a model version. diff --git a/docs/workspace/pipelines/pipelines.rst b/docs/workspace/pipelines/pipelines.rst index 70c8e007c..20fde4693 100755 --- a/docs/workspace/pipelines/pipelines.rst +++ b/docs/workspace/pipelines/pipelines.rst @@ -26,7 +26,7 @@ :returns: :class:`ApplyEnvironmentRequestResponse` - .. py:method:: clone(pipeline_id: str [, allow_duplicate_names: Optional[bool], budget_policy_id: Optional[str], catalog: Optional[str], channel: Optional[str], clone_mode: Optional[CloneMode], clusters: Optional[List[PipelineCluster]], configuration: Optional[Dict[str, str]], continuous: Optional[bool], deployment: Optional[PipelineDeployment], development: Optional[bool], edition: Optional[str], environment: Optional[PipelinesEnvironment], event_log: Optional[EventLogSpec], expected_last_modified: Optional[int], filters: Optional[Filters], gateway_definition: Optional[IngestionGatewayPipelineDefinition], id: Optional[str], ingestion_definition: Optional[IngestionPipelineDefinition], libraries: Optional[List[PipelineLibrary]], name: Optional[str], notifications: Optional[List[Notifications]], photon: Optional[bool], restart_window: Optional[RestartWindow], root_path: Optional[str], schema: Optional[str], serverless: Optional[bool], storage: Optional[str], tags: Optional[Dict[str, str]], target: Optional[str], trigger: Optional[PipelineTrigger], usage_policy_id: Optional[str]]) -> ClonePipelineResponse + .. py:method:: clone(pipeline_id: str [, allow_duplicate_names: Optional[bool], budget_policy_id: Optional[str], catalog: Optional[str], channel: Optional[str], clone_mode: Optional[CloneMode], clusters: Optional[List[PipelineCluster]], configuration: Optional[Dict[str, str]], continuous: Optional[bool], deployment: Optional[PipelineDeployment], development: Optional[bool], edition: Optional[str], environment: Optional[PipelinesEnvironment], event_log: Optional[EventLogSpec], expected_last_modified: Optional[int], filters: Optional[Filters], gateway_definition: Optional[IngestionGatewayPipelineDefinition], id: Optional[str], ingestion_definition: Optional[IngestionPipelineDefinition], libraries: Optional[List[PipelineLibrary]], name: Optional[str], notifications: Optional[List[Notifications]], photon: Optional[bool], restart_window: Optional[RestartWindow], root_path: Optional[str], schema: Optional[str], serverless: Optional[bool], serverless_compute_id: Optional[str], storage: Optional[str], tags: Optional[Dict[str, str]], target: Optional[str], trigger: Optional[PipelineTrigger], usage_policy_id: Optional[str]]) -> ClonePipelineResponse Creates a new pipeline using Unity Catalog from a pipeline using Hive Metastore. This method returns the ID of the newly created clone. Additionally, this method starts an update for the newly created @@ -92,6 +92,8 @@ The default schema (database) where tables are read from or published to. :param serverless: bool (optional) Whether serverless compute is enabled for this pipeline. + :param serverless_compute_id: str (optional) + Serverless compute ID specified by the user for serverless pipelines. :param storage: str (optional) DBFS root directory for storing checkpoints and tables. :param tags: Dict[str,str] (optional) @@ -109,7 +111,7 @@ :returns: :class:`ClonePipelineResponse` - .. py:method:: create( [, allow_duplicate_names: Optional[bool], budget_policy_id: Optional[str], catalog: Optional[str], channel: Optional[str], clusters: Optional[List[PipelineCluster]], configuration: Optional[Dict[str, str]], continuous: Optional[bool], deployment: Optional[PipelineDeployment], development: Optional[bool], dry_run: Optional[bool], edition: Optional[str], environment: Optional[PipelinesEnvironment], event_log: Optional[EventLogSpec], filters: Optional[Filters], gateway_definition: Optional[IngestionGatewayPipelineDefinition], id: Optional[str], ingestion_definition: Optional[IngestionPipelineDefinition], libraries: Optional[List[PipelineLibrary]], name: Optional[str], notifications: Optional[List[Notifications]], parameters: Optional[Dict[str, str]], photon: Optional[bool], restart_window: Optional[RestartWindow], root_path: Optional[str], run_as: Optional[RunAs], schema: Optional[str], serverless: Optional[bool], storage: Optional[str], tags: Optional[Dict[str, str]], target: Optional[str], trigger: Optional[PipelineTrigger], usage_policy_id: Optional[str]]) -> CreatePipelineResponse + .. py:method:: create( [, allow_duplicate_names: Optional[bool], budget_policy_id: Optional[str], catalog: Optional[str], channel: Optional[str], clusters: Optional[List[PipelineCluster]], configuration: Optional[Dict[str, str]], continuous: Optional[bool], deployment: Optional[PipelineDeployment], development: Optional[bool], dry_run: Optional[bool], edition: Optional[str], environment: Optional[PipelinesEnvironment], event_log: Optional[EventLogSpec], filters: Optional[Filters], gateway_definition: Optional[IngestionGatewayPipelineDefinition], id: Optional[str], ingestion_definition: Optional[IngestionPipelineDefinition], libraries: Optional[List[PipelineLibrary]], name: Optional[str], notifications: Optional[List[Notifications]], parameters: Optional[Dict[str, str]], photon: Optional[bool], restart_window: Optional[RestartWindow], root_path: Optional[str], run_as: Optional[RunAs], schema: Optional[str], serverless: Optional[bool], serverless_compute_id: Optional[str], storage: Optional[str], tags: Optional[Dict[str, str]], target: Optional[str], trigger: Optional[PipelineTrigger], usage_policy_id: Optional[str]]) -> CreatePipelineResponse Usage: @@ -206,6 +208,8 @@ The default schema (database) where tables are read from or published to. :param serverless: bool (optional) Whether serverless compute is enabled for this pipeline. + :param serverless_compute_id: str (optional) + Serverless compute ID specified by the user for serverless pipelines. :param storage: str (optional) DBFS root directory for storing checkpoints and tables. :param tags: Dict[str,str] (optional) @@ -496,7 +500,7 @@ .. py:method:: stop_and_wait(pipeline_id: str, timeout: datetime.timedelta = 0:20:00) -> GetPipelineResponse - .. py:method:: update(pipeline_id: str [, allow_duplicate_names: Optional[bool], budget_policy_id: Optional[str], catalog: Optional[str], channel: Optional[str], clusters: Optional[List[PipelineCluster]], configuration: Optional[Dict[str, str]], continuous: Optional[bool], deployment: Optional[PipelineDeployment], development: Optional[bool], edition: Optional[str], environment: Optional[PipelinesEnvironment], event_log: Optional[EventLogSpec], expected_last_modified: Optional[int], filters: Optional[Filters], gateway_definition: Optional[IngestionGatewayPipelineDefinition], id: Optional[str], ingestion_definition: Optional[IngestionPipelineDefinition], libraries: Optional[List[PipelineLibrary]], name: Optional[str], notifications: Optional[List[Notifications]], parameters: Optional[Dict[str, str]], photon: Optional[bool], restart_window: Optional[RestartWindow], root_path: Optional[str], run_as: Optional[RunAs], schema: Optional[str], serverless: Optional[bool], storage: Optional[str], tags: Optional[Dict[str, str]], target: Optional[str], trigger: Optional[PipelineTrigger], usage_policy_id: Optional[str]]) + .. py:method:: update(pipeline_id: str [, allow_duplicate_names: Optional[bool], budget_policy_id: Optional[str], catalog: Optional[str], channel: Optional[str], clusters: Optional[List[PipelineCluster]], configuration: Optional[Dict[str, str]], continuous: Optional[bool], deployment: Optional[PipelineDeployment], development: Optional[bool], edition: Optional[str], environment: Optional[PipelinesEnvironment], event_log: Optional[EventLogSpec], expected_last_modified: Optional[int], filters: Optional[Filters], gateway_definition: Optional[IngestionGatewayPipelineDefinition], id: Optional[str], ingestion_definition: Optional[IngestionPipelineDefinition], libraries: Optional[List[PipelineLibrary]], name: Optional[str], notifications: Optional[List[Notifications]], parameters: Optional[Dict[str, str]], photon: Optional[bool], restart_window: Optional[RestartWindow], root_path: Optional[str], run_as: Optional[RunAs], schema: Optional[str], serverless: Optional[bool], serverless_compute_id: Optional[str], storage: Optional[str], tags: Optional[Dict[str, str]], target: Optional[str], trigger: Optional[PipelineTrigger], usage_policy_id: Optional[str]]) Usage: @@ -612,6 +616,8 @@ The default schema (database) where tables are read from or published to. :param serverless: bool (optional) Whether serverless compute is enabled for this pipeline. + :param serverless_compute_id: str (optional) + Serverless compute ID specified by the user for serverless pipelines. :param storage: str (optional) DBFS root directory for storing checkpoints and tables. :param tags: Dict[str,str] (optional) diff --git a/docs/workspace/postgres/postgres.rst b/docs/workspace/postgres/postgres.rst index f7459377d..82724a27c 100755 --- a/docs/workspace/postgres/postgres.rst +++ b/docs/workspace/postgres/postgres.rst @@ -48,6 +48,18 @@ :returns: :class:`Operation` + .. py:method:: create_data_api(parent: str, data_api: DataApi) -> CreateDataApiOperation + + Enable Data API for a database. + + :param parent: str + Parent database: projects/{project_id}/branches/{branch_id}/databases/{database_id} + :param data_api: :class:`DataApi` + The Data API configuration to create. + + :returns: :class:`Operation` + + .. py:method:: create_database(parent: str, database: Database [, database_id: Optional[str]]) -> CreateDatabaseOperation Create a Database. @@ -168,6 +180,16 @@ :returns: :class:`Operation` + .. py:method:: delete_data_api(name: str) -> DeleteDataApiOperation + + Disable Data API for a database. + + :param name: str + Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api + + :returns: :class:`Operation` + + .. py:method:: delete_database(name: str) -> DeleteDatabaseOperation Delete a Database. @@ -264,6 +286,16 @@ :returns: :class:`Catalog` + .. py:method:: get_data_api(name: str) -> DataApi + + Get Data API configuration for a database. + + :param name: str + Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api + + :returns: :class:`DataApi` + + .. py:method:: get_database(name: str) -> Database Get a Database. @@ -445,6 +477,20 @@ :returns: :class:`Operation` + .. py:method:: update_data_api(name: str, data_api: DataApi, update_mask: FieldMask) -> UpdateDataApiOperation + + Update Data API configuration for a database. + + :param name: str + Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api + :param data_api: :class:`DataApi` + The Data API configuration to update. The data_api's `name` field identifies the resource. + :param update_mask: FieldMask + The list of fields to update. If unspecified, all fields will be updated when possible. + + :returns: :class:`Operation` + + .. py:method:: update_database(name: str, database: Database, update_mask: FieldMask) -> UpdateDatabaseOperation Update a Database. diff --git a/docs/workspace/sharing/providers.rst b/docs/workspace/sharing/providers.rst index 8f66df54a..302039578 100755 --- a/docs/workspace/sharing/providers.rst +++ b/docs/workspace/sharing/providers.rst @@ -101,25 +101,12 @@ .. code-block:: - import time - from databricks.sdk import WorkspaceClient + from databricks.sdk.service import sharing w = WorkspaceClient() - public_share_recipient = """{ - "shareCredentialsVersion":1, - "bearerToken":"dapiabcdefghijklmonpqrstuvwxyz", - "endpoint":"https://sharing.delta.io/delta-sharing/" - } - """ - - created = w.providers.create(name=f"sdk-{time.time_ns()}", recipient_profile_str=public_share_recipient) - - shares = w.providers.list_shares(name=created.name) - - # cleanup - w.providers.delete(name=created.name) + all = w.providers.list(sharing.ListProvidersRequest()) Gets an array of available authentication providers. The caller must either be a metastore admin, have the **USE_PROVIDER** privilege on the providers, or be the owner of the providers. Providers not owned diff --git a/docs/workspace/workspace/workspace.rst b/docs/workspace/workspace/workspace.rst index 97dbf6cef..784acdc27 100755 --- a/docs/workspace/workspace/workspace.rst +++ b/docs/workspace/workspace/workspace.rst @@ -81,7 +81,7 @@ notebook = f"/Users/{w.current_user.me().user_name}/sdk-{time.time_ns()}" - export_response = w.workspace.export_(format=workspace.ExportFormat.SOURCE, path=notebook) + export_response = w.workspace.export(format=workspace.ExportFormat.SOURCE, path=notebook) Exports an object or the contents of an entire directory. @@ -184,7 +184,7 @@ content=base64.b64encode(("CREATE LIVE TABLE dlt_sample AS SELECT 1").encode()).decode(), format=workspace.ImportFormat.SOURCE, language=workspace.Language.SQL, - overwrite=true_, + overwrite=True, path=notebook_path, ) diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index e06832449..000000000 --- a/examples/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Examples of using the SDK - -The Databricks SDK for Python comes with a number of examples demonstrating how to use the library for various common use-cases, including - -* [Using the SDK with OAuth from a webserver](https://github.com/databricks/databricks-sdk-py/blob/main/examples/flask_app_with_oauth.py) -* [Using long-running operations](https://github.com/databricks/databricks-sdk-py/blob/main/examples/starting_job_and_waiting.py) -* [Authenticating a client app using OAuth](https://github.com/databricks/databricks-sdk-py/blob/main/examples/local_browser_oauth.py) - -The examples are organized by the Databricks API that they use. Hand-written examples are present in the `examples/` directory. -Generated examples are available in subdirectories, with two main directories corresponding to Account -and Workspace clients. Inside these main directories, there are subdirectories corresponding to each -Databricks service. - -We welcome contributions of new examples or corrections to existing ones. Before contributing, be aware of the following caveats: -* Examples in service-specific subdirectories are autogenerated. Do not edit these directly; changes will be overwritten the next time SDK code is generated. -* Examples are not automatically tested as part of the CI pipeline. If you add a new example, please test it manually before submitting a PR.