From bc391eabd6308f631747c17ddcddf93520daadcc Mon Sep 17 00:00:00 2001 From: "hector.castejon" Date: Wed, 9 Sep 2026 12:46:50 +0000 Subject: [PATCH] Preview SDK generation from legacy public proto --- .codegen/_last_sha | 2 +- CHANGELOG.md | 9 - databricks/sdk/__init__.py | 226 +-- databricks/sdk/service/agentbricks.py | 46 +- databricks/sdk/service/aifunctions.py | 17 +- databricks/sdk/service/aisearch.py | 79 +- databricks/sdk/service/apps.py | 494 +---- databricks/sdk/service/billing.py | 202 +- databricks/sdk/service/bundledeployments.py | 71 +- databricks/sdk/service/catalog.py | 1201 +++--------- databricks/sdk/service/cleanrooms.py | 114 +- databricks/sdk/service/compute.py | 1648 ++--------------- databricks/sdk/service/dashboards.py | 258 +-- databricks/sdk/service/database.py | 107 +- databricks/sdk/service/databricks.py | 15 + databricks/sdk/service/dataclassification.py | 22 +- databricks/sdk/service/dataquality.py | 53 +- databricks/sdk/service/disasterrecovery.py | 46 +- databricks/sdk/service/domains.py | 36 +- databricks/sdk/service/environments.py | 54 +- databricks/sdk/service/files.py | 93 +- databricks/sdk/service/google.py | 15 + databricks/sdk/service/iam.py | 525 ++---- databricks/sdk/service/iamv2.py | 575 ++---- databricks/sdk/service/jobs.py | 683 ++----- databricks/sdk/service/knowledgeassistants.py | 443 +---- databricks/sdk/service/marketplace.py | 270 +-- databricks/sdk/service/ml.py | 1277 ++----------- databricks/sdk/service/networking.py | 33 +- databricks/sdk/service/oauth2.py | 284 +-- databricks/sdk/service/pipelines.py | 456 +---- databricks/sdk/service/postgres.py | 277 +-- databricks/sdk/service/provisioning.py | 344 ++-- databricks/sdk/service/qualitymonitorv2.py | 25 +- databricks/sdk/service/sandbox.py | 46 +- databricks/sdk/service/serving.py | 729 +------- databricks/sdk/service/settings.py | 1309 ++----------- databricks/sdk/service/settingsv2.py | 43 +- databricks/sdk/service/sharing.py | 184 +- databricks/sdk/service/sql.py | 932 ++-------- databricks/sdk/service/supervisoragents.py | 435 +---- databricks/sdk/service/tags.py | 70 +- databricks/sdk/service/vectorsearch.py | 456 +---- databricks/sdk/service/workspace.py | 929 +--------- databricks/sdk/version.py | 2 +- docs/dbdataclasses/catalog.rst | 7 - docs/workspace/domains/domains.rst | 3 +- docs/workspace/pipelines/pipelines.rst | 6 +- 48 files changed, 2223 insertions(+), 12928 deletions(-) create mode 100644 databricks/sdk/service/databricks.py create mode 100644 databricks/sdk/service/google.py diff --git a/.codegen/_last_sha b/.codegen/_last_sha index e44f2b9eb..6edd38c1a 100644 --- a/.codegen/_last_sha +++ b/.codegen/_last_sha @@ -1 +1 @@ -d4a68ff2811115e3aeb9d7e148ff9b4efb6e2a15 \ No newline at end of file +e3de5c8d1fe0388abbe5f874c4bd7ff9756d3756 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d703535e0..2da1fba60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,5 @@ # Version changelog -## Release v0.137.0 (2026-09-09) - -### API Changes -* Add `purge_feature_entities()` method for [w.feature_engineering](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/ml/feature_engineering.html) workspace-level service. -* Add `deny` field for `databricks.sdk.service.catalog.PolicyInfo`. -* Add `budget_policy_id` and `tags` fields for `databricks.sdk.service.ml.IngestionConfig`. -* Add `budget_policy_id` and `tags` fields for `databricks.sdk.service.ml.MaterializedFeature`. -* Add `policy_type_deny` enum value for `databricks.sdk.service.catalog.PolicyType`. - ## Release v0.136.0 (2026-09-07) ### API Changes diff --git a/databricks/sdk/__init__.py b/databricks/sdk/__init__.py index 7e0ae3b6a..59465c368 100644 --- a/databricks/sdk/__init__.py +++ b/databricks/sdk/__init__.py @@ -20,12 +20,14 @@ from databricks.sdk.service import compute as pkg_compute from databricks.sdk.service import dashboards as pkg_dashboards from databricks.sdk.service import database as pkg_database +from databricks.sdk.service import databricks as pkg_databricks from databricks.sdk.service import dataclassification as pkg_dataclassification from databricks.sdk.service import dataquality as pkg_dataquality from databricks.sdk.service import disasterrecovery as pkg_disasterrecovery from databricks.sdk.service import domains as pkg_domains from databricks.sdk.service import environments as pkg_environments from databricks.sdk.service import files as pkg_files +from databricks.sdk.service import google as pkg_google from databricks.sdk.service import iam as pkg_iam from databricks.sdk.service import iamv2 as pkg_iamv2 from databricks.sdk.service import jobs as pkg_jobs @@ -210,7 +212,6 @@ from databricks.sdk.service.iam import ServicePrincipalsV2API from databricks.sdk.service.iam import AccountServicePrincipalsV2API from databricks.sdk.service.serving import ServingEndpointsAPI -from databricks.sdk.service.serving import ServingEndpointsDataPlaneAPI from databricks.sdk.service.settings import SettingsAPI from databricks.sdk.service.settings import AccountSettingsAPI from databricks.sdk.service.settingsv2 import AccountSettingsV2API @@ -361,7 +362,6 @@ def __init__( ) self._config = config.copy() self._api_client = client.ApiClient(self._config) - serving_endpoints = ServingEndpointsExt(self._api_client) self._access_control = pkg_iam.AccessControlAPI(self._api_client) self._account_access_control_proxy = pkg_iam.AccountAccessControlProxyAPI(self._api_client) self._agent_bricks = pkg_agentbricks.AgentBricksAPI(self._api_client) @@ -471,13 +471,7 @@ def __init__( self._secrets_uc = pkg_catalog.SecretsUcAPI(self._api_client) self._service_principal_secrets_proxy = pkg_oauth2.ServicePrincipalSecretsProxyAPI(self._api_client) self._service_principals_v2 = pkg_iam.ServicePrincipalsV2API(self._api_client) - self._serving_endpoints = serving_endpoints - serving_endpoints_data_plane_token_source = DataPlaneTokenSource( - self._config.host, self._config.oauth_token, self._config.disable_async_token_refresh - ) - self._serving_endpoints_data_plane = pkg_serving.ServingEndpointsDataPlaneAPI( - self._api_client, serving_endpoints, serving_endpoints_data_plane_token_source - ) + self._serving_endpoints = ServingEndpointsExt(self._api_client) self._settings = pkg_settings.SettingsAPI(self._api_client) self._shares = pkg_sharing.SharesAPI(self._api_client) self._statement_execution = pkg_sql.StatementExecutionAPI(self._api_client) @@ -524,667 +518,566 @@ def dbutils(self) -> dbutils.RemoteDbUtils: @property def access_control(self) -> pkg_iam.AccessControlAPI: - """Rule based Access Control for Databricks Resources.""" return self._access_control @property def account_access_control_proxy(self) -> pkg_iam.AccountAccessControlProxyAPI: - """These APIs manage access rules on resources in an account.""" return self._account_access_control_proxy @property def agent_bricks(self) -> pkg_agentbricks.AgentBricksAPI: - """The Custom LLMs service manages state and powers the UI for the Custom LLM product.""" + """See http://go/protostyleguide/services.""" return self._agent_bricks @property def ai_functions(self) -> pkg_aifunctions.AiFunctionsAPI: - """Transform and enrich data with AI on Databricks.""" return self._ai_functions @property def ai_gateway(self) -> pkg_catalog.AiGatewayAPI: - """Govern AI workloads in Unity Catalog.""" + """See http://go/protostyleguide/services.""" return self._ai_gateway @property def ai_search(self) -> pkg_aisearch.AiSearchAPI: - """**AI Search Endpoint**: Represents the compute resources to host AI Search indexes.""" + """Customer-facing AI Search index control plane RPCs.""" return self._ai_search @property def alerts(self) -> pkg_sql.AlertsAPI: - """The alerts API can be used to perform CRUD operations on alerts.""" return self._alerts @property def alerts_legacy(self) -> pkg_sql.AlertsLegacyAPI: - """The alerts API can be used to perform CRUD operations on alerts.""" return self._alerts_legacy @property def alerts_v2(self) -> pkg_sql.AlertsV2API: - """New version of SQL Alerts.""" return self._alerts_v2 @property def apps(self) -> pkg_apps.AppsAPI: - """Apps run directly on a customer's Databricks instance, integrate with their data, use and extend Databricks services, and enable users to interact through single sign-on.""" + """TODO(LA-129): migrate `databricks.openapi.method` to `google.api.field_behavior` once it's supported.""" return self._apps @property def apps_settings(self) -> pkg_apps.AppsSettingsAPI: - """Apps Settings manage the settings for the Apps service on a customer's Databricks instance.""" + """TODO(LA-129): migrate `databricks.openapi.method` to `google.api.field_behavior` once it's supported.""" return self._apps_settings @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 use these artifacts on compute configured with shared access mode.""" return self._artifact_allowlists @property def bundle_deployments(self) -> pkg_bundledeployments.BundleDeploymentsAPI: - """Service for managing bundle deployment metadata.""" + """See http://go/protostyleguide/services.""" return self._bundle_deployments @property def catalogs(self) -> pkg_catalog.CatalogsAPI: - """A catalog is the first layer of Unity Catalog’s three-level namespace.""" return self._catalogs @property def clean_room_asset_revisions(self) -> pkg_cleanrooms.CleanRoomAssetRevisionsAPI: - """Clean Room Asset Revisions denote new versions of uploaded assets (e.g.""" + """Public Clean Room Service APIs.""" return self._clean_room_asset_revisions @property def clean_room_assets(self) -> pkg_cleanrooms.CleanRoomAssetsAPI: - """Clean room assets are data and code objects — Tables, volumes, and notebooks that are shared with the clean room.""" + """Public Clean Room Service APIs.""" return self._clean_room_assets @property def clean_room_auto_approval_rules(self) -> pkg_cleanrooms.CleanRoomAutoApprovalRulesAPI: - """Clean room auto-approval rules automatically create an approval on your behalf when an asset (e.g.""" + """Public Clean Room Service APIs.""" return self._clean_room_auto_approval_rules @property def clean_room_task_runs(self) -> pkg_cleanrooms.CleanRoomTaskRunsAPI: - """Clean room task runs are the executions of notebooks and JAR analyses in a clean room.""" + """Public Clean Room Service APIs.""" return self._clean_room_task_runs @property def clean_rooms(self) -> pkg_cleanrooms.CleanRoomsAPI: - """A clean room uses Delta Sharing and serverless compute to provide a secure and privacy-protecting environment where multiple parties can work together on sensitive enterprise data without direct access to each other's data.""" + """Public Clean Room Service APIs.""" return self._clean_rooms @property def cluster_policies(self) -> pkg_compute.ClusterPoliciesAPI: - """You can use cluster policies to control users' ability to configure clusters based on a set of rules.""" return self._cluster_policies @property def clusters(self) -> ClustersExt: - """The Clusters API allows you to create, start, edit, list, terminate, and delete clusters.""" return self._clusters @property def command_execution(self) -> pkg_compute.CommandExecutionAPI: - """This API allows execution of Python, Scala, SQL, or R commands on running Databricks Clusters.""" return self._command_execution @property def connections(self) -> pkg_catalog.ConnectionsAPI: - """A connection represents an external data source for use within Databricks.""" return self._connections @property def consumer_fulfillments(self) -> pkg_marketplace.ConsumerFulfillmentsAPI: - """Fulfillments are entities that allow consumers to preview installations.""" + """Check Databricks Protobuf Style Guide (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about recommended Protobuf practices.""" return self._consumer_fulfillments @property def consumer_installations(self) -> pkg_marketplace.ConsumerInstallationsAPI: - """Installations are entities that allow consumers to interact with Databricks Marketplace listings.""" + """Check Databricks Protobuf Style Guide (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about recommended Protobuf practices.""" return self._consumer_installations @property def consumer_listings(self) -> pkg_marketplace.ConsumerListingsAPI: - """Listings are the core entities in the Marketplace.""" + """Check Databricks Protobuf Style Guide (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about recommended Protobuf practices.""" return self._consumer_listings @property def consumer_personalization_requests(self) -> pkg_marketplace.ConsumerPersonalizationRequestsAPI: - """Personalization Requests allow customers to interact with the individualized Marketplace listing flow.""" + """Check Databricks Protobuf Style Guide (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about recommended Protobuf practices.""" return self._consumer_personalization_requests @property def consumer_providers(self) -> pkg_marketplace.ConsumerProvidersAPI: - """Providers are the entities that publish listings to the Marketplace.""" + """Check Databricks Protobuf Style Guide (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about recommended Protobuf practices.""" return self._consumer_providers @property def credentials(self) -> pkg_catalog.CredentialsAPI: - """A credential represents an authentication and authorization mechanism for accessing services on your cloud tenant.""" return self._credentials @property def credentials_manager(self) -> pkg_settings.CredentialsManagerAPI: - """Credentials manager interacts with with Identity Providers to to perform token exchanges using stored credentials and refresh tokens.""" return self._credentials_manager @property def current_user(self) -> pkg_iam.CurrentUserAPI: - """This API allows retrieving information about currently authenticated user or service principal.""" return self._current_user @property def dashboard_widgets(self) -> pkg_sql.DashboardWidgetsAPI: - """This is an evolving API that facilitates the addition and removal of widgets from existing dashboards within the Databricks Workspace.""" return self._dashboard_widgets @property def dashboards(self) -> pkg_sql.DashboardsAPI: - """In general, there is little need to modify dashboards using the API.""" return self._dashboards @property def data_classification(self) -> pkg_dataclassification.DataClassificationAPI: - """Manage data classification for Unity Catalog catalogs.""" return self._data_classification @property def data_quality(self) -> pkg_dataquality.DataQualityAPI: - """Manage the data quality of Unity Catalog objects (currently support `schema` and `table`).""" return self._data_quality @property def data_sources(self) -> pkg_sql.DataSourcesAPI: - """This API is provided to assist you in making new query objects.""" return self._data_sources @property def database(self) -> pkg_database.DatabaseAPI: - """Database Instances provide access to a database via REST API or direct SQL.""" + """Front-door (customer facing) service for Brickstore.""" return self._database @property def dbfs(self) -> DbfsExt: - """DBFS API makes it simple to interact with various data sources without having to include a users credentials every time to read a file.""" + """This service allows users to interact with the Databricks File System (DBFS), which is a distributed file system layer on top of S3.""" return self._dbfs @property def dbsql_permissions(self) -> pkg_sql.DbsqlPermissionsAPI: - """The SQL Permissions API is similar to the endpoints of the :method:permissions/set.""" return self._dbsql_permissions @property def domains(self) -> pkg_domains.DomainsAPI: - """Manage domains for organizing and discovering data assets.""" return self._domains @property def entity_tag_assignments(self) -> pkg_catalog.EntityTagAssignmentsAPI: - """Tags are attributes that include keys and optional values that you can use to organize and categorize entities in Unity Catalog.""" return self._entity_tag_assignments @property def environments(self) -> pkg_environments.EnvironmentsAPI: - """APIs to manage environment resources.""" + """Service for managing environment resources.""" return self._environments @property def experiments(self) -> pkg_ml.ExperimentsAPI: - """Experiments are the primary unit of organization in MLflow; all MLflow runs belong to an experiment.""" return self._experiments @property def external_lineage(self) -> pkg_catalog.ExternalLineageAPI: - """External Lineage APIs enable defining and managing lineage relationships between Databricks objects and external systems.""" return self._external_lineage @property def external_locations(self) -> pkg_catalog.ExternalLocationsAPI: - """An external location is an object that combines a cloud storage path with a storage credential that authorizes access to the cloud storage path.""" return self._external_locations @property def external_metadata(self) -> pkg_catalog.ExternalMetadataAPI: - """External Metadata objects enable customers to register and manage metadata about external systems within Unity Catalog.""" return self._external_metadata @property def feature_engineering(self) -> pkg_ml.FeatureEngineeringAPI: - """[description].""" return self._feature_engineering @property def feature_store(self) -> pkg_ml.FeatureStoreAPI: - """A feature store is a centralized repository that enables data scientists to find and share features.""" return self._feature_store @property def forecasting(self) -> pkg_ml.ForecastingAPI: - """The Forecasting API allows you to create and get serverless forecasting experiments.""" return self._forecasting @property def functions(self) -> pkg_catalog.FunctionsAPI: - """Functions implement User-Defined Functions (UDFs) in Unity Catalog.""" return self._functions @property def genie(self) -> pkg_dashboards.GenieAPI: - """Genie provides a no-code experience for business users, powered by AI/BI.""" return self._genie @property def git_credentials(self) -> pkg_workspace.GitCredentialsAPI: - """Registers personal access token for Databricks to do operations on behalf of the user.""" return self._git_credentials @property def global_init_scripts(self) -> pkg_compute.GlobalInitScriptsAPI: - """The Global Init Scripts API enables Workspace administrators to configure global initialization scripts for their workspace.""" return self._global_init_scripts @property def grants(self) -> pkg_catalog.GrantsAPI: - """In Unity Catalog, data is secure by default.""" return self._grants @property def groups_v2(self) -> pkg_iam.GroupsV2API: - """Groups simplify identity management, making it easier to assign access to Databricks workspace, data, and other securable objects.""" return self._groups_v2 @property def instance_pools(self) -> pkg_compute.InstancePoolsAPI: - """Instance Pools API are used to create, edit, delete and list instance pools by using ready-to-use cloud instances which reduces a cluster start and auto-scaling times.""" return self._instance_pools @property def instance_profiles(self) -> pkg_compute.InstanceProfilesAPI: - """The Instance Profiles API allows admins to add, list, and remove instance profiles that users can launch clusters with.""" return self._instance_profiles @property def ip_access_lists(self) -> pkg_settings.IpAccessListsAPI: - """IP Access List enables admins to configure IP access lists.""" return self._ip_access_lists @property def jobs(self) -> JobsExt: - """The Jobs API allows you to create, edit, and delete jobs.""" return self._jobs @property def knowledge_assistants(self) -> pkg_knowledgeassistants.KnowledgeAssistantsAPI: - """Manage Knowledge Assistants and related resources.""" return self._knowledge_assistants @property def lakeview(self) -> pkg_dashboards.LakeviewAPI: - """These APIs provide specific management operations for Lakeview dashboards.""" + """Lakeview API service provides end-users programmatic access to dashboards.""" return self._lakeview @property def lakeview_embedded(self) -> pkg_dashboards.LakeviewEmbeddedAPI: - """Token-based Lakeview APIs for embedding dashboards in external applications.""" + """Lakeview API service provides end-users programmatic access to dashboards.""" return self._lakeview_embedded @property def libraries(self) -> pkg_compute.LibrariesAPI: - """The Libraries API allows you to install and uninstall libraries and get the status of libraries on a cluster.""" return self._libraries @property def materialized_features(self) -> pkg_ml.MaterializedFeaturesAPI: - """Materialized Features are columns in tables and views that can be directly used as features to train and serve ML models.""" return self._materialized_features @property def metastores(self) -> pkg_catalog.MetastoresAPI: - """A metastore is the top-level container of objects in Unity Catalog.""" return self._metastores @property def model_registry(self) -> pkg_ml.ModelRegistryAPI: - """Note: This API reference documents APIs for the Workspace Model Registry.""" return self._model_registry @property def model_versions(self) -> pkg_catalog.ModelVersionsAPI: - """Databricks provides a hosted version of MLflow Model Registry in Unity Catalog.""" return self._model_versions @property def notification_destinations(self) -> pkg_settings.NotificationDestinationsAPI: - """The notification destinations API lets you programmatically manage a workspace's notification destinations.""" return self._notification_destinations @property def online_tables(self) -> pkg_catalog.OnlineTablesAPI: - """Online tables provide lower latency and higher QPS access to data from Delta tables.""" + """Front-door (customer facing) service for Brickstore.""" return self._online_tables @property def permission_migration(self) -> pkg_iam.PermissionMigrationAPI: - """APIs for migrating acl permissions, used only by the ucx tool: https://github.com/databrickslabs/ucx.""" return self._permission_migration @property def permissions(self) -> pkg_iam.PermissionsAPI: - """Permissions API are used to create read, write, edit, update and manage access for various users on different objects and endpoints.""" return self._permissions @property def pipelines(self) -> pkg_pipelines.PipelinesAPI: - """The Lakeflow Spark Declarative Pipelines API allows you to create, edit, delete, start, and view details about pipelines.""" return self._pipelines @property def policies(self) -> pkg_catalog.PoliciesAPI: - """Attribute-Based Access Control (ABAC) provides high leverage governance for enforcing compliance policies in Unity Catalog.""" return self._policies @property def policy_compliance_for_clusters(self) -> pkg_compute.PolicyComplianceForClustersAPI: - """The policy compliance APIs allow you to view and manage the policy compliance status of clusters in your workspace.""" return self._policy_compliance_for_clusters @property def policy_compliance_for_jobs(self) -> pkg_jobs.PolicyComplianceForJobsAPI: - """The compliance APIs allow you to view and manage the policy compliance status of jobs in your workspace.""" + """This proto is documentation only.""" return self._policy_compliance_for_jobs @property def policy_families(self) -> pkg_compute.PolicyFamiliesAPI: - """View available policy families.""" return self._policy_families @property def postgres(self) -> pkg_postgres.PostgresAPI: - """Use the Postgres API to create and manage Lakebase Autoscaling Postgres infrastructure, including projects, branches, compute endpoints, and roles.""" + """Front-door (customer facing) service for Brickstore.""" return self._postgres @property def provider_exchange_filters(self) -> pkg_marketplace.ProviderExchangeFiltersAPI: - """Marketplace exchanges filters curate which groups can access an exchange.""" + """Check Databricks Protobuf Style Guide (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about recommended Protobuf practices.""" return self._provider_exchange_filters @property def provider_exchanges(self) -> pkg_marketplace.ProviderExchangesAPI: - """Marketplace exchanges allow providers to share their listings with a curated set of customers.""" + """Check Databricks Protobuf Style Guide (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about recommended Protobuf practices.""" return self._provider_exchanges @property def provider_files(self) -> pkg_marketplace.ProviderFilesAPI: - """Marketplace offers a set of file APIs for various purposes such as preview notebooks and provider icons.""" + """Check Databricks Protobuf Style Guide (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about recommended Protobuf practices.""" return self._provider_files @property def provider_listings(self) -> pkg_marketplace.ProviderListingsAPI: - """Listings are the core entities in the Marketplace.""" + """Check Databricks Protobuf Style Guide (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about recommended Protobuf practices.""" return self._provider_listings @property def provider_personalization_requests(self) -> pkg_marketplace.ProviderPersonalizationRequestsAPI: - """Personalization requests are an alternate to instantly available listings.""" + """Check Databricks Protobuf Style Guide (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about recommended Protobuf practices.""" return self._provider_personalization_requests @property def provider_provider_analytics_dashboards(self) -> pkg_marketplace.ProviderProviderAnalyticsDashboardsAPI: - """Manage templated analytics solution for providers.""" + """Check Databricks Protobuf Style Guide (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about recommended Protobuf practices.""" return self._provider_provider_analytics_dashboards @property def provider_providers(self) -> pkg_marketplace.ProviderProvidersAPI: - """Providers are entities that manage assets in Marketplace.""" + """Check Databricks Protobuf Style Guide (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about recommended Protobuf practices.""" return self._provider_providers @property def providers(self) -> pkg_sharing.ProvidersAPI: - """A data provider is an object representing the organization in the real world who shares the data.""" return self._providers @property def quality_monitor_v2(self) -> pkg_qualitymonitorv2.QualityMonitorV2API: - """Deprecated: Please use the Data Quality Monitoring API instead (REST: /api/data-quality/v1/monitors).""" return self._quality_monitor_v2 @property def quality_monitors(self) -> pkg_catalog.QualityMonitorsAPI: - """Deprecated: Please use the Data Quality Monitors API instead (REST: /api/data-quality/v1/monitors), which manages both Data Profiling and Anomaly Detection.""" return self._quality_monitors @property def queries(self) -> pkg_sql.QueriesAPI: - """The queries API can be used to perform CRUD operations on queries.""" return self._queries @property def queries_legacy(self) -> pkg_sql.QueriesLegacyAPI: - """These endpoints are used for CRUD operations on query definitions.""" return self._queries_legacy @property def query_history(self) -> pkg_sql.QueryHistoryAPI: - """A service responsible for storing and retrieving the list of queries run against SQL endpoints and serverless compute.""" + """History service API.""" return self._query_history @property def query_visualizations(self) -> pkg_sql.QueryVisualizationsAPI: - """This is an evolving API that facilitates the addition and removal of visualizations from existing queries in the Databricks Workspace.""" return self._query_visualizations @property def query_visualizations_legacy(self) -> pkg_sql.QueryVisualizationsLegacyAPI: - """This is an evolving API that facilitates the addition and removal of visualizations from existing queries within the Databricks Workspace.""" return self._query_visualizations_legacy @property def recipient_activation(self) -> pkg_sharing.RecipientActivationAPI: - """The Recipient Activation API is only applicable in the open sharing model where the recipient object has the authentication type of `TOKEN`.""" return self._recipient_activation @property def recipient_federation_policies(self) -> pkg_sharing.RecipientFederationPoliciesAPI: - """The Recipient Federation Policies APIs are only applicable in the open sharing model where the recipient object has the authentication type of `OIDC_RECIPIENT`, enabling data sharing from Databricks to non-Databricks recipients.""" return self._recipient_federation_policies @property def recipients(self) -> pkg_sharing.RecipientsAPI: - """A recipient is an object you create using :method:recipients/create to represent an organization which you want to allow access shares.""" return self._recipients @property def redash_config(self) -> pkg_sql.RedashConfigAPI: - """Redash V2 service for workspace configurations (internal).""" return self._redash_config @property def registered_models(self) -> pkg_catalog.RegisteredModelsAPI: - """Databricks provides a hosted version of MLflow Model Registry in Unity Catalog.""" return self._registered_models @property def repos(self) -> pkg_workspace.ReposAPI: - """The Repos API allows users to manage their git repos.""" return self._repos @property def resource_quotas(self) -> pkg_catalog.ResourceQuotasAPI: - """Unity Catalog enforces resource quotas on all securable objects, which limits the number of resources that can be created.""" return self._resource_quotas @property def rfa(self) -> pkg_catalog.RfaAPI: - """Request for Access enables users to request access for Unity Catalog securables.""" + """See http://go/protostyleguide/services.""" return self._rfa @property def sandbox(self) -> pkg_sandbox.SandboxAPI: - """Create, manage, and control the lifecycle of sandboxes -- isolated, pre-configured, low-latency Serverless compute environments for running code.""" + """See http://go/protostyleguide/services.""" return self._sandbox @property def schemas(self) -> pkg_catalog.SchemasAPI: - """A schema (also called a database) is the second layer of Unity Catalog’s three-level namespace.""" return self._schemas @property def secrets(self) -> pkg_workspace.SecretsAPI: - """The Secrets API allows you to manage secrets, secret scopes, and access permissions.""" return self._secrets @property def secrets_uc(self) -> pkg_catalog.SecretsUcAPI: - """A secret is a Unity Catalog securable object that stores sensitive credential data (such as passwords, tokens, and keys) within a three-level namespace (**catalog_name.schema_name.secret_name**).""" + """See http://go/protostyleguide/services.""" return self._secrets_uc @property def service_principal_secrets_proxy(self) -> pkg_oauth2.ServicePrincipalSecretsProxyAPI: - """These APIs enable administrators to manage service principal secrets at the workspace level.""" return self._service_principal_secrets_proxy @property def service_principals_v2(self) -> pkg_iam.ServicePrincipalsV2API: - """Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms.""" return self._service_principals_v2 @property def serving_endpoints(self) -> ServingEndpointsExt: - """The Serving Endpoints API allows you to create, update, and delete model serving endpoints.""" return self._serving_endpoints - @property - def serving_endpoints_data_plane(self) -> pkg_serving.ServingEndpointsDataPlaneAPI: - """Serving endpoints DataPlane provides a set of operations to interact with data plane endpoints for Serving endpoints service.""" - return self._serving_endpoints_data_plane - @property def settings(self) -> pkg_settings.SettingsAPI: - """Workspace Settings API allows users to manage settings at the workspace level.""" return self._settings @property def shares(self) -> pkg_sharing.SharesAPI: - """A share is a container instantiated with :method:shares/create.""" return self._shares @property def statement_execution(self) -> pkg_sql.StatementExecutionAPI: - """The Databricks SQL Statement Execution API can be used to execute SQL statements on a SQL warehouse and fetch the result.""" return self._statement_execution @property def storage_credentials(self) -> pkg_catalog.StorageCredentialsAPI: - """A storage credential represents an authentication and authorization mechanism for accessing data stored on your cloud tenant.""" return self._storage_credentials @property def supervisor_agents(self) -> pkg_supervisoragents.SupervisorAgentsAPI: - """Manage Supervisor Agents and related resources.""" return self._supervisor_agents @property def system_schemas(self) -> pkg_catalog.SystemSchemasAPI: - """A system schema is a schema that lives within the system catalog.""" return self._system_schemas @property def table_constraints(self) -> pkg_catalog.TableConstraintsAPI: - """Primary key and foreign key constraints encode relationships between fields in tables.""" return self._table_constraints @property def tables(self) -> pkg_catalog.TablesAPI: - """A table resides in the third layer of Unity Catalog’s three-level namespace.""" return self._tables @property def tag_policies(self) -> pkg_tags.TagPoliciesAPI: - """The Tag Policy API allows you to manage policies for governed tags in Databricks.""" return self._tag_policies @property def temporary_path_credentials(self) -> pkg_catalog.TemporaryPathCredentialsAPI: - """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 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 are short-lived, downscoped credentials used to access cloud storage locations where volume data is stored in Databricks.""" return self._temporary_volume_credentials @property def token_management(self) -> pkg_settings.TokenManagementAPI: - """Enables administrators to get all tokens and delete tokens for other users.""" return self._token_management @property def tokens(self) -> pkg_settings.TokensAPI: - """The Token API allows you to create, list, and revoke tokens that can be used to authenticate and access Databricks REST APIs.""" return self._tokens @property def users_v2(self) -> pkg_iam.UsersV2API: - """User identities recognized by Databricks and represented by email addresses.""" return self._users_v2 @property def vector_search_endpoints(self) -> pkg_vectorsearch.VectorSearchEndpointsAPI: - """**Endpoint**: Represents the compute resources to host AI Search indexes.""" return self._vector_search_endpoints @property def vector_search_indexes(self) -> pkg_vectorsearch.VectorSearchIndexesAPI: - """**Index**: An efficient representation of your embedding vectors that supports real-time and efficient approximate nearest neighbor (ANN) search queries.""" return self._vector_search_indexes @property def volumes(self) -> pkg_catalog.VolumesAPI: - """Volumes are a Unity Catalog (UC) capability for accessing, storing, governing, organizing, and processing files.""" return self._volumes @property def warehouses(self) -> pkg_sql.WarehousesAPI: - """A SQL warehouse is a compute resource that lets you run SQL commands on data objects within Databricks SQL.""" return self._warehouses @property def workspace(self) -> WorkspaceExt: - """The Workspace API allows you to list, import, export, and delete workspace objects such as notebooks, files, folders, and dashboards.""" return self._workspace @property def workspace_bindings(self) -> pkg_catalog.WorkspaceBindingsAPI: - """A securable in Databricks can be configured as __OPEN__ or __ISOLATED__.""" return self._workspace_bindings @property def workspace_conf(self) -> pkg_settings.WorkspaceConfAPI: - """This API allows updating known workspace settings for advanced users.""" return self._workspace_conf @property def workspace_entity_tag_assignments(self) -> pkg_tags.WorkspaceEntityTagAssignmentsAPI: - """Manage tag assignments on workspace-scoped objects.""" return self._workspace_entity_tag_assignments @property def workspace_iam_v2(self) -> pkg_iamv2.WorkspaceIamV2API: - """These APIs are used to manage identities and the workspace access of these identities in .""" + """Handles group management operations for an account.""" return self._workspace_iam_v2 @property def workspace_settings_v2(self) -> pkg_settingsv2.WorkspaceSettingsV2API: - """APIs to manage workspace level settings.""" return self._workspace_settings_v2 @property @@ -1343,177 +1236,148 @@ def api_client(self) -> client.ApiClient: @property def access_control(self) -> pkg_iam.AccountAccessControlAPI: - """These APIs manage access rules on resources in an account.""" return self._access_control @property def billable_usage(self) -> pkg_billing.BillableUsageAPI: - """This API allows you to download billable usage logs for the specified account and date range.""" return self._billable_usage @property def budget_policy(self) -> pkg_billing.BudgetPolicyAPI: - """A service serves REST API about Budget policies.""" + """See http://go/protostyleguide/services.""" return self._budget_policy @property def budgets(self) -> pkg_billing.BudgetsAPI: - """These APIs manage budget configurations for this account.""" + """* Service for BUI APIs.""" return self._budgets @property def credentials(self) -> pkg_provisioning.CredentialsAPI: - """These APIs manage credential configurations for this workspace.""" return self._credentials @property def custom_app_integration(self) -> pkg_oauth2.CustomAppIntegrationAPI: - """These APIs enable administrators to manage custom OAuth app integrations, which is required for adding/using Custom OAuth App Integration like Tableau Cloud for Databricks in AWS cloud.""" return self._custom_app_integration @property def disaster_recovery(self) -> pkg_disasterrecovery.DisasterRecoveryAPI: - """Manage disaster recovery configurations and execute failover operations.""" + """Service for managing failover groups for disaster recovery.""" return self._disaster_recovery @property def encryption_keys(self) -> pkg_provisioning.EncryptionKeysAPI: - """These APIs manage encryption key configurations for this workspace (optional).""" return self._encryption_keys @property def endpoints(self) -> pkg_networking.EndpointsAPI: - """These APIs manage endpoint configurations for this account.""" return self._endpoints @property def federation_policy(self) -> pkg_oauth2.AccountFederationPolicyAPI: - """These APIs manage account federation policies.""" return self._federation_policy @property def groups_v2(self) -> pkg_iam.AccountGroupsV2API: - """Groups simplify identity management, making it easier to assign access to Databricks account, data, and other securable objects.""" return self._groups_v2 @property def iam_v2(self) -> pkg_iamv2.AccountIamV2API: - """These APIs are used to manage identities and the workspace access of these identities in .""" + """Handles group management operations for an account.""" return self._iam_v2 @property def ip_access_lists(self) -> pkg_settings.AccountIpAccessListsAPI: - """The Accounts IP Access List API enables account admins to configure IP access lists for access to the account console.""" return self._ip_access_lists @property def log_delivery(self) -> pkg_billing.LogDeliveryAPI: - """These APIs manage log delivery configurations for this account.""" + """* Service for BUI APIs.""" return self._log_delivery @property def metastore_assignments(self) -> pkg_catalog.AccountMetastoreAssignmentsAPI: - """These APIs manage metastore assignments to a workspace.""" return self._metastore_assignments @property def metastores(self) -> pkg_catalog.AccountMetastoresAPI: - """These APIs manage Unity Catalog metastores for an account.""" return self._metastores @property def network_connectivity(self) -> pkg_settings.NetworkConnectivityAPI: - """These APIs provide configurations for the network connectivity of your workspaces for serverless compute resources.""" return self._network_connectivity @property def network_policies(self) -> pkg_settings.NetworkPoliciesAPI: - """These APIs manage network policies for this account.""" return self._network_policies @property def networks(self) -> pkg_provisioning.NetworksAPI: - """These APIs manage network configurations for customer-managed VPCs (optional).""" return self._networks @property def o_auth_published_apps(self) -> pkg_oauth2.OAuthPublishedAppsAPI: - """These APIs enable administrators to view all the available published OAuth applications in Databricks.""" return self._o_auth_published_apps @property def private_access(self) -> pkg_provisioning.PrivateAccessAPI: - """These APIs manage private access settings for this account.""" return self._private_access @property def published_app_integration(self) -> pkg_oauth2.PublishedAppIntegrationAPI: - """These APIs enable administrators to manage published OAuth app integrations, which is required for adding/using Published OAuth App Integration like Tableau Desktop for Databricks in AWS cloud.""" return self._published_app_integration @property def service_principal_federation_policy(self) -> pkg_oauth2.ServicePrincipalFederationPolicyAPI: - """These APIs manage service principal federation policies.""" return self._service_principal_federation_policy @property def service_principal_secrets(self) -> pkg_oauth2.ServicePrincipalSecretsAPI: - """These APIs enable administrators to manage service principal secrets.""" return self._service_principal_secrets @property def service_principals_v2(self) -> pkg_iam.AccountServicePrincipalsV2API: - """Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms.""" return self._service_principals_v2 @property def settings(self) -> pkg_settings.AccountSettingsAPI: - """Accounts Settings API allows users to manage settings at the account level.""" return self._settings @property def settings_v2(self) -> pkg_settingsv2.AccountSettingsV2API: - """APIs to manage account level settings.""" return self._settings_v2 @property def storage(self) -> pkg_provisioning.StorageAPI: - """These APIs manage storage configurations for this workspace.""" return self._storage @property def storage_credentials(self) -> pkg_catalog.AccountStorageCredentialsAPI: - """These APIs manage storage credentials for a particular metastore.""" return self._storage_credentials @property def usage_dashboards(self) -> pkg_billing.UsageDashboardsAPI: - """These APIs manage usage dashboards for this account.""" + """* Service for BUI APIs.""" return self._usage_dashboards @property def users_v2(self) -> pkg_iam.AccountUsersV2API: - """User identities recognized by Databricks and represented by email addresses.""" return self._users_v2 @property def vpc_endpoints(self) -> pkg_provisioning.VpcEndpointsAPI: - """These APIs manage VPC endpoint configurations for this account.""" return self._vpc_endpoints @property def workspace_assignment(self) -> pkg_iam.WorkspaceAssignmentAPI: - """The Workspace Permission Assignment API allows you to manage workspace permissions for principals in your account.""" return self._workspace_assignment @property def workspace_network_configuration(self) -> pkg_settings.WorkspaceNetworkConfigurationAPI: - """These APIs allow configuration of network settings for Databricks workspaces by selecting which network policy to associate with the workspace.""" return self._workspace_network_configuration @property def workspaces(self) -> pkg_provisioning.WorkspacesAPI: - """These APIs manage workspaces for this account.""" return self._workspaces @property diff --git a/databricks/sdk/service/agentbricks.py b/databricks/sdk/service/agentbricks.py index 32024f456..efac94726 100644 --- a/databricks/sdk/service/agentbricks.py +++ b/databricks/sdk/service/agentbricks.py @@ -200,7 +200,7 @@ def from_dict(cls, d: Dict[str, Any]) -> Table: class AgentBricksAPI: - """The Custom LLMs service manages state and powers the UI for the Custom LLM product.""" + """See http://go/protostyleguide/services.""" def __init__(self, api_client): self._api = api_client @@ -213,17 +213,13 @@ def cancel_optimize(self, id: str): """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id - self._api.do("POST", f"/api/2.0/custom-llms/{id}/optimize/cancel", body=body, headers=headers) + self._api.do("POST", f"/api/2.0/custom-llms/{id}/optimize/cancel", headers=headers) def create_custom_llm( self, @@ -264,10 +260,7 @@ def create_custom_llm( body["instructions"] = instructions if name is not None: body["name"] = name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -285,9 +278,7 @@ def delete_custom_llm(self, id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -304,9 +295,7 @@ def get_custom_llm(self, id: str) -> CustomLlm: :returns: :class:`CustomLlm` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -324,17 +313,13 @@ def start_optimize(self, id: str) -> CustomLlm: :returns: :class:`CustomLlm` """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} 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/custom-llms/{id}/optimize", body=body, headers=headers) + res = self._api.do("POST", f"/api/2.0/custom-llms/{id}/optimize", headers=headers) return CustomLlm.from_dict(res) def update_custom_llm(self, id: str, custom_llm: CustomLlm, update_mask: str) -> CustomLlm: @@ -348,16 +333,6 @@ def update_custom_llm(self, id: str, custom_llm: CustomLlm, update_mask: str) -> The list of the CustomLlm fields to update. These should correspond to the values (or lack thereof) present in ``custom_llm``. - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. - :returns: :class:`CustomLlm` """ @@ -366,10 +341,7 @@ def update_custom_llm(self, id: str, custom_llm: CustomLlm, update_mask: str) -> body["custom_llm"] = custom_llm.as_dict() if update_mask is not None: body["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/aifunctions.py b/databricks/sdk/service/aifunctions.py index 7c00d79d8..4ddacb96e 100644 --- a/databricks/sdk/service/aifunctions.py +++ b/databricks/sdk/service/aifunctions.py @@ -624,8 +624,6 @@ def from_dict(cls, d: Dict[str, Any]) -> AiParseDocumentResponseMetadata: class AiFunctionsAPI: - """Transform and enrich data with AI on Databricks.""" - def __init__(self, api_client): self._api = api_client @@ -654,10 +652,7 @@ def ai_classify( body["labels"] = labels if options is not None: body["options"] = options.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -691,10 +686,7 @@ def ai_extract(self, content: any, schema: any, *, options: Optional[AiExtractOp body["options"] = options.as_dict() if schema is not None: body["schema"] = schema - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -723,10 +715,7 @@ def ai_parse_document( body["content"] = content if options is not None: body["options"] = options.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/aisearch.py b/databricks/sdk/service/aisearch.py index 7c2ae59ed..1e56b72e4 100644 --- a/databricks/sdk/service/aisearch.py +++ b/databricks/sdk/service/aisearch.py @@ -1356,8 +1356,16 @@ def from_dict(cls, d: Dict[str, Any]) -> UpsertDataResponse: class AiSearchAPI: - """**AI Search Endpoint**: Represents the compute resources to host AI Search indexes. AIP-conformant - replacement for the legacy VectorSearchEndpoints API; functionally equivalent.""" + """Customer-facing AI Search index control plane RPCs. AIP-conformant front door for AI Search index + resources; server-side handlers delegate to the existing Vector Search index logic via field-by-field + translation. + + This service deliberately has NO ``(databricks.openapi.service)`` option. Its methods are grouped under + the single ``AISearch`` SDK tag (via the per-method ``tag: "AISearch"``), which is defined once in + service.proto's AISearchService. The Index resource is declared in that same ``AISearch`` tag's + ``resources`` block (alongside Endpoint) — declaring a second tag named ``AISearch`` here would make the + OpenAPI generator fail spec normalization with a duplicate- tag error when service.proto and indexes.proto + are combined into one spec.""" def __init__(self, api_client): self._api = api_client @@ -1383,10 +1391,7 @@ def create_endpoint(self, parent: str, endpoint: Endpoint, *, endpoint_id: Optio query = {} if endpoint_id is not None: query["endpoint_id"] = endpoint_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1417,10 +1422,7 @@ def create_index(self, parent: str, index: Index, *, index_id: Optional[str] = N query = {} if index_id is not None: query["index_id"] = index_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1439,9 +1441,7 @@ def delete_endpoint(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1459,9 +1459,7 @@ def delete_index(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1478,9 +1476,7 @@ def get_endpoint(self, name: str) -> Endpoint: :returns: :class:`Endpoint` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1499,9 +1495,7 @@ def get_index(self, name: str) -> Index: :returns: :class:`Index` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1532,9 +1526,7 @@ def list_endpoints( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1572,9 +1564,7 @@ def list_indexes( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1664,10 +1654,7 @@ def query_index( body["score_threshold"] = score_threshold if sort_columns is not None: body["sort_columns"] = [v for v in sort_columns] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1691,10 +1678,7 @@ def remove_data(self, name: str, primary_keys: List[str]) -> RemoveDataResponse: body = {} if primary_keys is not None: body["primary_keys"] = [v for v in primary_keys] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1724,10 +1708,7 @@ def scan_index( body["page_size"] = page_size if page_token is not None: body["page_token"] = page_token - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1747,17 +1728,13 @@ def sync_index(self, name: str) -> SyncIndexResponse: :returns: :class:`SyncIndexResponse` """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} 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/ai-search/{name}:sync", body=body, headers=headers) + res = self._api.do("POST", f"/api/2.0/ai-search/{name}:sync", headers=headers) return SyncIndexResponse.from_dict(res) def update_endpoint(self, name: str, endpoint: Endpoint, update_mask: FieldMask) -> Endpoint: @@ -1783,10 +1760,7 @@ def update_endpoint(self, name: str, endpoint: Endpoint, update_mask: FieldMask) query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1810,10 +1784,7 @@ def upsert_data(self, name: str, inputs_json: str) -> UpsertDataResponse: body = {} if inputs_json is not None: body["inputs_json"] = inputs_json - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/apps.py b/databricks/sdk/service/apps.py index b5bedd687..f283e530f 100644 --- a/databricks/sdk/service/apps.py +++ b/databricks/sdk/service/apps.py @@ -338,115 +338,6 @@ def from_dict(cls, d: Dict[str, Any]) -> App: ) -@dataclass -class AppAccessControlRequest: - group_name: Optional[str] = None - """name of the group""" - - permission_level: Optional[AppPermissionLevel] = None - - service_principal_name: Optional[str] = None - """application ID of a service principal""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the AppAccessControlRequest into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the AppAccessControlRequest into a shallow dictionary of its immediate attributes.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> AppAccessControlRequest: - """Deserializes the AppAccessControlRequest from a dictionary.""" - return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", AppPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class AppAccessControlResponse: - all_permissions: Optional[List[AppPermission]] = None - """All permissions.""" - - display_name: Optional[str] = None - """Display name of the user or service principal.""" - - group_name: Optional[str] = None - """name of the group""" - - service_principal_name: Optional[str] = None - """Name of the service principal.""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the AppAccessControlResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the AppAccessControlResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.all_permissions: - body["all_permissions"] = self.all_permissions - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> AppAccessControlResponse: - """Deserializes the AppAccessControlResponse from a dictionary.""" - return cls( - all_permissions=_repeated_dict(d, "all_permissions", AppPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - @dataclass class AppDeployment: command: Optional[List[str]] = None @@ -973,125 +864,6 @@ class AppManifestAppResourceUcSecurableSpecUcSecurableType(Enum): VOLUME = "VOLUME" -@dataclass -class AppPermission: - inherited: Optional[bool] = None - - inherited_from_object: Optional[List[str]] = None - - permission_level: Optional[AppPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the AppPermission into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the AppPermission into a shallow dictionary of its immediate attributes.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> AppPermission: - """Deserializes the AppPermission from a dictionary.""" - return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", AppPermissionLevel), - ) - - -class AppPermissionLevel(Enum): - """Permission level""" - - CAN_MANAGE = "CAN_MANAGE" - CAN_USE = "CAN_USE" - - -@dataclass -class AppPermissions: - access_control_list: Optional[List[AppAccessControlResponse]] = None - - object_id: Optional[str] = None - - object_type: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the AppPermissions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - def as_shallow_dict(self) -> dict: - """Serializes the AppPermissions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.access_control_list: - body["access_control_list"] = self.access_control_list - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> AppPermissions: - """Deserializes the AppPermissions from a dictionary.""" - return cls( - access_control_list=_repeated_dict(d, "access_control_list", AppAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), - ) - - -@dataclass -class AppPermissionsDescription: - description: Optional[str] = None - - permission_level: Optional[AppPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the AppPermissionsDescription into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the AppPermissionsDescription into a shallow dictionary of its immediate attributes.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> AppPermissionsDescription: - """Deserializes the AppPermissionsDescription from a dictionary.""" - return cls( - description=d.get("description", None), permission_level=_enum(d, "permission_level", AppPermissionLevel) - ) - - @dataclass class AppResource: name: str @@ -2052,7 +1824,7 @@ class EnvVar: """The value for the environment variable.""" value_from: Optional[str] = None - """The name of an external Databricks resource that contains the value, such as a secret or a + """The name of an external resource that contains the value, such as a secret or a database table.""" def as_dict(self) -> dict: @@ -2169,31 +1941,6 @@ class ErrorCode(Enum): WORKSPACE_TEMPORARILY_UNAVAILABLE = "WORKSPACE_TEMPORARILY_UNAVAILABLE" -@dataclass -class GetAppPermissionLevelsResponse: - permission_levels: Optional[List[AppPermissionsDescription]] = None - """Specific permission levels""" - - def as_dict(self) -> dict: - """Serializes the GetAppPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GetAppPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.permission_levels: - body["permission_levels"] = self.permission_levels - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GetAppPermissionLevelsResponse: - """Deserializes the GetAppPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", AppPermissionsDescription)) - - @dataclass class GitRepository: """Git repository configuration specifying the location of the repository.""" @@ -2886,8 +2633,7 @@ def from_dict(cls, d: Dict[str, Any]) -> UnityCatalog: class AppsAPI: - """Apps run directly on a customer's Databricks instance, integrate with their data, use and extend - Databricks services, and enable users to interact through single sign-on.""" + """TODO(LA-129): migrate ``databricks.openapi.method`` to ``google.api.field_behavior`` once it's supported""" def __init__(self, api_client): self._api = api_client @@ -3039,10 +2785,7 @@ def create(self, app: App, *, no_compute: Optional[bool] = None) -> Wait[App]: query = {} if no_compute is not None: query["no_compute"] = no_compute - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3064,10 +2807,7 @@ def create_space(self, space: Space) -> CreateSpaceOperation: body = space.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3083,15 +2823,6 @@ def create_update(self, app_name: str, update_mask: str, *, app: Optional[App] = :param app_name: str :param update_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :param app: :class:`App` (optional) :returns: @@ -3104,10 +2835,7 @@ def create_update(self, app_name: str, update_mask: str, *, app: Optional[App] = body["app"] = app.as_dict() if update_mask is not None: body["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3130,9 +2858,7 @@ def delete(self, name: str) -> App: :returns: :class:`App` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3150,9 +2876,7 @@ def delete_app_thumbnail(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3169,9 +2893,7 @@ def delete_space(self, name: str) -> DeleteSpaceOperation: :returns: :class:`Operation` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3196,10 +2918,7 @@ def deploy(self, app_name: str, app_deployment: AppDeployment) -> Wait[AppDeploy body = app_deployment.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3227,9 +2946,7 @@ def get(self, name: str) -> App: :returns: :class:`App` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3249,9 +2966,7 @@ def get_deployment(self, app_name: str, deployment_id: str) -> AppDeployment: :returns: :class:`AppDeployment` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3260,46 +2975,6 @@ def get_deployment(self, app_name: str, deployment_id: str) -> AppDeployment: res = self._api.do("GET", f"/api/2.0/apps/{app_name}/deployments/{deployment_id}", headers=headers) return AppDeployment.from_dict(res) - def get_permission_levels(self, app_name: str) -> GetAppPermissionLevelsResponse: - """Gets the permission levels that a user can have on an object. - - :param app_name: str - The app for which to get or manage permissions. - - :returns: :class:`GetAppPermissionLevelsResponse` - """ - - 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/permissions/apps/{app_name}/permissionLevels", headers=headers) - return GetAppPermissionLevelsResponse.from_dict(res) - - def get_permissions(self, app_name: str) -> AppPermissions: - """Gets the permissions of an app. Apps can inherit permissions from their root object. - - :param app_name: str - The app for which to get or manage permissions. - - :returns: :class:`AppPermissions` - """ - - 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/permissions/apps/{app_name}", headers=headers) - return AppPermissions.from_dict(res) - def get_space(self, name: str) -> Space: """Retrieves information for the app space with the supplied name. @@ -3309,9 +2984,7 @@ def get_space(self, name: str) -> Space: :returns: :class:`Space` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3329,9 +3002,7 @@ def get_space_operation(self, name: str) -> Operation: :returns: :class:`Operation` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3349,9 +3020,7 @@ def get_update(self, app_name: str) -> AppUpdate: :returns: :class:`AppUpdate` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3382,9 +3051,7 @@ def list( query["page_token"] = page_token if space is not None: query["space"] = space - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3419,9 +3086,7 @@ def list_deployments( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3452,9 +3117,7 @@ def list_spaces(self, *, page_size: Optional[int] = None, page_token: Optional[s query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3469,34 +3132,6 @@ def list_spaces(self, *, page_size: Optional[int] = None, page_token: Optional[s return query["page_token"] = json["next_page_token"] - def set_permissions( - self, app_name: str, *, access_control_list: Optional[List[AppAccessControlRequest]] = None - ) -> AppPermissions: - """Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct - permissions if none are specified. Objects can inherit permissions from their root object. - - :param app_name: str - The app for which to get or manage permissions. - :param access_control_list: List[:class:`AppAccessControlRequest`] (optional) - - :returns: :class:`AppPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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("PUT", f"/api/2.0/permissions/apps/{app_name}", body=body, headers=headers) - return AppPermissions.from_dict(res) - def start(self, name: str) -> Wait[App]: """Start the last active deployment of the app in the workspace. @@ -3508,18 +3143,14 @@ def start(self, name: str) -> Wait[App]: See :method:wait_get_app_active for more details. """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id - op_response = self._api.do("POST", f"/api/2.0/apps/{name}/start", body=body, headers=headers) - return Wait(self.wait_get_app_active, response=App.from_dict(op_response), name=op_response["name"]) + op_response = self._api.do("POST", f"/api/2.0/apps/{name}/start", headers=headers) + return Wait(self.wait_get_app_active, response=App.from_dict(op_response), name=name) def start_and_wait(self, name: str, timeout=timedelta(minutes=20)) -> App: return self.start(name=name).result(timeout=timeout) @@ -3535,18 +3166,14 @@ def stop(self, name: str) -> Wait[App]: See :method:wait_get_app_stopped for more details. """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id - op_response = self._api.do("POST", f"/api/2.0/apps/{name}/stop", body=body, headers=headers) - return Wait(self.wait_get_app_stopped, response=App.from_dict(op_response), name=op_response["name"]) + op_response = self._api.do("POST", f"/api/2.0/apps/{name}/stop", headers=headers) + return Wait(self.wait_get_app_stopped, response=App.from_dict(op_response), name=name) def stop_and_wait(self, name: str, timeout=timedelta(minutes=20)) -> App: return self.stop(name=name).result(timeout=timeout) @@ -3564,10 +3191,7 @@ def update(self, name: str, app: App) -> App: body = app.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3590,10 +3214,7 @@ def update_app_thumbnail(self, name: str, *, app_thumbnail: Optional[AppThumbnai body = {} if app_thumbnail is not None: body["app_thumbnail"] = app_thumbnail.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3602,33 +3223,6 @@ def update_app_thumbnail(self, name: str, *, app_thumbnail: Optional[AppThumbnai res = self._api.do("PATCH", f"/api/2.0/apps/{name}/thumbnail", body=body, headers=headers) return AppThumbnail.from_dict(res) - def update_permissions( - self, app_name: str, *, access_control_list: Optional[List[AppAccessControlRequest]] = None - ) -> AppPermissions: - """Updates the permissions on an app. Apps can inherit permissions from their root object. - - :param app_name: str - The app for which to get or manage permissions. - :param access_control_list: List[:class:`AppAccessControlRequest`] (optional) - - :returns: :class:`AppPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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/permissions/apps/{app_name}", body=body, headers=headers) - return AppPermissions.from_dict(res) - def update_space(self, name: str, space: Space, update_mask: FieldMask) -> UpdateSpaceOperation: """Updates an app space. The update process is asynchronous and the status of the update can be checked with the GetSpaceOperation method. @@ -3638,15 +3232,6 @@ def update_space(self, name: str, space: Space, update_mask: FieldMask) -> Updat It must be unique within the workspace. :param space: :class:`Space` :param update_mask: FieldMask - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`Operation` """ @@ -3655,10 +3240,7 @@ def update_space(self, name: str, space: Space, update_mask: FieldMask) -> Updat query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3899,7 +3481,7 @@ def done(self) -> bool: class AppsSettingsAPI: - """Apps Settings manage the settings for the Apps service on a customer's Databricks instance.""" + """TODO(LA-129): migrate ``databricks.openapi.method`` to ``google.api.field_behavior`` once it's supported""" def __init__(self, api_client): self._api = api_client @@ -3914,10 +3496,7 @@ def create_custom_template(self, template: CustomTemplate) -> CustomTemplate: body = template.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3935,9 +3514,7 @@ def delete_custom_template(self, name: str) -> CustomTemplate: :returns: :class:`CustomTemplate` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3955,9 +3532,7 @@ def get_custom_template(self, name: str) -> CustomTemplate: :returns: :class:`CustomTemplate` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3984,9 +3559,7 @@ def list_custom_templates( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4014,10 +3587,7 @@ def update_custom_template(self, name: str, template: CustomTemplate) -> CustomT body = template.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/billing.py b/databricks/sdk/service/billing.py index 1d4c0ba42..e31d57571 100644 --- a/databricks/sdk/service/billing.py +++ b/databricks/sdk/service/billing.py @@ -21,9 +21,6 @@ ) -from databricks.sdk.service import compute - - _LOG = logging.getLogger("databricks.sdk") @@ -33,7 +30,7 @@ @dataclass class ActionConfiguration: action_configuration_id: Optional[str] = None - """Databricks action configuration ID.""" + """ action configuration ID.""" action_type: Optional[ActionConfigurationType] = None """The type of the action.""" @@ -87,7 +84,7 @@ class AlertConfiguration: state.""" alert_configuration_id: Optional[str] = None - """Databricks alert configuration ID.""" + """ alert configuration ID.""" principal_overrides: Optional[List[PrincipalOverride]] = None """Per-principal threshold overrides for this alert. Only applies to per-user alerts @@ -190,14 +187,14 @@ class AlertConfigurationTriggerType(Enum): @dataclass class BudgetConfiguration: account_id: Optional[str] = None - """Databricks account ID.""" + """ account ID.""" alert_configurations: Optional[List[AlertConfiguration]] = None """Alerts to configure when this budget is in a triggered state. Budgets must have exactly one alert configuration.""" budget_configuration_id: Optional[str] = None - """Databricks budget configuration ID.""" + """ budget configuration ID.""" create_time: Optional[int] = None """Creation time of this budget configuration.""" @@ -282,7 +279,7 @@ class BudgetConfigurationFilter: data.""" workspace_id: Optional[BudgetConfigurationFilterWorkspaceIdClause] = None - """If provided, usage must match with the provided Databricks workspace IDs.""" + """If provided, usage must match with the provided workspace IDs.""" def as_dict(self) -> dict: """Serializes the BudgetConfigurationFilter into a dictionary suitable for use as a JSON request body.""" @@ -419,7 +416,7 @@ class BudgetPolicy: """A list of tags defined by the customer. At most 20 entries are allowed per policy.""" policy_id: Optional[str] = None - """The Id of the policy. This field is generated by Databricks and globally unique.""" + """The Id of the policy. This field is generated by and globally unique.""" policy_name: Optional[str] = None """The name of the policy. @@ -501,7 +498,7 @@ def from_dict(cls, d: Dict[str, Any]) -> CreateBillingUsageDashboardResponse: @dataclass class CreateBudgetConfigurationBudget: account_id: Optional[str] = None - """Databricks account ID.""" + """ account ID.""" alert_configurations: Optional[List[CreateBudgetConfigurationBudgetAlertConfigurations]] = None """Alerts to configure when this budget is in a triggered state. Budgets must have exactly one @@ -767,7 +764,7 @@ class CreateLogDeliveryConfigurationParams: plan to use different log delivery configurations for different workspaces, set this field explicitly. Be aware that delivery configurations mentioning specific workspaces won't apply to new workspaces created in the future, and delivery won't include account level logs. For some - types of Databricks deployments there is only one workspace per account ID, so this field is + types of deployments there is only one workspace per account ID, so this field is unnecessary.""" def as_dict(self) -> dict: @@ -855,7 +852,7 @@ class DeliveryStatus(Enum): attempts since the config was created. ``SUCCEEDED``: The latest attempt of log delivery has succeeded completely. ``USER_FAILURE``: The latest attempt of log delivery failed because of misconfiguration of customer provided permissions on role or storage. ``SYSTEM_FAILURE``: The - latest attempt of log delivery failed because of an Databricks internal error. Contact support + latest attempt of log delivery failed because of an internal error. Contact support if it doesn't go away soon. ``NOT_FOUND``: The log delivery status as the configuration has been disabled since the release of this feature or there are no workspaces in the account.""" @@ -868,6 +865,8 @@ class DeliveryStatus(Enum): @dataclass class DownloadResponse: + """Billable usage data was returned successfully.""" + contents: Optional[BinaryIO] = None def as_dict(self) -> dict: @@ -1168,7 +1167,7 @@ class LogDeliveryConfiguration: `__.""" account_id: Optional[str] = None - """Databricks account ID.""" + """ account ID.""" config_id: Optional[str] = None """The unique UUID of log delivery configuration""" @@ -1210,7 +1209,7 @@ class LogDeliveryConfiguration: plan to use different log delivery configurations for different workspaces, set this field explicitly. Be aware that delivery configurations mentioning specific workspaces won't apply to new workspaces created in the future, and delivery won't include account level logs. For some - types of Databricks deployments there is only one workspace per account ID, so this field is + types of deployments there is only one workspace per account ID, so this field is unnecessary.""" def as_dict(self) -> dict: @@ -1309,7 +1308,7 @@ class LogDeliveryStatus: - ``SUCCEEDED``: The latest attempt of log delivery has succeeded completely. - ``USER_FAILURE``: The latest attempt of log delivery failed because of misconfiguration of customer provided permissions on role or storage. - - ``SYSTEM_FAILURE``: The latest attempt of log delivery failed because of an Databricks + - ``SYSTEM_FAILURE``: The latest attempt of log delivery failed because of an internal error. Contact support if it doesn't go away soon. - ``NOT_FOUND``: The log delivery status as the configuration has been disabled since the release of this feature or there are no workspaces in the account.""" @@ -1467,14 +1466,14 @@ class SortSpecField(Enum): @dataclass class UpdateBudgetConfigurationBudget: account_id: Optional[str] = None - """Databricks account ID.""" + """ account ID.""" alert_configurations: Optional[List[AlertConfiguration]] = None """Alerts to configure when this budget is in a triggered state. Budgets must have exactly one alert configuration.""" budget_configuration_id: Optional[str] = None - """Databricks budget configuration ID.""" + """ budget configuration ID.""" display_name: Optional[str] = None """Human-readable name of budget configuration. Max Length: 128""" @@ -1632,9 +1631,6 @@ def from_dict(cls, d: Dict[str, Any]) -> WrappedLogDeliveryConfigurations: class BillableUsageAPI: - """This API allows you to download billable usage logs for the specified account and date range. This feature - works with all account types.""" - def __init__(self, api_client): self._api = api_client @@ -1674,18 +1670,16 @@ def download(self, start_month: str, end_month: str, *, personal_data: Optional[ query["personal_data"] = personal_data if start_month is not None: query["start_month"] = start_month - headers = { - "Accept": "text/plain", - } + headers = {} res = self._api.do( - "GET", f"/api/2.0/accounts/{self._api.account_id}/usage/download", query=query, headers=headers, raw=True + "GET", f"/api/2.0/accounts/{self._api.account_id}/usage/download", query=query, headers=headers ) return DownloadResponse.from_dict(res) class BudgetPolicyAPI: - """A service serves REST API about Budget policies""" + """See http://go/protostyleguide/services.""" def __init__(self, api_client): self._api = api_client @@ -1711,10 +1705,7 @@ def create(self, *, policy: Optional[BudgetPolicy] = None, request_id: Optional[ body["policy"] = policy.as_dict() if request_id is not None: body["request_id"] = request_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", f"/api/2.1/accounts/{self._api.account_id}/budget-policies", body=body, headers=headers @@ -1730,9 +1721,7 @@ def delete(self, policy_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do("DELETE", f"/api/2.1/accounts/{self._api.account_id}/budget-policies/{policy_id}", headers=headers) @@ -1745,9 +1734,7 @@ def get(self, policy_id: str) -> BudgetPolicy: :returns: :class:`BudgetPolicy` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", f"/api/2.1/accounts/{self._api.account_id}/budget-policies/{policy_id}", headers=headers @@ -1790,9 +1777,7 @@ def list( query["page_token"] = page_token if sort_spec is not None: query["sort_spec"] = sort_spec.as_dict() - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -1811,7 +1796,7 @@ def update( """Updates a policy :param policy_id: str - The Id of the policy. This field is generated by Databricks and globally unique. + The Id of the policy. This field is generated by and globally unique. :param policy: :class:`BudgetPolicy` The policy to update. ``creator_user_id`` cannot be specified in the request. All other fields must be specified even if not changed. The ``policy_id`` is used to identify the policy to update. @@ -1825,10 +1810,7 @@ def update( query = {} if limit_config is not None: query["limit_config"] = limit_config.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -1841,9 +1823,7 @@ def update( class BudgetsAPI: - """These APIs manage budget configurations for this account. Budgets enable you to monitor usage across your - account. You can set up budgets to either track account-wide spending, or apply filters to track the - spending of specific teams, projects, or workspaces.""" + """Service for BUI APIs. To start with it will host endpoint for Log Delivery Configuration.""" def __init__(self, api_client): self._api = api_client @@ -1861,12 +1841,9 @@ def create(self, budget: CreateBudgetConfigurationBudget) -> CreateBudgetConfigu body = {} if budget is not None: body["budget"] = budget.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} - res = self._api.do("POST", f"/api/2.1/accounts/{self._api.account_id}/budgets", body=body, headers=headers) + res = self._api.do("POST", f"/api/2.1/accounts/{account_id}/budgets", body=body, headers=headers) return CreateBudgetConfigurationResponse.from_dict(res) def delete(self, budget_id: str): @@ -1874,14 +1851,12 @@ def delete(self, budget_id: str): ID. This cannot be undone. :param budget_id: str - The Databricks budget configuration ID. + The budget configuration ID. """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do("DELETE", f"/api/2.1/accounts/{self._api.account_id}/budgets/{budget_id}", headers=headers) @@ -1894,9 +1869,7 @@ def get(self, budget_id: str) -> GetBudgetConfigurationResponse: :returns: :class:`GetBudgetConfigurationResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/2.1/accounts/{self._api.account_id}/budgets/{budget_id}", headers=headers) return GetBudgetConfigurationResponse.from_dict(res) @@ -1914,9 +1887,7 @@ def list(self, *, page_token: Optional[str] = None) -> Iterator[BudgetConfigurat query = {} if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -1934,7 +1905,7 @@ def update(self, budget_id: str, budget: UpdateBudgetConfigurationBudget) -> Upd ID. :param budget_id: str - The Databricks budget configuration ID. + The budget configuration ID. :param budget: :class:`UpdateBudgetConfigurationBudget` The updated budget. This will overwrite the budget specified by the budget ID. @@ -1944,76 +1915,14 @@ def update(self, budget_id: str, budget: UpdateBudgetConfigurationBudget) -> Upd body = {} if budget is not None: body["budget"] = budget.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} - res = self._api.do( - "PUT", f"/api/2.1/accounts/{self._api.account_id}/budgets/{budget_id}", body=body, headers=headers - ) + res = self._api.do("PUT", f"/api/2.1/accounts/{account_id}/budgets/{budget_id}", body=body, headers=headers) return UpdateBudgetConfigurationResponse.from_dict(res) class LogDeliveryAPI: - """These APIs manage log delivery configurations for this account. The two supported log types for this API - are *billable usage logs* (AWS only) and *audit logs* (AWS and GCP). This feature is in Public Preview. - This feature works with all account ID types. - - Log delivery works with all account types. However, if your account is on the E2 version of the platform - or on a select custom plan that allows multiple workspaces per account, you can optionally configure - different storage destinations for each workspace. Log delivery status is also provided to know the latest - status of log delivery attempts. - - The high-level flow of billable usage delivery (AWS only): - - 1. **Create storage**: In AWS, `create a new AWS S3 bucket - `__ with a specific - bucket policy. Using Databricks APIs, call the Account API to create a [storage configuration - object](:method:Storage/Create) that uses the bucket name. - 2. **Create credentials**: In AWS, create the appropriate AWS IAM role. For full details, including the - required IAM role policies and trust relationship, see `Billable usage log delivery - `__. - Using Databricks APIs, call the Account API to create a [credential configuration - object](:method:Credentials/Create) that uses the IAM role's ARN. - 3. **Create log delivery configuration**: Using Databricks APIs, call the Account API to [create a log - delivery configuration](:method:LogDelivery/Create) that uses the credential and storage configuration - objects from previous steps. You can specify if the logs should include all events of that log type in - your account (*Account level* delivery) or only events for a specific set of workspaces (*workspace - level* delivery). Account level log delivery applies to all current and future workspaces plus account - level logs, while workspace level log delivery solely delivers logs related to the specified - workspaces. You can create multiple types of delivery configurations per account. - - For billable usage delivery (AWS only): - - - For more information about billable usage logs, see `Billable usage log delivery - `__. For - the CSV schema, see the `Usage page - `__. - - The delivery location is ``//billable-usage/csv/``, where ```` is the name - of the optional delivery path prefix you set up during log delivery configuration. Files are named - ``workspaceId=-usageMonth=.csv``. - - All billable usage logs apply to specific workspaces (*workspace level* logs). You can aggregate usage - for your entire account by creating an *account level* delivery configuration that delivers logs for all - current and future workspaces in your account. - - The files are delivered daily by overwriting the month's CSV file for each workspace. - - For audit log delivery (AWS and GCP): - - - For more information about about audit log delivery, see Audit log delivery `AWS - `__ or `GCP - `__, which includes information - about the used JSON schema. - - The delivery location is - ``//workspaceId=/date=/auditlogs_.json``. - Files may get overwritten with the same content multiple times to achieve exactly-once delivery. - - If the audit log delivery configuration included specific workspace IDs, only *workspace-level* audit - logs for those workspaces are delivered. If the log delivery configuration applies to the entire account - (*account level* delivery configuration), the audit log delivery includes workspace-level audit logs for - all workspaces in the account as well as account-level audit logs. See Audit log delivery `AWS - `__ or `GCP - `__ for details. - - Auditable events are typically available in logs within 15 minutes.""" + """Service for BUI APIs. To start with it will host endpoint for Log Delivery Configuration.""" def __init__(self, api_client): self._api = api_client @@ -2021,7 +1930,7 @@ def __init__(self, api_client): def create( self, log_delivery_configuration: CreateLogDeliveryConfigurationParams ) -> WrappedLogDeliveryConfiguration: - """Creates a new Databricks log delivery configuration to enable delivery of the specified type of logs + """Creates a new log delivery configuration to enable delivery of the specified type of logs to your storage location. This requires that you already created a [credential object](:method:Credentials/Create) (which encapsulates a cross-account service IAM role) and a [storage configuration object](:method:Storage/Create) (which encapsulates an S3 bucket). @@ -2050,16 +1959,13 @@ def create( body = {} if log_delivery_configuration is not None: body["log_delivery_configuration"] = log_delivery_configuration.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} - res = self._api.do("POST", f"/api/2.0/accounts/{self._api.account_id}/log-delivery", body=body, headers=headers) + res = self._api.do("POST", f"/api/2.0/accounts/{account_id}/log-delivery", body=body, headers=headers) return WrappedLogDeliveryConfiguration.from_dict(res) def get(self, log_delivery_configuration_id: str) -> GetLogDeliveryConfigurationResponse: - """Gets a Databricks log delivery configuration object for an account, both specified by ID. + """Gets a log delivery configuration object for an account, both specified by ID. :param log_delivery_configuration_id: str The log delivery configuration id of customer @@ -2067,9 +1973,7 @@ def get(self, log_delivery_configuration_id: str) -> GetLogDeliveryConfiguration :returns: :class:`GetLogDeliveryConfigurationResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -2086,7 +1990,7 @@ def list( status: Optional[LogDeliveryConfigStatus] = None, storage_configuration_id: Optional[str] = None, ) -> Iterator[LogDeliveryConfiguration]: - """Gets all Databricks log delivery configurations associated with an account specified by ID. + """Gets all log delivery configurations associated with an account specified by ID. :param credentials_id: str (optional) The Credentials id to filter the search results with @@ -2110,9 +2014,7 @@ def list( query["status"] = status.value if storage_configuration_id is not None: query["storage_configuration_id"] = storage_configuration_id - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -2145,10 +2047,7 @@ def patch_status(self, log_delivery_configuration_id: str, status: LogDeliveryCo body = {} if status is not None: body["status"] = status.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} self._api.do( "PATCH", @@ -2159,9 +2058,7 @@ def patch_status(self, log_delivery_configuration_id: str, status: LogDeliveryCo class UsageDashboardsAPI: - """These APIs manage usage dashboards for this account. Usage dashboards enable you to gain insights into - your usage with pre-built dashboards: visualize breakdowns, analyze tag attributions, and identify cost - drivers.""" + """Service for BUI APIs. To start with it will host endpoint for Log Delivery Configuration.""" def __init__(self, api_client): self._api = api_client @@ -2193,10 +2090,7 @@ def create( body["major_version"] = major_version.value if workspace_id is not None: body["workspace_id"] = workspace_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do("POST", f"/api/2.0/accounts/{self._api.account_id}/dashboard", body=body, headers=headers) return CreateBillingUsageDashboardResponse.from_dict(res) @@ -2220,9 +2114,7 @@ def get( query["dashboard_type"] = dashboard_type.value if workspace_id is not None: query["workspace_id"] = workspace_id - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/dashboard", query=query, headers=headers) return GetBillingUsageDashboardResponse.from_dict(res) diff --git a/databricks/sdk/service/bundledeployments.py b/databricks/sdk/service/bundledeployments.py index 5892a6f05..21625a385 100644 --- a/databricks/sdk/service/bundledeployments.py +++ b/databricks/sdk/service/bundledeployments.py @@ -1087,7 +1087,7 @@ def from_dict(cls, d: Dict[str, Any]) -> WorkspaceInfo: class BundleDeploymentsAPI: - """Service for managing bundle deployment metadata.""" + """See http://go/protostyleguide/services.""" def __init__(self, api_client): self._api = api_client @@ -1121,10 +1121,7 @@ def complete_version( body["completion_reason"] = completion_reason.value if force is not None: body["force"] = force - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1146,10 +1143,7 @@ def create_deployment(self, deployment: Deployment) -> Deployment: body = deployment.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1191,10 +1185,7 @@ def create_version(self, parent: str, version: Version, version_id: str) -> Vers query = {} if version_id is not None: query["version_id"] = version_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1212,9 +1203,7 @@ def delete_deployment(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1231,9 +1220,7 @@ def get_deployment(self, name: str) -> Deployment: :returns: :class:`Deployment` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1252,9 +1239,7 @@ def get_operation(self, name: str) -> Operation: :returns: :class:`Operation` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1272,9 +1257,7 @@ def get_resource(self, name: str) -> Resource: :returns: :class:`Resource` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1292,9 +1275,7 @@ def get_version(self, name: str) -> Version: :returns: :class:`Version` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1316,17 +1297,13 @@ def heartbeat(self, name: str) -> HeartbeatResponse: :returns: :class:`HeartbeatResponse` """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} 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/bundle/{name}/heartbeat", body=body, headers=headers) + res = self._api.do("POST", f"/api/2.0/bundle/{name}/heartbeat", headers=headers) return HeartbeatResponse.from_dict(res) def list_deployments( @@ -1350,9 +1327,7 @@ def list_deployments( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1390,9 +1365,7 @@ def list_operations( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1430,9 +1403,7 @@ def list_resources( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1470,9 +1441,7 @@ def list_versions( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1506,10 +1475,7 @@ def update_deployment(self, name: str, deployment: Deployment, update_mask: Fiel query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1551,10 +1517,7 @@ def update_operation(self, name: str, operation: Operation, update_mask: FieldMa query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/catalog.py b/databricks/sdk/service/catalog.py index e9982a128..7e6cd27fa 100644 --- a/databricks/sdk/service/catalog.py +++ b/databricks/sdk/service/catalog.py @@ -587,7 +587,7 @@ class AwsIamRole: """The Amazon Resource Name (ARN) of the AWS IAM role used to vend temporary credentials.""" unity_catalog_iam_arn: Optional[str] = None - """The Amazon Resource Name (ARN) of the AWS IAM user managed by Databricks. This is the identity + """The Amazon Resource Name (ARN) of the AWS IAM user managed by . This is the identity that is going to assume the AWS IAM role.""" def as_dict(self) -> dict: @@ -660,7 +660,7 @@ class AwsIamRoleResponse: """The external ID used in role assumption to prevent the confused deputy problem.""" unity_catalog_iam_arn: Optional[str] = None - """The Amazon Resource Name (ARN) of the AWS IAM user managed by Databricks. This is the identity + """The Amazon Resource Name (ARN) of the AWS IAM user managed by . This is the identity that is going to assume the AWS IAM role.""" def as_dict(self) -> dict: @@ -807,7 +807,7 @@ class AzureManagedIdentity: ``/subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.Databricks/accessConnectors/{connector-name}``.""" credential_id: Optional[str] = None - """The Databricks internal ID that represents this managed identity.""" + """The internal ID that represents this managed identity.""" managed_identity_id: Optional[str] = None """The Azure resource ID of the managed identity. Use the format, @@ -899,7 +899,7 @@ class AzureManagedIdentityResponse: ``/subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.Databricks/accessConnectors/{connector-name}``.""" credential_id: Optional[str] = None - """The Databricks internal ID that represents this managed identity.""" + """The internal ID that represents this managed identity.""" managed_identity_id: Optional[str] = None """The Azure resource ID of the managed identity. Use the format, @@ -2131,7 +2131,7 @@ class CreateAccountsStorageCredential: """Comment associated with the credential.""" databricks_gcp_service_account: Optional[DatabricksGcpServiceAccountRequest] = None - """The Databricks managed GCP service account configuration.""" + """The managed GCP service account configuration.""" read_only: Optional[bool] = None """Whether the credential is usable only for read operations. Only applicable when purpose is @@ -2416,7 +2416,7 @@ class CreateMetastoreAssignment: default_catalog_name: str """The name of the default catalog in the metastore. This field is deprecated. Please use "Default - Namespace API" to configure the default catalog for a Databricks workspace.""" + Namespace API" to configure the default catalog for a workspace.""" def as_dict(self) -> dict: """Serializes the CreateMetastoreAssignment into a dictionary suitable for use as a JSON request body.""" @@ -2557,7 +2557,7 @@ class CredentialInfo: """Username of credential creator.""" databricks_gcp_service_account: Optional[DatabricksGcpServiceAccount] = None - """The Databricks managed GCP service account configuration.""" + """The managed GCP service account configuration.""" full_name: Optional[str] = None """The full name of the credential.""" @@ -2579,7 +2579,6 @@ class CredentialInfo: """Username of current owner of credential.""" purpose: Optional[CredentialPurpose] = None - """Indicates the purpose of the credential.""" read_only: Optional[bool] = None """Whether the credential is usable only for read operations. Only applicable when purpose is @@ -2795,10 +2794,10 @@ class DataSourceFormat(Enum): @dataclass class DatabricksGcpServiceAccount: - """GCP long-lived credential. Databricks-created Google Cloud Storage service account.""" + """GCP long-lived credential. -created Google Cloud Storage service account.""" credential_id: Optional[str] = None - """The Databricks internal ID that represents this managed identity.""" + """The internal ID that represents this managed identity.""" email: Optional[str] = None """The email of the service account.""" @@ -2840,7 +2839,7 @@ def from_dict(cls, d: Dict[str, Any]) -> DatabricksGcpServiceAccount: @dataclass class DatabricksGcpServiceAccountRequest: - """GCP long-lived credential. Databricks-created Google Cloud Storage service account.""" + """GCP long-lived credential. -created Google Cloud Storage service account.""" def as_dict(self) -> dict: """Serializes the DatabricksGcpServiceAccountRequest into a dictionary suitable for use as a JSON request body.""" @@ -2860,10 +2859,10 @@ def from_dict(cls, d: Dict[str, Any]) -> DatabricksGcpServiceAccountRequest: @dataclass class DatabricksGcpServiceAccountResponse: - """GCP long-lived credential. Databricks-created Google Cloud Storage service account.""" + """GCP long-lived credential. -created Google Cloud Storage service account.""" credential_id: Optional[str] = None - """The Databricks internal ID that represents this managed identity.""" + """The internal ID that represents this managed identity.""" email: Optional[str] = None """The email of the service account.""" @@ -3058,32 +3057,6 @@ class DeltaSharingScopeEnum(Enum): INTERNAL_AND_EXTERNAL = "INTERNAL_AND_EXTERNAL" -@dataclass -class DenyOptions: - privileges: List[str] - """List of privileges to deny. When any of these privileges are requested, the policy will deny - access if the principal and condition match. Required on create and update.""" - - def as_dict(self) -> dict: - """Serializes the DenyOptions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.privileges: - body["privileges"] = [v for v in self.privileges] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the DenyOptions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.privileges: - body["privileges"] = self.privileges - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> DenyOptions: - """Deserializes the DenyOptions from a dictionary.""" - return cls(privileges=d.get("privileges", None)) - - @dataclass class Dependency: """A dependency of a SQL object. One of the following fields must be defined: **table**, @@ -3190,8 +3163,6 @@ def from_dict(cls, d: Dict[str, Any]) -> DisableResponse: @dataclass class EffectivePermissionsList: next_page_token: Optional[str] = None - """Opaque token to retrieve the next page of results. Absent if there are no more pages. - **page_token** should be set to this value for the next request (for the next page of results).""" privilege_assignments: Optional[List[EffectivePrivilegeAssignment]] = None """The privileges conveyed to each principal (either directly or via inheritance)""" @@ -7015,14 +6986,14 @@ def from_dict(cls, d: Dict[str, Any]) -> McpServiceConfigSourceConnection: @dataclass class MetastoreAssignment: workspace_id: int - """The unique ID of the Databricks workspace.""" + """The unique ID of the workspace.""" metastore_id: str """The unique ID of the metastore.""" default_catalog_name: Optional[str] = None """The name of the default catalog in the metastore. This field is deprecated. Please use "Default - Namespace API" to configure the default catalog for a Databricks workspace.""" + Namespace API" to configure the default catalog for a workspace.""" def as_dict(self) -> dict: """Serializes the MetastoreAssignment into a dictionary suitable for use as a JSON request body.""" @@ -8289,8 +8260,9 @@ def from_dict(cls, d: Dict[str, Any]) -> ModelProviderServiceConfigServiceCreden @dataclass class ModelService: """A governed AI Gateway endpoint in Unity Catalog that routes inference requests to one or more - destinations, such as a Databricks foundation model or an external model reached through a model - provider service. Applies centralized access control, rate limits, and auditing to its traffic.""" + destinations, such as a foundation model or an external model reached through a + model provider service. Applies centralized access control, rate limits, and auditing to its + traffic.""" comment: Optional[str] = None """User-provided description.""" @@ -8471,10 +8443,10 @@ class ModelServiceConfigDestinationConfig: destination until the backing resource is restored or the destination is replaced.""" pay_per_token_config: Optional[ModelServiceConfigPayPerTokenConfig] = None - """Configuration for a pay-per-token Databricks foundation model.""" + """Configuration for a pay-per-token foundation model.""" provisioned_throughput_config: Optional[ModelServiceConfigProvisionedThroughputConfig] = None - """Configuration for a provisioned-throughput Databricks foundation model.""" + """Configuration for a provisioned-throughput foundation model.""" traffic_percentage: Optional[int] = None """Percentage of primary traffic sent to this destination, from 0 to 100. Required when there is @@ -8762,7 +8734,7 @@ class ModelVersionInfo: run stored in an MLflow tracking server""" run_workspace_id: Optional[int] = None - """ID of the Databricks workspace containing the MLflow run that generated this model version, if + """ID of the workspace containing the MLflow run that generated this model version, if applicable""" schema_name: Optional[str] = None @@ -8883,14 +8855,14 @@ def from_dict(cls, d: Dict[str, Any]) -> ModelVersionInfo: model_name=d.get("model_name", None), model_version_dependencies=_from_dict(d, "model_version_dependencies", DependencyList), run_id=d.get("run_id", None), - run_workspace_id=d.get("run_workspace_id", None), + run_workspace_id=_int64(d, "run_workspace_id"), schema_name=d.get("schema_name", None), source=d.get("source", None), status=_enum(d, "status", ModelVersionInfoStatus), storage_location=d.get("storage_location", None), updated_at=_int64(d, "updated_at"), updated_by=d.get("updated_by", None), - version=d.get("version", None), + version=_int64(d, "version"), ) @@ -9589,7 +9561,7 @@ def from_dict(cls, d: Dict[str, Any]) -> NamedTableConstraint: class NotificationDestination: destination_id: Optional[str] = None """The identifier for the destination. This is the email address for EMAIL destinations, the URL - for URL destinations, or the unique Databricks notification destination ID for all other + for URL destinations, or the unique notification destination ID for all other external destinations.""" destination_type: Optional[DestinationType] = None @@ -10234,11 +10206,6 @@ class PolicyInfo: created_by: Optional[str] = None """Username of the user who created the policy. Output only.""" - deny: Optional[DenyOptions] = None - """Options for deny policies. Valid only if ``policy_type`` is ``POLICY_TYPE_DENY``. Required on - create and optional on update. When specified on update, the new options will replace the - existing options as a whole.""" - except_principals: Optional[List[str]] = None """Optional list of user or group names that should be excluded from the policy.""" @@ -10291,8 +10258,6 @@ def as_dict(self) -> dict: body["created_at"] = self.created_at if self.created_by is not None: body["created_by"] = self.created_by - if self.deny: - body["deny"] = self.deny.as_dict() if self.except_principals: body["except_principals"] = [v for v in self.except_principals] if self.for_securable_type is not None: @@ -10334,8 +10299,6 @@ def as_shallow_dict(self) -> dict: body["created_at"] = self.created_at if self.created_by is not None: body["created_by"] = self.created_by - if self.deny: - body["deny"] = self.deny if self.except_principals: body["except_principals"] = self.except_principals if self.for_securable_type is not None: @@ -10374,7 +10337,6 @@ def from_dict(cls, d: Dict[str, Any]) -> PolicyInfo: comment=d.get("comment", None), created_at=_int64(d, "created_at"), created_by=d.get("created_by", None), - deny=_from_dict(d, "deny", DenyOptions), except_principals=d.get("except_principals", None), for_securable_type=_enum(d, "for_securable_type", SecurableType), grant=_from_dict(d, "grant", GrantOptions), @@ -10394,7 +10356,6 @@ def from_dict(cls, d: Dict[str, Any]) -> PolicyInfo: class PolicyType(Enum): POLICY_TYPE_COLUMN_MASK = "POLICY_TYPE_COLUMN_MASK" - POLICY_TYPE_DENY = "POLICY_TYPE_DENY" POLICY_TYPE_GRANT = "POLICY_TYPE_GRANT" POLICY_TYPE_ROW_FILTER = "POLICY_TYPE_ROW_FILTER" @@ -10453,7 +10414,7 @@ def from_dict(cls, d: Dict[str, Any]) -> PrimaryKeyConstraint: @dataclass class Principal: id: Optional[str] = None - """Databricks user, group or service principal ID.""" + """ user, group or service principal ID.""" principal_type: Optional[PrincipalType] = None @@ -10931,7 +10892,7 @@ def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelAlias: id=d.get("id", None), model_name=d.get("model_name", None), schema_name=d.get("schema_name", None), - version_num=d.get("version_num", None), + version_num=_int64(d, "version_num"), ) @@ -11747,7 +11708,7 @@ class StorageCredentialInfo: """Username of credential creator.""" databricks_gcp_service_account: Optional[DatabricksGcpServiceAccountResponse] = None - """The Databricks managed GCP service account configuration.""" + """The managed GCP service account configuration.""" full_name: Optional[str] = None """The full name of the credential.""" @@ -12766,7 +12727,7 @@ class UpdateAccountsStorageCredential: """Comment associated with the credential.""" databricks_gcp_service_account: Optional[DatabricksGcpServiceAccountRequest] = None - """The Databricks managed GCP service account configuration.""" + """The managed GCP service account configuration.""" isolation_mode: Optional[IsolationMode] = None """Whether the current securable is accessible from all workspaces or a specific set of workspaces.""" @@ -12892,7 +12853,7 @@ class UpdateMetastoreAssignment: default_catalog_name: Optional[str] = None """The name of the default catalog in the metastore. This field is deprecated. Please use "Default - Namespace API" to configure the default catalog for a Databricks workspace.""" + Namespace API" to configure the default catalog for a workspace.""" metastore_id: Optional[str] = None """The unique ID of the metastore.""" @@ -13402,20 +13363,18 @@ class WorkspaceBindingBindingType(Enum): class AccountMetastoreAssignmentsAPI: - """These APIs manage metastore assignments to a workspace.""" - def __init__(self, api_client): self._api = api_client def create( - self, workspace_id: int, metastore_id: str, *, metastore_assignment: Optional[CreateMetastoreAssignment] = None + self, metastore_id: str, workspace_id: int, *, metastore_assignment: Optional[CreateMetastoreAssignment] = None ) -> AccountsCreateMetastoreAssignmentResponse: """Creates an assignment to a metastore for a workspace - :param workspace_id: int - Workspace ID. :param metastore_id: str Unity Catalog metastore ID + :param workspace_id: int + Workspace ID. :param metastore_assignment: :class:`CreateMetastoreAssignment` (optional) :returns: :class:`AccountsCreateMetastoreAssignmentResponse` @@ -13424,10 +13383,7 @@ def create( body = {} if metastore_assignment is not None: body["metastore_assignment"] = metastore_assignment.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", @@ -13437,20 +13393,18 @@ def create( ) return AccountsCreateMetastoreAssignmentResponse.from_dict(res) - def delete(self, workspace_id: int, metastore_id: str) -> AccountsDeleteMetastoreAssignmentResponse: + def delete(self, metastore_id: str, workspace_id: int) -> AccountsDeleteMetastoreAssignmentResponse: """Deletes a metastore assignment to a workspace, leaving the workspace with no metastore. - :param workspace_id: int - Workspace ID. :param metastore_id: str Unity Catalog metastore ID + :param workspace_id: int + Workspace ID. :returns: :class:`AccountsDeleteMetastoreAssignmentResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "DELETE", @@ -13470,9 +13424,7 @@ def get(self, workspace_id: int) -> AccountsMetastoreAssignment: :returns: :class:`AccountsMetastoreAssignment` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}/metastore", headers=headers @@ -13480,7 +13432,7 @@ def get(self, workspace_id: int) -> AccountsMetastoreAssignment: return AccountsMetastoreAssignment.from_dict(res) def list(self, metastore_id: str) -> Iterator[int]: - """Gets a list of all Databricks workspace IDs that have been assigned to given metastore. + """Gets a list of all workspace IDs that have been assigned to given metastore. :param metastore_id: str Unity Catalog metastore ID @@ -13488,9 +13440,7 @@ def list(self, metastore_id: str) -> Iterator[int]: :returns: Iterator over int """ - headers = { - "Accept": "application/json", - } + headers = {} json = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}/workspaces", headers=headers @@ -13499,15 +13449,15 @@ def list(self, metastore_id: str) -> Iterator[int]: return parsed if parsed is not None else [] def update( - self, workspace_id: int, metastore_id: str, *, metastore_assignment: Optional[UpdateMetastoreAssignment] = None + self, metastore_id: str, workspace_id: int, *, metastore_assignment: Optional[UpdateMetastoreAssignment] = None ) -> AccountsUpdateMetastoreAssignmentResponse: """Updates an assignment to a metastore for a workspace. Currently, only the default catalog may be updated. - :param workspace_id: int - Workspace ID. :param metastore_id: str Unity Catalog metastore ID + :param workspace_id: int + Workspace ID. :param metastore_assignment: :class:`UpdateMetastoreAssignment` (optional) :returns: :class:`AccountsUpdateMetastoreAssignmentResponse` @@ -13516,10 +13466,7 @@ def update( body = {} if metastore_assignment is not None: body["metastore_assignment"] = metastore_assignment.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PUT", @@ -13531,9 +13478,6 @@ def update( class AccountMetastoresAPI: - """These APIs manage Unity Catalog metastores for an account. A metastore contains catalogs that can be - associated with workspaces""" - def __init__(self, api_client): self._api = api_client @@ -13548,10 +13492,7 @@ def create(self, *, metastore_info: Optional[CreateAccountsMetastore] = None) -> body = {} if metastore_info is not None: body["metastore_info"] = metastore_info.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do("POST", f"/api/2.0/accounts/{self._api.account_id}/metastores", body=body, headers=headers) return AccountsCreateMetastoreResponse.from_dict(res) @@ -13570,9 +13511,7 @@ def delete(self, metastore_id: str, *, force: Optional[bool] = None) -> Accounts query = {} if force is not None: query["force"] = force - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "DELETE", @@ -13591,9 +13530,7 @@ def get(self, metastore_id: str) -> AccountsGetMetastoreResponse: :returns: :class:`AccountsGetMetastoreResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}", headers=headers @@ -13607,9 +13544,7 @@ def list(self) -> Iterator[MetastoreInfo]: :returns: Iterator over :class:`MetastoreInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} json = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/metastores", headers=headers) parsed = AccountsListMetastoresResponse.from_dict(json).metastores @@ -13631,10 +13566,7 @@ def update( body = {} if metastore_info is not None: body["metastore_info"] = metastore_info.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PUT", f"/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}", body=body, headers=headers @@ -13643,8 +13575,6 @@ def update( class AccountStorageCredentialsAPI: - """These APIs manage storage credentials for a particular metastore.""" - def __init__(self, api_client): self._api = api_client @@ -13679,10 +13609,7 @@ def create( body["credential_info"] = credential_info.as_dict() if skip_validation is not None: body["skip_validation"] = skip_validation - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", @@ -13711,9 +13638,7 @@ def delete( query = {} if force is not None: query["force"] = force - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "DELETE", @@ -13735,9 +13660,7 @@ def get(self, metastore_id: str, storage_credential_name: str) -> AccountsStorag :returns: :class:`AccountsStorageCredentialInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -13755,9 +13678,7 @@ def list(self, metastore_id: str) -> Iterator[StorageCredentialInfo]: :returns: Iterator over :class:`StorageCredentialInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} json = self._api.do( "GET", @@ -13794,10 +13715,7 @@ def update( body["credential_info"] = credential_info.as_dict() if skip_validation is not None: body["skip_validation"] = skip_validation - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PUT", @@ -13809,10 +13727,7 @@ def update( class AiGatewayAPI: - """Govern AI workloads in Unity Catalog. This API manages the Unity Catalog securables that bring centralized - access control, lineage, and auditing to AI-serving entities: model services (governed access to - foundation models and external LLMs), model provider services (governed resources for external model - providers), and MCP services (governed Model Context Protocol servers).""" + """See http://go/protostyleguide/services.""" def __init__(self, api_client): self._api = api_client @@ -13844,10 +13759,7 @@ def create_mcp_service(self, mcp_service: McpService, parent: str, mcp_service_i query["mcp_service_id"] = mcp_service_id if parent is not None: query["parent"] = parent - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -13887,10 +13799,7 @@ def create_model_provider_service( query["model_provider_service_id"] = model_provider_service_id if parent is not None: query["parent"] = parent - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -13931,10 +13840,7 @@ def create_model_service(self, model_service: ModelService, parent: str, model_s query["model_service_id"] = model_service_id if parent is not None: query["parent"] = parent - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -13964,9 +13870,7 @@ def delete_mcp_service(self, name: str, *, etag: Optional[str] = None): query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -13996,9 +13900,7 @@ def delete_model_provider_service(self, name: str, *, etag: Optional[str] = None query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14027,9 +13929,7 @@ def delete_model_service(self, name: str, *, etag: Optional[str] = None): query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14050,9 +13950,7 @@ def get_mcp_service(self, name: str) -> McpService: :returns: :class:`McpService` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14075,9 +13973,7 @@ def get_model_provider_service(self, name: str) -> ModelProviderService: :returns: :class:`ModelProviderService` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14099,9 +13995,7 @@ def get_model_service(self, name: str) -> ModelService: :returns: :class:`ModelService` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14151,9 +14045,7 @@ def list_mcp_services( query["parent"] = parent if view is not None: query["view"] = view.value - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14209,9 +14101,7 @@ def list_model_provider_services( query["parent"] = parent if view is not None: query["view"] = view.value - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14267,9 +14157,7 @@ def list_model_services( query["parent"] = parent if view is not None: query["view"] = view.value - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14323,10 +14211,7 @@ def update_mcp_service( query["etag"] = etag if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14385,10 +14270,7 @@ def update_model_provider_service( query["etag"] = etag if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14440,10 +14322,7 @@ def update_model_service( query["etag"] = etag if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14454,9 +14333,6 @@ def update_model_service( 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 use these artifacts on compute configured with shared access mode.""" - def __init__(self, api_client): self._api = api_client @@ -14470,9 +14346,7 @@ def get(self, artifact_type: ArtifactType) -> ArtifactAllowlistInfo: :returns: :class:`ArtifactAllowlistInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14517,10 +14391,7 @@ def update( body["created_by"] = created_by if metastore_id is not None: body["metastore_id"] = metastore_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14533,13 +14404,6 @@ def update( class CatalogsAPI: - """A catalog is the first layer of Unity Catalog’s three-level namespace. It’s used to organize your data - assets. Users can see all catalogs on which they have been assigned the USE_CATALOG data permission. - - In Unity Catalog, admins and data stewards manage users and their access to data centrally across all of - the workspaces in a Databricks account. Users in different workspaces can share access to the same data, - depending on privileges granted centrally in Unity Catalog.""" - def __init__(self, api_client): self._api = api_client @@ -14607,10 +14471,7 @@ def create( body["share_name"] = share_name if storage_root is not None: body["storage_root"] = storage_root - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14634,9 +14495,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): query = {} if force is not None: query["force"] = force - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14660,9 +14519,7 @@ def get(self, name: str, *, include_browse: Optional[bool] = None) -> CatalogInf query = {} if include_browse is not None: query["include_browse"] = include_browse - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14723,9 +14580,7 @@ def list( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14802,10 +14657,7 @@ def update( body["owner"] = owner if properties is not None: body["properties"] = properties - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14816,14 +14668,6 @@ def update( class ConnectionsAPI: - """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.""" - def __init__(self, api_client): self._api = api_client @@ -14882,10 +14726,7 @@ def create( body["properties"] = properties if read_only is not None: body["read_only"] = read_only - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14903,9 +14744,7 @@ def delete(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14922,9 +14761,7 @@ def get(self, name: str) -> ConnectionInfo: :returns: :class:`ConnectionInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -14969,9 +14806,7 @@ def list( query["page_token"] = page_token if parent is not None: query["parent"] = parent - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15022,10 +14857,7 @@ def update( body["options"] = options if owner is not None: body["owner"] = owner - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15036,14 +14868,6 @@ def update( class CredentialsAPI: - """A credential represents an authentication and authorization mechanism for accessing services on your cloud - tenant. Each credential is subject to Unity Catalog access-control policies that control which users and - groups can access the credential. - - To create credentials, you must be a Databricks account admin or have the ``CREATE SERVICE CREDENTIAL`` - privilege. The user who creates the credential can delegate ownership to another user or group to manage - permissions on it.""" - def __init__(self, api_client): self._api = api_client @@ -15078,9 +14902,8 @@ def create_credential( :param comment: str (optional) Comment associated with the credential. :param databricks_gcp_service_account: :class:`DatabricksGcpServiceAccount` (optional) - The Databricks managed GCP service account configuration. + The managed GCP service account configuration. :param purpose: :class:`CredentialPurpose` (optional) - Indicates the purpose of the credential. :param read_only: bool (optional) Whether the credential is usable only for read operations. Only applicable when purpose is **STORAGE**. @@ -15109,10 +14932,7 @@ def create_credential( body["read_only"] = read_only if skip_validation is not None: body["skip_validation"] = skip_validation - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15137,9 +14957,7 @@ def delete_credential(self, name_arg: str, *, force: Optional[bool] = None): query = {} if force is not None: query["force"] = force - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15172,10 +14990,7 @@ def generate_temporary_service_credential( body["credential_name"] = credential_name if gcp_options is not None: body["gcp_options"] = gcp_options.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15194,9 +15009,7 @@ def get_credential(self, name_arg: str) -> CredentialInfo: :returns: :class:`CredentialInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15237,7 +15050,6 @@ def list_credentials( :param page_token: str (optional) Opaque token to retrieve the next page of results. :param purpose: :class:`CredentialPurpose` (optional) - Return only credentials for the specified purpose. :returns: Iterator over :class:`CredentialInfo` """ @@ -15251,9 +15063,7 @@ def list_credentials( query["page_token"] = page_token if purpose is not None: query["purpose"] = purpose.value - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15300,7 +15110,7 @@ def update_credential( :param comment: str (optional) Comment associated with the credential. :param databricks_gcp_service_account: :class:`DatabricksGcpServiceAccount` (optional) - The Databricks managed GCP service account configuration. + The managed GCP service account configuration. :param force: bool (optional) Force an update even if there are dependent services (when purpose is **SERVICE**) or dependent external locations and external tables (when purpose is **STORAGE**). @@ -15342,10 +15152,7 @@ def update_credential( body["read_only"] = read_only if skip_validation is not None: body["skip_validation"] = skip_validation - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15389,7 +15196,6 @@ def validate_credential( The name of an existing external location to validate. Only applicable for storage credentials (purpose is **STORAGE**.) :param purpose: :class:`CredentialPurpose` (optional) - The purpose of the credential. This should only be used when the credential is specified. :param read_only: bool (optional) Whether the credential is only usable for read operations. Only applicable for storage credentials (purpose is **STORAGE**.) @@ -15416,10 +15222,7 @@ def validate_credential( body["read_only"] = read_only if url is not None: body["url"] = url - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15430,11 +15233,6 @@ 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 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 @@ -15458,10 +15256,7 @@ def create(self, tag_assignment: EntityTagAssignment) -> EntityTagAssignment: body = tag_assignment.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15493,9 +15288,7 @@ def delete(self, entity_type: str, entity_name: str, tag_key: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15520,9 +15313,7 @@ def get(self, entity_type: str, entity_name: str, tag_key: str) -> EntityTagAssi :returns: :class:`EntityTagAssignment` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15561,9 +15352,7 @@ def list( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15606,15 +15395,6 @@ def update( The key of the tag :param tag_assignment: :class:`EntityTagAssignment` :param update_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`EntityTagAssignment` """ @@ -15623,10 +15403,7 @@ def update( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15643,21 +15420,14 @@ def update( class ExternalLineageAPI: - """External Lineage APIs enable defining and managing lineage relationships between Databricks objects and - external systems. These APIs allow users to capture data flows connecting Databricks tables, models, and - file paths with external metadata objects. - - With these APIs, users can create, update, delete, and list lineage relationships with support for - column-level mappings and custom properties.""" - def __init__(self, api_client): self._api = api_client def create_external_lineage_relationship( self, external_lineage_relationship: CreateRequestExternalLineage ) -> ExternalLineageRelationship: - """Creates an external lineage relationship between a Databricks or external metadata object and another - external metadata object. + """Creates an external lineage relationship between a or external metadata object and + another external metadata object. :param external_lineage_relationship: :class:`CreateRequestExternalLineage` @@ -15666,10 +15436,7 @@ def create_external_lineage_relationship( body = external_lineage_relationship.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15679,8 +15446,8 @@ def create_external_lineage_relationship( return ExternalLineageRelationship.from_dict(res) def delete_external_lineage_relationship(self, external_lineage_relationship: DeleteRequestExternalLineage): - """Deletes an external lineage relationship between a Databricks or external metadata object and another - external metadata object. + """Deletes an external lineage relationship between a or external metadata object and + another external metadata object. :param external_lineage_relationship: :class:`DeleteRequestExternalLineage` @@ -15690,9 +15457,7 @@ def delete_external_lineage_relationship(self, external_lineage_relationship: De query = {} if external_lineage_relationship is not None: query["external_lineage_relationship"] = external_lineage_relationship.as_dict() - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15708,7 +15473,7 @@ def list_external_lineage_relationships( page_size: Optional[int] = None, page_token: Optional[str] = None, ) -> Iterator[ExternalLineageInfo]: - """Lists external lineage relationships of a Databricks object or external metadata given a supplied + """Lists external lineage relationships of a object or external metadata given a supplied direction. :param object_info: :class:`ExternalLineageObject` @@ -15735,9 +15500,7 @@ def list_external_lineage_relationships( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15755,20 +15518,11 @@ def list_external_lineage_relationships( def update_external_lineage_relationship( self, external_lineage_relationship: UpdateRequestExternalLineage, update_mask: str ) -> ExternalLineageRelationship: - """Updates an external lineage relationship between a Databricks or external metadata object and another - external metadata object. + """Updates an external lineage relationship between a or external metadata object and + another external metadata object. :param external_lineage_relationship: :class:`UpdateRequestExternalLineage` :param update_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`ExternalLineageRelationship` """ @@ -15777,10 +15531,7 @@ def update_external_lineage_relationship( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15793,17 +15544,6 @@ def update_external_lineage_relationship( class ExternalLocationsAPI: - """An external location is an object that combines a cloud storage path with a storage credential that - authorizes access to the cloud storage path. Each external location is subject to Unity Catalog - access-control policies that control which users and groups can access the credential. If a user does not - have access to an external location in Unity Catalog, the request fails and Unity Catalog does not attempt - to authenticate to your cloud tenant on the user’s behalf. - - Databricks recommends using external locations rather than using storage credentials directly. - - To create external locations, you must be a metastore admin or a user with the - **CREATE_EXTERNAL_LOCATION** privilege.""" - def __init__(self, api_client): self._api = api_client @@ -15886,10 +15626,7 @@ def create( body["skip_validation"] = skip_validation if url is not None: body["url"] = url - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15913,9 +15650,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): query = {} if force is not None: query["force"] = force - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15939,9 +15674,7 @@ def get(self, name: str, *, include_browse: Optional[bool] = None) -> ExternalLo query = {} if include_browse is not None: query["include_browse"] = include_browse - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -15998,9 +15731,7 @@ def list( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16113,10 +15844,7 @@ def update( body["skip_validation"] = skip_validation if url is not None: body["url"] = url - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16127,13 +15855,6 @@ def update( class ExternalMetadataAPI: - """External Metadata objects enable customers to register and manage metadata about external systems within - Unity Catalog. - - These APIs provide a standardized way to create, update, retrieve, list, and delete external metadata - objects. Fine-grained authorization ensures that only users with appropriate permissions can view and - manage external metadata objects.""" - def __init__(self, api_client): self._api = api_client @@ -16149,10 +15870,7 @@ def create_external_metadata(self, external_metadata: ExternalMetadata) -> Exter body = external_metadata.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16170,9 +15888,7 @@ def delete_external_metadata(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16189,9 +15905,7 @@ def get_external_metadata(self, name: str) -> ExternalMetadata: :returns: :class:`ExternalMetadata` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16222,9 +15936,7 @@ def list_external_metadata( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16251,15 +15963,6 @@ def update_external_metadata( Name of the external metadata object. :param external_metadata: :class:`ExternalMetadata` :param update_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`ExternalMetadata` """ @@ -16268,10 +15971,7 @@ def update_external_metadata( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16284,12 +15984,6 @@ def update_external_metadata( class FunctionsAPI: - """Functions implement User-Defined Functions (UDFs) in Unity Catalog. - - The function implementation can be any SQL expression or Query, and it can be invoked wherever a table - reference is allowed in a query. In Unity Catalog, a function resides at the same level as a table, so it - can be referenced with the form **catalog_name**.**schema_name**.**function_name**.""" - def __init__(self, api_client): self._api = api_client @@ -16312,10 +16006,7 @@ def create(self, function_info: CreateFunction) -> FunctionInfo: body = {} if function_info is not None: body["function_info"] = function_info.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16377,9 +16068,7 @@ def get(self, name: str, *, include_browse: Optional[bool] = None) -> FunctionIn query = {} if include_browse is not None: query["include_browse"] = include_browse - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16441,9 +16130,7 @@ def list( query["page_token"] = page_token if schema_name is not None: query["schema_name"] = schema_name - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16484,10 +16171,7 @@ def update(self, name: str, *, owner: Optional[str] = None) -> FunctionInfo: body = {} if owner is not None: body["owner"] = owner - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16498,15 +16182,6 @@ def update(self, name: str, *, owner: Optional[str] = None) -> FunctionInfo: class GrantsAPI: - """In Unity Catalog, data is secure by default. Initially, users have no access to data in a metastore. - Access can be granted by either a metastore admin, the owner of an object, or the owner of the catalog or - schema that contains the object. 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.""" - def __init__(self, api_client): self._api = api_client @@ -16560,9 +16235,7 @@ def get( query["page_token"] = page_token if principal is not None: query["principal"] = principal - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16626,9 +16299,7 @@ def get_effective( query["page_token"] = page_token if principal is not None: query["principal"] = principal - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16686,9 +16357,7 @@ def list( query["page_token"] = page_token if principal is not None: query["principal"] = principal - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16754,9 +16423,7 @@ def list_effective( query["page_token"] = page_token if principal is not None: query["principal"] = principal - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16803,10 +16470,7 @@ def update( body["changes"] = [v.as_dict() for v in changes] if omit_permissions_in_response is not None: body["omit_permissions_in_response"] = omit_permissions_in_response - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16819,18 +16483,6 @@ def update( class MetastoresAPI: - """A metastore is the top-level container of objects in Unity Catalog. It stores data assets (tables and - views) and the permissions that govern access to them. Databricks account admins can create metastores and - assign them to Databricks workspaces to control which workloads use each metastore. For a workspace to use - Unity Catalog, it must have a Unity Catalog metastore attached. - - Each metastore is configured with a root storage location in a cloud storage account. This storage - location is used for metadata and managed tables data. - - NOTE: This metastore is distinct from the metastore included in Databricks workspaces created before Unity - Catalog was released. If your workspace includes a legacy Hive metastore, the data in that metastore is - available in a catalog named hive_metastore.""" - def __init__(self, api_client): self._api = api_client @@ -16845,7 +16497,7 @@ def assign(self, workspace_id: int, metastore_id: str, default_catalog_name: str The unique ID of the metastore. :param default_catalog_name: str The name of the default catalog in the metastore. This field is deprecated. Please use "Default - Namespace API" to configure the default catalog for a Databricks workspace. + Namespace API" to configure the default catalog for a workspace. """ @@ -16855,10 +16507,7 @@ def assign(self, workspace_id: int, metastore_id: str, default_catalog_name: str body["default_catalog_name"] = default_catalog_name if metastore_id is not None: body["metastore_id"] = metastore_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16900,10 +16549,7 @@ def create( body["region"] = region if storage_root is not None: body["storage_root"] = storage_root - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16919,9 +16565,7 @@ def current(self) -> MetastoreAssignment: :returns: :class:`MetastoreAssignment` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16944,9 +16588,7 @@ def delete(self, id: str, *, force: Optional[bool] = None): query = {} if force is not None: query["force"] = force - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -16964,9 +16606,7 @@ def get(self, id: str) -> MetastoreInfo: :returns: :class:`MetastoreInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17008,9 +16648,7 @@ def list(self, *, max_results: Optional[int] = None, page_token: Optional[str] = query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17035,9 +16673,7 @@ def summary(self) -> GetMetastoreSummaryResponse: :returns: :class:`GetMetastoreSummaryResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17060,9 +16696,7 @@ def unassign(self, workspace_id: int, metastore_id: str): query = {} if metastore_id is not None: query["metastore_id"] = metastore_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17130,10 +16764,7 @@ def update( body["privilege_model_version"] = privilege_model_version if storage_root_credential_id is not None: body["storage_root_credential_id"] = storage_root_credential_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17154,7 +16785,7 @@ def update_assignment( A workspace ID. :param default_catalog_name: str (optional) The name of the default catalog in the metastore. This field is deprecated. Please use "Default - Namespace API" to configure the default catalog for a Databricks workspace. + Namespace API" to configure the default catalog for a workspace. :param metastore_id: str (optional) The unique ID of the metastore. @@ -17166,10 +16797,7 @@ def update_assignment( body["default_catalog_name"] = default_catalog_name if metastore_id is not None: body["metastore_id"] = metastore_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17179,13 +16807,6 @@ def update_assignment( class ModelVersionsAPI: - """Databricks provides a hosted version of MLflow Model Registry in Unity Catalog. Models in Unity Catalog - provide centralized access control, auditing, lineage, and discovery of ML models across Databricks - workspaces. - - This API reference documents the REST endpoints for managing model versions in Unity Catalog. For more - details, see the [registered models API docs](/api/workspace/registeredmodels).""" - def __init__(self, api_client): self._api = api_client @@ -17245,9 +16866,7 @@ def get( query["include_aliases"] = include_aliases if include_browse is not None: query["include_browse"] = include_browse - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17278,9 +16897,7 @@ def get_by_alias(self, full_name: str, alias: str, *, include_aliases: Optional[ query = {} if include_aliases is not None: query["include_aliases"] = include_aliases - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17342,9 +16959,7 @@ def list( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17417,7 +17032,7 @@ def update( MLflow run ID used when creating the model version, if ``source`` was generated by an experiment run stored in an MLflow tracking server :param run_workspace_id: int (optional) - ID of the Databricks workspace containing the MLflow run that generated this model version, if + ID of the workspace containing the MLflow run that generated this model version, if applicable :param schema_name: str (optional) The name of the schema containing the model version, relative to parent catalog @@ -17471,10 +17086,7 @@ def update( body["updated_at"] = updated_at if updated_by is not None: body["updated_by"] = updated_by - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17487,7 +17099,7 @@ def update( class OnlineTablesAPI: - """Online tables provide lower latency and higher QPS access to data from Delta tables.""" + """Front-door (customer facing) service for Brickstore.""" def __init__(self, api_client): self._api = api_client @@ -17534,10 +17146,7 @@ def create(self, table: OnlineTable) -> Wait[OnlineTable]: body = table.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17562,9 +17171,7 @@ def delete(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17581,9 +17188,7 @@ def get(self, name: str) -> OnlineTable: :returns: :class:`OnlineTable` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17594,13 +17199,6 @@ def get(self, name: str) -> OnlineTable: class PoliciesAPI: - """Attribute-Based Access Control (ABAC) provides high leverage governance for enforcing compliance policies - in Unity Catalog. With ABAC policies, access is controlled in a hierarchical and scalable manner, based on - data attributes rather than specific resources, enabling more flexible and comprehensive access control. - ABAC policies in Unity Catalog support conditions on securable properties, governance tags, and - environment contexts. Callers must have the ``MANAGE`` privilege on a securable to view, create, update, - or delete ABAC policies.""" - def __init__(self, api_client): self._api = api_client @@ -17615,10 +17213,7 @@ def create_policy(self, policy_info: PolicyInfo) -> PolicyInfo: body = policy_info.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17640,9 +17235,7 @@ def delete_policy(self, on_securable_type: str, on_securable_fullname: str, name :returns: :class:`DeletePolicyResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17668,9 +17261,7 @@ def get_policy(self, on_securable_type: str, on_securable_fullname: str, name: s :returns: :class:`PolicyInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17725,9 +17316,7 @@ def list_policies( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17784,10 +17373,7 @@ def update_policy( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17804,15 +17390,6 @@ def update_policy( class QualityMonitorsAPI: - """Deprecated: Please use the Data Quality Monitors API instead (REST: /api/data-quality/v1/monitors), which - manages both Data Profiling and Anomaly Detection. - - A monitor computes and monitors data or model quality metrics for a table over time. It generates metrics - tables and a dashboard that you can use to monitor table health and set alerts. Most write operations - require the user to be the owner of the table (or its parent schema or parent catalog). Viewing the - dashboard, computed metrics, or monitor configuration only requires the user to have **SELECT** privileges - on the table (along with **USE_SCHEMA** and **USE_CATALOG**).""" - def __init__(self, api_client): self._api = api_client @@ -17828,21 +17405,14 @@ def cancel_refresh(self, table_name: str, refresh_id: int): """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( - "POST", - f"/api/2.1/unity-catalog/tables/{table_name}/monitor/refreshes/{refresh_id}/cancel", - body=body, - headers=headers, + "POST", f"/api/2.1/unity-catalog/tables/{table_name}/monitor/refreshes/{refresh_id}/cancel", headers=headers ) def create( @@ -17953,10 +17523,7 @@ def create( body["time_series"] = time_series.as_dict() if warehouse_id is not None: body["warehouse_id"] = warehouse_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -17979,8 +17546,6 @@ def delete(self, table_name: str) -> DeleteMonitorResponse: - **USE_SCHEMA** on the table's parent schema - be an owner of the table. - Additionally, the call must be made from the workspace where the monitor was created. - Note that the metric tables and dashboard will not be deleted as part of this call; those assets must be manually cleaned up (if desired). @@ -17991,9 +17556,7 @@ def delete(self, table_name: str) -> DeleteMonitorResponse: :returns: :class:`DeleteMonitorResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -18027,9 +17590,7 @@ def get(self, table_name: str) -> MonitorInfo: :returns: :class:`MonitorInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -18062,9 +17623,7 @@ def get_refresh(self, table_name: str, refresh_id: int) -> MonitorRefreshInfo: :returns: :class:`MonitorRefreshInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -18085,9 +17644,9 @@ def list_refreshes(self, table_name: str) -> MonitorRefreshListResponse: 2. have **USE_CATALOG** on the table's parent catalog and be an owner of the table's parent schema 3. have the following permissions: - - **USE_CATALOG** on the table's parent catalog - - **USE_SCHEMA** on the table's parent schema - - **SELECT** privilege on the table. + - **USE_CATALOG** on the table's parent catalog + - **USE_SCHEMA** on the table's parent schema + - **SELECT** privilege on the table. Additionally, the call must be made from the workspace where the monitor was created. @@ -18098,9 +17657,7 @@ def list_refreshes(self, table_name: str) -> MonitorRefreshListResponse: :returns: :class:`MonitorRefreshListResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -18141,10 +17698,7 @@ def regenerate_dashboard( body = {} if warehouse_id is not None: body["warehouse_id"] = warehouse_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -18178,19 +17732,13 @@ def run_refresh(self, table_name: str) -> MonitorRefreshInfo: :returns: :class:`MonitorRefreshInfo` """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id - res = self._api.do( - "POST", f"/api/2.1/unity-catalog/tables/{table_name}/monitor/refreshes", body=body, headers=headers - ) + res = self._api.do("POST", f"/api/2.1/unity-catalog/tables/{table_name}/monitor/refreshes", headers=headers) return MonitorRefreshInfo.from_dict(res) def update( @@ -18223,8 +17771,7 @@ def update( - **USE_SCHEMA** on the table's parent schema - be an owner of the table. - Additionally, the call must be made from the workspace where the monitor was created, and the caller - must be the original creator of the monitor. + the original creator of the monitor. Certain configuration fields, such as output asset identifiers, cannot be updated. @@ -18291,10 +17838,7 @@ def update( body["snapshot"] = snapshot.as_dict() if time_series is not None: body["time_series"] = time_series.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -18305,32 +17849,6 @@ def update( class RegisteredModelsAPI: - """Databricks provides a hosted version of MLflow Model Registry in Unity Catalog. Models in Unity Catalog - provide centralized access control, auditing, lineage, and discovery of ML models across Databricks - workspaces. - - 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 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 - privileges are required for various operations: - - - To create a registered model, users must additionally have the CREATE_MODEL permission on the target - schema. - - To view registered model or model version metadata, model version data files, or invoke a model version, - users must additionally have the EXECUTE permission on the registered model - - To update registered model or model version tags, users must additionally have APPLY TAG permissions on - the registered model - - To update other registered model or model version metadata (comments, aliases) create a 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 (for example, tagging, grants) that - specify a securable type, use FUNCTION as the securable type.""" - def __init__(self, api_client): self._api = api_client @@ -18426,10 +17944,7 @@ def create( body["updated_at"] = updated_at if updated_by is not None: body["updated_by"] = updated_by - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -18507,9 +18022,7 @@ def get( query["include_aliases"] = include_aliases if include_browse is not None: query["include_browse"] = include_browse - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -18588,9 +18101,7 @@ def list( query["page_token"] = page_token if schema_name is not None: query["schema_name"] = schema_name - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -18625,10 +18136,7 @@ def set_alias(self, full_name: str, alias: str, version_num: int) -> RegisteredM body = {} if version_num is not None: body["version_num"] = version_num - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -18730,10 +18238,7 @@ def update( body["updated_at"] = updated_at if updated_by is not None: body["updated_by"] = updated_by - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -18744,12 +18249,6 @@ def update( class ResourceQuotasAPI: - """Unity Catalog enforces resource quotas on all securable objects, which limits the number of resources that - can be created. Quotas are expressed in terms of a resource type and a parent (for example, tables per - metastore or schemas per catalog). The resource quota APIs enable you to monitor your current usage and - limits. For more information on resource quotas see the `Unity Catalog documentation - `__.""" - def __init__(self, api_client): self._api = api_client @@ -18768,9 +18267,7 @@ def get_quota(self, parent_securable_type: str, parent_full_name: str, quota_nam :returns: :class:`GetQuotaResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -18806,9 +18303,7 @@ def list_quotas( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -18827,10 +18322,7 @@ def list_quotas( class RfaAPI: - """Request for Access enables users to request access for Unity Catalog securables. - - These APIs provide a standardized way for securable owners (or users with MANAGE privileges) to manage - access request destinations.""" + """See http://go/protostyleguide/services.""" def __init__(self, api_client): self._api = api_client @@ -18857,10 +18349,7 @@ def batch_create_access_requests( body = {} if requests is not None: body["requests"] = [v.as_dict() for v in requests] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -18885,9 +18374,7 @@ def get_access_request_destinations(self, securable_type: str, full_name: str) - :returns: :class:`AccessRequestDestinations` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -18912,15 +18399,6 @@ def update_access_request_destinations( The access request destinations to assign to the securable. For each destination, a **destination_id** and **destination_type** must be defined. :param update_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`AccessRequestDestinations` """ @@ -18929,10 +18407,7 @@ def update_access_request_destinations( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -18943,11 +18418,6 @@ 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 - the USE_SCHEMA data permission on the schema and its parent catalog, and they must have the SELECT - permission on the table or view.""" - def __init__(self, api_client): self._api = api_client @@ -18993,10 +18463,7 @@ def create( body["properties"] = properties if storage_root is not None: body["storage_root"] = storage_root - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19020,9 +18487,7 @@ def delete(self, full_name: str, *, force: Optional[bool] = None): query = {} if force is not None: query["force"] = force - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19046,9 +18511,7 @@ def get(self, full_name: str, *, include_browse: Optional[bool] = None) -> Schem query = {} if include_browse is not None: query["include_browse"] = include_browse - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19104,9 +18567,7 @@ def list( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19170,10 +18631,7 @@ def update( body["owner"] = owner if properties is not None: body["properties"] = properties - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19184,11 +18642,7 @@ def update( class SecretsUcAPI: - """A secret is a Unity Catalog securable object that stores sensitive credential data (such as passwords, - tokens, and keys) within a three-level namespace (**catalog_name.schema_name.secret_name**). - - Secrets can be managed using standard Unity Catalog permissions and are scoped to a schema within a - catalog.""" + """See http://go/protostyleguide/services.""" def __init__(self, api_client): self._api = api_client @@ -19211,10 +18665,7 @@ def create_secret(self, secret: Secret) -> Secret: body = secret.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19235,9 +18686,7 @@ def delete_secret(self, full_name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19267,9 +18716,7 @@ def get_secret(self, full_name: str, *, include_value: Optional[bool] = None) -> query = {} if include_value is not None: query["include_value"] = include_value - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19324,9 +18771,7 @@ def list_secrets( query["page_token"] = page_token if schema_name is not None: query["schema_name"] = schema_name - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19371,10 +18816,7 @@ def update_secret(self, full_name: str, secret: Secret, update_mask: FieldMask) query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19387,17 +18829,6 @@ def update_secret(self, full_name: str, secret: Secret, update_mask: FieldMask) class StorageCredentialsAPI: - """A storage credential represents an authentication and authorization mechanism for accessing data stored on - your cloud tenant. Each storage credential is subject to Unity Catalog access-control policies that - control which users and groups can access the credential. If a user does not have access to a storage - credential in Unity Catalog, the request fails and Unity Catalog does not attempt to authenticate to your - cloud tenant on the user’s behalf. - - Databricks recommends using external locations rather than using storage credentials directly. - - To create storage credentials, you must be a Databricks account admin. The account admin who creates the - storage credential can delegate ownership to another user or group to manage permissions on it.""" - def __init__(self, api_client): self._api = api_client @@ -19433,7 +18864,7 @@ def create( :param comment: str (optional) Comment associated with the credential. :param databricks_gcp_service_account: :class:`DatabricksGcpServiceAccountRequest` (optional) - The Databricks managed GCP service account configuration. + The managed GCP service account configuration. :param read_only: bool (optional) Whether the credential is usable only for read operations. Only applicable when purpose is **STORAGE**. @@ -19462,10 +18893,7 @@ def create( body["read_only"] = read_only if skip_validation is not None: body["skip_validation"] = skip_validation - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19490,9 +18918,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): query = {} if force is not None: query["force"] = force - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19510,9 +18936,7 @@ def get(self, name: str) -> StorageCredentialInfo: :returns: :class:`StorageCredentialInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19564,9 +18988,7 @@ def list( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19618,7 +19040,7 @@ def update( :param comment: str (optional) Comment associated with the credential. :param databricks_gcp_service_account: :class:`DatabricksGcpServiceAccountRequest` (optional) - The Databricks managed GCP service account configuration. + The managed GCP service account configuration. :param force: bool (optional) Force update even if there are dependent external locations or external tables. :param isolation_mode: :class:`IsolationMode` (optional) @@ -19661,10 +19083,7 @@ def update( body["read_only"] = read_only if skip_validation is not None: body["skip_validation"] = skip_validation - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19705,7 +19124,7 @@ def validate( :param cloudflare_api_token: :class:`CloudflareApiToken` (optional) The Cloudflare API token configuration. :param databricks_gcp_service_account: :class:`DatabricksGcpServiceAccountRequest` (optional) - The Databricks created GCP service account configuration. + The created GCP service account configuration. :param external_location_name: str (optional) The name of an existing external location to validate. :param read_only: bool (optional) @@ -19737,10 +19156,7 @@ def validate( body["storage_credential_name"] = storage_credential_name if url is not None: body["url"] = url - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19751,9 +19167,6 @@ 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, and lineage information.""" - def __init__(self, api_client): self._api = api_client @@ -19769,9 +19182,7 @@ def disable(self, metastore_id: str, schema_name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19798,10 +19209,7 @@ def enable(self, metastore_id: str, schema_name: str, *, catalog_name: Optional[ body = {} if catalog_name is not None: body["catalog_name"] = catalog_name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19848,9 +19256,7 @@ def list( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19871,17 +19277,6 @@ def list( 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 - 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 - key. - - You can declare primary keys and foreign keys as part of the table specification during table creation. - You can also add or drop constraints on existing tables.""" - def __init__(self, api_client): self._api = api_client @@ -19908,10 +19303,7 @@ def create(self, full_name_arg: str, constraint: TableConstraint) -> TableConstr body["constraint"] = constraint.as_dict() if full_name_arg is not None: body["full_name_arg"] = full_name_arg - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19947,9 +19339,7 @@ def delete(self, full_name: str, constraint_name: str, cascade: bool): query["cascade"] = cascade if constraint_name is not None: query["constraint_name"] = constraint_name - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -19959,15 +19349,6 @@ def delete(self, full_name: str, constraint_name: str, cascade: bool): class TablesAPI: - """A table resides in the third layer of Unity Catalog’s three-level namespace. It contains rows of data. - To create a table, users must have CREATE_TABLE and USE_SCHEMA permissions on the schema, and they must - have the USE_CATALOG permission on its parent catalog. To query a table, users must have the SELECT - permission on the table, and they must have the USE_CATALOG permission on its parent catalog and the - USE_SCHEMA permission on its parent schema. - - A table can be managed or external. From an API perspective, a **VIEW** is a particular kind of table - (rather than a managed or external table).""" - def __init__(self, api_client): self._api = api_client @@ -19998,9 +19379,9 @@ def create( is not Spark compatible, the tables may not be readable by Databricks Runtime. NOTE: The Create Table API for external clients only supports creating **external delta tables**. The - values shown in the respective enums are all values supported by Databricks, however for this specific - Create Table API, only **table_type** **EXTERNAL** and **data_source_format** **DELTA** are supported. - Additionally, column masks are not supported when creating tables through this API. + values shown in the respective enums are all values supported by , however for this + specific Create Table API, only **table_type** **EXTERNAL** and **data_source_format** **DELTA** are + supported. Additionally, column masks are not supported when creating tables through this API. :param name: str Name of table, relative to parent schema. @@ -20037,10 +19418,7 @@ def create( body["storage_location"] = storage_location if table_type is not None: body["table_type"] = table_type.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20061,9 +19439,7 @@ def delete(self, full_name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20089,9 +19465,7 @@ def exists(self, full_name: str) -> TableExistsResponse: :returns: :class:`TableExistsResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20137,9 +19511,7 @@ def get( query["include_delta_metadata"] = include_delta_metadata if include_manifest_capabilities is not None: query["include_manifest_capabilities"] = include_manifest_capabilities - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20224,9 +19596,7 @@ def list( query["page_token"] = page_token if schema_name is not None: query["schema_name"] = schema_name - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20305,9 +19675,7 @@ def list_summaries( query["schema_name_pattern"] = schema_name_pattern if table_name_pattern is not None: query["table_name_pattern"] = table_name_pattern - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20339,10 +19707,7 @@ def update(self, full_name: str, *, owner: Optional[str] = None): body = {} if owner is not None: body["owner"] = owner - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20352,40 +19717,20 @@ def update(self, full_name: str, *, owner: Optional[str] = None): class TemporaryPathCredentialsAPI: - """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 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 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 the - external location owner explicitly and is not included in external location ownership or ALL PRIVILEGES on - the external location for security reasons.""" - def __init__(self, api_client): self._api = api_client def generate_temporary_path_credentials( self, url: str, operation: PathOperation, *, dry_run: Optional[bool] = None ) -> GenerateTemporaryPathCredentialResponse: - """Get a short-lived credential for directly accessing cloud storage locations registered in Databricks. - The Generate Temporary Path Credentials API is only supported for external storage paths, specifically - external locations and external tables. Managed tables are not supported by this API. The metastore - must have **external_access_enabled** flag set to true (default false). The caller must have the - **EXTERNAL_USE_LOCATION** privilege on the external location; this privilege can only be granted by - external location owners. For requests on existing external tables, the caller must also have the - **EXTERNAL_USE_SCHEMA** privilege on the parent schema; this privilege can only be granted by catalog - owners. + """Get a short-lived credential for directly accessing cloud storage locations registered in + . The Generate Temporary Path Credentials API is only supported for external storage + paths, specifically external locations and external tables. Managed tables are not supported by this + API. The metastore must have **external_access_enabled** flag set to true (default false). The caller + must have the **EXTERNAL_USE_LOCATION** privilege on the external location; this privilege can only be + granted by external location owners. For requests on existing external tables, the caller must also + have the **EXTERNAL_USE_SCHEMA** privilege on the parent schema; this privilege can only be granted by + catalog owners. :param url: str URL for path-based access. @@ -20406,10 +19751,7 @@ def generate_temporary_path_credentials( body["operation"] = operation.value if url is not None: body["url"] = url - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20420,20 +19762,6 @@ def generate_temporary_path_credentials( class TemporaryTableCredentialsAPI: - """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 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 @@ -20459,10 +19787,7 @@ def generate_temporary_table_credentials( body["operation"] = operation.value if table_id is not None: body["table_id"] = table_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20473,20 +19798,6 @@ def generate_temporary_table_credentials( class TemporaryVolumeCredentialsAPI: - """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 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 @@ -20512,10 +19823,7 @@ def generate_temporary_volume_credentials( body["operation"] = operation.value if volume_id is not None: body["volume_id"] = volume_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20526,13 +19834,6 @@ def generate_temporary_volume_credentials( class VolumesAPI: - """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 to those files across - workspaces, or transforming and querying non-tabular data files in ETL.""" - def __init__(self, api_client): self._api = api_client @@ -20598,10 +19899,7 @@ def create( body["storage_location"] = storage_location if volume_type is not None: body["volume_type"] = volume_type.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20693,9 +19991,7 @@ def list( query["page_token"] = page_token if schema_name is not None: query["schema_name"] = schema_name - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20729,9 +20025,7 @@ def read(self, name: str, *, include_browse: Optional[bool] = None) -> VolumeInf query = {} if include_browse is not None: query["include_browse"] = include_browse - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20770,10 +20064,7 @@ def update( body["new_name"] = new_name if owner is not None: body["owner"] = owner - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20784,26 +20075,6 @@ def update( class WorkspaceBindingsAPI: - """A securable in Databricks can be configured as **OPEN** or **ISOLATED**. An **OPEN** securable can be - accessed from any workspace, while an **ISOLATED** securable can only be accessed from a configured list - of workspaces. This API allows you to configure (bind) securables to workspaces. - - NOTE: The **isolation_mode** is configured for the securable itself (using its Update method) and the - workspace bindings are only consulted when the securable's **isolation_mode** is set to **ISOLATED**. - - 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. 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""" - def __init__(self, api_client): self._api = api_client @@ -20817,9 +20088,7 @@ def get(self, name: str) -> GetCatalogWorkspaceBindingsResponse: :returns: :class:`GetCatalogWorkspaceBindingsResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20870,9 +20139,7 @@ def get_bindings( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20919,10 +20186,7 @@ def update( body["assign_workspaces"] = [v for v in assign_workspaces] if unassign_workspaces is not None: body["unassign_workspaces"] = [v for v in unassign_workspaces] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -20964,10 +20228,7 @@ def update_bindings( body["add"] = [v.as_dict() for v in add] if remove is not None: body["remove"] = [v.as_dict() for v in remove] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/cleanrooms.py b/databricks/sdk/service/cleanrooms.py index edfc0ca7d..03e985746 100644 --- a/databricks/sdk/service/cleanrooms.py +++ b/databricks/sdk/service/cleanrooms.py @@ -24,12 +24,6 @@ ) -from databricks.sdk.service import catalog -from databricks.sdk.service import jobs -from databricks.sdk.service import settings -from databricks.sdk.service import sharing - - _LOG = logging.getLogger("databricks.sdk") @@ -64,7 +58,7 @@ class CleanRoom: using the separate CreateCleanRoomOutputCatalog API.""" owner: Optional[str] = None - """This is the Databricks username of the owner of the local clean room securable for permission + """This is the username of the owner of the local clean room securable for permission management.""" remote_detailed_info: Optional[CleanRoomRemoteDetail] = None @@ -1894,7 +1888,7 @@ def from_dict(cls, d: Dict[str, Any]) -> NotebookVersionReview: class CleanRoomAssetRevisionsAPI: - """Clean Room Asset Revisions denote new versions of uploaded assets (e.g. notebooks) in the clean room.""" + """Public Clean Room Service APIs""" def __init__(self, api_client): self._api = api_client @@ -1914,9 +1908,7 @@ def get(self, clean_room_name: str, asset_type: CleanRoomAssetAssetType, name: s :returns: :class:`CleanRoomAsset` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1959,9 +1951,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1983,8 +1973,7 @@ def list( class CleanRoomAssetsAPI: - """Clean room assets are data and code objects — Tables, volumes, and notebooks that are shared with the - clean room.""" + """Public Clean Room Service APIs""" def __init__(self, api_client): self._api = api_client @@ -2005,10 +1994,7 @@ def create(self, clean_room_name: str, asset: CleanRoomAsset) -> CleanRoomAsset: body = asset.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2045,10 +2031,7 @@ def create_clean_room_asset_review( body["jar_analysis_review"] = jar_analysis_review.as_dict() if notebook_review is not None: body["notebook_review"] = notebook_review.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2075,9 +2058,7 @@ def delete(self, clean_room_name: str, asset_type: CleanRoomAssetAssetType, name """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2100,9 +2081,7 @@ def get(self, clean_room_name: str, asset_type: CleanRoomAssetAssetType, name: s :returns: :class:`CleanRoomAsset` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2127,9 +2106,7 @@ def list(self, clean_room_name: str, *, page_token: Optional[str] = None) -> Ite query = {} if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2172,10 +2149,7 @@ def update( body = asset.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2191,8 +2165,7 @@ def update( class CleanRoomAutoApprovalRulesAPI: - """Clean room auto-approval rules automatically create an approval on your behalf when an asset (e.g. - notebook) meeting specific criteria is shared in a clean room.""" + """Public Clean Room Service APIs""" def __init__(self, api_client): self._api = api_client @@ -2210,10 +2183,7 @@ def create(self, clean_room_name: str, auto_approval_rule: CleanRoomAutoApproval body = {} if auto_approval_rule is not None: body["auto_approval_rule"] = auto_approval_rule.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2233,9 +2203,7 @@ def delete(self, clean_room_name: str, rule_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2252,9 +2220,7 @@ def get(self, clean_room_name: str, rule_id: str) -> CleanRoomAutoApprovalRule: :returns: :class:`CleanRoomAutoApprovalRule` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2284,9 +2250,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2320,10 +2284,7 @@ def update( body = auto_approval_rule.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2336,7 +2297,7 @@ def update( class CleanRoomTaskRunsAPI: - """Clean room task runs are the executions of notebooks and JAR analyses in a clean room.""" + """Public Clean Room Service APIs""" def __init__(self, api_client): self._api = api_client @@ -2370,9 +2331,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2421,9 +2380,7 @@ def list_clean_room_task_runs_handler( query["page_token"] = page_token if task_type is not None: query["task_type"] = task_type.value - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2442,9 +2399,7 @@ def list_clean_room_task_runs_handler( class CleanRoomsAPI: - """A clean room uses Delta Sharing and serverless compute to provide a secure and privacy-protecting - environment where multiple parties can work together on sensitive enterprise data without direct access to - each other's data.""" + """Public Clean Room Service APIs""" def __init__(self, api_client): self._api = api_client @@ -2492,10 +2447,7 @@ def create(self, clean_room: CleanRoom) -> Wait[CleanRoom]: body = clean_room.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2523,10 +2475,7 @@ def create_output_catalog( body = output_catalog.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2548,9 +2497,7 @@ def delete(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2566,9 +2513,7 @@ def get(self, name: str) -> CleanRoom: :returns: :class:`CleanRoom` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2594,9 +2539,7 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2627,10 +2570,7 @@ def update(self, name: str, *, clean_room: Optional[CleanRoom] = None) -> CleanR body = {} if clean_room is not None: body["clean_room"] = clean_room.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/compute.py b/databricks/sdk/service/compute.py index 14c5cd36e..350aaee6f 100644 --- a/databricks/sdk/service/compute.py +++ b/databricks/sdk/service/compute.py @@ -128,9 +128,9 @@ class AwsAttributes: These EBS volumes will be mounted at ``/ebs0``, ``/ebs1``, and etc. Instance store volumes will be mounted at ``/local_disk0``, ``/local_disk1``, and etc. - If EBS volumes are attached, Databricks will configure Spark to use only the EBS volumes for + If EBS volumes are attached, will configure Spark to use only the EBS volumes for scratch storage because heterogenously sized scratch devices can lead to inefficient disk - utilization. If no EBS volumes are attached, Databricks will configure Spark to use instance + utilization. If no EBS volumes are attached, will configure Spark to use instance store volumes. Please note that if EBS volumes are specified, then the Spark configuration ``spark.local.dir`` @@ -164,7 +164,7 @@ class AwsAttributes: instance_profile_arn: Optional[str] = None """Nodes for this cluster will only be placed on AWS instances with this instance profile. If ommitted, nodes will be placed on instances without an IAM instance profile. The instance - profile must have previously been added to the Databricks environment by an account + profile must have previously been added to the environment by an account administrator. This feature may only be available to certain customer plans.""" @@ -181,7 +181,7 @@ class AwsAttributes: zone_id: Optional[str] = None """Identifier for the availability zone/datacenter in which the cluster resides. This string will be of a form like "us-west-2a". The provided availability zone must be in the same region as the - Databricks deployment. For example, "us-west-2a" is not a valid zone id if the Databricks + deployment. For example, "us-west-2a" is not a valid zone id if the deployment resides in the "us-east-1" region. This is an optional field at cluster creation, and if not specified, the zone "auto" will be used. If the zone specified is "auto", will try to place cluster in a zone with high availability, and will retry placement in a different AZ if @@ -505,115 +505,6 @@ class CloudProviderNodeStatus(Enum): NOT_ENABLED_ON_SUBSCRIPTION = "NotEnabledOnSubscription" -@dataclass -class ClusterAccessControlRequest: - group_name: Optional[str] = None - """name of the group""" - - permission_level: Optional[ClusterPermissionLevel] = None - - service_principal_name: Optional[str] = None - """application ID of a service principal""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the ClusterAccessControlRequest into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ClusterAccessControlRequest into a shallow dictionary of its immediate attributes.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ClusterAccessControlRequest: - """Deserializes the ClusterAccessControlRequest from a dictionary.""" - return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", ClusterPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class ClusterAccessControlResponse: - all_permissions: Optional[List[ClusterPermission]] = None - """All permissions.""" - - display_name: Optional[str] = None - """Display name of the user or service principal.""" - - group_name: Optional[str] = None - """name of the group""" - - service_principal_name: Optional[str] = None - """Name of the service principal.""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the ClusterAccessControlResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ClusterAccessControlResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.all_permissions: - body["all_permissions"] = self.all_permissions - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ClusterAccessControlResponse: - """Deserializes the ClusterAccessControlResponse from a dictionary.""" - return cls( - all_permissions=_repeated_dict(d, "all_permissions", ClusterPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - @dataclass class ClusterAttributes: """Common set of attributes set during cluster creation. These attributes cannot be changed over @@ -651,10 +542,10 @@ class ClusterAttributes: automatically set based on the job and job run IDs.""" custom_tags: Optional[Dict[str, str]] = None - """Additional tags for cluster resources. Databricks will tag all cluster resources (e.g., AWS + """Additional tags for cluster resources. will tag all cluster resources (e.g., AWS instances and EBS volumes) with these tags in addition to ``default_tags``. Notes: - - Currently, Databricks allows at most 45 custom tags + - Currently, allows at most 45 custom tags - Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster tags""" @@ -703,7 +594,7 @@ class ClusterAttributes: is_single_node: Optional[bool] = None """This field can only be used when ``kind = CLASSIC_PREVIEW``. - When set to true, Databricks will automatically set single node related ``custom_tags``, + When set to true, will automatically set single node related ``custom_tags``, ``spark_conf``, and ``num_workers``""" kind: Optional[Kind] = None @@ -1005,7 +896,7 @@ def from_dict(cls, d: Dict[str, Any]) -> ClusterCompliance: @dataclass class ClusterDetails: - """Describes all of the metadata about a single Spark cluster in Databricks.""" + """Describes all of the metadata about a single Spark cluster in .""" autoscale: Optional[AutoScale] = None """Parameters needed in order to automatically scale clusters up and down based on load. Note: @@ -1053,31 +944,29 @@ class ClusterDetails: automatically set based on the job and job run IDs.""" cluster_source: Optional[ClusterSource] = None - """Determines whether the cluster was created by a user through the UI, created by the Databricks - Jobs Scheduler, or through an API request.""" creator_user_name: Optional[str] = None """Creator user name. The field won't be included in the response if the user has already been deleted.""" custom_tags: Optional[Dict[str, str]] = None - """Additional tags for cluster resources. Databricks will tag all cluster resources (e.g., AWS + """Additional tags for cluster resources. will tag all cluster resources (e.g., AWS instances and EBS volumes) with these tags in addition to ``default_tags``. Notes: - - Currently, Databricks allows at most 45 custom tags + - Currently, allows at most 45 custom tags - Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster tags""" data_security_mode: Optional[DataSecurityMode] = None default_tags: Optional[Dict[str, str]] = None - """Tags that are added by Databricks regardless of any ``custom_tags``, including: + """Tags that are added by regardless of any ``custom_tags``, including: - - Vendor: Databricks + - Vendor: - Creator: - ClusterName: - ClusterId: - - Name: """ + - Name: < internal use>""" dependency_mode: Optional[DependencyMode] = None """Controls dependency configuration for the cluster.""" @@ -1087,7 +976,7 @@ class ClusterDetails: driver: Optional[SparkNode] = None """Node on which the Spark driver resides. The driver node contains the Spark master and the - Databricks application that manages the per-notebook Spark REPLs.""" + application that manages the per-notebook Spark REPLs.""" driver_instance_pool_id: Optional[str] = None """The optional ID of the instance pool for the driver of the cluster belongs. The pool cluster @@ -1129,7 +1018,7 @@ class ClusterDetails: is_single_node: Optional[bool] = None """This field can only be used when ``kind = CLASSIC_PREVIEW``. - When set to true, Databricks will automatically set single node related ``custom_tags``, + When set to true, will automatically set single node related ``custom_tags``, ``spark_conf``, and ``num_workers``""" jdbc_port: Optional[int] = None @@ -1673,355 +1562,6 @@ def from_dict(cls, d: Dict[str, Any]) -> ClusterLogConf: ) -@dataclass -class ClusterPermission: - inherited: Optional[bool] = None - - inherited_from_object: Optional[List[str]] = None - - permission_level: Optional[ClusterPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the ClusterPermission into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ClusterPermission into a shallow dictionary of its immediate attributes.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ClusterPermission: - """Deserializes the ClusterPermission from a dictionary.""" - return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", ClusterPermissionLevel), - ) - - -class ClusterPermissionLevel(Enum): - """Permission level""" - - CAN_ATTACH_TO = "CAN_ATTACH_TO" - CAN_MANAGE = "CAN_MANAGE" - CAN_RESTART = "CAN_RESTART" - - -@dataclass -class ClusterPermissions: - access_control_list: Optional[List[ClusterAccessControlResponse]] = None - - object_id: Optional[str] = None - - object_type: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the ClusterPermissions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ClusterPermissions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.access_control_list: - body["access_control_list"] = self.access_control_list - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ClusterPermissions: - """Deserializes the ClusterPermissions from a dictionary.""" - return cls( - access_control_list=_repeated_dict(d, "access_control_list", ClusterAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), - ) - - -@dataclass -class ClusterPermissionsDescription: - description: Optional[str] = None - - permission_level: Optional[ClusterPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the ClusterPermissionsDescription into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ClusterPermissionsDescription into a shallow dictionary of its immediate attributes.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ClusterPermissionsDescription: - """Deserializes the ClusterPermissionsDescription from a dictionary.""" - return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", ClusterPermissionLevel), - ) - - -@dataclass -class ClusterPolicyAccessControlRequest: - group_name: Optional[str] = None - """name of the group""" - - permission_level: Optional[ClusterPolicyPermissionLevel] = None - - service_principal_name: Optional[str] = None - """application ID of a service principal""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the ClusterPolicyAccessControlRequest into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ClusterPolicyAccessControlRequest into a shallow dictionary of its immediate attributes.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyAccessControlRequest: - """Deserializes the ClusterPolicyAccessControlRequest from a dictionary.""" - return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", ClusterPolicyPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class ClusterPolicyAccessControlResponse: - all_permissions: Optional[List[ClusterPolicyPermission]] = None - """All permissions.""" - - display_name: Optional[str] = None - """Display name of the user or service principal.""" - - group_name: Optional[str] = None - """name of the group""" - - service_principal_name: Optional[str] = None - """Name of the service principal.""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the ClusterPolicyAccessControlResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ClusterPolicyAccessControlResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.all_permissions: - body["all_permissions"] = self.all_permissions - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyAccessControlResponse: - """Deserializes the ClusterPolicyAccessControlResponse from a dictionary.""" - return cls( - all_permissions=_repeated_dict(d, "all_permissions", ClusterPolicyPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class ClusterPolicyPermission: - inherited: Optional[bool] = None - - inherited_from_object: Optional[List[str]] = None - - permission_level: Optional[ClusterPolicyPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the ClusterPolicyPermission into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ClusterPolicyPermission into a shallow dictionary of its immediate attributes.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyPermission: - """Deserializes the ClusterPolicyPermission from a dictionary.""" - return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", ClusterPolicyPermissionLevel), - ) - - -class ClusterPolicyPermissionLevel(Enum): - """Permission level""" - - CAN_USE = "CAN_USE" - - -@dataclass -class ClusterPolicyPermissions: - access_control_list: Optional[List[ClusterPolicyAccessControlResponse]] = None - - object_id: Optional[str] = None - - object_type: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the ClusterPolicyPermissions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ClusterPolicyPermissions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.access_control_list: - body["access_control_list"] = self.access_control_list - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyPermissions: - """Deserializes the ClusterPolicyPermissions from a dictionary.""" - return cls( - access_control_list=_repeated_dict(d, "access_control_list", ClusterPolicyAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), - ) - - -@dataclass -class ClusterPolicyPermissionsDescription: - description: Optional[str] = None - - permission_level: Optional[ClusterPolicyPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the ClusterPolicyPermissionsDescription into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ClusterPolicyPermissionsDescription into a shallow dictionary of its immediate attributes.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyPermissionsDescription: - """Deserializes the ClusterPolicyPermissionsDescription from a dictionary.""" - return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", ClusterPolicyPermissionLevel), - ) - - @dataclass class ClusterSettingsChange: """Represents a change to the cluster settings required for the cluster to become compliant with @@ -2163,10 +1703,10 @@ class ClusterSpec: automatically set based on the job and job run IDs.""" custom_tags: Optional[Dict[str, str]] = None - """Additional tags for cluster resources. Databricks will tag all cluster resources (e.g., AWS + """Additional tags for cluster resources. will tag all cluster resources (e.g., AWS instances and EBS volumes) with these tags in addition to ``default_tags``. Notes: - - Currently, Databricks allows at most 45 custom tags + - Currently, allows at most 45 custom tags - Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster tags""" @@ -2215,7 +1755,7 @@ class ClusterSpec: is_single_node: Optional[bool] = None """This field can only be used when ``kind = CLASSIC_PREVIEW``. - When set to true, Databricks will automatically set single node related ``custom_tags``, + When set to true, will automatically set single node related ``custom_tags``, ``spark_conf``, and ``num_workers``""" kind: Optional[Kind] = None @@ -2798,8 +2338,8 @@ class DataPlaneEventDetailsEventType(Enum): class DataSecurityMode(Enum): """Data security mode decides what data governance model to use when accessing data from a cluster. - - ``DATA_SECURITY_MODE_AUTO``: Databricks will choose the most appropriate access mode depending - on your compute configuration. + - ``DATA_SECURITY_MODE_AUTO``: will choose the most appropriate access mode + depending on your compute configuration. - ``DATA_SECURITY_MODE_STANDARD``: A secure cluster that can be shared by multiple users. Cluster users are fully isolated so that they cannot see each other’s data and credentials. Most data governance features are supported in this mode. But programming languages and @@ -2938,8 +2478,8 @@ def from_dict(cls, d: Dict[str, Any]) -> DeleteResponse: class DependencyMode(Enum): """Controls dependency configuration for the cluster. - - ``DEPENDENCY_MODE_AUTO``: Databricks will choose the most appropriate dependency mode based on - your compute configuration. + - ``DEPENDENCY_MODE_AUTO``: will choose the most appropriate dependency mode based + on your compute configuration. - ``DEPENDENCY_MODE_ENVIRONMENTS``: Enables a unified dependency management experience across classic and serverless, resulting in increased stability and performance. Supported only on DBR 19+ in Standard access mode. @@ -2973,7 +2513,7 @@ def from_dict(cls, d: Dict[str, Any]) -> DestroyResponse: class DiskSpec: """Describes the disks that are launched for each instance in the spark cluster. For example, if the cluster has 3 instances, each instance is configured to launch 2 disks, 100 GiB each, then - Databricks will launch a total of 6 disks, 100 GiB each, for this cluster.""" + will launch a total of 6 disks, 100 GiB each, for this cluster.""" disk_count: Optional[int] = None """The number of disks launched for each instance: @@ -2983,9 +2523,9 @@ class DiskSpec: - For node types with no OS disk, at least one disk must be specified; otherwise, cluster creation will fail. - If disks are attached, Databricks will configure Spark to use only the disks for scratch + If disks are attached, will configure Spark to use only the disks for scratch storage, because heterogenously sized scratch devices can lead to inefficient disk utilization. - If no disks are attached, Databricks will configure Spark to use instance store disks. + If no disks are attached, will configure Spark to use instance store disks. Note: If disks are specified, then the Spark configuration ``spark.local.dir`` will be overridden. @@ -3094,7 +2634,7 @@ def from_dict(cls, d: Dict[str, Any]) -> DiskType: class DiskTypeAzureDiskVolumeType(Enum): - """All Azure Disk types that Databricks supports. See + """All Azure Disk types that supports. See https://docs.microsoft.com/en-us/azure/storage/storage-about-disks-and-vhds-linux#types-of-disks""" PREMIUM_LRS = "PREMIUM_LRS" @@ -3102,7 +2642,7 @@ class DiskTypeAzureDiskVolumeType(Enum): class DiskTypeEbsVolumeType(Enum): - """All EBS volume types that Databricks supports. See https://aws.amazon.com/ebs/details/ for + """All EBS volume types that supports. See https://aws.amazon.com/ebs/details/ for details.""" GENERAL_PURPOSE_SSD = "GENERAL_PURPOSE_SSD" @@ -3174,7 +2714,7 @@ def from_dict(cls, d: Dict[str, Any]) -> DockerImage: class EbsVolumeType(Enum): - """All EBS volume types that Databricks supports. See https://aws.amazon.com/ebs/details/ for + """All EBS volume types that supports. See https://aws.amazon.com/ebs/details/ for details.""" GENERAL_PURPOSE_SSD = "GENERAL_PURPOSE_SSD" @@ -3336,10 +2876,10 @@ class EnforcePolicyComplianceForClusterResponseClusterSettings: automatically set based on the job and job run IDs.""" custom_tags: Optional[Dict[str, str]] = None - """Additional tags for cluster resources. Databricks will tag all cluster resources (e.g., AWS + """Additional tags for cluster resources. will tag all cluster resources (e.g., AWS instances and EBS volumes) with these tags in addition to ``default_tags``. Notes: - - Currently, Databricks allows at most 45 custom tags + - Currently, allows at most 45 custom tags - Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster tags""" @@ -3388,7 +2928,7 @@ class EnforcePolicyComplianceForClusterResponseClusterSettings: is_single_node: Optional[bool] = None """This field can only be used when ``kind = CLASSIC_PREVIEW``. - When set to true, Databricks will automatically set single node related ``custom_tags``, + When set to true, will automatically set single node related ``custom_tags``, ``spark_conf``, and ``num_workers``""" kind: Optional[Kind] = None @@ -3675,11 +3215,11 @@ class Environment: """The base environment this environment is built on top of. A base environment defines the environment version and a list of dependencies for serverless compute. The value can be a file path to a custom ``env.yaml`` file (e.g., ``/Workspace/path/to/env.yaml``). Support for a - Databricks-provided base environment ID (e.g., ``workspace-base-environments/databricks_ai_v4``) - and workspace base environment ID (e.g., + -provided base environment ID (e.g., + ``workspace-base-environments/databricks_ai_v4``) and workspace base environment ID (e.g., ``workspace-base-environments/dbe_b849b66e-b31a-4cb5-b161-1f2b10877fb7``) is in Beta. Either ``environment_version`` or ``base_environment`` can be provided. For more information about - Databricks-provided base environments, see the [list workspace base + -provided base environments, see the [list workspace base environments](:method:Environments/ListWorkspaceBaseEnvironments) API. For more information, see""" client: Optional[str] = None @@ -3690,7 +3230,7 @@ class Environment: dependency is a valid pip requirements file line per https://pip.pypa.io/en/stable/reference/requirements-file-format/. Allowed dependencies include a requirement specifier, an archive URL, a local project path (such as WSFS or UC Volumes in - Databricks), or a VCS project URL.""" + ), or a VCS project URL.""" environment_version: Optional[str] = None """Either ``environment_version`` or ``base_environment`` needs to be provided. Environment version @@ -4002,7 +3542,7 @@ class GcpAttributes: google_service_account: Optional[str] = None """If provided, the cluster will impersonate the google service account when accessing gcloud services (like GCS). The google service account must have previously been added to the - Databricks environment by an account administrator.""" + environment by an account administrator.""" local_ssd_count: Optional[int] = None """If provided, each node (workers and driver) in the cluster will have this number of local SSDs @@ -4019,9 +3559,9 @@ class GcpAttributes: """Identifier for the availability zone in which the cluster resides. This can be one of the following: - - "HA" => High availability, spread nodes across availability zones for a Databricks deployment - region [default]. - - "AUTO" => Databricks picks an availability zone to schedule the cluster on. + - "HA" => High availability, spread nodes across availability zones for a + deployment region [default]. + - "AUTO" => picks an availability zone to schedule the cluster on. - A GCP availability zone => Pick One of the available zones for (machine type + region) from https://cloud.google.com/compute/docs/regions-zones.""" @@ -4165,56 +3705,6 @@ def from_dict(cls, d: Dict[str, Any]) -> GetClusterComplianceResponse: ) -@dataclass -class GetClusterPermissionLevelsResponse: - permission_levels: Optional[List[ClusterPermissionsDescription]] = None - """Specific permission levels""" - - def as_dict(self) -> dict: - """Serializes the GetClusterPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GetClusterPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.permission_levels: - body["permission_levels"] = self.permission_levels - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GetClusterPermissionLevelsResponse: - """Deserializes the GetClusterPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", ClusterPermissionsDescription)) - - -@dataclass -class GetClusterPolicyPermissionLevelsResponse: - permission_levels: Optional[List[ClusterPolicyPermissionsDescription]] = None - """Specific permission levels""" - - def as_dict(self) -> dict: - """Serializes the GetClusterPolicyPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GetClusterPolicyPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.permission_levels: - body["permission_levels"] = self.permission_levels - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GetClusterPolicyPermissionLevelsResponse: - """Deserializes the GetClusterPolicyPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", ClusterPolicyPermissionsDescription)) - - @dataclass class GetEvents: cluster_id: str @@ -4402,15 +3892,15 @@ class GetInstancePool: of default values will be used.""" custom_tags: Optional[Dict[str, str]] = None - """Additional tags for pool resources. Databricks will tag all pool resources (e.g., AWS instances - and EBS volumes) with these tags in addition to ``default_tags``. Notes: + """Additional tags for pool resources. will tag all pool resources (e.g., AWS + instances and EBS volumes) with these tags in addition to ``default_tags``. Notes: - - Currently, Databricks allows at most 45 custom tags""" + - Currently, allows at most 45 custom tags""" default_tags: Optional[Dict[str, str]] = None - """Tags that are added by Databricks regardless of any ``custom_tags``, including: + """Tags that are added by regardless of any ``custom_tags``, including: - - Vendor: Databricks + - Vendor: - InstancePoolCreator: - InstancePoolName: - InstancePoolId: """ @@ -4605,31 +4095,6 @@ def from_dict(cls, d: Dict[str, Any]) -> GetInstancePool: ) -@dataclass -class GetInstancePoolPermissionLevelsResponse: - permission_levels: Optional[List[InstancePoolPermissionsDescription]] = None - """Specific permission levels""" - - def as_dict(self) -> dict: - """Serializes the GetInstancePoolPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GetInstancePoolPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.permission_levels: - body["permission_levels"] = self.permission_levels - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GetInstancePoolPermissionLevelsResponse: - """Deserializes the GetInstancePoolPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", InstancePoolPermissionsDescription)) - - @dataclass class GetSparkVersionsResponse: versions: Optional[List[SparkVersion]] = None @@ -4728,13 +4193,13 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> GlobalInitScriptDetails: """Deserializes the GlobalInitScriptDetails from a dictionary.""" return cls( - created_at=d.get("created_at", None), + created_at=_int64(d, "created_at"), created_by=d.get("created_by", None), enabled=d.get("enabled", None), name=d.get("name", None), position=d.get("position", None), script_id=d.get("script_id", None), - updated_at=d.get("updated_at", None), + updated_at=_int64(d, "updated_at"), updated_by=d.get("updated_by", None), ) @@ -4819,21 +4284,21 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> GlobalInitScriptDetailsWithContent: """Deserializes the GlobalInitScriptDetailsWithContent from a dictionary.""" return cls( - created_at=d.get("created_at", None), + created_at=_int64(d, "created_at"), created_by=d.get("created_by", None), enabled=d.get("enabled", None), name=d.get("name", None), position=d.get("position", None), script=d.get("script", None), script_id=d.get("script_id", None), - updated_at=d.get("updated_at", None), + updated_at=_int64(d, "updated_at"), updated_by=d.get("updated_by", None), ) class HardwareAcceleratorType(Enum): """HardwareAcceleratorType: The type of hardware accelerator to use for compute workloads. NOTE: - This enum is referenced and is intended to be used by other Databricks services that need to + This enum is referenced and is intended to be used by other services that need to specify hardware accelerator requirements for AI compute workloads.""" GPU_1X_A10 = "GPU_1xA10" @@ -5103,134 +4568,25 @@ def from_dict(cls, d: Dict[str, Any]) -> InitScriptInfoAndExecutionDetails: stderr=d.get("stderr", None), volumes=_from_dict(d, "volumes", VolumesStorageInfo), workspace=_from_dict(d, "workspace", WorkspaceStorageInfo), - ) - - -@dataclass -class InstallLibrariesResponse: - def as_dict(self) -> dict: - """Serializes the InstallLibrariesResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - return body - - def as_shallow_dict(self) -> dict: - """Serializes the InstallLibrariesResponse into a shallow dictionary of its immediate attributes.""" - body = {} - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> InstallLibrariesResponse: - """Deserializes the InstallLibrariesResponse from a dictionary.""" - return cls() - - -@dataclass -class InstancePoolAccessControlRequest: - group_name: Optional[str] = None - """name of the group""" - - permission_level: Optional[InstancePoolPermissionLevel] = None - - service_principal_name: Optional[str] = None - """application ID of a service principal""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the InstancePoolAccessControlRequest into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the InstancePoolAccessControlRequest into a shallow dictionary of its immediate attributes.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> InstancePoolAccessControlRequest: - """Deserializes the InstancePoolAccessControlRequest from a dictionary.""" - return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", InstancePoolPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class InstancePoolAccessControlResponse: - all_permissions: Optional[List[InstancePoolPermission]] = None - """All permissions.""" - - display_name: Optional[str] = None - """Display name of the user or service principal.""" - - group_name: Optional[str] = None - """name of the group""" - - service_principal_name: Optional[str] = None - """Name of the service principal.""" + ) - user_name: Optional[str] = None - """name of the user""" +@dataclass +class InstallLibrariesResponse: def as_dict(self) -> dict: - """Serializes the InstancePoolAccessControlResponse into a dictionary suitable for use as a JSON request body.""" + """Serializes the InstallLibrariesResponse into a dictionary suitable for use as a JSON request body.""" body = {} - if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: - """Serializes the InstancePoolAccessControlResponse into a shallow dictionary of its immediate attributes.""" + """Serializes the InstallLibrariesResponse into a shallow dictionary of its immediate attributes.""" body = {} - if self.all_permissions: - body["all_permissions"] = self.all_permissions - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name return body @classmethod - def from_dict(cls, d: Dict[str, Any]) -> InstancePoolAccessControlResponse: - """Deserializes the InstancePoolAccessControlResponse from a dictionary.""" - return cls( - all_permissions=_repeated_dict(d, "all_permissions", InstancePoolPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) + def from_dict(cls, d: Dict[str, Any]) -> InstallLibrariesResponse: + """Deserializes the InstallLibrariesResponse from a dictionary.""" + return cls() @dataclass @@ -5244,15 +4600,15 @@ class InstancePoolAndStats: of default values will be used.""" custom_tags: Optional[Dict[str, str]] = None - """Additional tags for pool resources. Databricks will tag all pool resources (e.g., AWS instances - and EBS volumes) with these tags in addition to ``default_tags``. Notes: + """Additional tags for pool resources. will tag all pool resources (e.g., AWS + instances and EBS volumes) with these tags in addition to ``default_tags``. Notes: - - Currently, Databricks allows at most 45 custom tags""" + - Currently, allows at most 45 custom tags""" default_tags: Optional[Dict[str, str]] = None - """Tags that are added by Databricks regardless of any ``custom_tags``, including: + """Tags that are added by regardless of any ``custom_tags``, including: - - Vendor: Databricks + - Vendor: - InstancePoolCreator: - InstancePoolName: - InstancePoolId: """ @@ -5463,7 +4819,7 @@ class InstancePoolAwsAttributes: clusters that use the pool will inherit the instance profile, and must not specify their own instance profile on cluster creation or update. If the pool does not specify an instance profile, clusters using the pool may specify any instance profile. The instance profile must - have previously been added to the Databricks environment by an account administrator. + have previously been added to the environment by an account administrator. This feature may only be available to certain customer plans.""" @@ -5479,7 +4835,7 @@ class InstancePoolAwsAttributes: zone_id: Optional[str] = None """Identifier for the availability zone/datacenter in which the cluster resides. This string will be of a form like "us-west-2a". The provided availability zone must be in the same region as the - Databricks deployment. For example, "us-west-2a" is not a valid zone id if the Databricks + deployment. For example, "us-west-2a" is not a valid zone id if the deployment resides in the "us-east-1" region. This is an optional field at cluster creation, and if not specified, a default zone will be used. The list of available zones as well as the default value can be found by using the ``List Zones`` method.""" @@ -5522,7 +4878,10 @@ def from_dict(cls, d: Dict[str, Any]) -> InstancePoolAwsAttributes: class InstancePoolAwsAttributesAvailability(Enum): - """The set of AWS availability types supported when setting up nodes for a cluster.""" + """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.""" ON_DEMAND = "ON_DEMAND" SPOT = "SPOT" @@ -5593,7 +4952,8 @@ def from_dict(cls, d: Dict[str, Any]) -> InstancePoolAzureAttributes: class InstancePoolAzureAttributesAvailability(Enum): - """The set of Azure availability types supported when setting up nodes for a cluster.""" + """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.""" ON_DEMAND_AZURE = "ON_DEMAND_AZURE" SPOT_AZURE = "SPOT_AZURE" @@ -5614,18 +4974,18 @@ class InstancePoolGcpAttributes: zone_id: Optional[str] = None """Identifier for the availability zone/datacenter in which the cluster resides. This string will be of a form like "us-west1-a". The provided availability zone must be in the same region as the - Databricks workspace. For example, "us-west1-a" is not a valid zone id if the Databricks + workspace. For example, "us-west1-a" is not a valid zone id if the workspace resides in the "us-east1" region. This is an optional field at instance pool creation, and if not specified, a default zone will be used. This field can be one of the following: - - "HA" => High availability, spread nodes across availability zones for a Databricks deployment - region + - "HA" => High availability, spread nodes across availability zones for a + deployment region - A GCP availability zone => Pick One of the available zones for (machine type + region) from https://cloud.google.com/compute/docs/regions-zones (e.g. "us-west1-a"). - If empty, Databricks picks an availability zone to schedule the cluster on.""" + If empty, picks an availability zone to schedule the cluster on.""" def as_dict(self) -> dict: """Serializes the InstancePoolGcpAttributes into a dictionary suitable for use as a JSON request body.""" @@ -5659,126 +5019,6 @@ def from_dict(cls, d: Dict[str, Any]) -> InstancePoolGcpAttributes: ) -@dataclass -class InstancePoolPermission: - inherited: Optional[bool] = None - - inherited_from_object: Optional[List[str]] = None - - permission_level: Optional[InstancePoolPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the InstancePoolPermission into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the InstancePoolPermission into a shallow dictionary of its immediate attributes.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> InstancePoolPermission: - """Deserializes the InstancePoolPermission from a dictionary.""" - return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", InstancePoolPermissionLevel), - ) - - -class InstancePoolPermissionLevel(Enum): - """Permission level""" - - CAN_ATTACH_TO = "CAN_ATTACH_TO" - CAN_MANAGE = "CAN_MANAGE" - - -@dataclass -class InstancePoolPermissions: - access_control_list: Optional[List[InstancePoolAccessControlResponse]] = None - - object_id: Optional[str] = None - - object_type: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the InstancePoolPermissions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - def as_shallow_dict(self) -> dict: - """Serializes the InstancePoolPermissions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.access_control_list: - body["access_control_list"] = self.access_control_list - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> InstancePoolPermissions: - """Deserializes the InstancePoolPermissions from a dictionary.""" - return cls( - access_control_list=_repeated_dict(d, "access_control_list", InstancePoolAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), - ) - - -@dataclass -class InstancePoolPermissionsDescription: - description: Optional[str] = None - - permission_level: Optional[InstancePoolPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the InstancePoolPermissionsDescription into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the InstancePoolPermissionsDescription into a shallow dictionary of its immediate attributes.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> InstancePoolPermissionsDescription: - """Deserializes the InstancePoolPermissionsDescription from a dictionary.""" - return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", InstancePoolPermissionLevel), - ) - - class InstancePoolState(Enum): """The state of a Cluster. The current allowable state transitions are as follows: @@ -5873,12 +5113,12 @@ def from_dict(cls, d: Dict[str, Any]) -> InstancePoolStatus: @dataclass class InstanceProfile: instance_profile_arn: str - """The AWS ARN of the instance profile to register with Databricks. This field is required.""" + """The AWS ARN of the instance profile to register with . This field is required.""" iam_role_arn: Optional[str] = None """The AWS IAM role ARN of the role associated with the instance profile. This field is required if your role name and instance profile name do not match and you want to use the instance profile - with `Databricks SQL Serverless `__. + with [Databricks SQL Serverless](/sql/admin/serverless.html). Otherwise, this field is optional.""" @@ -6202,16 +5442,12 @@ def from_dict(cls, d: Dict[str, Any]) -> ListClusterCompliancesResponse: @dataclass class ListClustersFilterBy: cluster_sources: Optional[List[ClusterSource]] = None - """The source of cluster creation.""" cluster_states: Optional[List[State]] = None - """The current state of the clusters.""" is_pinned: Optional[bool] = None - """Whether the clusters are pinned or not.""" policy_id: Optional[str] = None - """The ID of the cluster policy used to create the cluster if applicable.""" def as_dict(self) -> dict: """Serializes the ListClustersFilterBy into a dictionary suitable for use as a JSON request body.""" @@ -6297,11 +5533,8 @@ def from_dict(cls, d: Dict[str, Any]) -> ListClustersResponse: @dataclass class ListClustersSortBy: direction: Optional[ListClustersSortByDirection] = None - """The direction to sort by.""" field: Optional[ListClustersSortByField] = None - """The sorting criteria. By default, clusters are sorted by 3 columns from highest to lowest - precedence: cluster state, pinned or unpinned, then cluster name.""" def as_dict(self) -> dict: """Serializes the ListClustersSortBy into a dictionary suitable for use as a JSON request body.""" @@ -6603,9 +5836,6 @@ def from_dict(cls, d: Dict[str, Any]) -> LogSyncStatus: return cls(last_attempted=_int64(d, "last_attempted"), last_exception=d.get("last_exception", None)) -MapAny = Dict[str, Any] - - @dataclass class MavenLibrary: coordinates: str @@ -7095,7 +6325,7 @@ class Policy: """Additional human-readable description of the cluster policy.""" is_default: Optional[bool] = None - """If true, policy is a default policy created and managed by Databricks. Default policies cannot + """If true, policy is a default policy created and managed by . Default policies cannot be deleted, and their policy families cannot be changed.""" libraries: Optional[List[Library]] = None @@ -8077,10 +7307,10 @@ class UpdateClusterResource: automatically set based on the job and job run IDs.""" custom_tags: Optional[Dict[str, str]] = None - """Additional tags for cluster resources. Databricks will tag all cluster resources (e.g., AWS + """Additional tags for cluster resources. will tag all cluster resources (e.g., AWS instances and EBS volumes) with these tags in addition to ``default_tags``. Notes: - - Currently, Databricks allows at most 45 custom tags + - Currently, allows at most 45 custom tags - Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster tags""" @@ -8129,7 +7359,7 @@ class UpdateClusterResource: is_single_node: Optional[bool] = None """This field can only be used when ``kind = CLASSIC_PREVIEW``. - When set to true, Databricks will automatically set single node related ``custom_tags``, + When set to true, will automatically set single node related ``custom_tags``, ``spark_conf``, and ``num_workers``""" kind: Optional[Kind] = None @@ -8519,30 +7749,6 @@ def from_dict(cls, d: Dict[str, Any]) -> WorkspaceStorageInfo: class ClusterPoliciesAPI: - """You can use cluster policies to control users' ability to configure clusters based on a set of rules. - These rules specify which attributes or attribute values can be used during cluster creation. Cluster - policies have ACLs that limit their use to specific users and groups. - - With cluster policies, you can: - - - Auto-install cluster libraries on the next restart by listing them in the policy's "libraries" field - (Public Preview). - - Limit users to creating clusters with the prescribed settings. - - Simplify the user interface, enabling more users to create clusters, by fixing and hiding some fields. - - Manage costs by setting limits on attributes that impact the hourly rate. - - Cluster policy permissions limit which policies a user can select in the Policy drop-down when the user - creates a cluster: - - - A user who has unrestricted cluster create permission can select the Unrestricted policy and create - fully-configurable clusters. - - A user who has both unrestricted cluster create permission and access to cluster policies can select the - Unrestricted policy and policies they have access to. - - A user that has access to only cluster policies, can select the policies they have access to. - - If no policies exist in the workspace, the Policy drop-down doesn't appear. Only admin users can create, - edit, and delete policies. Admin users also have access to all policies.""" - def __init__(self, api_client): self._api = api_client @@ -8605,10 +7811,7 @@ def create( body["policy_family_definition_overrides"] = policy_family_definition_overrides if policy_family_id is not None: body["policy_family_id"] = policy_family_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8629,10 +7832,7 @@ def delete(self, policy_id: str): body = {} if policy_id is not None: body["policy_id"] = policy_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8705,10 +7905,7 @@ def edit( body["policy_family_id"] = policy_family_id if policy_id is not None: body["policy_id"] = policy_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8728,9 +7925,7 @@ def get(self, policy_id: str) -> Policy: query = {} if policy_id is not None: query["policy_id"] = policy_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8739,49 +7934,6 @@ def get(self, policy_id: str) -> Policy: res = self._api.do("GET", "/api/2.0/policies/clusters/get", query=query, headers=headers) return Policy.from_dict(res) - def get_permission_levels(self, cluster_policy_id: str) -> GetClusterPolicyPermissionLevelsResponse: - """Gets the permission levels that a user can have on an object. - - :param cluster_policy_id: str - The cluster policy for which to get or manage permissions. - - :returns: :class:`GetClusterPolicyPermissionLevelsResponse` - """ - - 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/permissions/cluster-policies/{cluster_policy_id}/permissionLevels", headers=headers - ) - return GetClusterPolicyPermissionLevelsResponse.from_dict(res) - - def get_permissions(self, cluster_policy_id: str) -> ClusterPolicyPermissions: - """Gets the permissions of a cluster policy. Cluster policies can inherit permissions from their root - object. - - :param cluster_policy_id: str - The cluster policy for which to get or manage permissions. - - :returns: :class:`ClusterPolicyPermissions` - """ - - 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/permissions/cluster-policies/{cluster_policy_id}", headers=headers) - return ClusterPolicyPermissions.from_dict(res) - def list( self, *, sort_column: Optional[ListSortColumn] = None, sort_order: Optional[ListSortOrder] = None ) -> Iterator[Policy]: @@ -8806,9 +7958,7 @@ def list( query["sort_column"] = sort_column.value if sort_order is not None: query["sort_order"] = sort_order.value - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8818,89 +7968,8 @@ def list( parsed = ListPoliciesResponse.from_dict(json).policies return parsed if parsed is not None else [] - def set_permissions( - self, cluster_policy_id: str, *, access_control_list: Optional[List[ClusterPolicyAccessControlRequest]] = None - ) -> ClusterPolicyPermissions: - """Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct - permissions if none are specified. Objects can inherit permissions from their root object. - - :param cluster_policy_id: str - The cluster policy for which to get or manage permissions. - :param access_control_list: List[:class:`ClusterPolicyAccessControlRequest`] (optional) - - :returns: :class:`ClusterPolicyPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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( - "PUT", f"/api/2.0/permissions/cluster-policies/{cluster_policy_id}", body=body, headers=headers - ) - return ClusterPolicyPermissions.from_dict(res) - - def update_permissions( - self, cluster_policy_id: str, *, access_control_list: Optional[List[ClusterPolicyAccessControlRequest]] = None - ) -> ClusterPolicyPermissions: - """Updates the permissions on a cluster policy. Cluster policies can inherit permissions from their root - object. - - :param cluster_policy_id: str - The cluster policy for which to get or manage permissions. - :param access_control_list: List[:class:`ClusterPolicyAccessControlRequest`] (optional) - - :returns: :class:`ClusterPolicyPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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/permissions/cluster-policies/{cluster_policy_id}", body=body, headers=headers - ) - return ClusterPolicyPermissions.from_dict(res) - class ClustersAPI: - """The Clusters API allows you to create, start, edit, list, terminate, and delete clusters. - - Databricks maps cluster node instance types to compute units known as DBUs. See the instance type pricing - page for a list of the supported instance types and their corresponding DBUs. - - A Databricks cluster is a set of computation resources and configurations on which you run data - engineering, data science, and data analytics workloads, such as production ETL pipelines, streaming - analytics, ad-hoc analytics, and machine learning. - - You run these workloads as a set of commands in a notebook or as an automated job. Databricks makes a - distinction between all-purpose clusters and job clusters. You use all-purpose clusters to analyze data - collaboratively using interactive notebooks. You use job clusters to run fast and robust automated jobs. - - You can create an all-purpose cluster using the UI, CLI, or REST API. You can manually terminate and - restart an all-purpose cluster. Multiple users can share such clusters to do collaborative interactive - analysis. - - IMPORTANT: Databricks retains cluster configuration information for terminated clusters for 30 days. To - keep an all-purpose cluster configuration even after it has been terminated for more than 30 days, an - administrator can pin a cluster to the cluster list.""" - def __init__(self, api_client): self._api = api_client @@ -8988,10 +8057,7 @@ def change_owner(self, cluster_id: str, owner_username: str): body["cluster_id"] = cluster_id if owner_username is not None: body["owner_username"] = owner_username - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9042,16 +8108,16 @@ def create( """Creates a new Spark cluster. This method will acquire new instances from the cloud provider if necessary. This method is asynchronous; the returned ``cluster_id`` can be used to poll the cluster status. When this method returns, the cluster will be in a ``PENDING`` state. The cluster will be - usable once it enters a ``RUNNING`` state. Note: Databricks may not be able to acquire some of the + usable once it enters a ``RUNNING`` state. Note: may not be able to acquire some of the requested nodes, due to cloud provider limitations (account limits, spot price, etc.) or transient network issues. - If Databricks acquires at least 85% of the requested on-demand nodes, cluster creation will succeed. + If acquires at least 85% of the requested on-demand nodes, cluster creation will succeed. Otherwise the cluster will terminate with an informative error message. Rather than authoring the cluster's JSON definition from scratch, Databricks recommends filling out - the `create compute UI `__ and then copying the - generated JSON definition from the UI. + the [create compute UI](/compute/configure.html) and then copying the generated JSON definition from + the UI. :param spark_version: str The Spark version of the cluster, e.g. ``3.3.x-scala2.11``. A list of available Spark versions can @@ -9086,10 +8152,10 @@ def create( the cluster name will be an empty string. For job clusters, the cluster name is automatically set based on the job and job run IDs. :param custom_tags: Dict[str,str] (optional) - Additional tags for cluster resources. Databricks will tag all cluster resources (e.g., AWS + Additional tags for cluster resources. will tag all cluster resources (e.g., AWS instances and EBS volumes) with these tags in addition to ``default_tags``. Notes: - - Currently, Databricks allows at most 45 custom tags + - Currently, allows at most 45 custom tags - Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster tags :param data_security_mode: :class:`DataSecurityMode` (optional) :param dependency_mode: :class:`DependencyMode` (optional) @@ -9125,7 +8191,7 @@ def create( :param is_single_node: bool (optional) This field can only be used when ``kind = CLASSIC_PREVIEW``. - When set to true, Databricks will automatically set single node related ``custom_tags``, + When set to true, will automatically set single node related ``custom_tags``, ``spark_conf``, and ``num_workers`` :param kind: :class:`Kind` (optional) :param node_type_id: str (optional) @@ -9267,10 +8333,7 @@ def create( body["worker_node_type_flexibility"] = worker_node_type_flexibility.as_dict() if workload_type is not None: body["workload_type"] = workload_type.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9379,10 +8442,7 @@ def delete(self, cluster_id: str) -> Wait[ClusterDetails]: body = {} if cluster_id is not None: body["cluster_id"] = cluster_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9479,10 +8539,10 @@ def edit( the cluster name will be an empty string. For job clusters, the cluster name is automatically set based on the job and job run IDs. :param custom_tags: Dict[str,str] (optional) - Additional tags for cluster resources. Databricks will tag all cluster resources (e.g., AWS + Additional tags for cluster resources. will tag all cluster resources (e.g., AWS instances and EBS volumes) with these tags in addition to ``default_tags``. Notes: - - Currently, Databricks allows at most 45 custom tags + - Currently, allows at most 45 custom tags - Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster tags :param data_security_mode: :class:`DataSecurityMode` (optional) :param dependency_mode: :class:`DependencyMode` (optional) @@ -9518,7 +8578,7 @@ def edit( :param is_single_node: bool (optional) This field can only be used when ``kind = CLASSIC_PREVIEW``. - When set to true, Databricks will automatically set single node related ``custom_tags``, + When set to true, will automatically set single node related ``custom_tags``, ``spark_conf``, and ``num_workers`` :param kind: :class:`Kind` (optional) :param node_type_id: str (optional) @@ -9660,10 +8720,7 @@ def edit( body["worker_node_type_flexibility"] = worker_node_type_flexibility.as_dict() if workload_type is not None: body["workload_type"] = workload_type.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9819,10 +8876,7 @@ def events( body["page_token"] = page_token if start_time is not None: body["start_time"] = start_time - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9850,9 +8904,7 @@ def get(self, cluster_id: str) -> ClusterDetails: query = {} if cluster_id is not None: query["cluster_id"] = cluster_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9861,46 +8913,6 @@ def get(self, cluster_id: str) -> ClusterDetails: res = self._api.do("GET", "/api/2.1/clusters/get", query=query, headers=headers) return ClusterDetails.from_dict(res) - def get_permission_levels(self, cluster_id: str) -> GetClusterPermissionLevelsResponse: - """Gets the permission levels that a user can have on an object. - - :param cluster_id: str - The cluster for which to get or manage permissions. - - :returns: :class:`GetClusterPermissionLevelsResponse` - """ - - 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/permissions/clusters/{cluster_id}/permissionLevels", headers=headers) - return GetClusterPermissionLevelsResponse.from_dict(res) - - def get_permissions(self, cluster_id: str) -> ClusterPermissions: - """Gets the permissions of a cluster. Clusters can inherit permissions from their root object. - - :param cluster_id: str - The cluster for which to get or manage permissions. - - :returns: :class:`ClusterPermissions` - """ - - 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/permissions/clusters/{cluster_id}", headers=headers) - return ClusterPermissions.from_dict(res) - def list( self, *, @@ -9913,7 +8925,6 @@ def list( 30 days. Clusters terminated prior to this period are not included. :param filter_by: :class:`ListClustersFilterBy` (optional) - Filters to apply to the list of clusters. :param page_size: int (optional) Use this field to specify the maximum number of results to be returned by the server. The server may further constrain the maximum number of results returned in a single page. @@ -9921,7 +8932,6 @@ def list( Use next_page_token or prev_page_token returned from the previous request to list the next or previous page of clusters respectively. :param sort_by: :class:`ListClustersSortBy` (optional) - Sort the list of clusters by a specific criteria. :returns: Iterator over :class:`ClusterDetails` """ @@ -9935,9 +8945,7 @@ def list( query["page_token"] = page_token if sort_by is not None: query["sort_by"] = sort_by.as_dict() - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9959,9 +8967,7 @@ def list_node_types(self) -> ListNodeTypesResponse: :returns: :class:`ListNodeTypesResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9978,9 +8984,7 @@ def list_zones(self) -> ListAvailableZonesResponse: :returns: :class:`ListAvailableZonesResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10005,10 +9009,7 @@ def permanent_delete(self, cluster_id: str): body = {} if cluster_id is not None: body["cluster_id"] = cluster_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10028,10 +9029,7 @@ def pin(self, cluster_id: str): body = {} if cluster_id is not None: body["cluster_id"] = cluster_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10072,10 +9070,7 @@ def resize( body["cluster_id"] = cluster_id if num_workers is not None: body["num_workers"] = num_workers - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10112,10 +9107,7 @@ def restart(self, cluster_id: str, *, restart_user: Optional[str] = None) -> Wai body["cluster_id"] = cluster_id if restart_user is not None: body["restart_user"] = restart_user - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10129,34 +9121,6 @@ def restart_and_wait( ) -> ClusterDetails: return self.restart(cluster_id=cluster_id, restart_user=restart_user).result(timeout=timeout) - def set_permissions( - self, cluster_id: str, *, access_control_list: Optional[List[ClusterAccessControlRequest]] = None - ) -> ClusterPermissions: - """Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct - permissions if none are specified. Objects can inherit permissions from their root object. - - :param cluster_id: str - The cluster for which to get or manage permissions. - :param access_control_list: List[:class:`ClusterAccessControlRequest`] (optional) - - :returns: :class:`ClusterPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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("PUT", f"/api/2.0/permissions/clusters/{cluster_id}", body=body, headers=headers) - return ClusterPermissions.from_dict(res) - def spark_versions(self) -> GetSparkVersionsResponse: """Returns the list of available Spark versions. These versions can be used to launch a cluster. @@ -10164,9 +9128,7 @@ def spark_versions(self) -> GetSparkVersionsResponse: :returns: :class:`GetSparkVersionsResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10181,8 +9143,9 @@ def start(self, cluster_id: str) -> Wait[ClusterDetails]: - The previous cluster id and attributes are preserved. - The cluster starts with the last specified cluster size. - - If the previous cluster was an autoscaling cluster, the current cluster starts with the minimum - number of nodes. + + - If the previous cluster was an autoscaling cluster, the current cluster starts with the minimum + number of nodes. - If the cluster is not currently in a ``TERMINATED`` state, nothing will happen. - Clusters launched to run a job cannot be started. @@ -10197,10 +9160,7 @@ def start(self, cluster_id: str) -> Wait[ClusterDetails]: body = {} if cluster_id is not None: body["cluster_id"] = cluster_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10225,10 +9185,7 @@ def unpin(self, cluster_id: str): body = {} if cluster_id is not None: body["cluster_id"] = cluster_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10253,16 +9210,6 @@ def update( :param update_mask: str Used to specify which cluster attributes and size fields to update. See https://google.aip.dev/161 for more details. - - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :param cluster: :class:`UpdateClusterResource` (optional) The cluster to be updated. @@ -10278,10 +9225,7 @@ def update( body["cluster_id"] = cluster_id if update_mask is not None: body["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10300,38 +9244,8 @@ def update_and_wait( ) -> ClusterDetails: return self.update(cluster=cluster, cluster_id=cluster_id, update_mask=update_mask).result(timeout=timeout) - def update_permissions( - self, cluster_id: str, *, access_control_list: Optional[List[ClusterAccessControlRequest]] = None - ) -> ClusterPermissions: - """Updates the permissions on a cluster. Clusters can inherit permissions from their root object. - - :param cluster_id: str - The cluster for which to get or manage permissions. - :param access_control_list: List[:class:`ClusterAccessControlRequest`] (optional) - - :returns: :class:`ClusterPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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/permissions/clusters/{cluster_id}", body=body, headers=headers) - return ClusterPermissions.from_dict(res) - class CommandExecutionAPI: - """This API allows execution of Python, Scala, SQL, or R commands on running Databricks Clusters. This API - only supports (classic) all-purpose clusters. Serverless compute is not supported.""" - def __init__(self, api_client): self._api = api_client @@ -10467,10 +9381,7 @@ def cancel( body["commandId"] = command_id if context_id is not None: body["contextId"] = context_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10513,9 +9424,7 @@ def command_status(self, cluster_id: str, context_id: str, command_id: str) -> C query["commandId"] = command_id if context_id is not None: query["contextId"] = context_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10538,9 +9447,7 @@ def context_status(self, cluster_id: str, context_id: str) -> ContextStatusRespo query["clusterId"] = cluster_id if context_id is not None: query["contextId"] = context_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10570,10 +9477,7 @@ def create( body["clusterId"] = cluster_id if language is not None: body["language"] = language.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10606,10 +9510,7 @@ def destroy(self, cluster_id: str, context_id: str): body["clusterId"] = cluster_id if context_id is not None: body["contextId"] = context_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10651,10 +9552,7 @@ def execute( body["contextId"] = context_id if language is not None: body["language"] = language.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10684,14 +9582,6 @@ def execute_and_wait( class GlobalInitScriptsAPI: - """The Global Init Scripts API enables Workspace administrators to configure global initialization scripts - for their workspace. These scripts run on every node in every cluster in the workspace. - - **Important:** Existing clusters must be restarted to pick up any changes made to global init scripts. - Global init scripts are run in order. If the init script returns with a bad exit code, the Apache Spark - container fails to launch and init scripts with later position are skipped. If enough containers fail, the - entire cluster fails with a ``GLOBAL_INIT_SCRIPT_FAILURE`` error code.""" - def __init__(self, api_client): self._api = api_client @@ -10729,10 +9619,7 @@ def create( body["position"] = position if script is not None: body["script"] = script - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10750,9 +9637,7 @@ def delete(self, script_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10769,9 +9654,7 @@ def get(self, script_id: str) -> GlobalInitScriptDetailsWithContent: :returns: :class:`GlobalInitScriptDetailsWithContent` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10789,9 +9672,7 @@ def list(self) -> Iterator[GlobalInitScriptDetails]: :returns: Iterator over :class:`GlobalInitScriptDetails` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10838,10 +9719,7 @@ def update( body["position"] = position if script is not None: body["script"] = script - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10851,21 +9729,6 @@ def update( class InstancePoolsAPI: - """Instance Pools API are used to create, edit, delete and list instance pools by using ready-to-use cloud - instances which reduces a cluster start and auto-scaling times. - - Databricks pools reduce cluster start and auto-scaling times by maintaining a set of idle, ready-to-use - instances. When a cluster is attached to a pool, cluster nodes are created using the pool’s idle - instances. If the pool has no idle instances, the pool expands by allocating a new instance from the - instance provider in order to accommodate the cluster’s request. When a cluster releases an instance, it - returns to the pool and is free for another cluster to use. Only clusters attached to a pool can use that - pool’s idle instances. - - You can specify a different pool for the driver node and worker nodes, or use the same pool for both. - - Databricks does not charge DBUs while instances are idle in the pool. Instance provider billing does - apply. See pricing.""" - def __init__(self, api_client): self._api = api_client @@ -10907,10 +9770,10 @@ def create( Attributes related to instance pools running on Azure. If not specified at pool creation, a set of default values will be used. :param custom_tags: Dict[str,str] (optional) - Additional tags for pool resources. Databricks will tag all pool resources (e.g., AWS instances and - EBS volumes) with these tags in addition to ``default_tags``. Notes: + Additional tags for pool resources. will tag all pool resources (e.g., AWS instances + and EBS volumes) with these tags in addition to ``default_tags``. Notes: - - Currently, Databricks allows at most 45 custom tags + - Currently, allows at most 45 custom tags :param disk_spec: :class:`DiskSpec` (optional) Defines the specification of the disks that will be attached to all spark containers. :param enable_elastic_disk: bool (optional) @@ -10984,10 +9847,7 @@ def create( body["remote_disk_throughput"] = remote_disk_throughput if total_initial_remote_disk_size is not None: body["total_initial_remote_disk_size"] = total_initial_remote_disk_size - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11008,10 +9868,7 @@ def delete(self, instance_pool_id: str): body = {} if instance_pool_id is not None: body["instance_pool_id"] = instance_pool_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11046,10 +9903,10 @@ def edit( `clusters/listNodeTypes `__ API call. :param custom_tags: Dict[str,str] (optional) - Additional tags for pool resources. Databricks will tag all pool resources (e.g., AWS instances and - EBS volumes) with these tags in addition to ``default_tags``. Notes: + Additional tags for pool resources. will tag all pool resources (e.g., AWS instances + and EBS volumes) with these tags in addition to ``default_tags``. Notes: - - Currently, Databricks allows at most 45 custom tags + - Currently, allows at most 45 custom tags :param idle_instance_autotermination_minutes: int (optional) Automatically terminates the extra instances in the pool cache after they are inactive for this time in minutes if min_idle_instances requirement is already met. If not set, the extra pool instances @@ -11091,10 +9948,7 @@ def edit( body["remote_disk_throughput"] = remote_disk_throughput if total_initial_remote_disk_size is not None: body["total_initial_remote_disk_size"] = total_initial_remote_disk_size - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11114,9 +9968,7 @@ def get(self, instance_pool_id: str) -> GetInstancePool: query = {} if instance_pool_id is not None: query["instance_pool_id"] = instance_pool_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11125,49 +9977,6 @@ def get(self, instance_pool_id: str) -> GetInstancePool: res = self._api.do("GET", "/api/2.0/instance-pools/get", query=query, headers=headers) return GetInstancePool.from_dict(res) - def get_permission_levels(self, instance_pool_id: str) -> GetInstancePoolPermissionLevelsResponse: - """Gets the permission levels that a user can have on an object. - - :param instance_pool_id: str - The instance pool for which to get or manage permissions. - - :returns: :class:`GetInstancePoolPermissionLevelsResponse` - """ - - 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/permissions/instance-pools/{instance_pool_id}/permissionLevels", headers=headers - ) - return GetInstancePoolPermissionLevelsResponse.from_dict(res) - - def get_permissions(self, instance_pool_id: str) -> InstancePoolPermissions: - """Gets the permissions of an instance pool. Instance pools can inherit permissions from their root - object. - - :param instance_pool_id: str - The instance pool for which to get or manage permissions. - - :returns: :class:`InstancePoolPermissions` - """ - - 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/permissions/instance-pools/{instance_pool_id}", headers=headers) - return InstancePoolPermissions.from_dict(res) - def list(self) -> Iterator[InstancePoolAndStats]: """Gets a list of instance pools with their statistics. @@ -11175,9 +9984,7 @@ def list(self) -> Iterator[InstancePoolAndStats]: :returns: Iterator over :class:`InstancePoolAndStats` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11187,72 +9994,8 @@ def list(self) -> Iterator[InstancePoolAndStats]: parsed = ListInstancePools.from_dict(json).instance_pools return parsed if parsed is not None else [] - def set_permissions( - self, instance_pool_id: str, *, access_control_list: Optional[List[InstancePoolAccessControlRequest]] = None - ) -> InstancePoolPermissions: - """Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct - permissions if none are specified. Objects can inherit permissions from their root object. - - :param instance_pool_id: str - The instance pool for which to get or manage permissions. - :param access_control_list: List[:class:`InstancePoolAccessControlRequest`] (optional) - - :returns: :class:`InstancePoolPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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("PUT", f"/api/2.0/permissions/instance-pools/{instance_pool_id}", body=body, headers=headers) - return InstancePoolPermissions.from_dict(res) - - def update_permissions( - self, instance_pool_id: str, *, access_control_list: Optional[List[InstancePoolAccessControlRequest]] = None - ) -> InstancePoolPermissions: - """Updates the permissions on an instance pool. Instance pools can inherit permissions from their root - object. - - :param instance_pool_id: str - The instance pool for which to get or manage permissions. - :param access_control_list: List[:class:`InstancePoolAccessControlRequest`] (optional) - - :returns: :class:`InstancePoolPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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/permissions/instance-pools/{instance_pool_id}", body=body, headers=headers - ) - return InstancePoolPermissions.from_dict(res) - class InstanceProfilesAPI: - """The Instance Profiles API allows admins to add, list, and remove instance profiles that users can launch - clusters with. Regular users can list the instance profiles available to them. See `Secure access to S3 - buckets - `__ - using instance profiles for more information.""" - def __init__(self, api_client): self._api = api_client @@ -11264,17 +10007,17 @@ def add( is_meta_instance_profile: Optional[bool] = None, skip_validation: Optional[bool] = None, ): - """Registers an instance profile in Databricks. In the UI, you can then give users the permission to use - this instance profile when launching clusters. + """Registers an instance profile in . In the UI, you can then give users the permission to + use this instance profile when launching clusters. This API is only available to admin users. :param instance_profile_arn: str - The AWS ARN of the instance profile to register with Databricks. This field is required. + The AWS ARN of the instance profile to register with . This field is required. :param iam_role_arn: str (optional) The AWS IAM role ARN of the role associated with the instance profile. This field is required if your role name and instance profile name do not match and you want to use the instance profile with - `Databricks SQL Serverless `__. + [Databricks SQL Serverless](/sql/admin/serverless.html). Otherwise, this field is optional. :param is_meta_instance_profile: bool (optional) @@ -11283,7 +10026,7 @@ def add( wide range of roles. Therefore it should always be used with authorization. This field is optional, the default value is ``false``. :param skip_validation: bool (optional) - By default, Databricks validates that it has sufficient permissions to launch instances with the + By default, validates that it has sufficient permissions to launch instances with the instance profile. This validation uses AWS dry-run mode for the RunInstances API. If validation fails with an error message that does not indicate an IAM related permission issue, (e.g. “Your requested instance type is not supported in your requested availability zone”), you can pass this @@ -11301,10 +10044,7 @@ def add( body["is_meta_instance_profile"] = is_meta_instance_profile if skip_validation is not None: body["skip_validation"] = skip_validation - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11324,20 +10064,19 @@ def edit( - Your role name and instance profile name do not match. The name is the part after the last slash in each ARN. - - You want to use the instance profile with `Databricks SQL Serverless - `__. + - You want to use the instance profile with [Databricks SQL Serverless](/sql/admin/serverless.html). - To understand where these fields are in the AWS console, see `Enable serverless SQL warehouses - `__. + To understand where these fields are in the AWS console, see [Enable serverless SQL + warehouses](/sql/admin/serverless.html). This API is only available to admin users. :param instance_profile_arn: str - The AWS ARN of the instance profile to register with Databricks. This field is required. + The AWS ARN of the instance profile to register with . This field is required. :param iam_role_arn: str (optional) The AWS IAM role ARN of the role associated with the instance profile. This field is required if your role name and instance profile name do not match and you want to use the instance profile with - `Databricks SQL Serverless `__. + [Databricks SQL Serverless](/sql/admin/serverless.html). Otherwise, this field is optional. :param is_meta_instance_profile: bool (optional) @@ -11356,10 +10095,7 @@ def edit( body["instance_profile_arn"] = instance_profile_arn if is_meta_instance_profile is not None: body["is_meta_instance_profile"] = is_meta_instance_profile - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11376,9 +10112,7 @@ def list(self) -> Iterator[InstanceProfile]: :returns: Iterator over :class:`InstanceProfile` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11403,10 +10137,7 @@ def remove(self, instance_profile_arn: str): body = {} if instance_profile_arn is not None: body["instance_profile_arn"] = instance_profile_arn - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11416,20 +10147,6 @@ def remove(self, instance_profile_arn: str): class LibrariesAPI: - """The Libraries API allows you to install and uninstall libraries and get the status of libraries on a - cluster. - - To make third-party or custom code available to notebooks and jobs running on your clusters, you can - install a library. Libraries can be written in Python, Java, Scala, and R. You can upload Python, Java, - Scala and R libraries and point to external packages in PyPI, Maven, and CRAN repositories. - - Cluster libraries can be used by all notebooks running on a cluster. You can install a cluster library - directly from a public repository such as PyPI or Maven, using a previously installed workspace library, - or using an init script. - - When you uninstall a library from a cluster, the library is removed only when you restart the cluster. - Until you restart the cluster, the status of the uninstalled library appears as Uninstall pending restart.""" - def __init__(self, api_client): self._api = api_client @@ -11441,9 +10158,7 @@ def all_cluster_statuses(self) -> Iterator[ClusterLibraryStatuses]: :returns: Iterator over :class:`ClusterLibraryStatuses` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11471,9 +10186,7 @@ def cluster_status(self, cluster_id: str) -> Iterator[LibraryFullStatus]: query = {} if cluster_id is not None: query["cluster_id"] = cluster_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11500,10 +10213,7 @@ def install(self, cluster_id: str, libraries: List[Library]): body["cluster_id"] = cluster_id if libraries is not None: body["libraries"] = [v.as_dict() for v in libraries] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11528,10 +10238,7 @@ def uninstall(self, cluster_id: str, libraries: List[Library]): body["cluster_id"] = cluster_id if libraries is not None: body["libraries"] = [v.as_dict() for v in libraries] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11541,15 +10248,6 @@ def uninstall(self, cluster_id: str, libraries: List[Library]): class PolicyComplianceForClustersAPI: - """The policy compliance APIs allow you to view and manage the policy compliance status of clusters in your - workspace. - - A cluster is compliant with its policy if its configuration satisfies all its policy rules. Clusters could - be out of compliance if their policy was updated after the cluster was last edited. - - The get and list compliance APIs allow you to view the policy compliance status of a cluster. The enforce - compliance API allows you to update a cluster to be compliant with the current version of its policy.""" - def __init__(self, api_client): self._api = api_client @@ -11573,10 +10271,7 @@ def cancel_pending_cluster_enforcement( body["allow_missing"] = allow_missing if cluster_id is not None: body["cluster_id"] = cluster_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11631,10 +10326,7 @@ def enforce_compliance( body["enforce_mode"] = enforce_mode.value if validate_only is not None: body["validate_only"] = validate_only - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11656,9 +10348,7 @@ def get_compliance(self, cluster_id: str) -> GetClusterComplianceResponse: query = {} if cluster_id is not None: query["cluster_id"] = cluster_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11692,9 +10382,7 @@ def list_compliance( query["page_token"] = page_token if policy_id is not None: query["policy_id"] = policy_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11711,16 +10399,6 @@ def list_compliance( class PolicyFamiliesAPI: - """View available policy families. A policy family contains a policy definition providing best practices for - configuring clusters for a particular use case. - - Databricks manages and provides policy families for several common cluster use cases. You cannot create, - edit, or delete policy families. - - Policy families cannot be used directly to create clusters. Instead, you create cluster policies using a - policy family. Cluster policies created using a policy family inherit the policy family's policy - definition.""" - def __init__(self, api_client): self._api = api_client @@ -11738,9 +10416,7 @@ def get(self, policy_family_id: str, *, version: Optional[int] = None) -> Policy query = {} if version is not None: query["version"] = version - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11766,9 +10442,7 @@ def list(self, *, max_results: Optional[int] = None, page_token: Optional[str] = query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/dashboards.py b/databricks/sdk/service/dashboards.py index d36c04914..87cda7846 100644 --- a/databricks/sdk/service/dashboards.py +++ b/databricks/sdk/service/dashboards.py @@ -27,9 +27,6 @@ ) -from databricks.sdk.service import sql - - _LOG = logging.getLogger("databricks.sdk") @@ -268,6 +265,8 @@ class DashboardView(Enum): @dataclass class DownloadMessageAttachmentVisualizationResponse: contents: Optional[BinaryIO] = None + """The rendered visualization as a PNG image. Returned as the raw HTTP response body rather than a + JSON field.""" def as_dict(self) -> dict: """Serializes the DownloadMessageAttachmentVisualizationResponse into a dictionary suitable for use as a JSON request body.""" @@ -430,7 +429,7 @@ def from_dict(cls, d: Dict[str, Any]) -> GenieConversation: last_updated_timestamp=_int64(d, "last_updated_timestamp"), space_id=d.get("space_id", None), title=d.get("title", None), - user_id=d.get("user_id", None), + user_id=_int64(d, "user_id"), ) @@ -2029,17 +2028,21 @@ class MessageStatus(Enum): @dataclass class PublishedDashboard: + """Published dashboard resource with a single page. This resource defines a static snapshot of the + metadata required for building a published dashboard.""" + display_name: Optional[str] = None - """The display name of the published dashboard.""" + """Display name of the dashboard.""" embed_credentials: Optional[bool] = None - """Indicates whether credentials are embedded in the published dashboard.""" revision_create_time: Optional[str] = None - """The timestamp of when the published dashboard was last revised.""" + """The timestamp that the revision was created.""" warehouse_id: Optional[str] = None - """The warehouse ID used to run the published dashboard.""" + """The Id of the warehouse the dashboard belongs to. Format: [0-9a-fA-F]{16} Note: This is not an + AIP resource and therefore is Id and not a resource path. Client should throw exception if + unset.""" def as_dict(self) -> dict: """Serializes the PublishedDashboard into a dictionary suitable for use as a JSON request body.""" @@ -2650,11 +2653,6 @@ def from_dict(cls, d: Dict[str, Any]) -> UnpublishDashboardResponse: class GenieAPI: - """Genie provides a no-code experience for business users, powered by AI/BI. Analysts set up spaces that - business users can use to ask questions using natural language. Genie uses data registered to Unity - Catalog and requires at least CAN USE permission on a Pro or Serverless SQL warehouse. Also, Databricks - Assistant must be enabled.""" - def __init__(self, api_client): self._api = api_client @@ -2717,10 +2715,7 @@ def create_message( body["content"] = content if enable_visualization is not None: body["enable_visualization"] = enable_visualization - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2776,10 +2771,7 @@ def create_message_comment( body = {} if content is not None: body["content"] = content - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2832,10 +2824,7 @@ def create_space( body["title"] = title if warehouse_id is not None: body["warehouse_id"] = warehouse_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2855,9 +2844,7 @@ def delete_conversation(self, space_id: str, conversation_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2878,9 +2865,7 @@ def delete_conversation_message(self, space_id: str, conversation_id: str, messa """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2904,15 +2889,13 @@ def download_message_attachment_visualization(self, name: str) -> DownloadMessag :returns: :class:`DownloadMessageAttachmentVisualizationResponse` """ - headers = { - "Accept": "application/octet-stream", - } + headers = {} 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/genie/{name}/download-visualization", headers=headers, raw=True) + res = self._api.do("GET", f"/api/2.0/genie/{name}/download-visualization", headers=headers) return DownloadMessageAttachmentVisualizationResponse.from_dict(res) def execute_message_attachment_query( @@ -2933,11 +2916,7 @@ def execute_message_attachment_query( :returns: :class:`GenieGetMessageQueryResultResponse` """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2946,7 +2925,6 @@ def execute_message_attachment_query( res = self._api.do( "POST", f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}/messages/{message_id}/attachments/{attachment_id}/execute-query", - body=body, headers=headers, ) return GenieGetMessageQueryResultResponse.from_dict(res) @@ -2967,11 +2945,7 @@ def execute_message_query( :returns: :class:`GenieGetMessageQueryResultResponse` """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2980,7 +2954,6 @@ def execute_message_query( res = self._api.do( "POST", f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}/messages/{message_id}/execute-query", - body=body, headers=headers, ) return GenieGetMessageQueryResultResponse.from_dict(res) @@ -3017,11 +2990,7 @@ def generate_download_full_query_result( :returns: :class:`GenieGenerateDownloadFullQueryResultResponse` """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3030,7 +2999,6 @@ def generate_download_full_query_result( res = self._api.do( "POST", f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}/messages/{message_id}/attachments/{attachment_id}/downloads", - body=body, headers=headers, ) return GenieGenerateDownloadFullQueryResultResponse.from_dict(res) @@ -3050,11 +3018,7 @@ def genie_cancel_response(self, agent_id: str, conversation_id: str, response_id :returns: :class:`GenieMessage` """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3063,7 +3027,6 @@ def genie_cancel_response(self, agent_id: str, conversation_id: str, response_id res = self._api.do( "POST", f"/api/2.0/genie/agents/{agent_id}/conversations/{conversation_id}/responses/{response_id}/cancel", - body=body, headers=headers, ) return GenieMessage.from_dict(res) @@ -3085,10 +3048,7 @@ def genie_create_eval_run( body = {} if benchmark_question_ids is not None: body["benchmark_question_ids"] = [v for v in benchmark_question_ids] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3110,9 +3070,7 @@ def genie_get_eval_result_details(self, space_id: str, eval_run_id: str, result_ :returns: :class:`GenieEvalResultDetails` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3133,9 +3091,7 @@ def genie_get_eval_run(self, space_id: str, eval_run_id: str) -> GenieEvalRunRes :returns: :class:`GenieEvalRunResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3166,9 +3122,7 @@ def genie_list_eval_results( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3199,9 +3153,7 @@ def genie_list_eval_runs( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3257,9 +3209,7 @@ def get_download_full_query_result( query = {} if download_id_signature is not None: query["download_id_signature"] = download_id_signature - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3286,9 +3236,7 @@ def get_message(self, space_id: str, conversation_id: str, message_id: str) -> G :returns: :class:`GenieMessage` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3319,9 +3267,7 @@ def get_message_attachment_query_result( :returns: :class:`GenieGetMessageQueryResultResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3350,9 +3296,7 @@ def get_message_query_result( :returns: :class:`GenieGetMessageQueryResultResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3383,9 +3327,7 @@ def get_message_query_result_by_attachment( :returns: :class:`GenieGetMessageQueryResultResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3413,9 +3355,7 @@ def get_space(self, space_id: str, *, include_serialized_space: Optional[bool] = query = {} if include_serialized_space is not None: query["include_serialized_space"] = include_serialized_space - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3446,9 +3386,7 @@ def list_conversation_comments( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3484,9 +3422,7 @@ def list_conversation_messages( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3530,9 +3466,7 @@ def list_conversations( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3571,9 +3505,7 @@ def list_message_comments( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3605,9 +3537,7 @@ def list_spaces( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3646,10 +3576,7 @@ def send_message_feedback( body["comment"] = comment if rating is not None: body["rating"] = rating.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3684,10 +3611,7 @@ def start_conversation( body["content"] = content if enable_visualization is not None: body["enable_visualization"] = enable_visualization - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3720,9 +3644,7 @@ def trash_space(self, space_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3778,10 +3700,7 @@ def update_space( body["title"] = title if warehouse_id is not None: body["warehouse_id"] = warehouse_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3792,8 +3711,7 @@ def update_space( class LakeviewAPI: - """These APIs provide specific management operations for Lakeview dashboards. Generic resource management can - be done with Workspace API (import, export, get-status, list, delete).""" + """Lakeview API service provides end-users programmatic access to dashboards.""" def __init__(self, api_client): self._api = api_client @@ -3824,10 +3742,7 @@ def create( query["dataset_catalog"] = dataset_catalog if dataset_schema is not None: query["dataset_schema"] = dataset_schema - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3849,10 +3764,7 @@ def create_schedule(self, dashboard_id: str, schedule: Schedule) -> Schedule: body = schedule.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3876,10 +3788,7 @@ def create_subscription(self, dashboard_id: str, schedule_id: str, subscription: body = subscription.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3910,9 +3819,7 @@ def delete_schedule(self, dashboard_id: str, schedule_id: str, *, etag: Optional query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3946,9 +3853,7 @@ def delete_subscription( query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3972,9 +3877,7 @@ def get(self, dashboard_id: str) -> Dashboard: :returns: :class:`Dashboard` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3998,9 +3901,7 @@ def get_published(self, dashboard_id: str) -> PublishedDashboard: :returns: :class:`PublishedDashboard` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4020,9 +3921,7 @@ def get_schedule(self, dashboard_id: str, schedule_id: str) -> Schedule: :returns: :class:`Schedule` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4046,9 +3945,7 @@ def get_subscription(self, dashboard_id: str, schedule_id: str, subscription_id: :returns: :class:`Subscription` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4096,9 +3993,7 @@ def list( query["show_trashed"] = show_trashed if view is not None: query["view"] = view.value - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4134,9 +4029,7 @@ def list_schedules( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4176,9 +4069,7 @@ def list_subscriptions( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4231,10 +4122,7 @@ def migrate( body["source_dashboard_id"] = source_dashboard_id if update_parameter_syntax is not None: body["update_parameter_syntax"] = update_parameter_syntax - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4266,10 +4154,7 @@ def publish( body["embed_credentials"] = embed_credentials if warehouse_id is not None: body["warehouse_id"] = warehouse_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4295,10 +4180,7 @@ def revert(self, dashboard_id: str, *, etag: Optional[str] = None) -> RevertDash body = {} if etag is not None: body["etag"] = etag - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4318,9 +4200,7 @@ def trash(self, dashboard_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4339,9 +4219,7 @@ def unpublish(self, dashboard_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4382,10 +4260,7 @@ def update( query["dataset_catalog"] = dataset_catalog if dataset_schema is not None: query["dataset_schema"] = dataset_schema - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4411,10 +4286,7 @@ def update_schedule(self, dashboard_id: str, schedule_id: str, schedule: Schedul body = schedule.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4427,7 +4299,7 @@ def update_schedule(self, dashboard_id: str, schedule_id: str, schedule: Schedul class LakeviewEmbeddedAPI: - """Token-based Lakeview APIs for embedding dashboards in external applications.""" + """Lakeview API service provides end-users programmatic access to dashboards.""" def __init__(self, api_client): self._api = api_client @@ -4458,9 +4330,7 @@ def get_published_dashboard_token_info( query["external_value"] = external_value if external_viewer_id is not None: query["external_viewer_id"] = external_viewer_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/database.py b/databricks/sdk/service/database.py index 7446db238..9d5a3c6f7 100644 --- a/databricks/sdk/service/database.py +++ b/databricks/sdk/service/database.py @@ -1639,7 +1639,7 @@ def from_dict(cls, d: Dict[str, Any]) -> SyncedTableTriggeredUpdateStatus: class DatabaseAPI: - """Database Instances provide access to a database via REST API or direct SQL.""" + """Front-door (customer facing) service for Brickstore.""" def __init__(self, api_client): self._api = api_client @@ -1679,10 +1679,7 @@ def create_database_catalog(self, catalog: DatabaseCatalog) -> DatabaseCatalog: body = catalog.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1704,10 +1701,7 @@ def create_database_instance(self, database_instance: DatabaseInstance) -> Wait[ body = database_instance.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1745,10 +1739,7 @@ def create_database_instance_role( query = {} if database_instance_name is not None: query["database_instance_name"] = database_instance_name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1770,10 +1761,7 @@ def create_database_table(self, table: DatabaseTable) -> DatabaseTable: body = table.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1792,10 +1780,7 @@ def create_synced_database_table(self, synced_table: SyncedDatabaseTable) -> Syn body = synced_table.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1812,9 +1797,7 @@ def delete_database_catalog(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1842,9 +1825,7 @@ def delete_database_instance(self, name: str, *, force: Optional[bool] = None, p query["force"] = force if purge is not None: query["purge"] = purge - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1876,9 +1857,7 @@ def delete_database_instance_role( query["allow_missing"] = allow_missing if reassign_owned_to is not None: query["reassign_owned_to"] = reassign_owned_to - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1896,9 +1875,7 @@ def delete_database_table(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1919,9 +1896,7 @@ def delete_synced_database_table(self, name: str, *, purge_data: Optional[bool] query = {} if purge_data is not None: query["purge_data"] = purge_data - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1941,9 +1916,7 @@ def find_database_instance_by_uid(self, *, uid: Optional[str] = None) -> Databas query = {} if uid is not None: query["uid"] = uid - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1983,10 +1956,7 @@ def generate_database_credential( body["instance_names"] = [v for v in instance_names] if request_id is not None: body["request_id"] = request_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2003,9 +1973,7 @@ def get_database_catalog(self, name: str) -> DatabaseCatalog: :returns: :class:`DatabaseCatalog` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2023,9 +1991,7 @@ def get_database_instance(self, name: str) -> DatabaseInstance: :returns: :class:`DatabaseInstance` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2043,9 +2009,7 @@ def get_database_instance_role(self, instance_name: str, name: str) -> DatabaseI :returns: :class:`DatabaseInstanceRole` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2062,9 +2026,7 @@ def get_database_table(self, name: str) -> DatabaseTable: :returns: :class:`DatabaseTable` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2081,9 +2043,7 @@ def get_synced_database_table(self, name: str) -> SyncedDatabaseTable: :returns: :class:`SyncedDatabaseTable` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2112,9 +2072,7 @@ def list_database_catalogs( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2152,9 +2110,7 @@ def list_database_instance_roles( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2189,9 +2145,7 @@ def list_database_instances( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2226,9 +2180,7 @@ def list_synced_database_tables( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2264,10 +2216,7 @@ def update_database_catalog( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2295,10 +2244,7 @@ def update_database_instance( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2326,10 +2272,7 @@ def update_synced_database_table( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/databricks.py b/databricks/sdk/service/databricks.py new file mode 100644 index 000000000..6c9e691c9 --- /dev/null +++ b/databricks/sdk/service/databricks.py @@ -0,0 +1,15 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. +# ruff: noqa: F811, F841 +# F401 is intentionally NOT covered: `make fmt` uses `ruff check --fix-only` +# to strip the fat-import header below; ignoring F401 would defeat that. + +from __future__ import annotations + + +import logging + + +_LOG = logging.getLogger("databricks.sdk") + + +# all definitions in this file are in alphabetical order diff --git a/databricks/sdk/service/dataclassification.py b/databricks/sdk/service/dataclassification.py index 074e40ae4..c4a449d80 100644 --- a/databricks/sdk/service/dataclassification.py +++ b/databricks/sdk/service/dataclassification.py @@ -163,10 +163,6 @@ def from_dict(cls, d: Dict[str, Any]) -> CatalogConfigSchemaNames: class DataClassificationAPI: - """Manage data classification for Unity Catalog catalogs. Data classification automatically identifies and - tags sensitive data (PII) in Unity Catalog tables. Each catalog can have at most one configuration - resource that controls scanning behavior and auto-tagging rules.""" - def __init__(self, api_client): self._api = api_client @@ -187,10 +183,7 @@ def create_catalog_config(self, parent: str, catalog_config: CatalogConfig) -> C body = catalog_config.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -208,9 +201,7 @@ def delete_catalog_config(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -227,9 +218,7 @@ def get_catalog_config(self, name: str) -> CatalogConfig: :returns: :class:`CatalogConfig` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -260,10 +249,7 @@ def update_catalog_config(self, name: str, catalog_config: CatalogConfig, update query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/dataquality.py b/databricks/sdk/service/dataquality.py index f9669c64b..4d9dd79c4 100644 --- a/databricks/sdk/service/dataquality.py +++ b/databricks/sdk/service/dataquality.py @@ -867,8 +867,6 @@ def from_dict(cls, d: Dict[str, Any]) -> TimeSeriesConfig: class DataQualityAPI: - """Manage the data quality of Unity Catalog objects (currently support ``schema`` and ``table``)""" - def __init__(self, api_client): self._api = api_client @@ -908,11 +906,7 @@ def cancel_refresh(self, object_type: str, object_id: str, refresh_id: int) -> C :returns: :class:`CancelRefreshResponse` """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -921,7 +915,6 @@ def cancel_refresh(self, object_type: str, object_id: str, refresh_id: int) -> C res = self._api.do( "POST", f"/api/data-quality/v1/monitors/{object_type}/{object_id}/refreshes/{refresh_id}/cancel", - body=body, headers=headers, ) return CancelRefreshResponse.from_dict(res) @@ -954,10 +947,7 @@ def create_monitor(self, monitor: Monitor) -> Monitor: body = monitor.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1004,10 +994,7 @@ def create_refresh(self, object_type: str, object_id: str, refresh: Refresh) -> body = refresh.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1056,9 +1043,7 @@ def delete_monitor(self, object_type: str, object_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1093,9 +1078,7 @@ def delete_refresh(self, object_type: str, object_id: str, refresh_id: int): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1147,9 +1130,7 @@ def get_monitor(self, object_type: str, object_id: str) -> Monitor: :returns: :class:`Monitor` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1199,9 +1180,7 @@ def get_refresh(self, object_type: str, object_id: str, refresh_id: int) -> Refr :returns: :class:`Refresh` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1226,9 +1205,7 @@ def list_monitor(self, *, page_size: Optional[int] = None, page_token: Optional[ query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1291,9 +1268,7 @@ def list_refresh( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1360,10 +1335,7 @@ def update_monitor(self, object_type: str, object_id: str, monitor: Monitor, upd query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1411,10 +1383,7 @@ def update_refresh( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/disasterrecovery.py b/databricks/sdk/service/disasterrecovery.py index 88f319fd1..0bc1c4be1 100644 --- a/databricks/sdk/service/disasterrecovery.py +++ b/databricks/sdk/service/disasterrecovery.py @@ -516,7 +516,7 @@ def from_dict(cls, d: Dict[str, Any]) -> WorkspaceSet: class DisasterRecoveryAPI: - """Manage disaster recovery configurations and execute failover operations.""" + """Service for managing failover groups for disaster recovery.""" def __init__(self, api_client): self._api = api_client @@ -550,10 +550,7 @@ def create_failover_group( query["failover_group_id"] = failover_group_id if validate_only is not None: query["validate_only"] = validate_only - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", f"/api/disaster-recovery/v1/{parent}/failover-groups", query=query, body=body, headers=headers @@ -584,10 +581,7 @@ def create_stable_url( query["stable_url_id"] = stable_url_id if validate_only is not None: query["validate_only"] = validate_only - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", f"/api/disaster-recovery/v1/{parent}/stable-urls", query=query, body=body, headers=headers @@ -610,9 +604,7 @@ def delete_failover_group(self, name: str, *, etag: Optional[str] = None): query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} self._api.do("DELETE", f"/api/disaster-recovery/v1/{name}", query=query, headers=headers) @@ -625,9 +617,7 @@ def delete_stable_url(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do("DELETE", f"/api/disaster-recovery/v1/{name}", headers=headers) @@ -663,10 +653,7 @@ def failover_failover_group( body["failover_type"] = failover_type.value if target_primary_region is not None: body["target_primary_region"] = target_primary_region - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do("POST", f"/api/disaster-recovery/v1/{name}/failover", body=body, headers=headers) return FailoverGroup.from_dict(res) @@ -681,9 +668,7 @@ def get_failover_group(self, name: str) -> FailoverGroup: :returns: :class:`FailoverGroup` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/disaster-recovery/v1/{name}", headers=headers) return FailoverGroup.from_dict(res) @@ -697,9 +682,7 @@ def get_stable_url(self, name: str) -> StableUrl: :returns: :class:`StableUrl` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/disaster-recovery/v1/{name}", headers=headers) return StableUrl.from_dict(res) @@ -733,9 +716,7 @@ def list_failover_groups( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -774,9 +755,7 @@ def list_stable_urls( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do("GET", f"/api/disaster-recovery/v1/{parent}/stable-urls", query=query, headers=headers) @@ -814,10 +793,7 @@ def update_failover_group( query["etag"] = etag if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do("PATCH", f"/api/disaster-recovery/v1/{name}", query=query, body=body, headers=headers) return FailoverGroup.from_dict(res) diff --git a/databricks/sdk/service/domains.py b/databricks/sdk/service/domains.py index 3606563cb..ebf7e0799 100644 --- a/databricks/sdk/service/domains.py +++ b/databricks/sdk/service/domains.py @@ -296,8 +296,6 @@ def from_dict(cls, d: Dict[str, Any]) -> ListDomainsResponse: class DomainsAPI: - """Manage domains for organizing and discovering data assets.""" - def __init__(self, api_client): self._api = api_client @@ -315,10 +313,7 @@ def create_domain(self, domain: Domain, *, domain_id: Optional[str] = None) -> D query = {} if domain_id is not None: query["domain_id"] = domain_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -335,7 +330,8 @@ def delete_domain(self, name: str, *, force: Optional[bool] = None): Full resource name of the domain to delete. Format: ``domains/{domain_id}`` :param force: bool (optional) When false (default), DeleteDomain is rejected with FAILED_PRECONDITION if the domain still has - Glossary pages. When true, those pages are deleted first and then the domain is removed. + Glossary pages. When true, those pages are deleted first and then the domain is removed. Forwarded + to the central service. """ @@ -343,9 +339,7 @@ def delete_domain(self, name: str, *, force: Optional[bool] = None): query = {} if force is not None: query["force"] = force - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -364,9 +358,7 @@ def get_domain(self, name: str) -> Domain: :returns: :class:`Domain` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -406,9 +398,7 @@ def list_domains( query["page_token"] = page_token if parent_domain_id is not None: query["parent_domain_id"] = parent_domain_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -433,15 +423,6 @@ def update_domain(self, name: str, domain: Domain, update_mask: FieldMask) -> Do to choose the id, set ``CreateDomainRequest.domain_id``. :param domain: :class:`Domain` :param update_mask: FieldMask - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`Domain` """ @@ -450,10 +431,7 @@ def update_domain(self, name: str, domain: Domain, update_mask: FieldMask) -> Do query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/environments.py b/databricks/sdk/service/environments.py index fa9012e8f..c9a985473 100644 --- a/databricks/sdk/service/environments.py +++ b/databricks/sdk/service/environments.py @@ -145,7 +145,7 @@ class EnvironmentSpec: dependency is a valid pip requirements file line per https://pip.pypa.io/en/stable/reference/requirements-file-format/. Allowed dependencies include a requirement specifier, an archive URL, a local project path (such as WSFS or UC Volumes in - Databricks), or a VCS project URL.""" + ), or a VCS project URL.""" environment_version: Optional[str] = None """Environment version used by the environment. Each version comes with a specific Python version @@ -516,11 +516,8 @@ def from_dict(cls, d: Dict[str, Any]) -> WorkspaceBaseEnvironmentOperationMetada class EnvironmentsAPI: - """APIs to manage environment resources. - - The Environments API provides management capabilities for different types of environments including - workspace-level base environments that define the environment version and dependencies to be used in - serverless notebooks and jobs.""" + """Service for managing environment resources. This service provides APIs for managing different types of + environments including workspace-level base environments.""" def __init__(self, api_client): self._api = api_client @@ -556,10 +553,7 @@ def create_workspace_base_environment( query["request_id"] = request_id if workspace_base_environment_id is not None: query["workspace_base_environment_id"] = workspace_base_environment_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -583,9 +577,7 @@ def delete_workspace_base_environment(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -604,9 +596,7 @@ def get_default_workspace_base_environment(self, name: str) -> DefaultWorkspaceB :returns: :class:`DefaultWorkspaceBaseEnvironment` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -624,9 +614,7 @@ def get_operation(self, name: str) -> Operation: :returns: :class:`Operation` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -645,9 +633,7 @@ def get_workspace_base_environment(self, name: str) -> WorkspaceBaseEnvironment: :returns: :class:`WorkspaceBaseEnvironment` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -661,7 +647,7 @@ def list_workspace_base_environments( ) -> Iterator[WorkspaceBaseEnvironment]: """Lists all WorkspaceBaseEnvironments in the workspace. - Databricks provides the following base environments: + provides the following base environments: - ``workspace-base-environments/databricks_ai_...``: includes popular AI and deep learning packages for serverless GPU compute. @@ -685,9 +671,7 @@ def list_workspace_base_environments( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -715,17 +699,13 @@ def refresh_workspace_base_environment(self, name: str) -> RefreshWorkspaceBaseE :returns: :class:`Operation` """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id - res = self._api.do("POST", f"/api/environments/v1/{name}/refresh", body=body, headers=headers) + res = self._api.do("POST", f"/api/environments/v1/{name}/refresh", headers=headers) operation = Operation.from_dict(res) return RefreshWorkspaceBaseEnvironmentOperation(self, operation) @@ -755,10 +735,7 @@ def update_default_workspace_base_environment( query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -785,10 +762,7 @@ def update_workspace_base_environment( body = workspace_base_environment.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/files.py b/databricks/sdk/service/files.py index f897417cd..b1bba5cc4 100644 --- a/databricks/sdk/service/files.py +++ b/databricks/sdk/service/files.py @@ -154,9 +154,9 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> DirectoryEntry: """Deserializes the DirectoryEntry from a dictionary.""" return cls( - file_size=_int64(d, "file_size"), + file_size=d.get("file_size", None), is_directory=d.get("is_directory", None), - last_modified=_int64(d, "last_modified"), + last_modified=d.get("last_modified", None), name=d.get("name", None), path=d.get("path", None), ) @@ -213,6 +213,8 @@ def from_dict(cls, d: Dict[str, Any]) -> DownloadResponse: @dataclass class FileInfo: + """Stores the attributes of a file or directory.""" + file_size: Optional[int] = None """The length of the file in bytes. Set to 0 for directories.""" @@ -451,8 +453,9 @@ def from_dict(cls, d: Dict[str, Any]) -> ReadResponse: class DbfsAPI: - """DBFS API makes it simple to interact with various data sources without having to include a users - credentials every time to read a file.""" + """This service allows users to interact with the Databricks File System (DBFS), which is a distributed file + system layer on top of S3. For example, users can create new files or list the contents of a given path in + DBFS.""" def __init__(self, api_client): self._api = api_client @@ -476,10 +479,7 @@ def add_block(self, handle: int, data: str): body["data"] = data if handle is not None: body["handle"] = handle - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -500,10 +500,7 @@ def close(self, handle: int): body = {} if handle is not None: body["handle"] = handle - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -535,10 +532,7 @@ def create(self, path: str, *, overwrite: Optional[bool] = None) -> CreateRespon body["overwrite"] = overwrite if path is not None: body["path"] = path - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -577,10 +571,7 @@ def delete(self, path: str, *, recursive: Optional[bool] = None): body["path"] = path if recursive is not None: body["recursive"] = recursive - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -601,9 +592,7 @@ def get_status(self, path: str) -> FileInfo: query = {} if path is not None: query["path"] = path - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -632,9 +621,7 @@ def list(self, path: str) -> Iterator[FileInfo]: query = {} if path is not None: query["path"] = path - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -659,10 +646,7 @@ def mkdirs(self, path: str): body = {} if path is not None: body["path"] = path - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -689,10 +673,7 @@ def move(self, source_path: str, destination_path: str): body["destination_path"] = destination_path if source_path is not None: body["source_path"] = source_path - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -729,10 +710,7 @@ def put(self, path: str, *, contents: Optional[str] = None, overwrite: Optional[ body["overwrite"] = overwrite if path is not None: body["path"] = path - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -767,9 +745,7 @@ def read(self, path: str, *, length: Optional[int] = None, offset: Optional[int] query["offset"] = offset if path is not None: query["path"] = path - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -780,22 +756,6 @@ def read(self, path: str, *, length: Optional[int] = None, offset: Optional[int] class FilesAPI: - """The Files API is a standard HTTP API that allows you to read, write, list, and delete files and - directories by referring to their URI. The API makes working with file content as raw bytes easier and - more efficient. - - The API supports `Unity Catalog volumes - `__, where files and directories to - operate on are specified using their volume URI path, which follows the format - /Volumes/<catalog_name>/<schema_name>/<volume_name>/<path_to_file>. - - The Files API has two distinct endpoints, one for working with files (``/fs/files``) and another one for - working with directories (``/fs/directories``). Both endpoints use the standard HTTP methods GET, HEAD, - PUT, and DELETE to manage files and directories specified using their URI path. The path is always - absolute. - - Use of Files API may incur Databricks data transfer charges.""" - def __init__(self, api_client): self._api = api_client @@ -869,9 +829,7 @@ def download(self, file_path: str) -> DownloadResponse: :returns: :class:`DownloadResponse` """ - headers = { - "Accept": "application/octet-stream", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -887,7 +845,6 @@ def download(self, file_path: str) -> DownloadResponse: f"/api/2.0/fs/files{_escape_multi_segment_path_parameter(file_path)}", headers=headers, response_headers=response_headers, - raw=True, ) return DownloadResponse.from_dict(res) @@ -978,9 +935,7 @@ def list_directory_contents( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1019,18 +974,12 @@ def upload(self, file_path: str, contents: BinaryIO, *, overwrite: Optional[bool query = {} if overwrite is not None: query["overwrite"] = overwrite - headers = { - "Content-Type": "application/octet-stream", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( - "PUT", - f"/api/2.0/fs/files{_escape_multi_segment_path_parameter(file_path)}", - query=query, - headers=headers, - data=contents, + "PUT", f"/api/2.0/fs/files{_escape_multi_segment_path_parameter(file_path)}", query=query, headers=headers ) diff --git a/databricks/sdk/service/google.py b/databricks/sdk/service/google.py new file mode 100644 index 000000000..6c9e691c9 --- /dev/null +++ b/databricks/sdk/service/google.py @@ -0,0 +1,15 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. +# ruff: noqa: F811, F841 +# F401 is intentionally NOT covered: `make fmt` uses `ruff check --fix-only` +# to strip the fat-import header below; ignoring F401 would defeat that. + +from __future__ import annotations + + +import logging + + +_LOG = logging.getLogger("databricks.sdk") + + +# all definitions in this file are in alphabetical order diff --git a/databricks/sdk/service/iam.py b/databricks/sdk/service/iam.py index f4a2c5778..9489d1b8b 100644 --- a/databricks/sdk/service/iam.py +++ b/databricks/sdk/service/iam.py @@ -138,7 +138,7 @@ def from_dict(cls, d: Dict[str, Any]) -> AccessControlResponse: @dataclass class AccountGroup: account_id: Optional[str] = None - """Databricks account ID""" + """ account ID""" display_name: Optional[str] = None """String that represents a human-readable group name""" @@ -147,7 +147,7 @@ class AccountGroup: """external_id should be unique for identifying groups""" id: Optional[str] = None - """Databricks group ID""" + """ group ID""" members: Optional[List[ComplexValue]] = None @@ -212,7 +212,7 @@ def from_dict(cls, d: Dict[str, Any]) -> AccountGroup: @dataclass class AccountServicePrincipal: account_id: Optional[str] = None - """Databricks account ID""" + """ account ID""" active: Optional[bool] = None """If this user is active""" @@ -226,7 +226,7 @@ class AccountServicePrincipal: external_id: Optional[str] = None id: Optional[str] = None - """Databricks service principal ID.""" + """ service principal ID.""" roles: Optional[List[ComplexValue]] = None """Indicates if the group has the admin role.""" @@ -286,7 +286,7 @@ def from_dict(cls, d: Dict[str, Any]) -> AccountServicePrincipal: @dataclass class AccountUser: account_id: Optional[str] = None - """Databricks account ID""" + """ account ID""" active: Optional[bool] = None """If this user is active""" @@ -295,14 +295,14 @@ class AccountUser: """String that represents a concatenation of given and family names. For example ``John Smith``.""" emails: Optional[List[ComplexValue]] = None - """All the emails associated with the Databricks user. This attribute cannot be updated through the - SCIM PATCH or PUT APIs; any supplied change is ignored.""" + """All the emails associated with the user. This attribute cannot be updated through + the SCIM PATCH or PUT APIs; any supplied change is ignored.""" external_id: Optional[str] = None """External ID is not currently supported. It is reserved for future use.""" id: Optional[str] = None - """Databricks user ID.""" + """ user ID.""" name: Optional[Name] = None @@ -310,8 +310,8 @@ class AccountUser: """Indicates if the group has the admin role.""" user_name: Optional[str] = None - """Email address of the Databricks user. This attribute cannot be updated through the SCIM PATCH or - PUT APIs; any supplied change is ignored.""" + """Email address of the user. This attribute cannot be updated through the SCIM PATCH + or PUT APIs; any supplied change is ignored.""" def as_dict(self) -> dict: """Serializes the AccountUser into a dictionary suitable for use as a JSON request body.""" @@ -679,7 +679,7 @@ class Group: groups: Optional[List[ComplexValue]] = None id: Optional[str] = None - """Databricks group ID""" + """ group ID""" members: Optional[List[ComplexValue]] = None @@ -802,10 +802,10 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> ListAccountGroupsResponse: """Deserializes the ListAccountGroupsResponse from a dictionary.""" return cls( - items_per_page=_int64(d, "itemsPerPage"), + items_per_page=d.get("itemsPerPage", None), resources=_repeated_dict(d, "Resources", AccountGroup), start_index=_int64(d, "startIndex"), - total_results=_int64(d, "totalResults"), + total_results=d.get("totalResults", None), ) @@ -853,10 +853,10 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> ListAccountServicePrincipalsResponse: """Deserializes the ListAccountServicePrincipalsResponse from a dictionary.""" return cls( - items_per_page=_int64(d, "itemsPerPage"), + items_per_page=d.get("itemsPerPage", None), resources=_repeated_dict(d, "Resources", AccountServicePrincipal), start_index=_int64(d, "startIndex"), - total_results=_int64(d, "totalResults"), + total_results=d.get("totalResults", None), ) @@ -904,10 +904,10 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> ListAccountUsersResponse: """Deserializes the ListAccountUsersResponse from a dictionary.""" return cls( - items_per_page=_int64(d, "itemsPerPage"), + items_per_page=d.get("itemsPerPage", None), resources=_repeated_dict(d, "Resources", AccountUser), start_index=_int64(d, "startIndex"), - total_results=_int64(d, "totalResults"), + total_results=d.get("totalResults", None), ) @@ -962,11 +962,11 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> ListGroupsResponse: """Deserializes the ListGroupsResponse from a dictionary.""" return cls( - items_per_page=_int64(d, "itemsPerPage"), + items_per_page=d.get("itemsPerPage", None), resources=_repeated_dict(d, "Resources", Group), schemas=_repeated_enum(d, "schemas", ListResponseSchema), start_index=_int64(d, "startIndex"), - total_results=_int64(d, "totalResults"), + total_results=d.get("totalResults", None), ) @@ -1025,11 +1025,11 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> ListServicePrincipalResponse: """Deserializes the ListServicePrincipalResponse from a dictionary.""" return cls( - items_per_page=_int64(d, "itemsPerPage"), + items_per_page=d.get("itemsPerPage", None), resources=_repeated_dict(d, "Resources", ServicePrincipal), schemas=_repeated_enum(d, "schemas", ListResponseSchema), start_index=_int64(d, "startIndex"), - total_results=_int64(d, "totalResults"), + total_results=d.get("totalResults", None), ) @@ -1089,11 +1089,11 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> ListUsersResponse: """Deserializes the ListUsersResponse from a dictionary.""" return cls( - items_per_page=_int64(d, "itemsPerPage"), + items_per_page=d.get("itemsPerPage", None), resources=_repeated_dict(d, "Resources", User), schemas=_repeated_enum(d, "schemas", ListResponseSchema), start_index=_int64(d, "startIndex"), - total_results=_int64(d, "totalResults"), + total_results=d.get("totalResults", None), ) @@ -1125,10 +1125,10 @@ def from_dict(cls, d: Dict[str, Any]) -> MigratePermissionsResponse: @dataclass class Name: family_name: Optional[str] = None - """Family name of the Databricks user.""" + """Family name of the user.""" given_name: Optional[str] = None - """Given name of the Databricks user.""" + """Given name of the user.""" def as_dict(self) -> dict: """Serializes the Name into a dictionary suitable for use as a JSON request body.""" @@ -1953,7 +1953,7 @@ class ServicePrincipal: groups: Optional[List[ComplexValue]] = None id: Optional[str] = None - """Databricks service principal ID.""" + """ service principal ID.""" roles: Optional[List[ComplexValue]] = None """Corresponds to AWS instance profile/arn role.""" @@ -2040,8 +2040,8 @@ class User: Use Account SCIM APIs to update ``displayName``.""" emails: Optional[List[ComplexValue]] = None - """All the emails associated with the Databricks user. This attribute cannot be updated through the - SCIM PATCH or PUT APIs; any supplied change is ignored.""" + """All the emails associated with the user. This attribute cannot be updated through + the SCIM PATCH or PUT APIs; any supplied change is ignored.""" entitlements: Optional[List[ComplexValue]] = None """Entitlements assigned to the user. See `assigning entitlements @@ -2054,7 +2054,7 @@ class User: groups: Optional[List[ComplexValue]] = None id: Optional[str] = None - """Databricks user ID.""" + """ user ID.""" name: Optional[Name] = None @@ -2065,8 +2065,8 @@ class User: """The schema of the user.""" user_name: Optional[str] = None - """Email address of the Databricks user. This attribute cannot be updated through the SCIM PATCH or - PUT APIs; any supplied change is ignored.""" + """Email address of the user. This attribute cannot be updated through the SCIM PATCH + or PUT APIs; any supplied change is ignored.""" def as_dict(self) -> dict: """Serializes the User into a dictionary suitable for use as a JSON request body.""" @@ -2179,8 +2179,6 @@ def from_dict(cls, d: Dict[str, Any]) -> WorkspacePermissions: class AccessControlAPI: - """Rule based Access Control for Databricks Resources.""" - def __init__(self, api_client): self._api = api_client @@ -2221,9 +2219,7 @@ def check_policy( query["resource"] = resource if resource_info is not None: query["resource_info"] = resource_info.as_dict() - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2234,10 +2230,6 @@ def check_policy( class AccountAccessControlAPI: - """These APIs manage access rules on resources in an account. Currently, only grant rules are supported. A - grant rule specifies a role assigned to a set of principals. A list of rules attached to a resource is - called a rule set.""" - def __init__(self, api_client): self._api = api_client @@ -2260,9 +2252,7 @@ def get_assignable_roles_for_resource(self, resource: str) -> GetAssignableRoles query = {} if resource is not None: query["resource"] = resource - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -2306,9 +2296,7 @@ def get_rule_set(self, name: str, etag: str) -> RuleSetResponse: query["etag"] = etag if name is not None: query["name"] = name - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -2334,10 +2322,7 @@ def update_rule_set(self, name: str, rule_set: RuleSetUpdateRequest) -> RuleSetR body["name"] = name if rule_set is not None: body["rule_set"] = rule_set.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PUT", @@ -2349,10 +2334,6 @@ def update_rule_set(self, name: str, rule_set: RuleSetUpdateRequest) -> RuleSetR class AccountAccessControlProxyAPI: - """These APIs manage access rules on resources in an account. Currently, only grant rules are supported. A - grant rule specifies a role assigned to a set of principals. A list of rules attached to a resource is - called a rule set. A workspace must belong to an account for these APIs to work""" - def __init__(self, api_client): self._api = api_client @@ -2375,9 +2356,7 @@ def get_assignable_roles_for_resource(self, resource: str) -> GetAssignableRoles query = {} if resource is not None: query["resource"] = resource - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2422,9 +2401,7 @@ def get_rule_set(self, name: str, etag: str) -> RuleSetResponse: query["etag"] = etag if name is not None: query["name"] = name - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2449,10 +2426,7 @@ def update_rule_set(self, name: str, rule_set: RuleSetUpdateRequest) -> RuleSetR body["name"] = name if rule_set is not None: body["rule_set"] = rule_set.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2463,13 +2437,6 @@ def update_rule_set(self, name: str, rule_set: RuleSetUpdateRequest) -> RuleSetR class AccountGroupsV2API: - """Groups simplify identity management, making it easier to assign access to Databricks account, data, and - other securable objects. - - It is best practice to assign access to workspaces and access-control policies in Unity Catalog to groups, - instead of to users individually. All Databricks account identities can be assigned as members of groups, - and members inherit permissions that are assigned to their group.""" - def __init__(self, api_client): self._api = api_client @@ -2483,13 +2450,13 @@ def create( meta: Optional[ResourceMeta] = None, roles: Optional[List[ComplexValue]] = None, ) -> AccountGroup: - """Creates a group in the Databricks account with a unique name, using the supplied group details. + """Creates a group in the account with a unique name, using the supplied group details. :param display_name: str (optional) String that represents a human-readable group name :param external_id: str (optional) :param id: str (optional) - Databricks group ID + group ID :param members: List[:class:`ComplexValue`] (optional) :param meta: :class:`ResourceMeta` (optional) Container for the group identifier. Workspace local versus account. @@ -2512,10 +2479,7 @@ def create( body["meta"] = meta.as_dict() if roles is not None: body["roles"] = [v.as_dict() for v in roles] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Groups", body=body, headers=headers @@ -2523,10 +2487,10 @@ def create( return AccountGroup.from_dict(res) def delete(self, id: str): - """Deletes a group from the Databricks account. + """Deletes a group from the account. :param id: str - Unique ID for a group in the Databricks account. + Unique ID for a group in the account. """ @@ -2536,17 +2500,15 @@ def delete(self, id: str): self._api.do("DELETE", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Groups/{id}", headers=headers) def get(self, id: str) -> AccountGroup: - """Gets the information for a specific group in the Databricks account. + """Gets the information for a specific group in the account. :param id: str - Unique ID for a group in the Databricks account. + Unique ID for a group in the account. :returns: :class:`AccountGroup` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Groups/{id}", headers=headers) return AccountGroup.from_dict(res) @@ -2562,10 +2524,10 @@ def list( sort_order: Optional[ListSortOrder] = None, start_index: Optional[int] = None, ) -> Iterator[AccountGroup]: - """Gets all details of the groups associated with the Databricks account. As of 08/22/2025, this endpoint - will no longer return members. Instead, members should be retrieved by iterating through ``Get group - details``. Existing accounts that rely on this attribute will not be impacted and will continue - receiving member data as before. + """Gets all details of the groups associated with the account. As of 08/22/2025, this + endpoint will no longer return members. Instead, members should be retrieved by iterating through + ``Get group details``. Existing accounts that rely on this attribute will not be impacted and will + continue receiving member data as before. :param attributes: str (optional) Comma-separated list of attributes to return in response. @@ -2604,9 +2566,7 @@ def list( query["sortOrder"] = sort_order.value if start_index is not None: query["startIndex"] = start_index - headers = { - "Accept": "application/json", - } + headers = {} query["startIndex"] = 1 if "count" not in query: @@ -2626,7 +2586,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O """Partially updates the details of a group. :param id: str - Unique ID in the Databricks workspace. + Unique ID in the workspace. :param operations: List[:class:`Patch`] (optional) :param schemas: List[:class:`PatchSchema`] (optional) The schema of the patch request. Must be ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]. @@ -2639,9 +2599,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O body["Operations"] = [v.as_dict() for v in operations] if schemas is not None: body["schemas"] = [v.value for v in schemas] - headers = { - "Content-Type": "application/json", - } + headers = {} self._api.do( "PATCH", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Groups/{id}", body=body, headers=headers @@ -2660,7 +2618,7 @@ def update( """Updates the details of a group by replacing the entire group entity. :param id: str - Databricks group ID + group ID :param display_name: str (optional) String that represents a human-readable group name :param external_id: str (optional) @@ -2684,21 +2642,12 @@ def update( body["meta"] = meta.as_dict() if roles is not None: body["roles"] = [v.as_dict() for v in roles] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} self._api.do("PUT", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Groups/{id}", body=body, headers=headers) class AccountServicePrincipalsV2API: - """Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms. - Databricks recommends creating service principals to run production jobs or modify production data. If all - processes that act on production data run with service principals, interactive users do not need any - write, delete, or modify privileges in production. This eliminates the risk of a user overwriting - production data by accident.""" - def __init__(self, api_client): self._api = api_client @@ -2712,7 +2661,7 @@ def create( id: Optional[str] = None, roles: Optional[List[ComplexValue]] = None, ) -> AccountServicePrincipal: - """Creates a new service principal in the Databricks account. + """Creates a new service principal in the account. :param active: bool (optional) If this user is active @@ -2722,7 +2671,7 @@ def create( String that represents a concatenation of given and family names. :param external_id: str (optional) :param id: str (optional) - Databricks service principal ID. + service principal ID. :param roles: List[:class:`ComplexValue`] (optional) Indicates if the group has the admin role. @@ -2742,10 +2691,7 @@ def create( body["id"] = id if roles is not None: body["roles"] = [v.as_dict() for v in roles] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/ServicePrincipals", body=body, headers=headers @@ -2753,10 +2699,10 @@ def create( return AccountServicePrincipal.from_dict(res) def delete(self, id: str): - """Delete a single service principal in the Databricks account. + """Delete a single service principal in the account. :param id: str - Unique ID for a service principal in the Databricks account. + Unique ID for a service principal in the account. """ @@ -2768,17 +2714,15 @@ def delete(self, id: str): ) def get(self, id: str) -> AccountServicePrincipal: - """Gets the details for a single service principal define in the Databricks account. + """Gets the details for a single service principal define in the account. :param id: str - Unique ID for a service principal in the Databricks account. + Unique ID for a service principal in the account. :returns: :class:`AccountServicePrincipal` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/ServicePrincipals/{id}", headers=headers @@ -2796,7 +2740,7 @@ def list( sort_order: Optional[ListSortOrder] = None, start_index: Optional[int] = None, ) -> Iterator[AccountServicePrincipal]: - """Gets the set of service principals associated with a Databricks account. + """Gets the set of service principals associated with a account. :param attributes: str (optional) Comma-separated list of attributes to return in response. @@ -2835,9 +2779,7 @@ def list( query["sortOrder"] = sort_order.value if start_index is not None: query["startIndex"] = start_index - headers = { - "Accept": "application/json", - } + headers = {} query["startIndex"] = 1 if "count" not in query: @@ -2857,10 +2799,10 @@ def list( query["startIndex"] += len(json["Resources"]) def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: Optional[List[PatchSchema]] = None): - """Partially updates the details of a single service principal in the Databricks account. + """Partially updates the details of a single service principal in the account. :param id: str - Unique ID in the Databricks workspace. + Unique ID in the workspace. :param operations: List[:class:`Patch`] (optional) :param schemas: List[:class:`PatchSchema`] (optional) The schema of the patch request. Must be ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]. @@ -2873,10 +2815,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O body["Operations"] = [v.as_dict() for v in operations] if schemas is not None: body["schemas"] = [v.value for v in schemas] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} self._api.do( "PATCH", @@ -2900,7 +2839,7 @@ def update( This action replaces the existing service principal with the same name. :param id: str - Databricks service principal ID. + service principal ID. :param active: bool (optional) If this user is active :param application_id: str (optional) @@ -2925,10 +2864,7 @@ def update( body["externalId"] = external_id if roles is not None: body["roles"] = [v.as_dict() for v in roles] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} self._api.do( "PUT", @@ -2939,16 +2875,6 @@ def update( class AccountUsersV2API: - """User identities recognized by Databricks and represented by email addresses. - - Databricks recommends using SCIM provisioning to sync users and groups automatically from your identity - provider to your Databricks account. SCIM streamlines onboarding a new employee or team by using your - identity provider to create users and groups in Databricks account and give them the proper level of - access. When a user leaves your organization or no longer needs access to Databricks account, admins can - terminate the user in your identity provider and that user’s account will also be removed from - Databricks account. This ensures a consistent offboarding process and prevents unauthorized users from - accessing sensitive data.""" - def __init__(self, api_client): self._api = api_client @@ -2964,7 +2890,7 @@ def create( roles: Optional[List[ComplexValue]] = None, user_name: Optional[str] = None, ) -> AccountUser: - """Creates a new user in the Databricks account. This new user will also be added to the Databricks + """Creates a new user in the account. This new user will also be added to the account. :param active: bool (optional) @@ -2972,16 +2898,16 @@ def create( :param display_name: str (optional) String that represents a concatenation of given and family names. For example ``John Smith``. :param emails: List[:class:`ComplexValue`] (optional) - All the emails associated with the Databricks user. + All the emails associated with the user. :param external_id: str (optional) External ID is not currently supported. It is reserved for future use. :param id: str (optional) - Databricks user ID. + user ID. :param name: :class:`Name` (optional) :param roles: List[:class:`ComplexValue`] (optional) Indicates if the group has the admin role. :param user_name: str (optional) - Email address of the Databricks user. + Email address of the user. :returns: :class:`AccountUser` """ @@ -3003,10 +2929,7 @@ def create( body["roles"] = [v.as_dict() for v in roles] if user_name is not None: body["userName"] = user_name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Users", body=body, headers=headers @@ -3014,11 +2937,11 @@ def create( return AccountUser.from_dict(res) def delete(self, id: str): - """Deletes a user. Deleting a user from a Databricks account also removes objects associated with the + """Deletes a user. Deleting a user from a account also removes objects associated with the user. :param id: str - Unique ID for a user in the Databricks account. + Unique ID for a user in the account. """ @@ -3039,10 +2962,10 @@ def get( sort_order: Optional[GetSortOrder] = None, start_index: Optional[int] = None, ) -> AccountUser: - """Gets information for a specific user in Databricks account. + """Gets information for a specific user in account. :param id: str - Unique ID for a user in the Databricks account. + Unique ID for a user in the account. :param attributes: str (optional) Comma-separated list of attributes to return in response. :param count: int (optional) @@ -3081,9 +3004,7 @@ def get( query["sortOrder"] = sort_order.value if start_index is not None: query["startIndex"] = start_index - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Users/{id}", query=query, headers=headers @@ -3101,7 +3022,7 @@ def list( sort_order: Optional[ListSortOrder] = None, start_index: Optional[int] = None, ) -> Iterator[AccountUser]: - """Gets details for all the users associated with a Databricks account. + """Gets details for all the users associated with a account. :param attributes: str (optional) Comma-separated list of attributes to return in response. @@ -3141,9 +3062,7 @@ def list( query["sortOrder"] = sort_order.value if start_index is not None: query["startIndex"] = start_index - headers = { - "Accept": "application/json", - } + headers = {} query["startIndex"] = 1 if "count" not in query: @@ -3165,7 +3084,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O them are ignored (no-op). :param id: str - Unique ID in the Databricks workspace. + Unique ID in the workspace. :param operations: List[:class:`Patch`] (optional) :param schemas: List[:class:`PatchSchema`] (optional) The schema of the patch request. Must be ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]. @@ -3178,10 +3097,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O body["Operations"] = [v.as_dict() for v in operations] if schemas is not None: body["schemas"] = [v.value for v in schemas] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} self._api.do( "PATCH", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Users/{id}", body=body, headers=headers @@ -3203,13 +3119,13 @@ def update( attributes cannot be updated through this API; any supplied changes to them are ignored (no-op). :param id: str - Databricks user ID. + user ID. :param active: bool (optional) If this user is active :param display_name: str (optional) String that represents a concatenation of given and family names. For example ``John Smith``. :param emails: List[:class:`ComplexValue`] (optional) - All the emails associated with the Databricks user. This attribute cannot be updated through the + All the emails associated with the user. This attribute cannot be updated through the SCIM PATCH or PUT APIs; any supplied change is ignored. :param external_id: str (optional) External ID is not currently supported. It is reserved for future use. @@ -3217,8 +3133,8 @@ def update( :param roles: List[:class:`ComplexValue`] (optional) Indicates if the group has the admin role. :param user_name: str (optional) - Email address of the Databricks user. This attribute cannot be updated through the SCIM PATCH or PUT - APIs; any supplied change is ignored. + Email address of the user. This attribute cannot be updated through the SCIM PATCH or + PUT APIs; any supplied change is ignored. """ @@ -3238,17 +3154,12 @@ def update( body["roles"] = [v.as_dict() for v in roles] if user_name is not None: body["userName"] = user_name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} self._api.do("PUT", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Users/{id}", body=body, headers=headers) class CurrentUserAPI: - """This API allows retrieving information about currently authenticated user or service principal.""" - def __init__(self, api_client): self._api = api_client @@ -3268,9 +3179,7 @@ def me(self, *, attributes: Optional[str] = None, excluded_attributes: Optional[ query["attributes"] = attributes if excluded_attributes is not None: query["excludedAttributes"] = excluded_attributes - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3281,13 +3190,6 @@ def me(self, *, attributes: Optional[str] = None, excluded_attributes: Optional[ class GroupsV2API: - """Groups simplify identity management, making it easier to assign access to Databricks workspace, data, and - other securable objects. - - It is best practice to assign access to workspaces and access-control policies in Unity Catalog to groups, - instead of to users individually. All Databricks workspace identities can be assigned as members of - groups, and members inherit permissions that are assigned to their group.""" - def __init__(self, api_client): self._api = api_client @@ -3304,7 +3206,7 @@ def create( roles: Optional[List[ComplexValue]] = None, schemas: Optional[List[GroupSchema]] = None, ) -> Group: - """Creates a group in the Databricks workspace with a unique name, using the supplied group details. + """Creates a group in the workspace with a unique name, using the supplied group details. :param display_name: str (optional) String that represents a human-readable group name @@ -3315,7 +3217,7 @@ def create( :param external_id: str (optional) :param groups: List[:class:`ComplexValue`] (optional) :param id: str (optional) - Databricks group ID + group ID :param members: List[:class:`ComplexValue`] (optional) :param meta: :class:`ResourceMeta` (optional) Container for the group identifier. Workspace local versus account. @@ -3346,10 +3248,7 @@ def create( body["roles"] = [v.as_dict() for v in roles] if schemas is not None: body["schemas"] = [v.value for v in schemas] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3359,10 +3258,10 @@ def create( return Group.from_dict(res) def delete(self, id: str): - """Deletes a group from the Databricks workspace. + """Deletes a group from the workspace. :param id: str - Unique ID for a group in the Databricks workspace. + Unique ID for a group in the workspace. """ @@ -3376,17 +3275,15 @@ def delete(self, id: str): self._api.do("DELETE", f"/api/2.0/preview/scim/v2/Groups/{id}", headers=headers) def get(self, id: str) -> Group: - """Gets the information for a specific group in the Databricks workspace. + """Gets the information for a specific group in the workspace. :param id: str - Unique ID for a group in the Databricks workspace. + Unique ID for a group in the workspace. :returns: :class:`Group` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3406,7 +3303,7 @@ def list( sort_order: Optional[ListSortOrder] = None, start_index: Optional[int] = None, ) -> Iterator[Group]: - """Gets all details of the groups associated with the Databricks workspace. + """Gets all details of the groups associated with the workspace. :param attributes: str (optional) Comma-separated list of attributes to return in response. @@ -3445,9 +3342,7 @@ def list( query["sortOrder"] = sort_order.value if start_index is not None: query["startIndex"] = start_index - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3469,7 +3364,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O """Partially updates the details of a group. :param id: str - Unique ID in the Databricks workspace. + Unique ID in the workspace. :param operations: List[:class:`Patch`] (optional) :param schemas: List[:class:`PatchSchema`] (optional) The schema of the patch request. Must be ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]. @@ -3482,10 +3377,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O body["Operations"] = [v.as_dict() for v in operations] if schemas is not None: body["schemas"] = [v.value for v in schemas] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3509,7 +3401,7 @@ def update( """Updates the details of a group by replacing the entire group entity. :param id: str - Databricks group ID + group ID :param display_name: str (optional) String that represents a human-readable group name :param entitlements: List[:class:`ComplexValue`] (optional) @@ -3546,10 +3438,7 @@ def update( body["roles"] = [v.as_dict() for v in roles] if schemas is not None: body["schemas"] = [v.value for v in schemas] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3559,8 +3448,6 @@ def update( class PermissionMigrationAPI: - """APIs for migrating acl permissions, used only by the ucx tool: https://github.com/databrickslabs/ucx""" - def __init__(self, api_client): self._api = api_client @@ -3595,10 +3482,7 @@ def migrate_permissions( body["to_account_group_name"] = to_account_group_name if workspace_id is not None: body["workspace_id"] = workspace_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3609,37 +3493,6 @@ def migrate_permissions( class PermissionsAPI: - """Permissions API are used to create read, write, edit, update and manage access for various users on - different objects and endpoints. - - - **[Apps permissions](:service:apps)** — Manage which users can manage or use apps. - - **[Cluster permissions](:service:clusters)** — Manage which users can manage, restart, or attach to - clusters. - - **[Cluster policy permissions](:service:clusterpolicies)** — Manage which users can use cluster - policies. - - **[Spark Declarative Pipelines permissions](:service:pipelines)** — Manage which users can view, - manage, run, cancel, or own a Spark Declarative Pipeline. - - **[Job permissions](:service:jobs)** — Manage which users can view, manage, trigger, cancel, or own a - job. - - **[MLflow experiment permissions](:service:experiments)** — Manage which users can read, edit, or - manage MLflow experiments. - - **[MLflow registered model permissions](:service:modelregistry)** — Manage which users can read, edit, - or manage MLflow registered models. - - **[Instance Pool permissions](:service:instancepools)** — Manage which users can manage or attach to - pools. - - **[Repo permissions](repos)** — Manage which users can read, run, edit, or manage a repo. - - **[Serving endpoint permissions](:service:servingendpoints)** — Manage which users can view, query, or - manage a serving endpoint. - - **[SQL warehouse permissions](:service:warehouses)** — Manage which users can use or manage SQL - warehouses. - - **[Token permissions](:service:tokenmanagement)** — Manage which users can create or use tokens. - - **[Workspace object permissions](:service:workspace)** — Manage which users can read, run, edit, or - manage alerts, dbsql-dashboards, directories, files, notebooks and queries. For the mapping of the - required permissions for specific actions or abilities and other important information, see `Access - Control `__. Note that to - manage access control on service principals, use **[Account Access Control - Proxy](:service:accountaccesscontrolproxy)**.""" - def __init__(self, api_client): self._api = api_client @@ -3659,9 +3512,7 @@ def get(self, request_object_type: str, request_object_id: str) -> ObjectPermiss :returns: :class:`ObjectPermissions` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3684,9 +3535,7 @@ def get_permission_levels(self, request_object_type: str, request_object_id: str :returns: :class:`GetPermissionLevelsResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3724,10 +3573,7 @@ def set( body = {} if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3764,10 +3610,7 @@ def update( body = {} if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3780,12 +3623,6 @@ def update( class ServicePrincipalsV2API: - """Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms. - Databricks recommends creating service principals to run production jobs or modify production data. If all - processes that act on production data run with service principals, interactive users do not need any - write, delete, or modify privileges in production. This eliminates the risk of a user overwriting - production data by accident.""" - def __init__(self, api_client): self._api = api_client @@ -3802,7 +3639,7 @@ def create( roles: Optional[List[ComplexValue]] = None, schemas: Optional[List[ServicePrincipalSchema]] = None, ) -> ServicePrincipal: - """Creates a new service principal in the Databricks workspace. + """Creates a new service principal in the workspace. :param active: bool (optional) If this user is active @@ -3817,7 +3654,7 @@ def create( :param external_id: str (optional) :param groups: List[:class:`ComplexValue`] (optional) :param id: str (optional) - Databricks service principal ID. + service principal ID. :param roles: List[:class:`ComplexValue`] (optional) Corresponds to AWS instance profile/arn role. :param schemas: List[:class:`ServicePrincipalSchema`] (optional) @@ -3845,10 +3682,7 @@ def create( body["roles"] = [v.as_dict() for v in roles] if schemas is not None: body["schemas"] = [v.value for v in schemas] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3858,10 +3692,10 @@ def create( return ServicePrincipal.from_dict(res) def delete(self, id: str): - """Delete a single service principal in the Databricks workspace. + """Delete a single service principal in the workspace. :param id: str - Unique ID for a service principal in the Databricks workspace. + Unique ID for a service principal in the workspace. """ @@ -3875,17 +3709,15 @@ def delete(self, id: str): self._api.do("DELETE", f"/api/2.0/preview/scim/v2/ServicePrincipals/{id}", headers=headers) def get(self, id: str) -> ServicePrincipal: - """Gets the details for a single service principal define in the Databricks workspace. + """Gets the details for a single service principal define in the workspace. :param id: str - Unique ID for a service principal in the Databricks workspace. + Unique ID for a service principal in the workspace. :returns: :class:`ServicePrincipal` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3905,7 +3737,7 @@ def list( sort_order: Optional[ListSortOrder] = None, start_index: Optional[int] = None, ) -> Iterator[ServicePrincipal]: - """Gets the set of service principals associated with a Databricks workspace. + """Gets the set of service principals associated with a workspace. :param attributes: str (optional) Comma-separated list of attributes to return in response. @@ -3944,9 +3776,7 @@ def list( query["sortOrder"] = sort_order.value if start_index is not None: query["startIndex"] = start_index - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3965,10 +3795,10 @@ def list( query["startIndex"] += len(json["Resources"]) def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: Optional[List[PatchSchema]] = None): - """Partially updates the details of a single service principal in the Databricks workspace. + """Partially updates the details of a single service principal in the workspace. :param id: str - Unique ID in the Databricks workspace. + Unique ID in the workspace. :param operations: List[:class:`Patch`] (optional) :param schemas: List[:class:`PatchSchema`] (optional) The schema of the patch request. Must be ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]. @@ -3981,10 +3811,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O body["Operations"] = [v.as_dict() for v in operations] if schemas is not None: body["schemas"] = [v.value for v in schemas] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4010,7 +3837,7 @@ def update( This action replaces the existing service principal with the same name. :param id: str - Databricks service principal ID. + service principal ID. :param active: bool (optional) If this user is active :param application_id: str (optional) @@ -4048,10 +3875,7 @@ def update( body["roles"] = [v.as_dict() for v in roles] if schemas is not None: body["schemas"] = [v.value for v in schemas] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4061,16 +3885,6 @@ def update( class UsersV2API: - """User identities recognized by Databricks and represented by email addresses. - - Databricks recommends using SCIM provisioning to sync users and groups automatically from your identity - provider to your Databricks workspace. SCIM streamlines onboarding a new employee or team by using your - identity provider to create users and groups in Databricks workspace and give them the proper level of - access. When a user leaves your organization or no longer needs access to Databricks workspace, admins can - terminate the user in your identity provider and that user’s account will also be removed from - Databricks workspace. This ensures a consistent offboarding process and prevents unauthorized users from - accessing sensitive data.""" - def __init__(self, api_client): self._api = api_client @@ -4089,7 +3903,7 @@ def create( schemas: Optional[List[UserSchema]] = None, user_name: Optional[str] = None, ) -> User: - """Creates a new user in the Databricks workspace. This new user will also be added to the Databricks + """Creates a new user in the workspace. This new user will also be added to the account. :param active: bool (optional) @@ -4100,7 +3914,7 @@ def create( `__. Use Account SCIM APIs to update ``displayName``. :param emails: List[:class:`ComplexValue`] (optional) - All the emails associated with the Databricks user. + All the emails associated with the user. :param entitlements: List[:class:`ComplexValue`] (optional) Entitlements assigned to the user. See `assigning entitlements `__ @@ -4109,14 +3923,14 @@ def create( External ID is not currently supported. It is reserved for future use. :param groups: List[:class:`ComplexValue`] (optional) :param id: str (optional) - Databricks user ID. + user ID. :param name: :class:`Name` (optional) :param roles: List[:class:`ComplexValue`] (optional) Corresponds to AWS instance profile/arn role. :param schemas: List[:class:`UserSchema`] (optional) The schema of the user. :param user_name: str (optional) - Email address of the Databricks user. + Email address of the user. :returns: :class:`User` """ @@ -4144,10 +3958,7 @@ def create( body["schemas"] = [v.value for v in schemas] if user_name is not None: body["userName"] = user_name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4157,11 +3968,11 @@ def create( return User.from_dict(res) def delete(self, id: str): - """Deletes a user. Deleting a user from a Databricks workspace also removes objects associated with the + """Deletes a user. Deleting a user from a workspace also removes objects associated with the user. :param id: str - Unique ID for a user in the Databricks workspace. + Unique ID for a user in the workspace. """ @@ -4186,10 +3997,10 @@ def get( sort_order: Optional[GetSortOrder] = None, start_index: Optional[int] = None, ) -> User: - """Gets information for a specific user in Databricks workspace. + """Gets information for a specific user in workspace. :param id: str - Unique ID for a user in the Databricks workspace. + Unique ID for a user in the workspace. :param attributes: str (optional) Comma-separated list of attributes to return in response. :param count: int (optional) @@ -4228,9 +4039,7 @@ def get( query["sortOrder"] = sort_order.value if start_index is not None: query["startIndex"] = start_index - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4246,9 +4055,7 @@ def get_permission_levels(self) -> GetPasswordPermissionLevelsResponse: :returns: :class:`GetPasswordPermissionLevelsResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4264,9 +4071,7 @@ def get_permissions(self) -> PasswordPermissions: :returns: :class:`PasswordPermissions` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4286,7 +4091,7 @@ def list( sort_order: Optional[ListSortOrder] = None, start_index: Optional[int] = None, ) -> Iterator[User]: - """Gets details for all the users associated with a Databricks workspace. + """Gets details for all the users associated with a workspace. :param attributes: str (optional) Comma-separated list of attributes to return in response. @@ -4326,9 +4131,7 @@ def list( query["sortOrder"] = sort_order.value if start_index is not None: query["startIndex"] = start_index - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4352,7 +4155,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O them are ignored (no-op). :param id: str - Unique ID in the Databricks workspace. + Unique ID in the workspace. :param operations: List[:class:`Patch`] (optional) :param schemas: List[:class:`PatchSchema`] (optional) The schema of the patch request. Must be ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]. @@ -4365,10 +4168,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O body["Operations"] = [v.as_dict() for v in operations] if schemas is not None: body["schemas"] = [v.value for v in schemas] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4390,10 +4190,7 @@ def set_permissions( body = {} if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4421,7 +4218,7 @@ def update( attributes cannot be updated through this API; any supplied changes to them are ignored (no-op). :param id: str - Databricks user ID. + user ID. :param active: bool (optional) If this user is active :param display_name: str (optional) @@ -4430,7 +4227,7 @@ def update( `__. Use Account SCIM APIs to update ``displayName``. :param emails: List[:class:`ComplexValue`] (optional) - All the emails associated with the Databricks user. This attribute cannot be updated through the + All the emails associated with the user. This attribute cannot be updated through the SCIM PATCH or PUT APIs; any supplied change is ignored. :param entitlements: List[:class:`ComplexValue`] (optional) Entitlements assigned to the user. See `assigning entitlements @@ -4445,8 +4242,8 @@ def update( :param schemas: List[:class:`UserSchema`] (optional) The schema of the user. :param user_name: str (optional) - Email address of the Databricks user. This attribute cannot be updated through the SCIM PATCH or PUT - APIs; any supplied change is ignored. + Email address of the user. This attribute cannot be updated through the SCIM PATCH or + PUT APIs; any supplied change is ignored. """ @@ -4472,10 +4269,7 @@ def update( body["schemas"] = [v.value for v in schemas] if user_name is not None: body["userName"] = user_name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4496,10 +4290,7 @@ def update_permissions( body = {} if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4510,9 +4301,6 @@ def update_permissions( class WorkspaceAssignmentAPI: - """The Workspace Permission Assignment API allows you to manage workspace permissions for principals in your - account.""" - def __init__(self, api_client): self._api = api_client @@ -4528,9 +4316,7 @@ def delete(self, workspace_id: int, principal_id: int): """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do( "DELETE", @@ -4547,9 +4333,7 @@ def get(self, workspace_id: int) -> WorkspacePermissions: :returns: :class:`WorkspacePermissions` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -4559,7 +4343,7 @@ def get(self, workspace_id: int) -> WorkspacePermissions: return WorkspacePermissions.from_dict(res) def list(self, workspace_id: int) -> Iterator[PermissionAssignment]: - """Get the permission assignments for the specified Databricks account and Databricks workspace. + """Get the permission assignments for the specified and . :param workspace_id: int The workspace ID for the account. @@ -4567,9 +4351,7 @@ def list(self, workspace_id: int) -> Iterator[PermissionAssignment]: :returns: Iterator over :class:`PermissionAssignment` """ - headers = { - "Accept": "application/json", - } + headers = {} json = self._api.do( "GET", @@ -4602,10 +4384,7 @@ def update( body = {} if permissions is not None: body["permissions"] = [v.value for v in permissions] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PUT", diff --git a/databricks/sdk/service/iamv2.py b/databricks/sdk/service/iamv2.py index 8f18aa552..499c6424a 100644 --- a/databricks/sdk/service/iamv2.py +++ b/databricks/sdk/service/iamv2.py @@ -32,13 +32,13 @@ class DirectGroupMember: """Represents a principal that is a direct member of a group, with its source of membership.""" principal_id: int - """Internal ID of the principal in Databricks.""" + """Internal ID of the principal in .""" display_name: Optional[str] = None """Display name of the principal.""" external_id: Optional[str] = None - """The external ID of the principal in Databricks.""" + """The external ID of the principal in .""" group_id: Optional[int] = None """The internal ID of the group this member belongs to.""" @@ -107,12 +107,12 @@ class Entitlement(Enum): @dataclass class ExternalGroup: - """An external group from the customer's Identity Provider, resolved into Databricks. This is a + """An external group from the customer's Identity Provider, resolved into . This is a read-only resource keyed by the IdP external ID. The Get method may trigger an idempotent sync - from the customer's IdP to provision or refresh the group's data in Databricks.""" + from the customer's IdP to provision or refresh the group's data in .""" account_id: Optional[str] = None - """The parent account ID, from Databricks.""" + """The parent account ID, from .""" display_name: Optional[str] = None """Display name of the group from the customer's IdP.""" @@ -121,7 +121,7 @@ class ExternalGroup: """The external ID of the group in the customer's IdP.""" internal_id: Optional[str] = None - """Internal groupId of the group in Databricks.""" + """Internal groupId of the group in .""" name: Optional[str] = None """The resource name of the external group. The format depends on the API that returned it: @@ -173,16 +173,16 @@ def from_dict(cls, d: Dict[str, Any]) -> ExternalGroup: @dataclass class ExternalServicePrincipal: - """An external service principal from the customer's Identity Provider, resolved into Databricks. + """An external service principal from the customer's Identity Provider, resolved into . This is a read-only resource keyed by the IdP external ID. The Get method may trigger an idempotent sync from the customer's IdP to provision or refresh the service principal's data in - Databricks.""" + .""" account_id: Optional[str] = None - """The parent account ID, from Databricks.""" + """The parent account ID, from .""" account_sp_status: Optional[State] = None - """The activity status of the service principal in the Databricks account.""" + """The activity status of the service principal in the account.""" application_id: Optional[str] = None """Application ID of the service principal, from the customer's IdP.""" @@ -194,7 +194,7 @@ class ExternalServicePrincipal: """The external ID of the service principal in the customer's IdP.""" internal_id: Optional[str] = None - """Internal servicePrincipalId of the service principal in Databricks.""" + """Internal servicePrincipalId of the service principal in .""" name: Optional[str] = None """The resource name of the external service principal. The format depends on the API that returned @@ -258,17 +258,17 @@ def from_dict(cls, d: Dict[str, Any]) -> ExternalServicePrincipal: @dataclass class ExternalUser: - """An external user from the customer's Identity Provider, resolved into Databricks. This is a + """An external user from the customer's Identity Provider, resolved into . This is a read-only resource that allows customers to look up external user identities by their IdP - external ID and retrieve the corresponding Databricks internal ID and metadata. The Get method + external ID and retrieve the corresponding internal ID and metadata. The Get method may trigger an idempotent sync from the customer's IdP to provision or refresh the user's data - in Databricks.""" + in .""" account_id: Optional[str] = None - """The parent account ID, from Databricks.""" + """The parent account ID, from .""" account_user_status: Optional[State] = None - """The activity status of the user in the Databricks account.""" + """The activity status of the user in the account.""" display_name: Optional[str] = None """Display name of the user from the customer's IdP.""" @@ -280,7 +280,7 @@ class ExternalUser: """The full name of the user, from the customer's IdP.""" internal_id: Optional[str] = None - """Internal userId of the user in Databricks.""" + """Internal userId of the user in .""" name: Optional[str] = None """The resource name of the external user. The format depends on the API that returned it: @@ -289,7 +289,7 @@ class ExternalUser: - Workspace-scoped: external-users/{external_user_id}""" username: Optional[str] = None - """Username/email of the user, from Databricks.""" + """Username/email of the user, from .""" def as_dict(self) -> dict: """Serializes the ExternalUser into a dictionary suitable for use as a JSON request body.""" @@ -387,13 +387,13 @@ class Group: """The details of a Group resource.""" account_id: Optional[str] = None - """The parent account ID for group in Databricks.""" + """The parent account ID for group in .""" external_id: Optional[str] = None """ExternalId of the group in the customer's IdP.""" group_id: Optional[str] = None - """Internal group ID of the group in Databricks.""" + """Internal group ID of the group in .""" group_name: Optional[str] = None """Display name of the group.""" @@ -786,10 +786,10 @@ class ServicePrincipal: """Display name of the service principal.""" account_sp_status: State - """The activity status of a service principal in a Databricks account.""" + """The activity status of a service principal in a account.""" account_id: Optional[str] = None - """The parent account ID for the service principal in Databricks.""" + """The parent account ID for the service principal in .""" application_id: Optional[str] = None """Application ID of the service principal. Set at creation time and cannot be changed afterwards; @@ -799,7 +799,7 @@ class ServicePrincipal: """ExternalId of the service principal in the customer's IdP.""" service_principal_id: Optional[str] = None - """Internal service principal ID of the service principal in Databricks.""" + """Internal service principal ID of the service principal in .""" def as_dict(self) -> dict: """Serializes the ServicePrincipal into a dictionary suitable for use as a JSON request body.""" @@ -849,7 +849,7 @@ def from_dict(cls, d: Dict[str, Any]) -> ServicePrincipal: class State(Enum): - """The activity status of a user or service principal in a Databricks account or workspace.""" + """The activity status of a user or service principal in a account or workspace.""" ACTIVE = "ACTIVE" INACTIVE = "INACTIVE" @@ -860,13 +860,13 @@ class TransitiveParentGroup: """Represents a group that is a transitive parent of a principal.""" account_id: Optional[str] = None - """The parent account ID for group in Databricks.""" + """The parent account ID for group in .""" external_id: Optional[str] = None """ExternalId of the group in the customer's IdP.""" group_id: Optional[str] = None - """Internal group ID of the group in Databricks.""" + """Internal group ID of the group in .""" def as_dict(self) -> dict: """Serializes the TransitiveParentGroup into a dictionary suitable for use as a JSON request body.""" @@ -910,16 +910,16 @@ class User: full_name: UserFullName account_user_status: State - """The activity status of a user in a Databricks account.""" + """The activity status of a user in a account.""" account_id: Optional[str] = None - """The accountId parent of the user in Databricks.""" + """The accountId parent of the user in .""" external_id: Optional[str] = None """ExternalId of the user in the customer's IdP.""" user_id: Optional[str] = None - """Internal userId of the user in Databricks.""" + """Internal userId of the user in .""" def as_dict(self) -> dict: """Serializes the User into a dictionary suitable for use as a JSON request body.""" @@ -1011,7 +1011,7 @@ class WorkspaceAccessDetail: """The permissions granted to the principal in the workspace.""" principal_id: Optional[int] = None - """The internal ID of the principal (user/sp/group) in Databricks.""" + """The internal ID of the principal (user/sp/group) in .""" principal_type: Optional[PrincipalType] = None @@ -1110,7 +1110,7 @@ class WorkspaceAssignment: permission-assignment APIs, and is intended for account and workspace admins.""" principal_id: int - """The internal ID of the principal (user/sp/group) in Databricks.""" + """The internal ID of the principal (user/sp/group) in .""" account_id: Optional[str] = None """The account ID parent of the workspace where the principal is assigned""" @@ -1201,7 +1201,7 @@ class WorkspaceAssignmentDetail: permission-assignment APIs, and is intended for account and workspace admins.""" principal_id: int - """The internal ID of the principal (user/sp/group) in Databricks.""" + """The internal ID of the principal (user/sp/group) in .""" account_id: Optional[str] = None """The account ID parent of the workspace where the principal is assigned""" @@ -1276,13 +1276,13 @@ class WorkspaceIdentityDetail: """The type of assignment the principal has to the workspace (direct or indirect).""" principal_id: Optional[int] = None - """The internal ID of the principal (user/sp/group) in Databricks.""" + """The internal ID of the principal (user/sp/group) in .""" principal_type: Optional[PrincipalType] = None """The type of the principal (user/service principal/group).""" workspace_identity_status: Optional[State] = None - """The activity status of an identity in a Databricks workspace.""" + """The activity status of an identity in a workspace.""" def as_dict(self) -> dict: """Serializes the WorkspaceIdentityDetail into a dictionary suitable for use as a JSON request body.""" @@ -1336,7 +1336,7 @@ class WorkspacePermission(Enum): class AccountIamV2API: - """These APIs are used to manage identities and the workspace access of these identities in .""" + """Handles group management operations for an account.""" def __init__(self, api_client): self._api = api_client @@ -1345,7 +1345,7 @@ def create_direct_group_member(self, group_id: int, direct_group_member: DirectG """Creates a group membership (assigns a principal to a group). :param group_id: int - Required. Internal ID of the group in Databricks. + Required. Internal ID of the group in . :param direct_group_member: :class:`DirectGroupMember` Required. The direct group member to be added to the group. @@ -1354,10 +1354,7 @@ def create_direct_group_member(self, group_id: int, direct_group_member: DirectG body = direct_group_member.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", @@ -1368,7 +1365,7 @@ def create_direct_group_member(self, group_id: int, direct_group_member: DirectG return DirectGroupMember.from_dict(res) def create_group(self, group: Group) -> Group: - """Creates a local group in the Databricks account and returns the created group. A local group is one + """Creates a local group in the account and returns the created group. A local group is one that is not synced from the customer's identity provider, and can be created whether or not Account Identity Management (AIM) is enabled. @@ -1384,10 +1381,7 @@ def create_group(self, group: Group) -> Group: body = group.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", f"/api/2.0/identity/accounts/{self._api.account_id}/groups", body=body, headers=headers @@ -1395,9 +1389,9 @@ def create_group(self, group: Group) -> Group: return Group.from_dict(res) def create_service_principal(self, service_principal: ServicePrincipal) -> ServicePrincipal: - """Creates a local service principal in the Databricks account and returns the created service principal. - A local service principal is one that is not synced from the customer's identity provider, and can be - created whether or not Account Identity Management (AIM) is enabled. + """Creates a local service principal in the account and returns the created service + principal. A local service principal is one that is not synced from the customer's identity provider, + and can be created whether or not Account Identity Management (AIM) is enabled. When AIM is enabled, supplying an external ID returns an error. To provision the identity from your identity provider, resolve it by its external ID with ResolveServicePrincipal; to read an existing @@ -1411,10 +1405,7 @@ def create_service_principal(self, service_principal: ServicePrincipal) -> Servi body = service_principal.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", f"/api/2.0/identity/accounts/{self._api.account_id}/service-principals", body=body, headers=headers @@ -1422,8 +1413,8 @@ def create_service_principal(self, service_principal: ServicePrincipal) -> Servi return ServicePrincipal.from_dict(res) def create_user(self, user: User) -> User: - """Creates a local user in the Databricks account and returns the created user. A local user is one that - is not synced from the customer's identity provider, and can be created whether or not Account + """Creates a local user in the account and returns the created user. A local user is one + that is not synced from the customer's identity provider, and can be created whether or not Account Identity Management (AIM) is enabled. When AIM is enabled, supplying an external ID returns an error. To provision the identity from your @@ -1438,10 +1429,7 @@ def create_user(self, user: User) -> User: body = user.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", f"/api/2.0/identity/accounts/{self._api.account_id}/users", body=body, headers=headers @@ -1466,10 +1454,7 @@ def create_workspace_assignment( body = workspace_assignment.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", @@ -1494,10 +1479,7 @@ def create_workspace_assignment_detail( body = workspace_assignment_detail.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", @@ -1511,16 +1493,14 @@ def delete_direct_group_member(self, group_id: int, principal_id: int): """Deletes a group membership (unassigns a principal from a group). :param group_id: int - Required. Internal ID of the group in Databricks. + Required. Internal ID of the group in . :param principal_id: int Required. Internal ID of the principal to be unassigned from the group. """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do( "DELETE", @@ -1529,32 +1509,28 @@ def delete_direct_group_member(self, group_id: int, principal_id: int): ) def delete_group(self, group_id: str): - """Deletes a group from the Databricks account by its internal ID. + """Deletes a group from the account by its internal ID. :param group_id: str - Required. Internal ID of the group in Databricks. + Required. Internal ID of the group in . """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do("DELETE", f"/api/2.0/identity/accounts/{self._api.account_id}/groups/{group_id}", headers=headers) def delete_service_principal(self, service_principal_id: str): - """Deletes a service principal from the Databricks account by its internal ID. + """Deletes a service principal from the account by its internal ID. :param service_principal_id: str - Required. Internal ID of the service principal in Databricks. + Required. Internal ID of the service principal in . """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do( "DELETE", @@ -1563,36 +1539,32 @@ def delete_service_principal(self, service_principal_id: str): ) def delete_user(self, user_id: str): - """Deletes a user from the Databricks account by its internal ID. + """Deletes a user from the account by its internal ID. :param user_id: str - Required. Internal ID of the user in Databricks. + Required. Internal ID of the user in . """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do("DELETE", f"/api/2.0/identity/accounts/{self._api.account_id}/users/{user_id}", headers=headers) - def delete_workspace_assignment(self, workspace_id: int, principal_id: int): + def delete_workspace_assignment(self, principal_id: int, workspace_id: int): """Deletes a workspace assignment for a principal, revoking all of its entitlements. Entitlements are revoked one at a time rather than atomically. If the request fails partway through, the principal stays assigned with some of its original entitlements. Retrying is safe. + :param principal_id: int + Required. ID of the principal in to delete workspace assignment for. :param workspace_id: int The workspace ID where the principal has access. - :param principal_id: int - Required. ID of the principal in Databricks to delete workspace assignment for. """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do( "DELETE", @@ -1600,22 +1572,20 @@ def delete_workspace_assignment(self, workspace_id: int, principal_id: int): headers=headers, ) - def delete_workspace_assignment_detail(self, workspace_id: int, principal_id: int): + def delete_workspace_assignment_detail(self, principal_id: int, workspace_id: int): """Deletes a workspace assignment detail for a principal, revoking all of its entitlements. Entitlements are revoked one at a time rather than atomically. If the request fails partway through, the principal stays assigned with some of its original entitlements. Retrying is safe. + :param principal_id: int + Required. ID of the principal in to delete workspace assignment for. :param workspace_id: int The workspace ID where the principal has access. - :param principal_id: int - Required. ID of the principal in Databricks to delete workspace assignment for. """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do( "DELETE", @@ -1627,16 +1597,14 @@ def get_direct_group_member(self, group_id: int, principal_id: int) -> DirectGro """Gets a provisioned direct member of a group. :param group_id: int - Required. Internal ID of the group in Databricks. + Required. Internal ID of the group in . :param principal_id: int - Required. Internal ID of the principal belonging to the group in Databricks. + Required. Internal ID of the principal belonging to the group in . :returns: :class:`DirectGroupMember` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -1657,9 +1625,7 @@ def get_external_group(self, name: str) -> ExternalGroup: :returns: :class:`ExternalGroup` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/2.0/identity/{name}", headers=headers) return ExternalGroup.from_dict(res) @@ -1676,9 +1642,7 @@ def get_external_service_principal(self, name: str) -> ExternalServicePrincipal: :returns: :class:`ExternalServicePrincipal` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/2.0/identity/{name}", headers=headers) return ExternalServicePrincipal.from_dict(res) @@ -1695,25 +1659,21 @@ def get_external_user(self, name: str) -> ExternalUser: :returns: :class:`ExternalUser` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/2.0/identity/{name}", headers=headers) return ExternalUser.from_dict(res) def get_group(self, group_id: str) -> Group: - """Fetches a group from the Databricks account by its internal ID. + """Fetches a group from the account by its internal ID. :param group_id: str - Required. Internal ID of the group in Databricks. + Required. Internal ID of the group in . :returns: :class:`Group` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", f"/api/2.0/identity/accounts/{self._api.account_id}/groups/{group_id}", headers=headers @@ -1721,17 +1681,15 @@ def get_group(self, group_id: str) -> Group: return Group.from_dict(res) def get_service_principal(self, service_principal_id: str) -> ServicePrincipal: - """Fetches a service principal from the Databricks account by its internal ID. + """Fetches a service principal from the account by its internal ID. :param service_principal_id: str - Required. Internal ID of the service principal in Databricks. + Required. Internal ID of the service principal in . :returns: :class:`ServicePrincipal` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -1741,17 +1699,15 @@ def get_service_principal(self, service_principal_id: str) -> ServicePrincipal: return ServicePrincipal.from_dict(res) def get_user(self, user_id: str) -> User: - """Fetches a user from the Databricks account by its internal ID. + """Fetches a user from the account by its internal ID. :param user_id: str - Required. Internal ID of the user in Databricks. + Required. Internal ID of the user in . :returns: :class:`User` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/2.0/identity/accounts/{self._api.account_id}/users/{user_id}", headers=headers) return User.from_dict(res) @@ -1762,8 +1718,8 @@ def get_workspace_access_detail( """Returns the access details for a principal in a workspace. Allows for checking access details for any provisioned principal (user, service principal, or group) in a workspace. - - Provisioned principal here refers to one that has been synced into Databricks from the customer's - IdP or added explicitly to Databricks via SCIM/UI. Allows for passing in a "view" parameter to + - Provisioned principal here refers to one that has been synced into from the customer's + IdP or added explicitly to via SCIM/UI. Allows for passing in a "view" parameter to control what fields are returned (BASIC by default or FULL). :param workspace_id: int @@ -1780,9 +1736,7 @@ def get_workspace_access_detail( query = {} if view is not None: query["view"] = view.value - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -1804,9 +1758,7 @@ def get_workspace_assignment(self, workspace_id: int, principal_id: int) -> Work :returns: :class:`WorkspaceAssignment` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -1827,9 +1779,7 @@ def get_workspace_assignment_detail(self, workspace_id: int, principal_id: int) :returns: :class:`WorkspaceAssignmentDetail` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -1845,7 +1795,7 @@ def list_direct_group_members( provider). :param group_id: int - Required. Internal ID of the group in Databricks whose direct members are being listed. + Required. Internal ID of the group in whose direct members are being listed. :param page_size: int (optional) The maximum number of members to return. The service may return fewer than this value. If not provided, defaults to 1000, which is also the maximum allowed. Requests for more than the maximum @@ -1862,9 +1812,7 @@ def list_direct_group_members( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -1883,7 +1831,7 @@ def list_direct_group_members( def list_groups( self, *, filter: Optional[str] = None, page_size: Optional[int] = None, page_token: Optional[str] = None ) -> Iterator[Group]: - """Lists the groups in the Databricks account, returning one page per call. Supports filtering by group + """Lists the groups in the account, returning one page per call. Supports filtering by group name or external ID. :param filter: str (optional) @@ -1906,9 +1854,7 @@ def list_groups( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -1924,7 +1870,7 @@ def list_groups( def list_service_principals( self, *, filter: Optional[str] = None, page_size: Optional[int] = None, page_token: Optional[str] = None ) -> Iterator[ServicePrincipal]: - """Lists the service principals in the Databricks account, returning one page per call. Supports + """Lists the service principals in the account, returning one page per call. Supports filtering by application ID or external ID. :param filter: str (optional) @@ -1947,9 +1893,7 @@ def list_service_principals( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -1971,7 +1915,7 @@ def list_transitive_parent_groups( """Lists all transitive parent groups of a principal. :param principal_id: int - Required. Internal ID of the principal in Databricks whose transitive parent groups are being + Required. Internal ID of the principal in whose transitive parent groups are being listed. :param page_size: int (optional) The maximum number of parent groups to return. The service may return fewer than this value. If not @@ -1989,9 +1933,7 @@ def list_transitive_parent_groups( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -2004,8 +1946,8 @@ def list_transitive_parent_groups( def list_users( self, *, filter: Optional[str] = None, page_size: Optional[int] = None, page_token: Optional[str] = None ) -> Iterator[User]: - """Lists the users in the Databricks account, returning one page per call. Supports filtering by username - or external ID. + """Lists the users in the account, returning one page per call. Supports filtering by + username or external ID. :param filter: str (optional) Optional. Allows filtering users by username or external id. @@ -2026,9 +1968,7 @@ def list_users( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -2066,9 +2006,7 @@ def list_workspace_assignment_details( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -2109,9 +2047,7 @@ def list_workspace_assignments( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -2141,10 +2077,7 @@ def resolve_group(self, external_id: str) -> ResolveGroupResponse: body = {} if external_id is not None: body["external_id"] = external_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", @@ -2168,10 +2101,7 @@ def resolve_service_principal(self, external_id: str) -> ResolveServicePrincipal body = {} if external_id is not None: body["external_id"] = external_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", @@ -2195,10 +2125,7 @@ def resolve_user(self, external_id: str) -> ResolveUserResponse: body = {} if external_id is not None: body["external_id"] = external_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", @@ -2209,14 +2136,14 @@ def resolve_user(self, external_id: str) -> ResolveUserResponse: return ResolveUserResponse.from_dict(res) def update_group(self, group_id: str, group: Group, update_mask: str) -> Group: - """Updates an existing group in the Databricks account. Only the fields named in the update mask are + """Updates an existing group in the account. Only the fields named in the update mask are modified. Returns the updated Group resource. When AIM is enabled and the group is an external identity (its external_id is set), only external_id can be updated; its other fields are sourced from your identity provider. :param group_id: str - Required. Internal ID of the group in Databricks. + Required. Internal ID of the group in . :param group: :class:`Group` Required. Group to be updated in :param update_mask: str @@ -2229,10 +2156,7 @@ def update_group(self, group_id: str, group: Group, update_mask: str) -> Group: query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -2246,14 +2170,14 @@ def update_group(self, group_id: str, group: Group, update_mask: str) -> Group: def update_service_principal( self, service_principal_id: str, service_principal: ServicePrincipal, update_mask: str ) -> ServicePrincipal: - """Updates an existing service principal in the Databricks account. Only the fields named in the update + """Updates an existing service principal in the account. Only the fields named in the update mask are modified. Returns the updated ServicePrincipal resource. When AIM is enabled and the service principal is an external identity (its external_id is set), only external_id can be updated; its other fields are sourced from your identity provider. :param service_principal_id: str - Required. Internal ID of the service principal in Databricks. + Required. Internal ID of the service principal in . :param service_principal: :class:`ServicePrincipal` Required. Service Principal to be updated in :param update_mask: str @@ -2266,10 +2190,7 @@ def update_service_principal( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -2281,15 +2202,15 @@ def update_service_principal( return ServicePrincipal.from_dict(res) def update_user(self, user_id: str, user: User, update_mask: str) -> User: - """Updates an existing user in the Databricks account and returns the updated user. Only the fields named - in the update mask are modified. The updatable fields are fullName.givenName, fullName.familyName, - status, and externalId. + """Updates an existing user in the account and returns the updated user. Only the fields + named in the update mask are modified. The updatable fields are fullName.givenName, + fullName.familyName, status, and externalId. When AIM is enabled and the user is an external identity (its external_id is set), only external_id can be updated; its other fields are sourced from your identity provider. :param user_id: str - Required. Internal ID of the user in Databricks. + Required. Internal ID of the user in . :param user: :class:`User` Required. User to be updated in :param update_mask: str @@ -2302,10 +2223,7 @@ def update_user(self, user_id: str, user: User, update_mask: str) -> User: query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -2326,7 +2244,7 @@ def update_workspace_assignment( :param workspace_id: int Required. The workspace ID for which the workspace assignment is being updated. :param principal_id: int - Required. ID of the principal in Databricks. + Required. ID of the principal in . :param workspace_assignment: :class:`WorkspaceAssignment` Required. Workspace assignment to be updated in . :param update_mask: FieldMask @@ -2339,10 +2257,7 @@ def update_workspace_assignment( query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -2367,7 +2282,7 @@ def update_workspace_assignment_detail( :param workspace_id: int Required. The workspace ID for which the workspace assignment detail is being updated. :param principal_id: int - Required. ID of the principal in Databricks. + Required. ID of the principal in . :param workspace_assignment_detail: :class:`WorkspaceAssignmentDetail` Required. Workspace assignment detail to be updated in . :param update_mask: FieldMask @@ -2380,10 +2295,7 @@ def update_workspace_assignment_detail( query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -2396,7 +2308,7 @@ def update_workspace_assignment_detail( class WorkspaceIamV2API: - """These APIs are used to manage identities and the workspace access of these identities in .""" + """Handles group management operations for an account.""" def __init__(self, api_client): self._api = api_client @@ -2407,7 +2319,7 @@ def create_direct_group_member_proxy( """Creates a group membership (assigns a principal to a group). :param group_id: int - Required. Internal ID of the group in Databricks. + Required. Internal ID of the group in . :param direct_group_member: :class:`DirectGroupMember` Required. The group membership to create. @@ -2416,10 +2328,7 @@ def create_direct_group_member_proxy( body = direct_group_member.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2429,7 +2338,7 @@ def create_direct_group_member_proxy( return DirectGroupMember.from_dict(res) def create_group_proxy(self, group: Group) -> Group: - """Creates a local group in the Databricks account that parents the calling workspace and returns the + """Creates a local group in the account that parents the calling workspace and returns the created group. A local group is one that is not synced from the customer's identity provider, and can be created whether or not Account Identity Management (AIM) is enabled. @@ -2445,10 +2354,7 @@ def create_group_proxy(self, group: Group) -> Group: body = group.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2458,7 +2364,7 @@ def create_group_proxy(self, group: Group) -> Group: return Group.from_dict(res) def create_service_principal_proxy(self, service_principal: ServicePrincipal) -> ServicePrincipal: - """Creates a local service principal in the Databricks account that parents the calling workspace and + """Creates a local service principal in the account that parents the calling workspace and returns the created service principal. A local service principal is one that is not synced from the customer's identity provider, and can be created whether or not Account Identity Management (AIM) is enabled. @@ -2475,10 +2381,7 @@ def create_service_principal_proxy(self, service_principal: ServicePrincipal) -> body = service_principal.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2488,7 +2391,7 @@ def create_service_principal_proxy(self, service_principal: ServicePrincipal) -> return ServicePrincipal.from_dict(res) def create_user_proxy(self, user: User) -> User: - """Creates a local user in the Databricks account that parents the calling workspace and returns the + """Creates a local user in the account that parents the calling workspace and returns the created user. A local user is one that is not synced from the customer's identity provider, and can be created whether or not Account Identity Management (AIM) is enabled. @@ -2504,10 +2407,7 @@ def create_user_proxy(self, user: User) -> User: body = user.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2529,10 +2429,7 @@ def create_workspace_assignment_detail_proxy( body = workspace_assignment_detail.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2555,10 +2452,7 @@ def create_workspace_assignment_proxy(self, workspace_assignment: WorkspaceAssig body = workspace_assignment.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2571,16 +2465,14 @@ def delete_direct_group_member_proxy(self, group_id: int, principal_id: int): """Deletes a group membership (unassigns a principal from a group). :param group_id: int - Required. Internal ID of the group in Databricks. + Required. Internal ID of the group in . :param principal_id: int Required. Internal ID of the principal to be unassigned from the group. """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2589,17 +2481,15 @@ def delete_direct_group_member_proxy(self, group_id: int, principal_id: int): self._api.do("DELETE", f"/api/2.0/identity/groups/{group_id}/direct-members/{principal_id}", headers=headers) def delete_group_proxy(self, group_id: str): - """Deletes a group by its internal ID from the Databricks account that parents the calling workspace. + """Deletes a group by its internal ID from the account that parents the calling workspace. :param group_id: str - Required. Internal ID of the group in Databricks. + Required. Internal ID of the group in . """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2608,18 +2498,16 @@ def delete_group_proxy(self, group_id: str): self._api.do("DELETE", f"/api/2.0/identity/groups/{group_id}", headers=headers) def delete_service_principal_proxy(self, service_principal_id: str): - """Deletes a service principal by its internal ID from the Databricks account that parents the calling + """Deletes a service principal by its internal ID from the account that parents the calling workspace. :param service_principal_id: str - Required. Internal ID of the service principal in Databricks. + Required. Internal ID of the service principal in . """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2628,17 +2516,15 @@ def delete_service_principal_proxy(self, service_principal_id: str): self._api.do("DELETE", f"/api/2.0/identity/service-principals/{service_principal_id}", headers=headers) def delete_user_proxy(self, user_id: str): - """Deletes a user by its internal ID from the Databricks account that parents the calling workspace. + """Deletes a user by its internal ID from the account that parents the calling workspace. :param user_id: str - Required. Internal ID of the user in Databricks. + Required. Internal ID of the user in . """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2653,14 +2539,12 @@ def delete_workspace_assignment_detail_proxy(self, principal_id: int): safe. :param principal_id: int - Required. ID of the principal in Databricks to delete workspace assignment for. + Required. ID of the principal in to delete workspace assignment for. """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2675,14 +2559,12 @@ def delete_workspace_assignment_proxy(self, principal_id: int): safe. :param principal_id: int - Required. ID of the principal in Databricks to delete workspace assignment for. + Required. ID of the principal in to delete workspace assignment for. """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2694,16 +2576,14 @@ def get_direct_group_member_proxy(self, group_id: int, principal_id: int) -> Dir """Gets a provisioned direct member of a group. :param group_id: int - Required. Internal ID of the group in Databricks. + Required. Internal ID of the group in . :param principal_id: int - Required. Internal ID of the principal belonging to the group in Databricks. + Required. Internal ID of the principal belonging to the group in . :returns: :class:`DirectGroupMember` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2724,9 +2604,7 @@ def get_external_group_proxy(self, name: str) -> ExternalGroup: :returns: :class:`ExternalGroup` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2748,9 +2626,7 @@ def get_external_service_principal_proxy(self, name: str) -> ExternalServicePrin :returns: :class:`ExternalServicePrincipal` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2770,9 +2646,7 @@ def get_external_user_proxy(self, name: str) -> ExternalUser: :returns: :class:`ExternalUser` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2782,17 +2656,15 @@ def get_external_user_proxy(self, name: str) -> ExternalUser: return ExternalUser.from_dict(res) def get_group_proxy(self, group_id: str) -> Group: - """Fetches a group by its internal ID from the Databricks account that parents the calling workspace. + """Fetches a group by its internal ID from the account that parents the calling workspace. :param group_id: str - Required. Internal ID of the group in Databricks. + Required. Internal ID of the group in . :returns: :class:`Group` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2802,18 +2674,16 @@ def get_group_proxy(self, group_id: str) -> Group: return Group.from_dict(res) def get_service_principal_proxy(self, service_principal_id: str) -> ServicePrincipal: - """Fetches a service principal by its internal ID from the Databricks account that parents the calling + """Fetches a service principal by its internal ID from the account that parents the calling workspace. :param service_principal_id: str - Required. Internal ID of the service principal in Databricks. + Required. Internal ID of the service principal in . :returns: :class:`ServicePrincipal` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2823,17 +2693,15 @@ def get_service_principal_proxy(self, service_principal_id: str) -> ServicePrinc return ServicePrincipal.from_dict(res) def get_user_proxy(self, user_id: str) -> User: - """Fetches a user by its internal ID from the Databricks account that parents the calling workspace. + """Fetches a user by its internal ID from the account that parents the calling workspace. :param user_id: str - Required. Internal ID of the user in Databricks. + Required. Internal ID of the user in . :returns: :class:`User` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2848,8 +2716,8 @@ def get_workspace_access_detail_local( """Returns the access details for a principal in the current workspace. Allows for checking access details for any provisioned principal (user, service principal, or group) in the current workspace. - - Provisioned principal here refers to one that has been synced into Databricks from the customer's - IdP or added explicitly to Databricks via SCIM/UI. Allows for passing in a "view" parameter to + - Provisioned principal here refers to one that has been synced into from the customer's + IdP or added explicitly to via SCIM/UI. Allows for passing in a "view" parameter to control what fields are returned (BASIC by default or FULL). :param principal_id: int @@ -2864,9 +2732,7 @@ def get_workspace_access_detail_local( query = {} if view is not None: query["view"] = view.value - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2887,9 +2753,7 @@ def get_workspace_assignment_detail_proxy(self, principal_id: int) -> WorkspaceA :returns: :class:`WorkspaceAssignmentDetail` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2908,9 +2772,7 @@ def get_workspace_assignment_proxy(self, principal_id: int) -> WorkspaceAssignme :returns: :class:`WorkspaceAssignment` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2929,9 +2791,7 @@ def get_workspace_identity_detail(self, principal_id: int) -> WorkspaceIdentityD :returns: :class:`WorkspaceIdentityDetail` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2947,7 +2807,7 @@ def list_direct_group_members_proxy( provider). :param group_id: int - Required. Internal ID of the group in Databricks whose direct members are being listed. + Required. Internal ID of the group in whose direct members are being listed. :param page_size: int (optional) The maximum number of members to return. The service may return fewer than this value. If not provided, defaults to 1000, which is also the maximum allowed. Requests for more than the maximum @@ -2963,9 +2823,7 @@ def list_direct_group_members_proxy( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2985,8 +2843,8 @@ def list_direct_group_members_proxy( def list_groups_proxy( self, *, filter: Optional[str] = None, page_size: Optional[int] = None, page_token: Optional[str] = None ) -> Iterator[Group]: - """Lists the groups in the Databricks account that parents the calling workspace, returning one page per - call. Supports filtering by group name or external ID. + """Lists the groups in the account that parents the calling workspace, returning one page + per call. Supports filtering by group name or external ID. :param filter: str (optional) Optional. Allows filtering groups by group name or external id. @@ -3008,9 +2866,7 @@ def list_groups_proxy( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3028,7 +2884,7 @@ def list_groups_proxy( def list_service_principals_proxy( self, *, filter: Optional[str] = None, page_size: Optional[int] = None, page_token: Optional[str] = None ) -> Iterator[ServicePrincipal]: - """Lists the service principals in the Databricks account that parents the calling workspace, returning + """Lists the service principals in the account that parents the calling workspace, returning one page per call. Supports filtering by application ID or external ID. :param filter: str (optional) @@ -3051,9 +2907,7 @@ def list_service_principals_proxy( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3074,7 +2928,7 @@ def list_transitive_parent_groups_proxy( """Lists all transitive parent groups of a principal. :param principal_id: int - Required. Internal ID of the principal in Databricks whose transitive parent groups are being + Required. Internal ID of the principal in whose transitive parent groups are being listed. :param page_size: int (optional) The maximum number of parent groups to return. The service may return fewer than this value. If not @@ -3092,9 +2946,7 @@ def list_transitive_parent_groups_proxy( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3108,7 +2960,7 @@ def list_transitive_parent_groups_proxy( def list_users_proxy( self, *, filter: Optional[str] = None, page_size: Optional[int] = None, page_token: Optional[str] = None ) -> Iterator[User]: - """Lists the users in the Databricks account that parents the calling workspace, returning one page per + """Lists the users in the account that parents the calling workspace, returning one page per call. Supports filtering by username or external ID. :param filter: str (optional) @@ -3130,9 +2982,7 @@ def list_users_proxy( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3169,9 +3019,7 @@ def list_workspace_assignment_details_proxy( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3208,9 +3056,7 @@ def list_workspace_assignments_proxy( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3239,10 +3085,7 @@ def resolve_group_proxy(self, external_id: str) -> ResolveGroupResponse: body = {} if external_id is not None: body["external_id"] = external_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3265,10 +3108,7 @@ def resolve_service_principal_proxy(self, external_id: str) -> ResolveServicePri body = {} if external_id is not None: body["external_id"] = external_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3293,10 +3133,7 @@ def resolve_user_proxy(self, external_id: str) -> ResolveUserResponse: body = {} if external_id is not None: body["external_id"] = external_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3306,14 +3143,14 @@ def resolve_user_proxy(self, external_id: str) -> ResolveUserResponse: return ResolveUserResponse.from_dict(res) def update_group_proxy(self, group_id: str, group: Group, update_mask: str) -> Group: - """Updates an existing group in the Databricks account that parents the calling workspace. Only the + """Updates an existing group in the account that parents the calling workspace. Only the fields named in the update mask are modified. Returns the updated Group resource. When AIM is enabled and the group is an external identity (its external_id is set), only external_id can be updated; its other fields are sourced from your identity provider. :param group_id: str - Required. Internal ID of the group in Databricks. + Required. Internal ID of the group in . :param group: :class:`Group` Required. Group to be updated in :param update_mask: str @@ -3326,10 +3163,7 @@ def update_group_proxy(self, group_id: str, group: Group, update_mask: str) -> G query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3341,14 +3175,14 @@ def update_group_proxy(self, group_id: str, group: Group, update_mask: str) -> G def update_service_principal_proxy( self, service_principal_id: str, service_principal: ServicePrincipal, update_mask: str ) -> ServicePrincipal: - """Updates an existing service principal in the Databricks account that parents the calling workspace. + """Updates an existing service principal in the account that parents the calling workspace. Only the fields named in the update mask are modified. Returns the updated ServicePrincipal resource. When AIM is enabled and the service principal is an external identity (its external_id is set), only external_id can be updated; its other fields are sourced from your identity provider. :param service_principal_id: str - Required. Internal ID of the service principal in Databricks. + Required. Internal ID of the service principal in . :param service_principal: :class:`ServicePrincipal` Required. Service principal to be updated in :param update_mask: str @@ -3361,10 +3195,7 @@ def update_service_principal_proxy( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3380,15 +3211,15 @@ def update_service_principal_proxy( return ServicePrincipal.from_dict(res) def update_user_proxy(self, user_id: str, user: User, update_mask: str) -> User: - """Updates an existing user in the Databricks account that parents the calling workspace and returns the - updated user. Only the fields named in the update mask are modified. The updatable fields are + """Updates an existing user in the account that parents the calling workspace and returns + the updated user. Only the fields named in the update mask are modified. The updatable fields are fullName.givenName, fullName.familyName, status, and externalId. When AIM is enabled and the user is an external identity (its external_id is set), only external_id can be updated; its other fields are sourced from your identity provider. :param user_id: str - Required. Internal ID of the user in Databricks. + Required. Internal ID of the user in . :param user: :class:`User` Required. User to be updated in :param update_mask: str @@ -3401,10 +3232,7 @@ def update_user_proxy(self, user_id: str, user: User, update_mask: str) -> User: query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3421,7 +3249,7 @@ def update_workspace_assignment_detail_proxy( requested changes take effect. Get the assignment detail afterwards to confirm the final state. :param principal_id: int - Required. ID of the principal in Databricks. + Required. ID of the principal in . :param workspace_assignment_detail: :class:`WorkspaceAssignmentDetail` Required. Workspace assignment detail to be updated in . :param update_mask: FieldMask @@ -3434,10 +3262,7 @@ def update_workspace_assignment_detail_proxy( query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3460,7 +3285,7 @@ def update_workspace_assignment_proxy( requested changes take effect. Get the assignment afterwards to confirm the final state. :param principal_id: int - Required. ID of the principal in Databricks. + Required. ID of the principal in . :param workspace_assignment: :class:`WorkspaceAssignment` Required. Workspace assignment to be updated in . :param update_mask: FieldMask @@ -3473,10 +3298,7 @@ def update_workspace_assignment_proxy( query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3493,7 +3315,7 @@ def update_workspace_identity_detail( """Updates a workspace identity detail for a principal. :param principal_id: int - Required. ID of the principal in Databricks. + Required. ID of the principal in . :param workspace_identity_detail: :class:`WorkspaceIdentityDetail` Required. Workspace identity detail to be updated in . :param update_mask: FieldMask @@ -3506,10 +3328,7 @@ def update_workspace_identity_detail( query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/jobs.py b/databricks/sdk/service/jobs.py index 13facd994..25637b188 100644 --- a/databricks/sdk/service/jobs.py +++ b/databricks/sdk/service/jobs.py @@ -25,9 +25,6 @@ ) -from databricks.sdk.service import compute - - _LOG = logging.getLogger("databricks.sdk") @@ -61,7 +58,7 @@ class AiRuntimeTask: docker_image_url: Optional[str] = None """Optional Docker image URL for a custom container image. When set, the task runs on the specified - container image instead of the default Databricks client image. Format: + container image instead of the default client image. Format: ``{organization}/{repository}:{tag}``""" mlflow_artifact_location: Optional[str] = None @@ -1139,7 +1136,7 @@ class ComputeSpec: provisioned_capacity_id: Optional[str] = None """Optional ID of a pre-provisioned accelerator capacity reservation to run this AI Runtime workload on. When set, the workload is scheduled onto the referenced reserved capacity instead - of the on-demand capacity shared among all Databricks customers.""" + of the on-demand capacity shared among all customers.""" def as_dict(self) -> dict: """Serializes the ComputeSpec into a dictionary suitable for use as a JSON request body.""" @@ -1999,11 +1996,11 @@ class DbtTask: source: Optional[Source] = None """Optional location type of the project directory. When set to ``WORKSPACE``, the project will be - retrieved from the local Databricks workspace. When set to ``GIT``, the project will be + retrieved from the local workspace. When set to ``GIT``, the project will be retrieved from a Git repository defined in ``git_source``. If the value is empty, the task will use ``GIT`` if ``git_source`` is defined and ``WORKSPACE`` otherwise. - - ``WORKSPACE``: Project is located in Databricks workspace. + - ``WORKSPACE``: Project is located in workspace. - ``GIT``: Project is located in cloud Git provider.""" warehouse_id: Optional[str] = None @@ -2230,8 +2227,6 @@ def from_dict(cls, d: Dict[str, Any]) -> EnforcePolicyComplianceResponse: @dataclass class ExportRunOutput: - """Run was exported successfully.""" - views: Optional[List[ViewItem]] = None """The exported content in HTML format (one for every view item). To extract the HTML notebook from the JSON response, download and run this [Python script](/_static/examples/extract.py).""" @@ -2541,16 +2536,16 @@ class GenAiComputeTask: source: Optional[Source] = None """Optional location type of the training script. When set to ``WORKSPACE``, the script will be - retrieved from the local Databricks workspace. When set to ``GIT``, the script will be retrieved - from a Git repository defined in ``git_source``. If the value is empty, the task will use - ``GIT`` if ``git_source`` is defined and ``WORKSPACE`` otherwise. + retrieved from the local workspace. When set to ``GIT``, the script will be + retrieved from a Git repository defined in ``git_source``. If the value is empty, the task will + use ``GIT`` if ``git_source`` is defined and ``WORKSPACE`` otherwise. - - ``WORKSPACE``: Script is located in Databricks workspace. + - ``WORKSPACE``: Script is located in workspace. - ``GIT``: Script is located in cloud Git provider.""" training_script_path: Optional[str] = None """The training script file path to be executed. Cloud file URIs (such as dbfs:/, s3:/, adls:/, - gcs:/) and workspace paths are supported. For python files stored in the Databricks workspace, + gcs:/) and workspace paths are supported. For python files stored in the workspace, the path must be absolute and begin with ``/``. For files stored in a remote repository, the path must be relative. This field is required.""" @@ -2618,31 +2613,6 @@ def from_dict(cls, d: Dict[str, Any]) -> GenAiComputeTask: ) -@dataclass -class GetJobPermissionLevelsResponse: - permission_levels: Optional[List[JobPermissionsDescription]] = None - """Specific permission levels""" - - def as_dict(self) -> dict: - """Serializes the GetJobPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GetJobPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.permission_levels: - body["permission_levels"] = self.permission_levels - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GetJobPermissionLevelsResponse: - """Deserializes the GetJobPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", JobPermissionsDescription)) - - @dataclass class GetPolicyComplianceResponse: is_compliant: Optional[bool] = None @@ -2816,8 +2786,6 @@ def from_dict(cls, d: Dict[str, Any]) -> GitSource: @dataclass class Job: - """Job was retrieved successfully.""" - created_time: Optional[int] = None """The time at which this job was created in epoch milliseconds (milliseconds since 1/1/1970 UTC).""" @@ -2846,7 +2814,6 @@ class Job: """The canonical identifier for this job.""" next_page_token: Optional[str] = None - """A token that can be used to list the next page of array properties.""" run_as_user_name: Optional[str] = None """The email of an active workspace user or the application ID of a service principal that the job @@ -2945,15 +2912,12 @@ def from_dict(cls, d: Dict[str, Any]) -> Job: @dataclass class JobAccessControlRequest: group_name: Optional[str] = None - """name of the group""" permission_level: Optional[JobPermissionLevel] = None service_principal_name: Optional[str] = None - """application ID of a service principal""" user_name: Optional[str] = None - """name of the user""" def as_dict(self) -> dict: """Serializes the JobAccessControlRequest into a dictionary suitable for use as a JSON request body.""" @@ -2992,65 +2956,6 @@ def from_dict(cls, d: Dict[str, Any]) -> JobAccessControlRequest: ) -@dataclass -class JobAccessControlResponse: - all_permissions: Optional[List[JobPermission]] = None - """All permissions.""" - - display_name: Optional[str] = None - """Display name of the user or service principal.""" - - group_name: Optional[str] = None - """name of the group""" - - service_principal_name: Optional[str] = None - """Name of the service principal.""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the JobAccessControlResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the JobAccessControlResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.all_permissions: - body["all_permissions"] = self.all_permissions - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> JobAccessControlResponse: - """Deserializes the JobAccessControlResponse from a dictionary.""" - return cls( - all_permissions=_repeated_dict(d, "all_permissions", JobPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - @dataclass class JobCluster: job_cluster_key: str @@ -3148,7 +3053,7 @@ class JobDeployment: """The kind of deployment that manages the job. - ``BUNDLE``: The job is managed by Databricks Asset Bundle. - - ``SYSTEM_MANAGED``: The job is managed by Databricks and is read-only.""" + - ``SYSTEM_MANAGED``: The job is managed by and is read-only.""" deployment_id: Optional[str] = None """ID of the deployment that manages this job. Only set when ``kind`` is ``BUNDLE``. Used to look @@ -3200,7 +3105,7 @@ def from_dict(cls, d: Dict[str, Any]) -> JobDeployment: class JobDeploymentKind(Enum): """- ``BUNDLE``: The job is managed by Databricks Asset Bundle. - - ``SYSTEM_MANAGED``: The job is managed by Databricks and is read-only.""" + - ``SYSTEM_MANAGED``: The job is managed by and is read-only.""" BUNDLE = "BUNDLE" SYSTEM_MANAGED = "SYSTEM_MANAGED" @@ -3440,127 +3345,13 @@ def from_dict(cls, d: Dict[str, Any]) -> JobParameterDefinition: return cls(default=d.get("default", None), name=d.get("name", None)) -@dataclass -class JobPermission: - inherited: Optional[bool] = None - - inherited_from_object: Optional[List[str]] = None - - permission_level: Optional[JobPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the JobPermission into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the JobPermission into a shallow dictionary of its immediate attributes.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> JobPermission: - """Deserializes the JobPermission from a dictionary.""" - return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", JobPermissionLevel), - ) - - class JobPermissionLevel(Enum): - """Permission level""" - CAN_MANAGE = "CAN_MANAGE" CAN_MANAGE_RUN = "CAN_MANAGE_RUN" CAN_VIEW = "CAN_VIEW" IS_OWNER = "IS_OWNER" -@dataclass -class JobPermissions: - access_control_list: Optional[List[JobAccessControlResponse]] = None - - object_id: Optional[str] = None - - object_type: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the JobPermissions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - def as_shallow_dict(self) -> dict: - """Serializes the JobPermissions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.access_control_list: - body["access_control_list"] = self.access_control_list - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> JobPermissions: - """Deserializes the JobPermissions from a dictionary.""" - return cls( - access_control_list=_repeated_dict(d, "access_control_list", JobAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), - ) - - -@dataclass -class JobPermissionsDescription: - description: Optional[str] = None - - permission_level: Optional[JobPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the JobPermissionsDescription into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the JobPermissionsDescription into a shallow dictionary of its immediate attributes.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> JobPermissionsDescription: - """Deserializes the JobPermissionsDescription from a dictionary.""" - return cls( - description=d.get("description", None), permission_level=_enum(d, "permission_level", JobPermissionLevel) - ) - - @dataclass class JobRunAs: """Write-only setting. Specifies the user or service principal that the job runs as. If not @@ -4361,7 +4152,7 @@ class NotebookOutput: result: Optional[str] = None """The value passed to [dbutils.notebook.exit()](/notebooks/notebook-workflows.html#notebook-workflows-exit). - Databricks restricts this API to return the first 5 MB of the value. For a larger result, your + restricts this API to return the first 5 MB of the value. For a larger result, your job can store the results in a cloud storage service. This field is absent if ``dbutils.notebook.exit()`` was never called.""" @@ -4395,32 +4186,33 @@ def from_dict(cls, d: Dict[str, Any]) -> NotebookOutput: @dataclass class NotebookTask: notebook_path: str - """The path of the notebook to be run in the Databricks workspace or remote repository. For - notebooks stored in the Databricks workspace, the path must be absolute and begin with a slash. - For notebooks stored in a remote repository, the path must be relative. This field is required.""" + """The path of the notebook to be run in the workspace or remote repository. For + notebooks stored in the workspace, the path must be absolute and begin with a + slash. For notebooks stored in a remote repository, the path must be relative. This field is + required.""" base_parameters: Optional[Dict[str, str]] = None """Base parameters to be used for each run of this job. If the run is initiated by a call to :method:jobs/run Now with parameters specified, the two parameters maps are merged. If the same key is specified in ``base_parameters`` and in ``run-now``, the value from ``run-now`` is used. - Use `Task parameter variables `__ to - set parameters containing information about job runs. + Use [Task parameter variables](/jobs.html#parameter-variables) to set parameters containing + information about job runs. If the notebook takes a parameter that is not specified in the job’s ``base_parameters`` or the ``run-now`` override parameters, the default value from the notebook is used. - Retrieve these parameters in a notebook using `dbutils.widgets.get - `__. + Retrieve these parameters in a notebook using + [dbutils.widgets.get](/dev-tools/databricks-utils.html#dbutils-widgets). The JSON representation of this field cannot exceed 1MB.""" source: Optional[Source] = None """Optional location type of the notebook. When set to ``WORKSPACE``, the notebook will be - retrieved from the local Databricks workspace. When set to ``GIT``, the notebook will be + retrieved from the local workspace. When set to ``GIT``, the notebook will be retrieved from a Git repository defined in ``git_source``. If the value is empty, the task will use ``GIT`` if ``git_source`` is defined and ``WORKSPACE`` otherwise. - - ``WORKSPACE``: Notebook is located in Databricks workspace. + - ``WORKSPACE``: Notebook is located in workspace. - ``GIT``: Notebook is located in cloud Git provider.""" warehouse_id: Optional[str] = None @@ -4599,9 +4391,7 @@ def from_dict(cls, d: Dict[str, Any]) -> PerTriggerState: class PerformanceTarget(Enum): - """PerformanceTarget defines how performant (lower latency) or cost efficient the execution of run - on serverless compute should be. The performance mode on the job or pipeline should map to a - performance setting that is passed to Cluster Manager (see cluster-common PerformanceTarget).""" + """Provide different scheduling options for CreateCluster.""" PERFORMANCE_OPTIMIZED = "PERFORMANCE_OPTIMIZED" STANDARD = "STANDARD" @@ -4810,7 +4600,7 @@ def from_dict(cls, d: Dict[str, Any]) -> PipelineTask: @dataclass class PowerBiModel: authentication_method: Optional[AuthenticationMethod] = None - """How the published Power BI model authenticates to Databricks""" + """How the published Power BI model authenticates to """ model_name: Optional[str] = None """The name of the Power BI model""" @@ -4869,13 +4659,13 @@ def from_dict(cls, d: Dict[str, Any]) -> PowerBiModel: @dataclass class PowerBiTable: catalog: Optional[str] = None - """The catalog name in Databricks""" + """The catalog name in """ name: Optional[str] = None - """The table name in Databricks""" + """The table name in """ schema: Optional[str] = None - """The schema name in Databricks""" + """The schema name in """ storage_mode: Optional[StorageMode] = None """The Power BI storage mode of the table""" @@ -4920,7 +4710,7 @@ def from_dict(cls, d: Dict[str, Any]) -> PowerBiTable: @dataclass class PowerBiTask: connection_resource_name: Optional[str] = None - """The resource name of the UC connection to authenticate from Databricks to Power BI""" + """The resource name of the UC connection to authenticate from to Power BI""" power_bi_model: Optional[PowerBiModel] = None """The semantic model to update""" @@ -5628,8 +5418,6 @@ def from_dict(cls, d: Dict[str, Any]) -> ResolvedValuesAiRuntimeTaskResolvedValu @dataclass class Run: - """Run was retrieved successfully""" - attempt_number: Optional[int] = None """The sequence number of this run attempt for a triggered job run. The initial attempt of a run has an attempt_number of 0. If the initial run attempt fails, and the job has a retry policy @@ -5702,7 +5490,6 @@ class Run: :method:jobs/listruns requests with ``expand_tasks=true``.""" iterations: Optional[List[RunTask]] = None - """Only populated by for-each iterations. The parent for-each task is located in tasks array.""" job_clusters: Optional[List[JobCluster]] = None """A list of job cluster specifications that can be shared and reused by tasks of this job. @@ -5722,7 +5509,6 @@ class Run: that the task run belongs to.""" next_page_token: Optional[str] = None - """A token that can be used to list the next page of array properties.""" number_in_job: Optional[int] = None """A unique identifier for this job run. This is set to the same value as ``run_id``.""" @@ -6166,9 +5952,8 @@ class RunJobTask: """An array of commands to execute for jobs with the dbt task, for example ``"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt run"]`` - ⚠ **Deprecation note** Use `job parameters - `__ to pass - information down to tasks.""" + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) + to pass information down to tasks.""" jar_params: Optional[List[str]] = None """A list of parameters for jobs with Spark JAR tasks, for example ``"jar_params": ["john doe", @@ -6177,9 +5962,8 @@ class RunJobTask: cannot be specified in conjunction with notebook_params. The JSON representation of this field (for example ``{"jar_params":["john doe","35"]}``) cannot exceed 10,000 bytes. - ⚠ **Deprecation note** Use `job parameters - `__ to pass - information down to tasks.""" + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) + to pass information down to tasks.""" job_parameters: Optional[Dict[str, str]] = None """Job-level parameters used to trigger the job.""" @@ -6187,15 +5971,14 @@ class RunJobTask: notebook_params: Optional[Dict[str, str]] = None """A map from keys to values for jobs with notebook task, for example ``"notebook_params": {"name": "john doe", "age": "35"}``. The map is passed to the notebook and is accessible through the - `dbutils.widgets.get `__ function. + [dbutils.widgets.get](/dev-tools/databricks-utils.html) function. If not specified upon ``run-now``, the triggered run uses the job’s base parameters. notebook_params cannot be specified in conjunction with jar_params. - ⚠ **Deprecation note** Use `job parameters - `__ to pass - information down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) + to pass information down to tasks. The JSON representation of this field (for example ``{"notebook_params":{"name":"john doe","age":"35"}}``) cannot exceed 10,000 bytes.""" @@ -6211,9 +5994,8 @@ class RunJobTask: ``run-now``, it would overwrite the parameters specified in job setting. The JSON representation of this field (for example ``{"python_params":["john doe","35"]}``) cannot exceed 10,000 bytes. - ⚠ **Deprecation note** Use `job parameters - `__ to pass - information down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) + to pass information down to tasks. Important @@ -6228,9 +6010,8 @@ class RunJobTask: parameters specified in job setting. The JSON representation of this field (for example ``{"python_params":["john doe","35"]}``) cannot exceed 10,000 bytes. - ⚠ **Deprecation note** Use `job parameters - `__ to pass - information down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) + to pass information down to tasks. Important @@ -6242,9 +6023,8 @@ class RunJobTask: """A map from keys to values for jobs with SQL task, for example ``"sql_params": {"name": "john doe", "age": "35"}``. The SQL alert task does not support custom parameters. - ⚠ **Deprecation note** Use `job parameters - `__ to pass - information down to tasks.""" + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) + to pass information down to tasks.""" def as_dict(self) -> dict: """Serializes the RunJobTask into a dictionary suitable for use as a JSON request body.""" @@ -6391,8 +6171,6 @@ def from_dict(cls, d: Dict[str, Any]) -> RunNowResponse: @dataclass class RunOutput: - """Run output was retrieved successfully.""" - ai_runtime_task_output: Optional[AiRuntimeTaskOutput] = None """The output of an AiRuntimeTask, if available — MLflow identifiers, artifact paths, and per-replica allocated compute. Run lifecycle / termination status lives on the surrounding @@ -6431,21 +6209,20 @@ class RunOutput: It's not supported for the notebook_task, pipeline_task or spark_submit_task. - Databricks restricts this API to return the last 5 MB of these logs.""" + restricts this API to return the last 5 MB of these logs.""" logs_truncated: Optional[bool] = None """Whether the logs are truncated.""" metadata: Optional[Run] = None - """All details of the run except for its output.""" notebook_output: Optional[NotebookOutput] = None """The output of a notebook task, if available. A notebook task that terminates (either successfully or with a failure) without calling ``dbutils.notebook.exit()`` is considered to - have an empty output. This field is set but its result value is empty. Databricks restricts this - API to return the first 5 MB of the output. To return a larger result, use the `ClusterLogConf - `__ field to - configure log storage for the job cluster.""" + have an empty output. This field is set but its result value is empty. restricts + this API to return the first 5 MB of the output. To return a larger result, use the + [ClusterLogConf](/dev-tools/api/latest/clusters.html#clusterlogconf) field to configure log + storage for the job cluster.""" run_job_output: Optional[RunJobOutput] = None """The output of a run job task, if available""" @@ -6558,9 +6335,8 @@ class RunParameters: """An array of commands to execute for jobs with the dbt task, for example ``"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt run"]`` - ⚠ **Deprecation note** Use `job parameters - `__ to pass - information down to tasks.""" + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) + to pass information down to tasks.""" jar_params: Optional[List[str]] = None """A list of parameters for jobs with Spark JAR tasks, for example ``"jar_params": ["john doe", @@ -6569,22 +6345,20 @@ class RunParameters: cannot be specified in conjunction with notebook_params. The JSON representation of this field (for example ``{"jar_params":["john doe","35"]}``) cannot exceed 10,000 bytes. - ⚠ **Deprecation note** Use `job parameters - `__ to pass - information down to tasks.""" + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) + to pass information down to tasks.""" notebook_params: Optional[Dict[str, str]] = None """A map from keys to values for jobs with notebook task, for example ``"notebook_params": {"name": "john doe", "age": "35"}``. The map is passed to the notebook and is accessible through the - `dbutils.widgets.get `__ function. + [dbutils.widgets.get](/dev-tools/databricks-utils.html) function. If not specified upon ``run-now``, the triggered run uses the job’s base parameters. notebook_params cannot be specified in conjunction with jar_params. - ⚠ **Deprecation note** Use `job parameters - `__ to pass - information down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) + to pass information down to tasks. The JSON representation of this field (for example ``{"notebook_params":{"name":"john doe","age":"35"}}``) cannot exceed 10,000 bytes.""" @@ -6600,9 +6374,8 @@ class RunParameters: ``run-now``, it would overwrite the parameters specified in job setting. The JSON representation of this field (for example ``{"python_params":["john doe","35"]}``) cannot exceed 10,000 bytes. - ⚠ **Deprecation note** Use `job parameters - `__ to pass - information down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) + to pass information down to tasks. Important @@ -6617,9 +6390,8 @@ class RunParameters: parameters specified in job setting. The JSON representation of this field (for example ``{"python_params":["john doe","35"]}``) cannot exceed 10,000 bytes. - ⚠ **Deprecation note** Use `job parameters - `__ to pass - information down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) + to pass information down to tasks. Important @@ -6631,9 +6403,8 @@ class RunParameters: """A map from keys to values for jobs with SQL task, for example ``"sql_params": {"name": "john doe", "age": "35"}``. The SQL alert task does not support custom parameters. - ⚠ **Deprecation note** Use `job parameters - `__ to pass - information down to tasks.""" + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) + to pass information down to tasks.""" def as_dict(self) -> dict: """Serializes the RunParameters into a dictionary suitable for use as a JSON request body.""" @@ -6844,7 +6615,7 @@ class RunTask: type and count, the command to run, and where the workload's code and MLflow output are stored.""" alert_task: Optional[AlertTask] = None - """The task evaluates a Databricks alert and sends notifications to subscribers when the + """The task evaluates a alert and sends notifications to subscribers when the ``alert_task`` field is present.""" attempt_number: Optional[int] = None @@ -6856,8 +6627,8 @@ class RunTask: job.""" clean_rooms_notebook_task: Optional[CleanRoomsNotebookTask] = None - """The task runs a `clean rooms `__ notebook - when the ``clean_rooms_notebook_task`` field is present.""" + """The task runs a [clean rooms](/clean-rooms/index.html) notebook when the + ``clean_rooms_notebook_task`` field is present.""" cleanup_duration: Optional[int] = None """The time in milliseconds it took to terminate the cluster and clean up any associated artifacts. @@ -7363,8 +7134,8 @@ class RunType(Enum): """The type of a run. - ``JOB_RUN``: Normal job run. A run created with :method:jobs/runNow. - - ``WORKFLOW_RUN``: Workflow run. A run created with `dbutils.notebook.run - `__. + - ``WORKFLOW_RUN``: Workflow run. A run created with + [dbutils.notebook.run](/dev-tools/databricks-utils.html#dbutils-workflow). - ``SUBMIT_RUN``: Submit run. A run created with :method:jobs/submit.""" JOB_RUN = "JOB_RUN" @@ -7395,11 +7166,11 @@ def from_dict(cls, d: Dict[str, Any]) -> ScheduleTriggerState: class Source(Enum): """Optional location type of the SQL file. When set to ``WORKSPACE``, the SQL file will be - retrieved from the local Databricks workspace. When set to ``GIT``, the SQL file will be + retrieved from the local workspace. When set to ``GIT``, the SQL file will be retrieved from a Git repository defined in ``git_source``. If the value is empty, the task will use ``GIT`` if ``git_source`` is defined and ``WORKSPACE`` otherwise. - - ``WORKSPACE``: SQL file is located in Databricks workspace. + - ``WORKSPACE``: SQL file is located in workspace. - ``GIT``: SQL file is located in cloud Git provider.""" GIT = "GIT" @@ -7425,8 +7196,8 @@ class SparkJarTask: parameters: Optional[List[str]] = None """Parameters passed to the main method. - Use `Task parameter variables `__ to - set parameters containing information about job runs.""" + Use [Task parameter variables](/jobs.html#parameter-variables) to set parameters containing + information about job runs.""" run_as_repl: Optional[bool] = None """Deprecated. A value of ``false`` is no longer supported.""" @@ -7472,23 +7243,23 @@ def from_dict(cls, d: Dict[str, Any]) -> SparkJarTask: class SparkPythonTask: python_file: str """The Python file to be executed. Cloud file URIs (such as dbfs:/, s3:/, adls:/, gcs:/) and - workspace paths are supported. For python files stored in the Databricks workspace, the path + workspace paths are supported. For python files stored in the workspace, the path must be absolute and begin with ``/``. For files stored in a remote repository, the path must be relative. This field is required.""" parameters: Optional[List[str]] = None """Command line parameters passed to the Python file. - Use `Task parameter variables `__ to - set parameters containing information about job runs.""" + Use [Task parameter variables](/jobs.html#parameter-variables) to set parameters containing + information about job runs.""" source: Optional[Source] = None """Optional location type of the Python file. When set to ``WORKSPACE`` or not specified, the file - will be retrieved from the local Databricks workspace or cloud location (if the ``python_file`` - has a URI format). When set to ``GIT``, the Python file will be retrieved from a Git repository - defined in ``git_source``. + will be retrieved from the local workspace or cloud location (if the + ``python_file`` has a URI format). When set to ``GIT``, the Python file will be retrieved from a + Git repository defined in ``git_source``. - - ``WORKSPACE``: The Python file is located in a Databricks workspace or at a cloud filesystem + - ``WORKSPACE``: The Python file is located in a workspace or at a cloud filesystem URI. - ``GIT``: The Python file is located in a remote Git repository.""" @@ -7529,8 +7300,8 @@ class SparkSubmitTask: parameters: Optional[List[str]] = None """Command-line parameters passed to spark submit. - Use `Task parameter variables `__ to - set parameters containing information about job runs.""" + Use [Task parameter variables](/jobs.html#parameter-variables) to set parameters containing + information about job runs.""" def as_dict(self) -> dict: """Serializes the SparkSubmitTask into a dictionary suitable for use as a JSON request body.""" @@ -8244,11 +8015,11 @@ class SqlTaskFile: source: Optional[Source] = None """Optional location type of the SQL file. When set to ``WORKSPACE``, the SQL file will be - retrieved from the local Databricks workspace. When set to ``GIT``, the SQL file will be + retrieved from the local workspace. When set to ``GIT``, the SQL file will be retrieved from a Git repository defined in ``git_source``. If the value is empty, the task will use ``GIT`` if ``git_source`` is defined and ``WORKSPACE`` otherwise. - - ``WORKSPACE``: SQL file is located in Databricks workspace. + - ``WORKSPACE``: SQL file is located in workspace. - ``GIT``: SQL file is located in cloud Git provider.""" def as_dict(self) -> dict: @@ -8380,12 +8151,12 @@ class SubmitTask: type and count, the command to run, and where the workload's code and MLflow output are stored.""" alert_task: Optional[AlertTask] = None - """The task evaluates a Databricks alert and sends notifications to subscribers when the + """The task evaluates a alert and sends notifications to subscribers when the ``alert_task`` field is present.""" clean_rooms_notebook_task: Optional[CleanRoomsNotebookTask] = None - """The task runs a `clean rooms `__ notebook - when the ``clean_rooms_notebook_task`` field is present.""" + """The task runs a [clean rooms](/clean-rooms/index.html) notebook when the + ``clean_rooms_notebook_task`` field is present.""" compute: Optional[Compute] = None """Task level compute configuration.""" @@ -8938,12 +8709,12 @@ class Task: type and count, the command to run, and where the workload's code and MLflow output are stored.""" alert_task: Optional[AlertTask] = None - """The task evaluates a Databricks alert and sends notifications to subscribers when the + """The task evaluates a alert and sends notifications to subscribers when the ``alert_task`` field is present.""" clean_rooms_notebook_task: Optional[CleanRoomsNotebookTask] = None - """The task runs a `clean rooms `__ notebook - when the ``clean_rooms_notebook_task`` field is present.""" + """The task runs a [clean rooms](/clean-rooms/index.html) notebook when the + ``clean_rooms_notebook_task`` field is present.""" compute: Optional[Compute] = None """Task level compute configuration.""" @@ -9483,7 +9254,7 @@ class TerminationCodeCode(Enum): - ``SUCCESS``: The run was completed successfully. - ``SUCCESS_WITH_FAILURES``: The run was completed successfully but some child runs failed. - ``USER_CANCELED``: The run was successfully canceled during execution by a user. - - ``CANCELED``: The run was canceled during execution by the Databricks platform; for example, + - ``CANCELED``: The run was canceled during execution by the platform; for example, if the maximum run duration was exceeded. - ``SKIPPED``: Run was never executed, for example, if the upstream task run failed, the dependency type condition was not met, or there were no material tasks to execute. @@ -9605,7 +9376,7 @@ def from_dict(cls, d: Dict[str, Any]) -> TerminationDetails: class TerminationTypeType(Enum): """- ``SUCCESS``: The run terminated without any issues - - ``INTERNAL_ERROR``: An error occurred in the Databricks platform. Please look at the `status + - ``INTERNAL_ERROR``: An error occurred in the platform. Please look at the `status page `__ or contact support if the issue persists. - ``CLIENT_ERROR``: The run was terminated because of an error caused by user input or the job configuration. @@ -10185,21 +9956,6 @@ def from_dict(cls, d: Dict[str, Any]) -> WidgetErrorDetail: class JobsAPI: - """The Jobs API allows you to create, edit, and delete jobs. - - You can use a Databricks job to run a data processing or data analysis task in a Databricks cluster with - scalable resources. Your job can consist of a single task or can be a large, multi-task workflow with - complex dependencies. Databricks manages the task orchestration, cluster management, monitoring, and error - reporting for all of your jobs. You can run your jobs immediately or periodically through an easy-to-use - scheduling system. You can implement job tasks using notebooks, JARS, Spark Declarative Pipelines, or - Python, Scala, Spark submit, and Java applications. - - You should never hard code secrets or store them in plain text. Use the `Secrets CLI - `__ to manage secrets in the `Databricks CLI - `__. Use the `Secrets utility - `__ to reference secrets in - notebooks and jobs.""" - def __init__(self, api_client): self._api = api_client @@ -10255,9 +10011,7 @@ def cancel_all_runs(self, *, all_queued_runs: Optional[bool] = None, job_id: Opt body["all_queued_runs"] = all_queued_runs if job_id is not None: body["job_id"] = job_id - headers = { - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10280,9 +10034,7 @@ def cancel_run(self, run_id: int) -> Wait[Run]: body = {} if run_id is not None: body["run_id"] = run_id - headers = { - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10497,10 +10249,7 @@ def create( body["usage_policy_id"] = usage_policy_id if webhook_notifications is not None: body["webhook_notifications"] = webhook_notifications.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10521,9 +10270,7 @@ def delete(self, job_id: int): body = {} if job_id is not None: body["job_id"] = job_id - headers = { - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10543,9 +10290,7 @@ def delete_run(self, run_id: int): body = {} if run_id is not None: body["run_id"] = run_id - headers = { - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10569,9 +10314,7 @@ def export_run(self, run_id: int, *, views_to_export: Optional[ViewsToExport] = query["run_id"] = run_id if views_to_export is not None: query["views_to_export"] = views_to_export.value - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10610,9 +10353,7 @@ def get( query["job_id"] = job_id if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10621,46 +10362,6 @@ def get( res = self._api.do("GET", "/api/2.2/jobs/get", query=query, headers=headers) return Job.from_dict(res) - def get_permission_levels(self, job_id: str) -> GetJobPermissionLevelsResponse: - """Gets the permission levels that a user can have on an object. - - :param job_id: str - The job for which to get or manage permissions. - - :returns: :class:`GetJobPermissionLevelsResponse` - """ - - 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/permissions/jobs/{job_id}/permissionLevels", headers=headers) - return GetJobPermissionLevelsResponse.from_dict(res) - - def get_permissions(self, job_id: str) -> JobPermissions: - """Gets the permissions of a job. Jobs can inherit permissions from their root object. - - :param job_id: str - The job for which to get or manage permissions. - - :returns: :class:`JobPermissions` - """ - - 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/permissions/jobs/{job_id}", headers=headers) - return JobPermissions.from_dict(res) - def get_run( self, run_id: int, @@ -10700,9 +10401,7 @@ def get_run( query["page_token"] = page_token if run_id is not None: query["run_id"] = run_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10713,7 +10412,7 @@ def get_run( def get_run_output(self, run_id: int) -> RunOutput: """Retrieve the output and metadata of a single task run. When a notebook task returns a value through - the ``dbutils.notebook.exit()`` call, you can use this endpoint to retrieve that value. Databricks + the ``dbutils.notebook.exit()`` call, you can use this endpoint to retrieve that value. restricts this API to returning the first 5 MB of the output. To return a larger result, you can store job results in a cloud storage service. @@ -10730,9 +10429,7 @@ def get_run_output(self, run_id: int) -> RunOutput: query = {} if run_id is not None: query["run_id"] = run_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10781,9 +10478,7 @@ def list( query["offset"] = offset if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10868,9 +10563,7 @@ def list_runs( query["start_time_from"] = start_time_from if start_time_to is not None: query["start_time_to"] = start_time_to - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10913,9 +10606,8 @@ def repair_run( An array of commands to execute for jobs with the dbt task, for example ``"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt run"]`` - ⚠ **Deprecation note** Use `job parameters - `__ to pass information - down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to + pass information down to tasks. :param jar_params: List[str] (optional) A list of parameters for jobs with Spark JAR tasks, for example ``"jar_params": ["john doe", "35"]``. The parameters are used to invoke the main function of the main class specified in the @@ -10923,9 +10615,8 @@ def repair_run( be specified in conjunction with notebook_params. The JSON representation of this field (for example ``{"jar_params":["john doe","35"]}``) cannot exceed 10,000 bytes. - ⚠ **Deprecation note** Use `job parameters - `__ to pass information - down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to + pass information down to tasks. :param job_parameters: Dict[str,str] (optional) Job-level parameters used in the run. for example ``"param": "overriding_val"`` :param latest_repair_id: int (optional) @@ -10934,15 +10625,14 @@ def repair_run( :param notebook_params: Dict[str,str] (optional) A map from keys to values for jobs with notebook task, for example ``"notebook_params": {"name": "john doe", "age": "35"}``. The map is passed to the notebook and is accessible through the - `dbutils.widgets.get `__ function. + [dbutils.widgets.get](/dev-tools/databricks-utils.html) function. If not specified upon ``run-now``, the triggered run uses the job’s base parameters. notebook_params cannot be specified in conjunction with jar_params. - ⚠ **Deprecation note** Use `job parameters - `__ to pass information - down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to + pass information down to tasks. The JSON representation of this field (for example ``{"notebook_params":{"name":"john doe","age":"35"}}``) cannot exceed 10,000 bytes. @@ -10963,9 +10653,8 @@ def repair_run( ``run-now``, it would overwrite the parameters specified in job setting. The JSON representation of this field (for example ``{"python_params":["john doe","35"]}``) cannot exceed 10,000 bytes. - ⚠ **Deprecation note** Use `job parameters - `__ to pass information - down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to + pass information down to tasks. Important @@ -10987,9 +10676,8 @@ def repair_run( specified in job setting. The JSON representation of this field (for example ``{"python_params":["john doe","35"]}``) cannot exceed 10,000 bytes. - ⚠ **Deprecation note** Use `job parameters - `__ to pass information - down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to + pass information down to tasks. Important @@ -11000,9 +10688,8 @@ def repair_run( A map from keys to values for jobs with SQL task, for example ``"sql_params": {"name": "john doe", "age": "35"}``. The SQL alert task does not support custom parameters. - ⚠ **Deprecation note** Use `job parameters - `__ to pass information - down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to + pass information down to tasks. :returns: Long-running operation waiter for :class:`Run`. @@ -11040,10 +10727,7 @@ def repair_run( body["spark_submit_params"] = [v for v in spark_submit_params] if sql_params is not None: body["sql_params"] = sql_params - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11114,9 +10798,7 @@ def reset(self, job_id: int, new_settings: JobSettings): body["job_id"] = job_id if new_settings is not None: body["new_settings"] = new_settings.as_dict() - headers = { - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11150,16 +10832,15 @@ def run_now( An array of commands to execute for jobs with the dbt task, for example ``"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt run"]`` - ⚠ **Deprecation note** Use `job parameters - `__ to pass information - down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to + pass information down to tasks. :param idempotency_token: str (optional) An optional token to guarantee the idempotency of job run requests. If a run with the provided token already exists, the request does not create a new run but returns the ID of the existing run instead. If a run with the provided token is deleted, an error is returned. If you specify the idempotency token, upon failure you can retry until the request succeeds. - Databricks guarantees that exactly one run is launched with that idempotency token. + guarantees that exactly one run is launched with that idempotency token. This token must have at most 64 characters. :param jar_params: List[str] (optional) @@ -11169,23 +10850,21 @@ def run_now( be specified in conjunction with notebook_params. The JSON representation of this field (for example ``{"jar_params":["john doe","35"]}``) cannot exceed 10,000 bytes. - ⚠ **Deprecation note** Use `job parameters - `__ to pass information - down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to + pass information down to tasks. :param job_parameters: Dict[str,str] (optional) Job-level parameters used in the run. for example ``"param": "overriding_val"`` :param notebook_params: Dict[str,str] (optional) A map from keys to values for jobs with notebook task, for example ``"notebook_params": {"name": "john doe", "age": "35"}``. The map is passed to the notebook and is accessible through the - `dbutils.widgets.get `__ function. + [dbutils.widgets.get](/dev-tools/databricks-utils.html) function. If not specified upon ``run-now``, the triggered run uses the job’s base parameters. notebook_params cannot be specified in conjunction with jar_params. - ⚠ **Deprecation note** Use `job parameters - `__ to pass information - down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to + pass information down to tasks. The JSON representation of this field (for example ``{"notebook_params":{"name":"john doe","age":"35"}}``) cannot exceed 10,000 bytes. @@ -11214,9 +10893,8 @@ def run_now( ``run-now``, it would overwrite the parameters specified in job setting. The JSON representation of this field (for example ``{"python_params":["john doe","35"]}``) cannot exceed 10,000 bytes. - ⚠ **Deprecation note** Use `job parameters - `__ to pass information - down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to + pass information down to tasks. Important @@ -11232,9 +10910,8 @@ def run_now( specified in job setting. The JSON representation of this field (for example ``{"python_params":["john doe","35"]}``) cannot exceed 10,000 bytes. - ⚠ **Deprecation note** Use `job parameters - `__ to pass information - down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to + pass information down to tasks. Important @@ -11245,9 +10922,8 @@ def run_now( A map from keys to values for jobs with SQL task, for example ``"sql_params": {"name": "john doe", "age": "35"}``. The SQL alert task does not support custom parameters. - ⚠ **Deprecation note** Use `job parameters - `__ to pass information - down to tasks. + ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to + pass information down to tasks. :returns: Long-running operation waiter for :class:`Run`. @@ -11283,10 +10959,7 @@ def run_now( body["spark_submit_params"] = [v for v in spark_submit_params] if sql_params is not None: body["sql_params"] = sql_params - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11335,34 +11008,6 @@ def run_now_and_wait( sql_params=sql_params, ).result(timeout=timeout) - def set_permissions( - self, job_id: str, *, access_control_list: Optional[List[JobAccessControlRequest]] = None - ) -> JobPermissions: - """Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct - permissions if none are specified. Objects can inherit permissions from their root object. - - :param job_id: str - The job for which to get or manage permissions. - :param access_control_list: List[:class:`JobAccessControlRequest`] (optional) - - :returns: :class:`JobPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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("PUT", f"/api/2.0/permissions/jobs/{job_id}", body=body, headers=headers) - return JobPermissions.from_dict(res) - def submit( self, *, @@ -11388,10 +11033,10 @@ def submit( the run state after the job is submitted. **Important:** Jobs submitted using this endpoint are not saved as a job. They do not show up in the - Jobs UI, and do not retry when they fail. Because they are not saved, Databricks cannot auto-optimize - serverless compute in case of failure. If your job fails, you may want to use classic compute to - specify the compute needs for the job. Alternatively, use the ``POST /jobs/create`` and ``POST - /jobs/run-now`` endpoints to create and run a saved job. + Jobs UI, and do not retry when they fail. Because they are not saved, cannot + auto-optimize serverless compute in case of failure. If your job fails, you may want to use classic + compute to specify the compute needs for the job. Alternatively, use the ``POST /jobs/create`` and + ``POST /jobs/run-now`` endpoints to create and run a saved job. :param access_control_list: List[:class:`JobAccessControlRequest`] (optional) List of permissions to set on the job. @@ -11418,7 +11063,7 @@ def submit( existing run instead. If a run with the provided token is deleted, an error is returned. If you specify the idempotency token, upon failure you can retry until the request succeeds. - Databricks guarantees that exactly one run is launched with that idempotency token. + guarantees that exactly one run is launched with that idempotency token. This token must have at most 64 characters. :param notification_settings: :class:`JobNotificationSettings` (optional) @@ -11486,10 +11131,7 @@ def submit( body["usage_policy_id"] = usage_policy_id if webhook_notifications is not None: body["webhook_notifications"] = webhook_notifications.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11575,9 +11217,7 @@ def update( body["job_id"] = job_id if new_settings is not None: body["new_settings"] = new_settings.as_dict() - headers = { - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11585,45 +11225,9 @@ def update( self._api.do("POST", "/api/2.2/jobs/update", body=body, headers=headers) - def update_permissions( - self, job_id: str, *, access_control_list: Optional[List[JobAccessControlRequest]] = None - ) -> JobPermissions: - """Updates the permissions on a job. Jobs can inherit permissions from their root object. - - :param job_id: str - The job for which to get or manage permissions. - :param access_control_list: List[:class:`JobAccessControlRequest`] (optional) - - :returns: :class:`JobPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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/permissions/jobs/{job_id}", body=body, headers=headers) - return JobPermissions.from_dict(res) - class PolicyComplianceForJobsAPI: - """The compliance APIs allow you to view and manage the policy compliance status of jobs in your workspace. - This API currently only supports compliance controls for cluster policies. - - A job is in compliance if its cluster configurations satisfy the rules of all their respective cluster - policies. A job could be out of compliance if a cluster policy it uses was updated after the job was last - edited. The job is considered out of compliance if any of its clusters no longer comply with their updated - policies. - - The get and list compliance APIs allow you to view the policy compliance status of a job. The enforce - compliance API allows you to update a job so that it becomes compliant with all of its policies.""" + """This proto is documentation only. Keep this in sync with policies.proto for these methods.""" def __init__(self, api_client): self._api = api_client @@ -11648,10 +11252,7 @@ def enforce_compliance( body["job_id"] = job_id if validate_only is not None: body["validate_only"] = validate_only - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11674,9 +11275,7 @@ def get_compliance(self, job_id: int) -> GetPolicyComplianceResponse: query = {} if job_id is not None: query["job_id"] = job_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11711,9 +11310,7 @@ def list_compliance( query["page_token"] = page_token if policy_id is not None: query["policy_id"] = policy_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/knowledgeassistants.py b/databricks/sdk/service/knowledgeassistants.py index 1ccb65a6a..bab7bfe84 100644 --- a/databricks/sdk/service/knowledgeassistants.py +++ b/databricks/sdk/service/knowledgeassistants.py @@ -159,31 +159,6 @@ def from_dict(cls, d: Dict[str, Any]) -> FilesSpec: return cls(path=d.get("path", None)) -@dataclass -class GetKnowledgeAssistantPermissionLevelsResponse: - permission_levels: Optional[List[KnowledgeAssistantPermissionsDescription]] = None - """Specific permission levels""" - - def as_dict(self) -> dict: - """Serializes the GetKnowledgeAssistantPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GetKnowledgeAssistantPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.permission_levels: - body["permission_levels"] = self.permission_levels - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GetKnowledgeAssistantPermissionLevelsResponse: - """Deserializes the GetKnowledgeAssistantPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", KnowledgeAssistantPermissionsDescription)) - - @dataclass class IndexSpec: """IndexSpec specifies a vector search index source configuration.""" @@ -344,235 +319,6 @@ def from_dict(cls, d: Dict[str, Any]) -> KnowledgeAssistant: ) -@dataclass -class KnowledgeAssistantAccessControlRequest: - group_name: Optional[str] = None - """name of the group""" - - permission_level: Optional[KnowledgeAssistantPermissionLevel] = None - - service_principal_name: Optional[str] = None - """application ID of a service principal""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the KnowledgeAssistantAccessControlRequest into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the KnowledgeAssistantAccessControlRequest into a shallow dictionary of its immediate attributes.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> KnowledgeAssistantAccessControlRequest: - """Deserializes the KnowledgeAssistantAccessControlRequest from a dictionary.""" - return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", KnowledgeAssistantPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class KnowledgeAssistantAccessControlResponse: - all_permissions: Optional[List[KnowledgeAssistantPermission]] = None - """All permissions.""" - - display_name: Optional[str] = None - """Display name of the user or service principal.""" - - group_name: Optional[str] = None - """name of the group""" - - service_principal_name: Optional[str] = None - """Name of the service principal.""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the KnowledgeAssistantAccessControlResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the KnowledgeAssistantAccessControlResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.all_permissions: - body["all_permissions"] = self.all_permissions - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> KnowledgeAssistantAccessControlResponse: - """Deserializes the KnowledgeAssistantAccessControlResponse from a dictionary.""" - return cls( - all_permissions=_repeated_dict(d, "all_permissions", KnowledgeAssistantPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class KnowledgeAssistantPermission: - inherited: Optional[bool] = None - - inherited_from_object: Optional[List[str]] = None - - permission_level: Optional[KnowledgeAssistantPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the KnowledgeAssistantPermission into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the KnowledgeAssistantPermission into a shallow dictionary of its immediate attributes.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> KnowledgeAssistantPermission: - """Deserializes the KnowledgeAssistantPermission from a dictionary.""" - return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", KnowledgeAssistantPermissionLevel), - ) - - -class KnowledgeAssistantPermissionLevel(Enum): - """Permission level""" - - CAN_MANAGE = "CAN_MANAGE" - CAN_QUERY = "CAN_QUERY" - - -@dataclass -class KnowledgeAssistantPermissions: - access_control_list: Optional[List[KnowledgeAssistantAccessControlResponse]] = None - - object_id: Optional[str] = None - - object_type: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the KnowledgeAssistantPermissions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - def as_shallow_dict(self) -> dict: - """Serializes the KnowledgeAssistantPermissions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.access_control_list: - body["access_control_list"] = self.access_control_list - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> KnowledgeAssistantPermissions: - """Deserializes the KnowledgeAssistantPermissions from a dictionary.""" - return cls( - access_control_list=_repeated_dict(d, "access_control_list", KnowledgeAssistantAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), - ) - - -@dataclass -class KnowledgeAssistantPermissionsDescription: - description: Optional[str] = None - - permission_level: Optional[KnowledgeAssistantPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the KnowledgeAssistantPermissionsDescription into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the KnowledgeAssistantPermissionsDescription into a shallow dictionary of its immediate attributes.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> KnowledgeAssistantPermissionsDescription: - """Deserializes the KnowledgeAssistantPermissionsDescription from a dictionary.""" - return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", KnowledgeAssistantPermissionLevel), - ) - - class KnowledgeAssistantState(Enum): ACTIVE = "ACTIVE" CREATING = "CREATING" @@ -800,8 +546,6 @@ def from_dict(cls, d: Dict[str, Any]) -> ListKnowledgeSourcesResponse: class KnowledgeAssistantsAPI: - """Manage Knowledge Assistants and related resources.""" - def __init__(self, api_client): self._api = api_client @@ -819,10 +563,7 @@ def create_example(self, parent: str, example: Example) -> Example: body = example.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -842,10 +583,7 @@ def create_knowledge_assistant(self, knowledge_assistant: KnowledgeAssistant) -> body = knowledge_assistant.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -867,10 +605,7 @@ def create_knowledge_source(self, parent: str, knowledge_source: KnowledgeSource body = knowledge_source.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -889,9 +624,7 @@ def delete_example(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -909,9 +642,7 @@ def delete_knowledge_assistant(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -929,9 +660,7 @@ def delete_knowledge_source(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -949,9 +678,7 @@ def get_example(self, name: str) -> Example: :returns: :class:`Example` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -969,9 +696,7 @@ def get_knowledge_assistant(self, name: str) -> KnowledgeAssistant: :returns: :class:`KnowledgeAssistant` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -990,9 +715,7 @@ def get_knowledge_source(self, name: str) -> KnowledgeSource: :returns: :class:`KnowledgeSource` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1001,53 +724,6 @@ def get_knowledge_source(self, name: str) -> KnowledgeSource: res = self._api.do("GET", f"/api/2.1/{name}", headers=headers) return KnowledgeSource.from_dict(res) - def get_permission_levels(self, knowledge_assistant_id: str) -> GetKnowledgeAssistantPermissionLevelsResponse: - """Gets the permission levels that a user can have on an object. - - :param knowledge_assistant_id: str - The knowledge assistant for which to get or manage permissions. - - :returns: :class:`GetKnowledgeAssistantPermissionLevelsResponse` - """ - - 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/permissions/knowledge-assistants/{knowledge_assistant_id}/permissionLevels", - headers=headers, - ) - return GetKnowledgeAssistantPermissionLevelsResponse.from_dict(res) - - def get_permissions(self, knowledge_assistant_id: str) -> KnowledgeAssistantPermissions: - """Gets the permissions of a knowledge assistant. Knowledge assistants can inherit permissions from their - root object. - - :param knowledge_assistant_id: str - The knowledge assistant for which to get or manage permissions. - - :returns: :class:`KnowledgeAssistantPermissions` - """ - - 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/permissions/knowledge-assistants/{knowledge_assistant_id}", headers=headers - ) - return KnowledgeAssistantPermissions.from_dict(res) - def list_examples( self, parent: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None ) -> Iterator[Example]: @@ -1070,9 +746,7 @@ def list_examples( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1107,9 +781,7 @@ def list_knowledge_assistants( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1142,9 +814,7 @@ def list_knowledge_sources( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1159,39 +829,6 @@ def list_knowledge_sources( return query["page_token"] = json["next_page_token"] - def set_permissions( - self, - knowledge_assistant_id: str, - *, - access_control_list: Optional[List[KnowledgeAssistantAccessControlRequest]] = None, - ) -> KnowledgeAssistantPermissions: - """Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct - permissions if none are specified. Objects can inherit permissions from their root object. - - :param knowledge_assistant_id: str - The knowledge assistant for which to get or manage permissions. - :param access_control_list: List[:class:`KnowledgeAssistantAccessControlRequest`] (optional) - - :returns: :class:`KnowledgeAssistantPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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( - "PUT", f"/api/2.0/permissions/knowledge-assistants/{knowledge_assistant_id}", body=body, headers=headers - ) - return KnowledgeAssistantPermissions.from_dict(res) - def sync_knowledge_sources(self, name: str): """Sync all non-index Knowledge Sources for a Knowledge Assistant (index sources do not require sync) @@ -1201,17 +838,13 @@ def sync_knowledge_sources(self, name: str): """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id - self._api.do("POST", f"/api/2.1/{name}/knowledge-sources:sync", body=body, headers=headers) + self._api.do("POST", f"/api/2.1/{name}/knowledge-sources:sync", headers=headers) def update_example(self, name: str, example: Example, update_mask: FieldMask) -> Example: """Updates an example in a Knowledge Assistant. @@ -1234,10 +867,7 @@ def update_example(self, name: str, example: Example, update_mask: FieldMask) -> query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1271,10 +901,7 @@ def update_knowledge_assistant( query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1309,10 +936,7 @@ def update_knowledge_source( query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1320,36 +944,3 @@ def update_knowledge_source( res = self._api.do("PATCH", f"/api/2.1/{name}", query=query, body=body, headers=headers) return KnowledgeSource.from_dict(res) - - def update_permissions( - self, - knowledge_assistant_id: str, - *, - access_control_list: Optional[List[KnowledgeAssistantAccessControlRequest]] = None, - ) -> KnowledgeAssistantPermissions: - """Updates the permissions on a knowledge assistant. Knowledge assistants can inherit permissions from - their root object. - - :param knowledge_assistant_id: str - The knowledge assistant for which to get or manage permissions. - :param access_control_list: List[:class:`KnowledgeAssistantAccessControlRequest`] (optional) - - :returns: :class:`KnowledgeAssistantPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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/permissions/knowledge-assistants/{knowledge_assistant_id}", body=body, headers=headers - ) - return KnowledgeAssistantPermissions.from_dict(res) diff --git a/databricks/sdk/service/marketplace.py b/databricks/sdk/service/marketplace.py index bc1459c86..566a42fd8 100644 --- a/databricks/sdk/service/marketplace.py +++ b/databricks/sdk/service/marketplace.py @@ -2927,7 +2927,9 @@ class Visibility(Enum): class ConsumerFulfillmentsAPI: - """Fulfillments are entities that allow consumers to preview installations.""" + """Check Databricks Protobuf Style Guide + (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about + recommended Protobuf practices.""" def __init__(self, api_client): self._api = api_client @@ -2949,9 +2951,7 @@ def get( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2988,9 +2988,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3009,7 +3007,9 @@ def list( class ConsumerInstallationsAPI: - """Installations are entities that allow consumers to interact with Databricks Marketplace listings.""" + """Check Databricks Protobuf Style Guide + (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about + recommended Protobuf practices.""" def __init__(self, api_client): self._api = api_client @@ -3048,10 +3048,7 @@ def create( body["repo_detail"] = repo_detail.as_dict() if share_name is not None: body["share_name"] = share_name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3071,9 +3068,7 @@ def delete(self, listing_id: str, installation_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3101,9 +3096,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3135,9 +3128,7 @@ def list_listing_installations( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3184,10 +3175,7 @@ def update( body["installation"] = installation.as_dict() if rotate_token is not None: body["rotate_token"] = rotate_token - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3203,8 +3191,9 @@ def update( class ConsumerListingsAPI: - """Listings are the core entities in the Marketplace. They represent the products that are available for - consumption.""" + """Check Databricks Protobuf Style Guide + (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about + recommended Protobuf practices.""" def __init__(self, api_client): self._api = api_client @@ -3220,9 +3209,7 @@ def batch_get(self, *, ids: Optional[List[str]] = None) -> BatchGetListingsRespo query = {} if ids is not None: query["ids"] = [v for v in ids] - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3239,9 +3226,7 @@ def get(self, id: str) -> GetListingResponse: :returns: :class:`GetListingResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3304,9 +3289,7 @@ def list( query["provider_ids"] = [v for v in provider_ids] if tags is not None: query["tags"] = tags.as_dict() - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3369,9 +3352,7 @@ def search( query["provider_ids"] = [v for v in provider_ids] if query is not None: query["query"] = query - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3388,7 +3369,9 @@ def search( class ConsumerPersonalizationRequestsAPI: - """Personalization Requests allow customers to interact with the individualized Marketplace listing flow.""" + """Check Databricks Protobuf Style Guide + (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about + recommended Protobuf practices.""" def __init__(self, api_client): self._api = api_client @@ -3438,10 +3421,7 @@ def create( body["last_name"] = last_name if recipient_type is not None: body["recipient_type"] = recipient_type.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3464,9 +3444,7 @@ def get(self, listing_id: str) -> GetPersonalizationRequestResponse: :returns: :class:`GetPersonalizationRequestResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3493,9 +3471,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3514,7 +3490,9 @@ def list( class ConsumerProvidersAPI: - """Providers are the entities that publish listings to the Marketplace.""" + """Check Databricks Protobuf Style Guide + (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about + recommended Protobuf practices.""" def __init__(self, api_client): self._api = api_client @@ -3530,9 +3508,7 @@ def batch_get(self, *, ids: Optional[List[str]] = None) -> BatchGetProvidersResp query = {} if ids is not None: query["ids"] = [v for v in ids] - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3549,9 +3525,7 @@ def get(self, id: str) -> GetProviderResponse: :returns: :class:`GetProviderResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3579,9 +3553,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3598,7 +3570,9 @@ def list( class ProviderExchangeFiltersAPI: - """Marketplace exchanges filters curate which groups can access an exchange.""" + """Check Databricks Protobuf Style Guide + (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about + recommended Protobuf practices.""" def __init__(self, api_client): self._api = api_client @@ -3614,10 +3588,7 @@ def create(self, filter: ExchangeFilter) -> CreateExchangeFilterResponse: body = {} if filter is not None: body["filter"] = filter.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3634,9 +3605,7 @@ def delete(self, id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3663,9 +3632,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3692,10 +3659,7 @@ def update(self, id: str, filter: ExchangeFilter) -> UpdateExchangeFilterRespons body = {} if filter is not None: body["filter"] = filter.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3706,7 +3670,9 @@ def update(self, id: str, filter: ExchangeFilter) -> UpdateExchangeFilterRespons class ProviderExchangesAPI: - """Marketplace exchanges allow providers to share their listings with a curated set of customers.""" + """Check Databricks Protobuf Style Guide + (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about + recommended Protobuf practices.""" def __init__(self, api_client): self._api = api_client @@ -3725,10 +3691,7 @@ def add_listing_to_exchange(self, listing_id: str, exchange_id: str) -> AddExcha body["exchange_id"] = exchange_id if listing_id is not None: body["listing_id"] = listing_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3748,10 +3711,7 @@ def create(self, exchange: Exchange) -> CreateExchangeResponse: body = {} if exchange is not None: body["exchange"] = exchange.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3768,9 +3728,7 @@ def delete(self, id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3786,9 +3744,7 @@ def delete_listing_from_exchange(self, id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3804,9 +3760,7 @@ def get(self, id: str) -> GetExchangeResponse: :returns: :class:`GetExchangeResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3829,9 +3783,7 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3865,9 +3817,7 @@ def list_exchanges_for_listing( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3903,9 +3853,7 @@ def list_listings_for_exchange( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3934,10 +3882,7 @@ def update(self, id: str, exchange: Exchange) -> UpdateExchangeResponse: body = {} if exchange is not None: body["exchange"] = exchange.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3948,7 +3893,9 @@ def update(self, id: str, exchange: Exchange) -> UpdateExchangeResponse: class ProviderFilesAPI: - """Marketplace offers a set of file APIs for various purposes such as preview notebooks and provider icons.""" + """Check Databricks Protobuf Style Guide + (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about + recommended Protobuf practices.""" def __init__(self, api_client): self._api = api_client @@ -3980,10 +3927,7 @@ def create( body["marketplace_file_type"] = marketplace_file_type.value if mime_type is not None: body["mime_type"] = mime_type - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4000,9 +3944,7 @@ def delete(self, file_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4018,9 +3960,7 @@ def get(self, file_id: str) -> GetFileResponse: :returns: :class:`GetFileResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4048,9 +3988,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4067,8 +4005,9 @@ def list( class ProviderListingsAPI: - """Listings are the core entities in the Marketplace. They represent the products that are available for - consumption.""" + """Check Databricks Protobuf Style Guide + (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about + recommended Protobuf practices.""" def __init__(self, api_client): self._api = api_client @@ -4084,10 +4023,7 @@ def create(self, listing: Listing) -> CreateListingResponse: body = {} if listing is not None: body["listing"] = listing.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4104,9 +4040,7 @@ def delete(self, id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4122,9 +4056,7 @@ def get(self, id: str) -> GetListingResponse: :returns: :class:`GetListingResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4147,9 +4079,7 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4176,10 +4106,7 @@ def update(self, id: str, listing: Listing) -> UpdateListingResponse: body = {} if listing is not None: body["listing"] = listing.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4190,8 +4117,9 @@ def update(self, id: str, listing: Listing) -> UpdateListingResponse: class ProviderPersonalizationRequestsAPI: - """Personalization requests are an alternate to instantly available listings. Control the lifecycle of - personalized solutions.""" + """Check Databricks Protobuf Style Guide + (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about + recommended Protobuf practices.""" def __init__(self, api_client): self._api = api_client @@ -4213,9 +4141,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4259,10 +4185,7 @@ def update( body["share"] = share.as_dict() if status is not None: body["status"] = status.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4278,7 +4201,9 @@ def update( class ProviderProviderAnalyticsDashboardsAPI: - """Manage templated analytics solution for providers.""" + """Check Databricks Protobuf Style Guide + (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about + recommended Protobuf practices.""" def __init__(self, api_client): self._api = api_client @@ -4291,17 +4216,13 @@ def create(self) -> ProviderAnalyticsDashboard: :returns: :class:`ProviderAnalyticsDashboard` """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id - res = self._api.do("POST", "/api/2.0/marketplace-provider/analytics_dashboard", body=body, headers=headers) + res = self._api.do("POST", "/api/2.0/marketplace-provider/analytics_dashboard", headers=headers) return ProviderAnalyticsDashboard.from_dict(res) def get(self) -> ListProviderAnalyticsDashboardResponse: @@ -4311,9 +4232,7 @@ def get(self) -> ListProviderAnalyticsDashboardResponse: :returns: :class:`ListProviderAnalyticsDashboardResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4329,9 +4248,7 @@ def get_latest_version(self) -> GetLatestVersionProviderAnalyticsDashboardRespon :returns: :class:`GetLatestVersionProviderAnalyticsDashboardResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4355,10 +4272,7 @@ def update(self, id: str, *, version: Optional[int] = None) -> UpdateProviderAna body = {} if version is not None: body["version"] = version - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4369,7 +4283,9 @@ def update(self, id: str, *, version: Optional[int] = None) -> UpdateProviderAna class ProviderProvidersAPI: - """Providers are entities that manage assets in Marketplace.""" + """Check Databricks Protobuf Style Guide + (https://docs.google.com/document/d/1ukom2tCkQbNCAmjk3vHONaXp1n-I741tQjOMTipLbO4/edit?usp=sharing) about + recommended Protobuf practices.""" def __init__(self, api_client): self._api = api_client @@ -4385,10 +4301,7 @@ def create(self, provider: ProviderInfo) -> CreateProviderResponse: body = {} if provider is not None: body["provider"] = provider.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4405,9 +4318,7 @@ def delete(self, id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4423,9 +4334,7 @@ def get(self, id: str) -> GetProviderResponse: :returns: :class:`GetProviderResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4448,9 +4357,7 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4477,10 +4384,7 @@ def update(self, id: str, provider: ProviderInfo) -> UpdateProviderResponse: body = {} if provider is not None: body["provider"] = provider.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/ml.py b/databricks/sdk/service/ml.py index 64c87379b..c5fa49b78 100644 --- a/databricks/sdk/service/ml.py +++ b/databricks/sdk/service/ml.py @@ -2025,236 +2025,6 @@ def from_dict(cls, d: Dict[str, Any]) -> Experiment: ) -@dataclass -class ExperimentAccessControlRequest: - group_name: Optional[str] = None - """name of the group""" - - permission_level: Optional[ExperimentPermissionLevel] = None - - service_principal_name: Optional[str] = None - """application ID of a service principal""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the ExperimentAccessControlRequest into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ExperimentAccessControlRequest into a shallow dictionary of its immediate attributes.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ExperimentAccessControlRequest: - """Deserializes the ExperimentAccessControlRequest from a dictionary.""" - return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", ExperimentPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class ExperimentAccessControlResponse: - all_permissions: Optional[List[ExperimentPermission]] = None - """All permissions.""" - - display_name: Optional[str] = None - """Display name of the user or service principal.""" - - group_name: Optional[str] = None - """name of the group""" - - service_principal_name: Optional[str] = None - """Name of the service principal.""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the ExperimentAccessControlResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ExperimentAccessControlResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.all_permissions: - body["all_permissions"] = self.all_permissions - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ExperimentAccessControlResponse: - """Deserializes the ExperimentAccessControlResponse from a dictionary.""" - return cls( - all_permissions=_repeated_dict(d, "all_permissions", ExperimentPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class ExperimentPermission: - inherited: Optional[bool] = None - - inherited_from_object: Optional[List[str]] = None - - permission_level: Optional[ExperimentPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the ExperimentPermission into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ExperimentPermission into a shallow dictionary of its immediate attributes.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ExperimentPermission: - """Deserializes the ExperimentPermission from a dictionary.""" - return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", ExperimentPermissionLevel), - ) - - -class ExperimentPermissionLevel(Enum): - """Permission level""" - - CAN_EDIT = "CAN_EDIT" - CAN_MANAGE = "CAN_MANAGE" - CAN_READ = "CAN_READ" - - -@dataclass -class ExperimentPermissions: - access_control_list: Optional[List[ExperimentAccessControlResponse]] = None - - object_id: Optional[str] = None - - object_type: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the ExperimentPermissions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ExperimentPermissions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.access_control_list: - body["access_control_list"] = self.access_control_list - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ExperimentPermissions: - """Deserializes the ExperimentPermissions from a dictionary.""" - return cls( - access_control_list=_repeated_dict(d, "access_control_list", ExperimentAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), - ) - - -@dataclass -class ExperimentPermissionsDescription: - description: Optional[str] = None - - permission_level: Optional[ExperimentPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the ExperimentPermissionsDescription into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ExperimentPermissionsDescription into a shallow dictionary of its immediate attributes.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ExperimentPermissionsDescription: - """Deserializes the ExperimentPermissionsDescription from a dictionary.""" - return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", ExperimentPermissionLevel), - ) - - @dataclass class ExperimentTag: """A tag for an experiment.""" @@ -2350,8 +2120,8 @@ class Feature: lineage_context: Optional[LineageContext] = None """Lineage context information for this feature. WARNING: This field is primarily intended for - internal use by Databricks systems and is automatically populated when features are created - through Databricks notebooks or jobs. Users should not manually set this field as incorrect + internal use by systems and is automatically populated when features are created + through notebooks or jobs. Users should not manually set this field as incorrect values may lead to inaccurate lineage tracking or unexpected behavior. This field will be set by feature-engineering client and should be left unset by SDK and terraform users.""" @@ -3056,31 +2826,6 @@ def from_dict(cls, d: Dict[str, Any]) -> GetExperimentByNameResponse: return cls(experiment=_from_dict(d, "experiment", Experiment)) -@dataclass -class GetExperimentPermissionLevelsResponse: - permission_levels: Optional[List[ExperimentPermissionsDescription]] = None - """Specific permission levels""" - - def as_dict(self) -> dict: - """Serializes the GetExperimentPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GetExperimentPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.permission_levels: - body["permission_levels"] = self.permission_levels - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GetExperimentPermissionLevelsResponse: - """Deserializes the GetExperimentPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", ExperimentPermissionsDescription)) - - @dataclass class GetExperimentResponse: experiment: Optional[Experiment] = None @@ -3265,31 +3010,6 @@ def from_dict(cls, d: Dict[str, Any]) -> GetModelVersionResponse: return cls(model_version=_from_dict(d, "model_version", ModelVersion)) -@dataclass -class GetRegisteredModelPermissionLevelsResponse: - permission_levels: Optional[List[RegisteredModelPermissionsDescription]] = None - """Specific permission levels""" - - def as_dict(self) -> dict: - """Serializes the GetRegisteredModelPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GetRegisteredModelPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.permission_levels: - body["permission_levels"] = self.permission_levels - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GetRegisteredModelPermissionLevelsResponse: - """Deserializes the GetRegisteredModelPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", RegisteredModelPermissionsDescription)) - - @dataclass class GetRunResponse: run: Optional[Run] = None @@ -3411,14 +3131,14 @@ def from_dict(cls, d: Dict[str, Any]) -> HttpUrlSpecWithoutSecret: @dataclass class IngestionConfig: - """Configuration for the Databricks-managed ingestion pipeline. Groups the ingestion destination + """Configuration for the -managed ingestion pipeline. Groups the ingestion destination (required) and optional backfill source.""" ingestion_destination: IngestionDestination - """Destination for the Databricks-managed Delta table that holds an offline copy of the streaming + """Destination for the -managed Delta table that holds an offline copy of the streaming data for querying and training. This table contains both 1) forward-filled data from the Stream and 2) backfilled data from the BackfillSource (if provided). This table is created and managed - by Databricks and is deleted when the Stream is deleted.""" + by and is deleted when the Stream is deleted.""" backfill_job_id: Optional[int] = None """The ID of the Databricks Job that performs the historical backfill of the ingestion Delta table.""" @@ -3513,7 +3233,7 @@ def from_dict(cls, d: Dict[str, Any]) -> IngestionConfig: @dataclass class IngestionDestination: - """Destination for the Databricks-managed Delta table that holds an offline copy of the streaming + """Destination for the -managed Delta table that holds an offline copy of the streaming data for querying and training.""" delta_table_name: Optional[str] = None @@ -3735,15 +3455,15 @@ class KafkaConfig: backfill_source: Optional[BackfillSource] = None """A user-provided and managed source for backfilling data. Historical data is used when creating a training set from streaming features linked to this Kafka config. In the future, a separate - table will be maintained by Databricks for forward filling data. The schema for this source must - match exactly that of the key and value schemas specified for this Kafka config.""" + table will be maintained by for forward filling data. The schema for this source + must match exactly that of the key and value schemas specified for this Kafka config.""" extra_options: Optional[Dict[str, str]] = None """Catch-all for miscellaneous options. Keys should be source options or Kafka consumer options (kafka.*)""" ingestion_config: Optional[IngestionConfig] = None - """Configuration for ingesting Kafka data into a Databricks-managed Delta table.""" + """Configuration for ingesting Kafka data into a -managed Delta table.""" key_schema: Optional[SchemaConfig] = None """Schema configuration for extracting message keys from topics. At least one of key_schema and @@ -3965,7 +3685,7 @@ def from_dict(cls, d: Dict[str, Any]) -> KafkaSubscriptionMode: @dataclass class KinesisStreamConfig: """Kinesis-specific configuration for a Stream. For the underlying connector and its source - options, see the Databricks documentation on connecting to Amazon Kinesis + options, see the documentation on connecting to Amazon Kinesis (https://docs.databricks.com/aws/en/connect/streaming/kinesis).""" extra_options: Optional[Dict[str, str]] = None @@ -5867,7 +5587,7 @@ def from_dict(cls, d: Dict[str, Any]) -> ModelVersionTag: class MtlsConfig: """Mutual-TLS (mTLS) authentication configuration. The keystore (client certificate + private key) and truststore (CAs trusted to verify the broker) live as JKS files on Unity Catalog volumes, - with their passwords stored in Databricks secret scopes. This matches the SSL setup pattern + with their passwords stored in secret scopes. This matches the SSL setup pattern documented at https://docs.databricks.com/en/connect/streaming/kafka/authentication#use-ssl-to-connect-databricks-to-kafka. @@ -6571,238 +6291,6 @@ class PurgeFeatureEntitiesResultState(Enum): SUCCEEDED = "SUCCEEDED" -@dataclass -class RegisteredModelAccessControlRequest: - group_name: Optional[str] = None - """name of the group""" - - permission_level: Optional[RegisteredModelPermissionLevel] = None - - service_principal_name: Optional[str] = None - """application ID of a service principal""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the RegisteredModelAccessControlRequest into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the RegisteredModelAccessControlRequest into a shallow dictionary of its immediate attributes.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelAccessControlRequest: - """Deserializes the RegisteredModelAccessControlRequest from a dictionary.""" - return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", RegisteredModelPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class RegisteredModelAccessControlResponse: - all_permissions: Optional[List[RegisteredModelPermission]] = None - """All permissions.""" - - display_name: Optional[str] = None - """Display name of the user or service principal.""" - - group_name: Optional[str] = None - """name of the group""" - - service_principal_name: Optional[str] = None - """Name of the service principal.""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the RegisteredModelAccessControlResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the RegisteredModelAccessControlResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.all_permissions: - body["all_permissions"] = self.all_permissions - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelAccessControlResponse: - """Deserializes the RegisteredModelAccessControlResponse from a dictionary.""" - return cls( - all_permissions=_repeated_dict(d, "all_permissions", RegisteredModelPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class RegisteredModelPermission: - inherited: Optional[bool] = None - - inherited_from_object: Optional[List[str]] = None - - permission_level: Optional[RegisteredModelPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the RegisteredModelPermission into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the RegisteredModelPermission into a shallow dictionary of its immediate attributes.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelPermission: - """Deserializes the RegisteredModelPermission from a dictionary.""" - return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", RegisteredModelPermissionLevel), - ) - - -class RegisteredModelPermissionLevel(Enum): - """Permission level""" - - CAN_EDIT = "CAN_EDIT" - CAN_MANAGE = "CAN_MANAGE" - CAN_MANAGE_PRODUCTION_VERSIONS = "CAN_MANAGE_PRODUCTION_VERSIONS" - CAN_MANAGE_STAGING_VERSIONS = "CAN_MANAGE_STAGING_VERSIONS" - CAN_READ = "CAN_READ" - - -@dataclass -class RegisteredModelPermissions: - access_control_list: Optional[List[RegisteredModelAccessControlResponse]] = None - - object_id: Optional[str] = None - - object_type: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the RegisteredModelPermissions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - def as_shallow_dict(self) -> dict: - """Serializes the RegisteredModelPermissions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.access_control_list: - body["access_control_list"] = self.access_control_list - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelPermissions: - """Deserializes the RegisteredModelPermissions from a dictionary.""" - return cls( - access_control_list=_repeated_dict(d, "access_control_list", RegisteredModelAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), - ) - - -@dataclass -class RegisteredModelPermissionsDescription: - description: Optional[str] = None - - permission_level: Optional[RegisteredModelPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the RegisteredModelPermissionsDescription into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the RegisteredModelPermissionsDescription into a shallow dictionary of its immediate attributes.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelPermissionsDescription: - """Deserializes the RegisteredModelPermissionsDescription from a dictionary.""" - return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", RegisteredModelPermissionLevel), - ) - - class RegistryEmailSubscriptionType(Enum): """.. note:: Experimental: This entity may change or be removed in a future release without warning. Email subscription types for registry notifications: @@ -7590,7 +7078,7 @@ class SchemaRegistryConfig: """Configuration for resolving a Stream's schema from an external schema registry (e.g. Confluent).""" api_secret_ref: SecretScopeReference - """Reference to the schema registry API secret in a Databricks secret scope.""" + """Reference to the schema registry API secret in a secret scope.""" key_schema_locator: Optional[SchemaLocator] = None """Schema locator for the message key. Only used for Kafka streams. At least one of @@ -7898,11 +7386,11 @@ def from_dict(cls, d: Dict[str, Any]) -> SearchRunsResponse: @dataclass class SecretScopeReference: - """Reference to an entry in a Databricks secret scope. The referenced value is fetched on the Spark - cluster at materialization time via dbutils.secrets.get(scope, key).""" + """Reference to an entry in a secret scope. The referenced value is fetched on the + Spark cluster at materialization time via dbutils.secrets.get(scope, key).""" scope: str - """The Databricks secret scope name.""" + """The secret scope name.""" key: str """The key within the scope.""" @@ -9220,13 +8708,6 @@ class ViewType(Enum): class ExperimentsAPI: - """Experiments are the primary unit of organization in MLflow; all MLflow runs belong to an experiment. Each - experiment lets you visualize, search, and compare runs, as well as download run artifacts or metadata for - analysis in other tools. Experiments are maintained in a Databricks hosted MLflow tracking server. - - Experiments are located in the workspace file tree. You manage experiments using the same tools you use to - manage other workspace objects such as folders, notebooks, and libraries.""" - def __init__(self, api_client): self._api = api_client @@ -9273,10 +8754,7 @@ def create_experiment( body["tags"] = [v.as_dict() for v in tags] if trace_location is not None: body["trace_location"] = trace_location.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9326,10 +8804,7 @@ def create_logged_model( body["source_run_id"] = source_run_id if tags is not None: body["tags"] = [v.as_dict() for v in tags] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9377,10 +8852,7 @@ def create_run( body["tags"] = [v.as_dict() for v in tags] if user_id is not None: body["user_id"] = user_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9402,10 +8874,7 @@ def delete_experiment(self, experiment_id: str): body = {} if experiment_id is not None: body["experiment_id"] = experiment_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9422,9 +8891,7 @@ def delete_logged_model(self, model_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9443,9 +8910,7 @@ def delete_logged_model_tag(self, model_id: str, tag_key: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9465,10 +8930,7 @@ def delete_run(self, run_id: str): body = {} if run_id is not None: body["run_id"] = run_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9502,10 +8964,7 @@ def delete_runs( body["max_runs"] = max_runs if max_timestamp_millis is not None: body["max_timestamp_millis"] = max_timestamp_millis - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9531,10 +8990,7 @@ def delete_tag(self, run_id: str, key: str): body["key"] = key if run_id is not None: body["run_id"] = run_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9557,10 +9013,7 @@ def finalize_logged_model(self, model_id: str, status: LoggedModelStatus) -> Fin body = {} if status is not None: body["status"] = status.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9587,9 +9040,7 @@ def get_by_name(self, experiment_name: str) -> GetExperimentByNameResponse: query = {} if experiment_name is not None: query["experiment_name"] = experiment_name - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9610,9 +9061,7 @@ def get_experiment(self, experiment_id: str) -> GetExperimentResponse: query = {} if experiment_id is not None: query["experiment_id"] = experiment_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9659,9 +9108,7 @@ def get_history( query["run_id"] = run_id if run_uuid is not None: query["run_uuid"] = run_uuid - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9685,9 +9132,7 @@ def get_logged_model(self, model_id: str) -> GetLoggedModelResponse: :returns: :class:`GetLoggedModelResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9696,46 +9141,6 @@ def get_logged_model(self, model_id: str) -> GetLoggedModelResponse: res = self._api.do("GET", f"/api/2.0/mlflow/logged-models/{model_id}", headers=headers) return GetLoggedModelResponse.from_dict(res) - def get_permission_levels(self, experiment_id: str) -> GetExperimentPermissionLevelsResponse: - """Gets the permission levels that a user can have on an object. - - :param experiment_id: str - The experiment for which to get or manage permissions. - - :returns: :class:`GetExperimentPermissionLevelsResponse` - """ - - 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/permissions/experiments/{experiment_id}/permissionLevels", headers=headers) - return GetExperimentPermissionLevelsResponse.from_dict(res) - - def get_permissions(self, experiment_id: str) -> ExperimentPermissions: - """Gets the permissions of an experiment. Experiments can inherit permissions from their root object. - - :param experiment_id: str - The experiment for which to get or manage permissions. - - :returns: :class:`ExperimentPermissions` - """ - - 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/permissions/experiments/{experiment_id}", headers=headers) - return ExperimentPermissions.from_dict(res) - def get_run(self, run_id: str, *, run_uuid: Optional[str] = None) -> GetRunResponse: """Gets the metadata, metrics, params, and tags for a run. In the case where multiple metrics with the same key are logged for a run, return only the value with the latest timestamp. @@ -9756,9 +9161,7 @@ def get_run(self, run_id: str, *, run_uuid: Optional[str] = None) -> GetRunRespo query["run_id"] = run_id if run_uuid is not None: query["run_uuid"] = run_uuid - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9807,9 +9210,7 @@ def list_artifacts( query["run_id"] = run_id if run_uuid is not None: query["run_uuid"] = run_uuid - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9852,9 +9253,7 @@ def list_experiments( query["page_token"] = page_token if view_type is not None: query["view_type"] = view_type.value - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9937,10 +9336,7 @@ def log_batch( body["run_id"] = run_id if tags is not None: body["tags"] = [v.as_dict() for v in tags] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9970,10 +9366,7 @@ def log_inputs( body["models"] = [v.as_dict() for v in models] if run_id is not None: body["run_id"] = run_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9997,10 +9390,7 @@ def log_logged_model_params(self, model_id: str, *, params: Optional[List[Logged body = {} if params is not None: body["params"] = [v.as_dict() for v in params] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10069,10 +9459,7 @@ def log_metric( body["timestamp"] = timestamp if value is not None: body["value"] = value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10099,10 +9486,7 @@ def log_model(self, *, model_json: Optional[str] = None, run_id: Optional[str] = body["model_json"] = model_json if run_id is not None: body["run_id"] = run_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10126,10 +9510,7 @@ def log_outputs(self, run_id: str, *, models: Optional[List[ModelOutput]] = None body["models"] = [v.as_dict() for v in models] if run_id is not None: body["run_id"] = run_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10164,10 +9545,7 @@ def log_param(self, key: str, value: str, *, run_id: Optional[str] = None, run_u body["run_uuid"] = run_uuid if value is not None: body["value"] = value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10191,10 +9569,7 @@ def restore_experiment(self, experiment_id: str): body = {} if experiment_id is not None: body["experiment_id"] = experiment_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10216,10 +9591,7 @@ def restore_run(self, run_id: str): body = {} if run_id is not None: body["run_id"] = run_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10253,10 +9625,7 @@ def restore_runs( body["max_runs"] = max_runs if min_timestamp_millis is not None: body["min_timestamp_millis"] = min_timestamp_millis - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10303,10 +9672,7 @@ def search_experiments( body["page_token"] = page_token if view_type is not None: body["view_type"] = view_type.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10369,10 +9735,7 @@ def search_logged_models( body["order_by"] = [v.as_dict() for v in order_by] if page_token is not None: body["page_token"] = page_token - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10437,10 +9800,7 @@ def search_runs( body["page_token"] = page_token if run_view_type is not None: body["run_view_type"] = run_view_type.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10475,10 +9835,7 @@ def set_experiment_tag(self, experiment_id: str, key: str, value: str): body["key"] = key if value is not None: body["value"] = value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10500,10 +9857,7 @@ def set_logged_model_tags(self, model_id: str, *, tags: Optional[List[LoggedMode body = {} if tags is not None: body["tags"] = [v.as_dict() for v in tags] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10511,34 +9865,6 @@ def set_logged_model_tags(self, model_id: str, *, tags: Optional[List[LoggedMode self._api.do("PATCH", f"/api/2.0/mlflow/logged-models/{model_id}/tags", body=body, headers=headers) - def set_permissions( - self, experiment_id: str, *, access_control_list: Optional[List[ExperimentAccessControlRequest]] = None - ) -> ExperimentPermissions: - """Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct - permissions if none are specified. Objects can inherit permissions from their root object. - - :param experiment_id: str - The experiment for which to get or manage permissions. - :param access_control_list: List[:class:`ExperimentAccessControlRequest`] (optional) - - :returns: :class:`ExperimentPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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("PUT", f"/api/2.0/permissions/experiments/{experiment_id}", body=body, headers=headers) - return ExperimentPermissions.from_dict(res) - def set_tag(self, key: str, value: str, *, run_id: Optional[str] = None, run_uuid: Optional[str] = None): """Sets a tag on a run. Tags are run metadata that can be updated during a run and after a run completes. @@ -10564,10 +9890,7 @@ def set_tag(self, key: str, value: str, *, run_id: Optional[str] = None, run_uui body["run_uuid"] = run_uuid if value is not None: body["value"] = value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10591,10 +9914,7 @@ def update_experiment(self, experiment_id: str, *, new_name: Optional[str] = Non body["experiment_id"] = experiment_id if new_name is not None: body["new_name"] = new_name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10602,33 +9922,6 @@ def update_experiment(self, experiment_id: str, *, new_name: Optional[str] = Non self._api.do("POST", "/api/2.0/mlflow/experiments/update", body=body, headers=headers) - def update_permissions( - self, experiment_id: str, *, access_control_list: Optional[List[ExperimentAccessControlRequest]] = None - ) -> ExperimentPermissions: - """Updates the permissions on an experiment. Experiments can inherit permissions from their root object. - - :param experiment_id: str - The experiment for which to get or manage permissions. - :param access_control_list: List[:class:`ExperimentAccessControlRequest`] (optional) - - :returns: :class:`ExperimentPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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/permissions/experiments/{experiment_id}", body=body, headers=headers) - return ExperimentPermissions.from_dict(res) - def update_run( self, *, @@ -10666,10 +9959,7 @@ def update_run( body["run_uuid"] = run_uuid if status is not None: body["status"] = status.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10680,8 +9970,6 @@ def update_run( class FeatureEngineeringAPI: - """[description]""" - def __init__(self, api_client): self._api = api_client @@ -10709,10 +9997,7 @@ def backfill_features( body["feature_full_names"] = [v for v in feature_full_names] if request_id is not None: body["request_id"] = request_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10736,10 +10021,7 @@ def batch_create_materialized_features( body = {} if requests is not None: body["requests"] = [v.as_dict() for v in requests] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10759,17 +10041,13 @@ def cancel_operation(self, name: str): """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id - self._api.do("POST", f"/api/2.0/feature-engineering/{name}:cancel", body=body, headers=headers) + self._api.do("POST", f"/api/2.0/feature-engineering/{name}:cancel", headers=headers) def create_feature(self, feature: Feature) -> Feature: """Create a Feature. @@ -10782,10 +10060,7 @@ def create_feature(self, feature: Feature) -> Feature: body = feature.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10805,10 +10080,7 @@ def create_kafka_config(self, kafka_config: KafkaConfig) -> KafkaConfig: body = kafka_config.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10828,10 +10100,7 @@ def create_materialized_feature(self, materialized_feature: MaterializedFeature) body = materialized_feature.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10851,10 +10120,7 @@ def create_stream(self, stream: Stream) -> Stream: body = stream.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10872,9 +10138,7 @@ def delete_feature(self, full_name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10892,9 +10156,7 @@ def delete_kafka_config(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10911,9 +10173,7 @@ def delete_materialized_feature(self, materialized_feature_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10932,9 +10192,7 @@ def delete_stream(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10951,9 +10209,7 @@ def get_feature(self, full_name: str) -> Feature: :returns: :class:`Feature` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10972,9 +10228,7 @@ def get_kafka_config(self, name: str) -> KafkaConfig: :returns: :class:`KafkaConfig` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10992,9 +10246,7 @@ def get_materialized_feature(self, materialized_feature_id: str) -> Materialized :returns: :class:`MaterializedFeature` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11014,9 +10266,7 @@ def get_operation(self, name: str) -> Operation: :returns: :class:`Operation` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11034,9 +10284,7 @@ def get_stream(self, name: str) -> Stream: :returns: :class:`Stream` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11071,9 +10319,7 @@ def list_features( query["page_token"] = page_token if schema_name is not None: query["schema_name"] = schema_name - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11107,9 +10353,7 @@ def list_kafka_configs( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11150,9 +10394,7 @@ def list_materialized_features( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11191,9 +10433,7 @@ def list_streams( query["page_token"] = page_token if parent is not None: query["parent"] = parent - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11236,10 +10476,7 @@ def purge_feature_entities( body["features"] = [v for v in features] if request_id is not None: body["request_id"] = request_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11270,10 +10507,7 @@ def update_feature(self, full_name: str, feature: Feature, update_mask: str) -> query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11304,10 +10538,7 @@ def update_kafka_config(self, name: str, kafka_config: KafkaConfig, update_mask: query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11342,10 +10573,7 @@ def update_materialized_feature( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11377,10 +10605,7 @@ def update_stream(self, name: str, stream: Stream, update_mask: FieldMask) -> St query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11553,13 +10778,6 @@ def done(self) -> bool: class FeatureStoreAPI: - """A feature store is a centralized repository that enables data scientists to find and share features. Using - a feature store also ensures that the code used to compute feature values is the same during model - training and when the model is used for inference. - - An online store is a low-latency database used for feature lookup during real-time model inference or - serve feature for real-time applications.""" - def __init__(self, api_client): self._api = api_client @@ -11574,10 +10792,7 @@ def create_online_store(self, online_store: OnlineStore) -> OnlineStore: body = online_store.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11595,9 +10810,7 @@ def delete_online_store(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11614,9 +10827,7 @@ def delete_online_table(self, online_table_name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11633,9 +10844,7 @@ def get_online_store(self, name: str) -> OnlineStore: :returns: :class:`OnlineStore` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11662,9 +10871,7 @@ def list_online_stores( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11693,10 +10900,7 @@ def publish_table(self, source_table_name: str, publish_spec: PublishSpec) -> Pu body = {} if publish_spec is not None: body["publish_spec"] = publish_spec.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11724,10 +10928,7 @@ def update_online_store(self, name: str, online_store: OnlineStore, update_mask: query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11740,15 +10941,13 @@ def update_online_store(self, name: str, online_store: OnlineStore, update_mask: class ForecastingAPI: - """The Forecasting API allows you to create and get serverless forecasting experiments""" - def __init__(self, api_client): self._api = api_client def wait_get_experiment_forecasting_succeeded( self, experiment_id: str, - timeout=timedelta(minutes=120), + timeout=timedelta(minutes=20), callback: Optional[Callable[[ForecastingExperiment], None]] = None, ) -> ForecastingExperiment: deadline = time.time() + timeout.total_seconds() @@ -11894,10 +11093,7 @@ def create_experiment( body["train_data_path"] = train_data_path if training_frameworks is not None: body["training_frameworks"] = [v for v in training_frameworks] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11930,7 +11126,7 @@ def create_experiment_and_wait( split_column: Optional[str] = None, timeseries_identifier_columns: Optional[List[str]] = None, training_frameworks: Optional[List[str]] = None, - timeout=timedelta(minutes=120), + timeout=timedelta(minutes=20), ) -> ForecastingExperiment: return self.create_experiment( custom_weights_column=custom_weights_column, @@ -11961,9 +11157,7 @@ def get_experiment(self, experiment_id: str) -> ForecastingExperiment: :returns: :class:`ForecastingExperiment` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -11974,9 +11168,6 @@ def get_experiment(self, experiment_id: str) -> ForecastingExperiment: class MaterializedFeaturesAPI: - """Materialized Features are columns in tables and views that can be directly used as features to train and - serve ML models.""" - def __init__(self, api_client): self._api = api_client @@ -11992,10 +11183,7 @@ def create_feature_tag(self, table_name: str, feature_name: str, feature_tag: Fe body = feature_tag.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12022,9 +11210,7 @@ def delete_feature_tag(self, table_name: str, feature_name: str, key: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12047,9 +11233,7 @@ def get_feature_lineage(self, table_name: str, feature_name: str) -> FeatureLine :returns: :class:`FeatureLineage` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12072,9 +11256,7 @@ def get_feature_tag(self, table_name: str, feature_name: str, key: str) -> Featu :returns: :class:`FeatureTag` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12107,9 +11289,7 @@ def list_feature_tags( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12154,10 +11334,7 @@ def update_feature_tag( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12174,14 +11351,6 @@ def update_feature_tag( class ModelRegistryAPI: - """Note: This API reference documents APIs for the Workspace Model Registry. Databricks recommends using - [Models in Unity Catalog](/api/workspace/registeredmodels) instead. Models in Unity Catalog provides - centralized model governance, cross-workspace access, lineage, and deployment. Workspace Model Registry - will be deprecated in the future. - - The Workspace Model Registry is a centralized model repository and a UI and set of APIs that enable you to - manage the full lifecycle of MLflow Models.""" - def __init__(self, api_client): self._api = api_client @@ -12220,10 +11389,7 @@ def approve_transition_request( body["stage"] = stage if version is not None: body["version"] = version - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12253,10 +11419,7 @@ def create_comment(self, name: str, version: str, comment: str) -> CreateComment body["name"] = name if version is not None: body["version"] = version - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12288,10 +11451,7 @@ def create_model( body["name"] = name if tags is not None: body["tags"] = [v.as_dict() for v in tags] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12343,10 +11503,7 @@ def create_model_version( body["source"] = source if tags is not None: body["tags"] = [v.as_dict() for v in tags] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12386,10 +11543,7 @@ def create_transition_request( body["stage"] = stage if version is not None: body["version"] = version - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12463,10 +11617,7 @@ def create_webhook( body["model_name"] = model_name if status is not None: body["status"] = status.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12487,9 +11638,7 @@ def delete_comment(self, id: str): query = {} if id is not None: query["id"] = id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12509,9 +11658,7 @@ def delete_model(self, name: str): query = {} if name is not None: query["name"] = name - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12536,9 +11683,7 @@ def delete_model_tag(self, name: str, key: str): query["key"] = key if name is not None: query["name"] = name - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12562,9 +11707,7 @@ def delete_model_version(self, name: str, version: str): query["name"] = name if version is not None: query["version"] = version - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12593,9 +11736,7 @@ def delete_model_version_tag(self, name: str, version: str, key: str): query["name"] = name if version is not None: query["version"] = version - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12639,9 +11780,7 @@ def delete_transition_request( query["stage"] = stage if version is not None: query["version"] = version - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12662,9 +11801,7 @@ def delete_webhook(self, id: str): query = {} if id is not None: query["id"] = id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12688,10 +11825,7 @@ def get_latest_versions(self, name: str, *, stages: Optional[List[str]] = None) body["name"] = name if stages is not None: body["stages"] = [v for v in stages] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12702,9 +11836,9 @@ def get_latest_versions(self, name: str, *, stages: Optional[List[str]] = None) return parsed if parsed is not None else [] def get_model(self, name: str) -> GetModelResponse: - """Get the details of a model. This is a Databricks workspace version of the `MLflow endpoint + """Get the details of a model. This is a workspace version of the `MLflow endpoint `__ that also returns the - model's Databricks workspace ID and the permission level of the requesting user on the model. + model's workspace ID and the permission level of the requesting user on the model. :param name: str Registered model unique name identifier. @@ -12715,9 +11849,7 @@ def get_model(self, name: str) -> GetModelResponse: query = {} if name is not None: query["name"] = name - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12742,9 +11874,7 @@ def get_model_version(self, name: str, version: str) -> GetModelVersionResponse: query["name"] = name if version is not None: query["version"] = version - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12769,9 +11899,7 @@ def get_model_version_download_uri(self, name: str, version: str) -> GetModelVer query["name"] = name if version is not None: query["version"] = version - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12780,49 +11908,6 @@ def get_model_version_download_uri(self, name: str, version: str) -> GetModelVer res = self._api.do("GET", "/api/2.0/mlflow/model-versions/get-download-uri", query=query, headers=headers) return GetModelVersionDownloadUriResponse.from_dict(res) - def get_permission_levels(self, registered_model_id: str) -> GetRegisteredModelPermissionLevelsResponse: - """Gets the permission levels that a user can have on an object. - - :param registered_model_id: str - The registered model for which to get or manage permissions. - - :returns: :class:`GetRegisteredModelPermissionLevelsResponse` - """ - - 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/permissions/registered-models/{registered_model_id}/permissionLevels", headers=headers - ) - return GetRegisteredModelPermissionLevelsResponse.from_dict(res) - - def get_permissions(self, registered_model_id: str) -> RegisteredModelPermissions: - """Gets the permissions of a registered model. Registered models can inherit permissions from their root - object. - - :param registered_model_id: str - The registered model for which to get or manage permissions. - - :returns: :class:`RegisteredModelPermissions` - """ - - 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/permissions/registered-models/{registered_model_id}", headers=headers) - return RegisteredModelPermissions.from_dict(res) - def list_models(self, *, max_results: Optional[int] = None, page_token: Optional[str] = None) -> Iterator[Model]: """Lists all available registered models, up to the limit specified in **max_results**. @@ -12839,9 +11924,7 @@ def list_models(self, *, max_results: Optional[int] = None, page_token: Optional query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12872,9 +11955,7 @@ def list_transition_requests(self, name: str, version: str) -> Iterator[Activity query["name"] = name if version is not None: query["version"] = version - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12936,9 +12017,7 @@ def list_webhooks( query["model_name"] = model_name if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -12984,10 +12063,7 @@ def reject_transition_request( body["stage"] = stage if version is not None: body["version"] = version - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -13012,10 +12088,7 @@ def rename_model(self, name: str, *, new_name: Optional[str] = None) -> RenameMo body["name"] = name if new_name is not None: body["new_name"] = new_name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -13058,9 +12131,7 @@ def search_model_versions( query["order_by"] = [v for v in order_by] if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -13110,9 +12181,7 @@ def search_models( query["order_by"] = [v for v in order_by] if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -13150,10 +12219,7 @@ def set_model_tag(self, name: str, key: str, value: str): body["name"] = name if value is not None: body["value"] = value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -13188,10 +12254,7 @@ def set_model_version_tag(self, name: str, version: str, key: str, value: str): body["value"] = value if version is not None: body["version"] = version - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -13199,39 +12262,6 @@ def set_model_version_tag(self, name: str, version: str, key: str, value: str): self._api.do("POST", "/api/2.0/mlflow/model-versions/set-tag", body=body, headers=headers) - def set_permissions( - self, - registered_model_id: str, - *, - access_control_list: Optional[List[RegisteredModelAccessControlRequest]] = None, - ) -> RegisteredModelPermissions: - """Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct - permissions if none are specified. Objects can inherit permissions from their root object. - - :param registered_model_id: str - The registered model for which to get or manage permissions. - :param access_control_list: List[:class:`RegisteredModelAccessControlRequest`] (optional) - - :returns: :class:`RegisteredModelPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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( - "PUT", f"/api/2.0/permissions/registered-models/{registered_model_id}", body=body, headers=headers - ) - return RegisteredModelPermissions.from_dict(res) - def test_registry_webhook( self, id: str, *, event: Optional[RegistryWebhookEvent] = None ) -> TestRegistryWebhookResponse: @@ -13251,10 +12281,7 @@ def test_registry_webhook( body["event"] = event.value if id is not None: body["id"] = id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -13266,7 +12293,7 @@ def test_registry_webhook( def transition_stage( self, name: str, version: str, stage: str, archive_existing_versions: bool, *, comment: Optional[str] = None ) -> TransitionStageResponse: - """Transition a model version's stage. This is a Databricks workspace version of the `MLflow endpoint + """Transition a model version's stage. This is a workspace version of the `MLflow endpoint `__ that also accepts a comment associated with the transition to be recorded. @@ -13300,10 +12327,7 @@ def transition_stage( body["stage"] = stage if version is not None: body["version"] = version - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -13330,10 +12354,7 @@ def update_comment(self, id: str, comment: str) -> UpdateCommentResponse: body["comment"] = comment if id is not None: body["id"] = id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -13358,10 +12379,7 @@ def update_model(self, name: str, *, description: Optional[str] = None) -> Updat body["description"] = description if name is not None: body["name"] = name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -13392,10 +12410,7 @@ def update_model_version( body["name"] = name if version is not None: body["version"] = version - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -13404,39 +12419,6 @@ def update_model_version( res = self._api.do("PATCH", "/api/2.0/mlflow/model-versions/update", body=body, headers=headers) return UpdateModelVersionResponse.from_dict(res) - def update_permissions( - self, - registered_model_id: str, - *, - access_control_list: Optional[List[RegisteredModelAccessControlRequest]] = None, - ) -> RegisteredModelPermissions: - """Updates the permissions on a registered model. Registered models can inherit permissions from their - root object. - - :param registered_model_id: str - The registered model for which to get or manage permissions. - :param access_control_list: List[:class:`RegisteredModelAccessControlRequest`] (optional) - - :returns: :class:`RegisteredModelPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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/permissions/registered-models/{registered_model_id}", body=body, headers=headers - ) - return RegisteredModelPermissions.from_dict(res) - def update_webhook( self, id: str, @@ -13492,10 +12474,7 @@ def update_webhook( body["job_spec"] = job_spec.as_dict() if status is not None: body["status"] = status.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/networking.py b/databricks/sdk/service/networking.py index 24e8f40c0..f8202bf50 100644 --- a/databricks/sdk/service/networking.py +++ b/databricks/sdk/service/networking.py @@ -125,7 +125,7 @@ def from_dict(cls, d: Dict[str, Any]) -> AzurePrivateEndpointInfo: @dataclass class Endpoint: """Endpoint represents a cloud networking resource in a user's cloud account and binds it to the - Databricks account.""" + account.""" display_name: str """The human-readable display name of this endpoint. The input should conform to RFC-1034, which @@ -150,7 +150,7 @@ class Endpoint: endpoint_id: Optional[str] = None """The unique identifier for this endpoint under the account. This field is a UUID generated by - Databricks.""" + .""" gcp_psc_endpoint_info: Optional[GcpPscEndpointInfo] = None """Info for a GCP Private Service Connect endpoint.""" @@ -268,7 +268,7 @@ class GcpPscEndpointInfo: assigned by GCP when the PSC connection is created.""" service_attachment_id: Optional[str] = None - """The ID of the Databricks service attachment this PSC endpoint connects to.""" + """The ID of the service attachment this PSC endpoint connects to.""" def as_dict(self) -> dict: """Serializes the GcpPscEndpointInfo into a dictionary suitable for use as a JSON request body.""" @@ -343,16 +343,14 @@ def from_dict(cls, d: Dict[str, Any]) -> ListEndpointsResponse: class EndpointsAPI: - """These APIs manage endpoint configurations for this account.""" - def __init__(self, api_client): self._api = api_client def create_endpoint(self, parent: str, endpoint: Endpoint) -> Endpoint: """Creates a new network connectivity endpoint that enables private connectivity between your network - resources and Databricks services. + resources and services. - After creation, the endpoint is initially in the PENDING state. The Databricks endpoint service + After creation, the endpoint is initially in the PENDING state. The endpoint service automatically reviews and approves the endpoint within a few minutes. Use the GET method to retrieve the latest endpoint state. @@ -368,17 +366,14 @@ def create_endpoint(self, parent: str, endpoint: Endpoint) -> Endpoint: body = endpoint.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do("POST", f"/api/networking/v1/{parent}/endpoints", body=body, headers=headers) return Endpoint.from_dict(res) def delete_endpoint(self, name: str): - """Deletes a network endpoint. This will remove the endpoint configuration from Databricks. Depending on - the endpoint type and use case, you may also need to delete corresponding network resources in your + """Deletes a network endpoint. This will remove the endpoint configuration from . Depending + on the endpoint type and use case, you may also need to delete corresponding network resources in your cloud provider account. :param name: str @@ -386,9 +381,7 @@ def delete_endpoint(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do("DELETE", f"/api/networking/v1/{name}", headers=headers) @@ -400,9 +393,7 @@ def get_endpoint(self, name: str) -> Endpoint: :returns: :class:`Endpoint` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/networking/v1/{name}", headers=headers) return Endpoint.from_dict(res) @@ -425,9 +416,7 @@ def list_endpoints( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do("GET", f"/api/networking/v1/{parent}/endpoints", query=query, headers=headers) diff --git a/databricks/sdk/service/oauth2.py b/databricks/sdk/service/oauth2.py index 5a20a7d73..b97783d3a 100644 --- a/databricks/sdk/service/oauth2.py +++ b/databricks/sdk/service/oauth2.py @@ -26,10 +26,10 @@ @dataclass class CreateCustomAppIntegrationOutput: client_id: Optional[str] = None - """OAuth client-id generated by the Databricks""" + """OAuth client-id generated by the """ client_secret: Optional[str] = None - """OAuth client-secret generated by the Databricks. If this is a confidential OAuth app + """OAuth client-secret generated by the . If this is a confidential OAuth app client-secret will be generated.""" integration_id: Optional[str] = None @@ -634,7 +634,7 @@ class OidcFederationPolicy: """The allowed token audiences, as specified in the 'aud' claim of federated tokens. The audience identifier is intended to represent the recipient of the token. Can be any non-empty string value. As long as the audience in the token matches at least one audience in the policy, the - token is considered a match. If audiences is unspecified, defaults to your Databricks account + token is considered a match. If audiences is unspecified, defaults to your account id.""" issuer: Optional[str] = None @@ -643,16 +643,16 @@ class OidcFederationPolicy: jwks_json: Optional[str] = None """The public keys used to validate the signature of federated tokens, in JWKS format. Most use cases should not need to specify this field. If jwks_uri and jwks_json are both unspecified - (recommended), Databricks automatically fetches the public keys from your issuer’s well known - endpoint. Databricks strongly recommends relying on your issuer’s well known endpoint for - discovering public keys.""" + (recommended), automatically fetches the public keys from your issuer’s well + known endpoint. Databricks strongly recommends relying on your issuer’s well known endpoint + for discovering public keys.""" jwks_uri: Optional[str] = None """URL of the public keys used to validate the signature of federated tokens, in JWKS format. Most use cases should not need to specify this field. If jwks_uri and jwks_json are both unspecified - (recommended), Databricks automatically fetches the public keys from your issuer’s well known - endpoint. Databricks strongly recommends relying on your issuer’s well known endpoint for - discovering public keys.""" + (recommended), automatically fetches the public keys from your issuer’s well + known endpoint. Databricks strongly recommends relying on your issuer’s well known endpoint + for discovering public keys.""" subject: Optional[str] = None """The required token subject, as specified in the subject claim of federated tokens. Must be @@ -866,7 +866,7 @@ class TokenAccessPolicy: enable_single_use_refresh_tokens: Optional[bool] = None """Whether to enable single-use refresh tokens (refresh token rotation). If this feature is - enabled, upon successfully getting a new access token using a refresh token, Databricks will + enabled, upon successfully getting a new access token using a refresh token, will issue a new refresh token along with the access token in the response and invalidate the old refresh token. The client should use the new refresh token to get access tokens in future requests.""" @@ -950,64 +950,6 @@ def from_dict(cls, d: Dict[str, Any]) -> UpdatePublishedAppIntegrationOutput: class AccountFederationPolicyAPI: - """These APIs manage account federation policies. - - Account federation policies allow users and service principals in your Databricks account to securely - access Databricks APIs using tokens from your trusted identity providers (IdPs). - - With token federation, your users and service principals can exchange tokens from your IdP for Databricks - OAuth tokens, which can be used to access Databricks APIs. Token federation eliminates the need to manage - Databricks secrets, and allows you to centralize management of token issuance policies in your IdP. - Databricks token federation is typically used in combination with `SCIM - `__, so users in your IdP are synchronized - into your Databricks account. - - Token federation is configured in your Databricks account using an account federation policy. An account - federation policy specifies: - - - which IdP, or issuer, your Databricks account should accept tokens from - - how to determine which Databricks user, or subject, a token is issued for - - To configure a federation policy, you provide the following: - - - The required token **issuer**, as specified in the “iss” claim of your tokens. The issuer is an - https URL that identifies your IdP. - - The allowed token **audiences**, as specified in the “aud” claim of your tokens. This identifier is - intended to represent the recipient of the token. As long as the audience in the token matches at least - one audience in the policy, the token is considered a match. If unspecified, the default value is your - Databricks account id. - - The **subject claim**, which indicates which token claim contains the Databricks username of the user - the token was issued for. If unspecified, the default value is “sub”. - - Optionally, the public keys used to validate the signature of your tokens, in JWKS format. If - unspecified (recommended), Databricks automatically fetches the public keys from your issuer’s well - known endpoint. Databricks strongly recommends relying on your issuer’s well known endpoint for - discovering public keys. - - An example federation policy is: - - .. code-block:: - - issuer: "https://idp.mycompany.com/oidc" - audiences: ["databricks"] - subject_claim: "sub" - - An example JWT token body that matches this policy and could be used to authenticate to Databricks as user - ``username@mycompany.com`` is: - - .. code-block:: - - { - "iss": "https://idp.mycompany.com/oidc", - "aud": "databricks", - "sub": "username@mycompany.com" - } - - You may also need to configure your IdP to generate tokens for your users to exchange with Databricks, if - your users do not already have the ability to generate tokens that are compatible with your federation - policy. - - You do not need to configure an OAuth application in Databricks to use token federation.""" - def __init__(self, api_client): self._api = api_client @@ -1017,7 +959,7 @@ def create(self, policy: FederationPolicy, *, policy_id: Optional[str] = None) - :param policy: :class:`FederationPolicy` :param policy_id: str (optional) The identifier for the federation policy. The identifier must contain only lowercase alphanumeric - characters, numbers, hyphens, and slashes. If unspecified, the id will be assigned by Databricks. + characters, numbers, hyphens, and slashes. If unspecified, the id will be assigned by . :returns: :class:`FederationPolicy` """ @@ -1026,10 +968,7 @@ def create(self, policy: FederationPolicy, *, policy_id: Optional[str] = None) - query = {} if policy_id is not None: query["policy_id"] = policy_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", @@ -1049,9 +988,7 @@ def delete(self, policy_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do( "DELETE", f"/api/2.0/accounts/{self._api.account_id}/federationPolicies/{policy_id}", headers=headers @@ -1066,9 +1003,7 @@ def get(self, policy_id: str) -> FederationPolicy: :returns: :class:`FederationPolicy` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/federationPolicies/{policy_id}", headers=headers @@ -1089,9 +1024,7 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -1126,10 +1059,7 @@ def update( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -1142,9 +1072,6 @@ def update( class CustomAppIntegrationAPI: - """These APIs enable administrators to manage custom OAuth app integrations, which is required for - adding/using Custom OAuth App Integration like Tableau Cloud for Databricks in AWS cloud.""" - def __init__(self, api_client): self._api = api_client @@ -1194,10 +1121,7 @@ def create( body["token_access_policy"] = token_access_policy.as_dict() if user_authorized_scopes is not None: body["user_authorized_scopes"] = [v for v in user_authorized_scopes] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", @@ -1216,9 +1140,7 @@ def delete(self, integration_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do( "DELETE", @@ -1235,9 +1157,7 @@ def get(self, integration_id: str) -> GetCustomAppIntegrationOutput: :returns: :class:`GetCustomAppIntegrationOutput` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -1253,7 +1173,7 @@ def list( page_size: Optional[int] = None, page_token: Optional[str] = None, ) -> Iterator[GetCustomAppIntegrationOutput]: - """Get the list of custom OAuth app integrations for the specified Databricks account + """Get the list of custom OAuth app integrations for the specified :param include_creator_username: bool (optional) :param page_size: int (optional) @@ -1269,9 +1189,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -1323,10 +1241,7 @@ def update( body["token_access_policy"] = token_access_policy.as_dict() if user_authorized_scopes is not None: body["user_authorized_scopes"] = [v for v in user_authorized_scopes] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} self._api.do( "PATCH", @@ -1337,17 +1252,13 @@ def update( class OAuthPublishedAppsAPI: - """These APIs enable administrators to view all the available published OAuth applications in Databricks. - Administrators can add the published OAuth applications to their account through the OAuth Published App - Integration APIs.""" - def __init__(self, api_client): self._api = api_client def list( self, *, page_size: Optional[int] = None, page_token: Optional[str] = None ) -> Iterator[PublishedAppOutput]: - """Get all the available published OAuth apps in Databricks. + """Get all the available published OAuth apps in . :param page_size: int (optional) The max number of OAuth published apps to return in one page. @@ -1362,9 +1273,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -1379,9 +1288,6 @@ def list( class PublishedAppIntegrationAPI: - """These APIs enable administrators to manage published OAuth app integrations, which is required for - adding/using Published OAuth App Integration like Tableau Desktop for Databricks in AWS cloud.""" - def __init__(self, api_client): self._api = api_client @@ -1406,10 +1312,7 @@ def create( body["app_id"] = app_id if token_access_policy is not None: body["token_access_policy"] = token_access_policy.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", @@ -1429,9 +1332,7 @@ def delete(self, integration_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do( "DELETE", @@ -1447,9 +1348,7 @@ def get(self, integration_id: str) -> GetPublishedAppIntegrationOutput: :returns: :class:`GetPublishedAppIntegrationOutput` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -1461,7 +1360,7 @@ def get(self, integration_id: str) -> GetPublishedAppIntegrationOutput: def list( self, *, page_size: Optional[int] = None, page_token: Optional[str] = None ) -> Iterator[GetPublishedAppIntegrationOutput]: - """Get the list of published OAuth app integrations for the specified Databricks account + """Get the list of published OAuth app integrations for the specified :param page_size: int (optional) :param page_token: str (optional) @@ -1474,9 +1373,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -1507,10 +1404,7 @@ def update(self, integration_id: str, *, token_access_policy: Optional[TokenAcce body = {} if token_access_policy is not None: body["token_access_policy"] = token_access_policy.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} self._api.do( "PATCH", @@ -1521,61 +1415,6 @@ def update(self, integration_id: str, *, token_access_policy: Optional[TokenAcce class ServicePrincipalFederationPolicyAPI: - """These APIs manage service principal federation policies. - - Service principal federation, also known as Workload Identity Federation, allows your automated workloads - running outside of Databricks to securely access Databricks APIs without the need for Databricks secrets. - With Workload Identity Federation, your application (or workload) authenticates to Databricks as a - Databricks service principal, using tokens provided by the workload runtime. - - Databricks strongly recommends using Workload Identity Federation to authenticate to Databricks from - automated workloads, over alternatives such as OAuth client secrets or Personal Access Tokens, whenever - possible. Workload Identity Federation is supported by many popular services, including Github Actions, - Azure DevOps, GitLab, Terraform Cloud, and Kubernetes clusters, among others. - - Workload identity federation is configured in your Databricks account using a service principal federation - policy. A service principal federation policy specifies: - - - which IdP, or issuer, the service principal is allowed to authenticate from - - which workload identity, or subject, is allowed to authenticate as the Databricks service principal - - To configure a federation policy, you provide the following: - - - The required token **issuer**, as specified in the “iss” claim of workload identity tokens. The - issuer is an https URL that identifies the workload identity provider. - - The required token **subject**, as specified in the “sub” claim of workload identity tokens. The - subject uniquely identifies the workload in the workload runtime environment. - - The allowed token **audiences**, as specified in the “aud” claim of workload identity tokens. The - audience is intended to represent the recipient of the token. As long as the audience in the token - matches at least one audience in the policy, the token is considered a match. If unspecified, the - default value is your Databricks account id. - - Optionally, the public keys used to validate the signature of the workload identity tokens, in JWKS - format. If unspecified (recommended), Databricks automatically fetches the public keys from the - issuer’s well known endpoint. Databricks strongly recommends relying on the issuer’s well known - endpoint for discovering public keys. - - An example service principal federation policy, for a Github Actions workload, is: - - .. code-block:: - - issuer: "https://token.actions.githubusercontent.com" - audiences: ["https://github.com/my-github-org"] - subject: "repo:my-github-org/my-repo:environment:prod" - - An example JWT token body that matches this policy and could be used to authenticate to Databricks is: - - .. code-block:: - - { - "iss": "https://token.actions.githubusercontent.com", - "aud": "https://github.com/my-github-org", - "sub": "repo:my-github-org/my-repo:environment:prod" - } - - You may also need to configure the workload runtime to generate tokens for your workloads. - - You do not need to configure an OAuth application in Databricks to use token federation.""" - def __init__(self, api_client): self._api = api_client @@ -1589,7 +1428,7 @@ def create( :param policy: :class:`FederationPolicy` :param policy_id: str (optional) The identifier for the federation policy. The identifier must contain only lowercase alphanumeric - characters, numbers, hyphens, and slashes. If unspecified, the id will be assigned by Databricks. + characters, numbers, hyphens, and slashes. If unspecified, the id will be assigned by . :returns: :class:`FederationPolicy` """ @@ -1598,10 +1437,7 @@ def create( query = {} if policy_id is not None: query["policy_id"] = policy_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", @@ -1623,9 +1459,7 @@ def delete(self, service_principal_id: int, policy_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do( "DELETE", @@ -1644,9 +1478,7 @@ def get(self, service_principal_id: int, policy_id: str) -> FederationPolicy: :returns: :class:`FederationPolicy` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -1673,9 +1505,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -1715,10 +1545,7 @@ def update( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -1731,16 +1558,6 @@ def update( class ServicePrincipalSecretsAPI: - """These APIs enable administrators to manage service principal secrets. - - You can use the generated secrets to obtain OAuth access tokens for a service principal, which can then be - used to access Databricks Accounts and Workspace APIs. For more information, see `Authentication using - OAuth tokens for service principals `__. - - In addition, the generated secrets can be used to configure the Databricks Terraform Provider to - authenticate with the service principal. For more information, see `Databricks Terraform Provider - `__.""" - def __init__(self, api_client): self._api = api_client @@ -1761,10 +1578,7 @@ def create( body = {} if lifetime is not None: body["lifetime"] = lifetime - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", @@ -1818,9 +1632,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -1838,17 +1650,6 @@ def list( class ServicePrincipalSecretsProxyAPI: - """These APIs enable administrators to manage service principal secrets at the workspace level. To use these - APIs, the service principal must be first added to the current workspace. - - You can use the generated secrets to obtain OAuth access tokens for a service principal, which can then be - used to access Databricks Accounts and Workspace APIs. For more information, see `Authentication using - OAuth tokens for service principals `__. - - In addition, the generated secrets can be used to configure the Databricks Terraform Providerto - authenticate with the service principal. For more information, see `Databricks Terraform Provider - `__.""" - def __init__(self, api_client): self._api = api_client @@ -1869,10 +1670,7 @@ def create( body = {} if lifetime is not None: body["lifetime"] = lifetime - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1934,9 +1732,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/pipelines.py b/databricks/sdk/service/pipelines.py index 128eba095..02935510f 100644 --- a/databricks/sdk/service/pipelines.py +++ b/databricks/sdk/service/pipelines.py @@ -25,9 +25,6 @@ ) -from databricks.sdk.service import compute - - _LOG = logging.getLogger("databricks.sdk") @@ -885,31 +882,6 @@ def from_dict(cls, d: Dict[str, Any]) -> Filters: return cls(exclude=d.get("exclude", None), include=d.get("include", None)) -@dataclass -class GetPipelinePermissionLevelsResponse: - permission_levels: Optional[List[PipelinePermissionsDescription]] = None - """Specific permission levels""" - - def as_dict(self) -> dict: - """Serializes the GetPipelinePermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GetPipelinePermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.permission_levels: - body["permission_levels"] = self.permission_levels - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GetPipelinePermissionLevelsResponse: - """Deserializes the GetPipelinePermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", PipelinePermissionsDescription)) - - @dataclass class GetPipelineResponse: cause: Optional[str] = None @@ -2097,10 +2069,10 @@ def from_dict(cls, d: Dict[str, Any]) -> ListPipelineEventsResponse: @dataclass class ListPipelinesResponse: next_page_token: Optional[str] = None - """If present, a token to fetch the next page of pipelines.""" + """If present, a token to fetch the next page of events.""" statuses: Optional[List[PipelineStateInfo]] = None - """The list of pipelines matching the request criteria.""" + """The list of events matching the request criteria.""" def as_dict(self) -> dict: """Serializes the ListPipelinesResponse into a dictionary suitable for use as a JSON request body.""" @@ -2866,115 +2838,6 @@ def from_dict(cls, d: Dict[str, Any]) -> PathPattern: return cls(include=d.get("include", None)) -@dataclass -class PipelineAccessControlRequest: - group_name: Optional[str] = None - """name of the group""" - - permission_level: Optional[PipelinePermissionLevel] = None - - service_principal_name: Optional[str] = None - """application ID of a service principal""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the PipelineAccessControlRequest into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the PipelineAccessControlRequest into a shallow dictionary of its immediate attributes.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> PipelineAccessControlRequest: - """Deserializes the PipelineAccessControlRequest from a dictionary.""" - return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", PipelinePermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class PipelineAccessControlResponse: - all_permissions: Optional[List[PipelinePermission]] = None - """All permissions.""" - - display_name: Optional[str] = None - """Display name of the user or service principal.""" - - group_name: Optional[str] = None - """name of the group""" - - service_principal_name: Optional[str] = None - """Name of the service principal.""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the PipelineAccessControlResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the PipelineAccessControlResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.all_permissions: - body["all_permissions"] = self.all_permissions - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> PipelineAccessControlResponse: - """Deserializes the PipelineAccessControlResponse from a dictionary.""" - return cls( - all_permissions=_repeated_dict(d, "all_permissions", PipelinePermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - @dataclass class PipelineCluster: apply_policy_default_values: Optional[bool] = None @@ -3000,10 +2863,10 @@ class PipelineCluster: ``$destination/$clusterId/executor``.""" custom_tags: Optional[Dict[str, str]] = None - """Additional tags for cluster resources. Databricks will tag all cluster resources (e.g., AWS + """Additional tags for cluster resources. will tag all cluster resources (e.g., AWS instances and EBS volumes) with these tags in addition to ``default_tags``. Notes: - - Currently, Databricks allows at most 45 custom tags + - Currently, allows at most 45 custom tags - Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster tags""" @@ -3417,7 +3280,7 @@ class PipelineLibrary: """Specification of a maven library to be installed.""" notebook: Optional[NotebookLibrary] = None - """The path to a notebook that defines a pipeline and is stored in the Databricks workspace.""" + """The path to a notebook that defines a pipeline and is stored in the workspace.""" whl: Optional[str] = None """URI of the whl to be installed.""" @@ -3469,128 +3332,6 @@ def from_dict(cls, d: Dict[str, Any]) -> PipelineLibrary: ) -@dataclass -class PipelinePermission: - inherited: Optional[bool] = None - - inherited_from_object: Optional[List[str]] = None - - permission_level: Optional[PipelinePermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the PipelinePermission into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the PipelinePermission into a shallow dictionary of its immediate attributes.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> PipelinePermission: - """Deserializes the PipelinePermission from a dictionary.""" - return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", PipelinePermissionLevel), - ) - - -class PipelinePermissionLevel(Enum): - """Permission level""" - - CAN_MANAGE = "CAN_MANAGE" - CAN_RUN = "CAN_RUN" - CAN_VIEW = "CAN_VIEW" - IS_OWNER = "IS_OWNER" - - -@dataclass -class PipelinePermissions: - access_control_list: Optional[List[PipelineAccessControlResponse]] = None - - object_id: Optional[str] = None - - object_type: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the PipelinePermissions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - def as_shallow_dict(self) -> dict: - """Serializes the PipelinePermissions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.access_control_list: - body["access_control_list"] = self.access_control_list - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> PipelinePermissions: - """Deserializes the PipelinePermissions from a dictionary.""" - return cls( - access_control_list=_repeated_dict(d, "access_control_list", PipelineAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), - ) - - -@dataclass -class PipelinePermissionsDescription: - description: Optional[str] = None - - permission_level: Optional[PipelinePermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the PipelinePermissionsDescription into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the PipelinePermissionsDescription into a shallow dictionary of its immediate attributes.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> PipelinePermissionsDescription: - """Deserializes the PipelinePermissionsDescription from a dictionary.""" - return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", PipelinePermissionLevel), - ) - - @dataclass class PipelineSpec: budget_policy_id: Optional[str] = None @@ -3663,7 +3404,7 @@ class PipelineSpec: root_path: Optional[str] = None """Root path for this pipeline. This is used as the root directory when editing the pipeline in the - Databricks user interface and it is added to sys.path when executing Python sources during + user interface and it is added to sys.path when executing Python sources during pipeline execution.""" schema: Optional[str] = None @@ -4001,7 +3742,7 @@ class PipelinesEnvironment: dependency is a pip requirement file line https://pip.pypa.io/en/stable/reference/requirements-file-format/ Allowed dependency could be , , (WSFS or Volumes in - Databricks), """ + ), """ environment_version: Optional[str] = None """The environment version of the serverless Python environment used to execute customer Python @@ -4009,8 +3750,8 @@ class PipelinesEnvironment: pre-installed libraries with defined versions, providing a stable and reproducible execution environment. - Databricks supports a three-year lifecycle for each environment version. For available versions - and their included packages, see + supports a three-year lifecycle for each environment version. For available + versions and their included packages, see https://docs.databricks.com/aws/en/release-notes/serverless/environment-version/ The value should be a string representing the environment version number, for example: ``"4"``.""" @@ -5714,18 +5455,6 @@ def from_dict(cls, d: Dict[str, Any]) -> ZendeskSupportOptions: class PipelinesAPI: - """The Lakeflow Spark Declarative Pipelines API allows you to create, edit, delete, start, and view details - about pipelines. - - Spark Declarative Pipelines is a framework for building reliable, maintainable, and testable data - processing pipelines. You define the transformations to perform on your data, and Spark Declarative - Pipelines manages task orchestration, cluster management, monitoring, data quality, and error handling. - - Instead of defining your data pipelines using a series of separate Apache Spark tasks, Spark Declarative - Pipelines manages how your data is transformed based on a target schema you define for each processing - step. You can also enforce data quality with Spark Declarative Pipelines expectations. Expectations allow - you to define expected data quality and specify how to handle records that fail those expectations.""" - def __init__(self, api_client): self._api = api_client @@ -5770,9 +5499,7 @@ def apply_environment(self, pipeline_id: str) -> ApplyEnvironmentRequestResponse :returns: :class:`ApplyEnvironmentRequestResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5881,8 +5608,8 @@ def clone( Restart window of this pipeline. :param root_path: str (optional) Root path for this pipeline. This is used as the root directory when editing the pipeline in the - Databricks user interface and it is added to sys.path when executing Python sources during pipeline - execution. + user interface and it is added to sys.path when executing Python sources during + pipeline execution. :param schema: str (optional) The default schema (database) where tables are read from or published to. :param serverless: bool (optional) @@ -5971,10 +5698,7 @@ def clone( body["trigger"] = trigger.as_dict() if usage_policy_id is not None: body["usage_policy_id"] = usage_policy_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -6079,8 +5803,8 @@ def create( Restart window of this pipeline. :param root_path: str (optional) Root path for this pipeline. This is used as the root directory when editing the pipeline in the - Databricks user interface and it is added to sys.path when executing Python sources during pipeline - execution. + user interface and it is added to sys.path when executing Python sources during + pipeline execution. :param run_as: :class:`RunAs` (optional) :param schema: str (optional) The default schema (database) where tables are read from or published to. @@ -6172,10 +5896,7 @@ def create( body["trigger"] = trigger.as_dict() if usage_policy_id is not None: body["usage_policy_id"] = usage_policy_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -6186,7 +5907,7 @@ def create( def delete(self, pipeline_id: str, *, cascade: Optional[bool] = None, force: Optional[bool] = None): """Deletes a pipeline. If the pipeline publishes to Unity Catalog, pipeline deletion will cascade to all - pipeline tables. Please reach out to Databricks support for assistance to undo this action. + pipeline tables. Please reach out to support for assistance to undo this action. :param pipeline_id: str :param cascade: bool (optional) @@ -6204,9 +5925,7 @@ def delete(self, pipeline_id: str, *, cascade: Optional[bool] = None, force: Opt query["cascade"] = cascade if force is not None: query["force"] = force - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -6222,9 +5941,7 @@ def get(self, pipeline_id: str) -> GetPipelineResponse: :returns: :class:`GetPipelineResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -6233,46 +5950,6 @@ def get(self, pipeline_id: str) -> GetPipelineResponse: res = self._api.do("GET", f"/api/2.0/pipelines/{pipeline_id}", headers=headers) return GetPipelineResponse.from_dict(res) - def get_permission_levels(self, pipeline_id: str) -> GetPipelinePermissionLevelsResponse: - """Gets the permission levels that a user can have on an object. - - :param pipeline_id: str - The pipeline for which to get or manage permissions. - - :returns: :class:`GetPipelinePermissionLevelsResponse` - """ - - 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/permissions/pipelines/{pipeline_id}/permissionLevels", headers=headers) - return GetPipelinePermissionLevelsResponse.from_dict(res) - - def get_permissions(self, pipeline_id: str) -> PipelinePermissions: - """Gets the permissions of a pipeline. Pipelines can inherit permissions from their root object. - - :param pipeline_id: str - The pipeline for which to get or manage permissions. - - :returns: :class:`PipelinePermissions` - """ - - 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/permissions/pipelines/{pipeline_id}", headers=headers) - return PipelinePermissions.from_dict(res) - def get_update(self, pipeline_id: str, update_id: str) -> GetUpdateResponse: """Gets an update from an active pipeline. @@ -6284,9 +5961,7 @@ def get_update(self, pipeline_id: str, update_id: str) -> GetUpdateResponse: :returns: :class:`GetUpdateResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -6343,9 +6018,7 @@ def list_pipeline_events( query["order_by"] = [v for v in order_by] if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -6380,9 +6053,9 @@ def list_pipelines( Composite filters are not supported. This field is optional. :param max_results: int (optional) The maximum number of entries to return in a single page. The system may return fewer than - max_results pipelines in a response, even if there are more pipelines available. This field is - optional. The default value is 25. The maximum value is 100. An error is returned if the value of - max_results is greater than 100. + max_results events in a response, even if there are more events available. This field is optional. + The default value is 25. The maximum value is 100. An error is returned if the value of max_results + is greater than 100. :param order_by: List[str] (optional) A list of strings specifying the order of results. Supported order_by fields are id and name. The default is id asc. This field is optional. @@ -6401,9 +6074,7 @@ def list_pipelines( query["order_by"] = [v for v in order_by] if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -6447,9 +6118,7 @@ def list_updates( query["page_token"] = page_token if until_update_id is not None: query["until_update_id"] = until_update_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -6458,34 +6127,6 @@ def list_updates( res = self._api.do("GET", f"/api/2.0/pipelines/{pipeline_id}/updates", query=query, headers=headers) return ListUpdatesResponse.from_dict(res) - def set_permissions( - self, pipeline_id: str, *, access_control_list: Optional[List[PipelineAccessControlRequest]] = None - ) -> PipelinePermissions: - """Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct - permissions if none are specified. Objects can inherit permissions from their root object. - - :param pipeline_id: str - The pipeline for which to get or manage permissions. - :param access_control_list: List[:class:`PipelineAccessControlRequest`] (optional) - - :returns: :class:`PipelinePermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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("PUT", f"/api/2.0/permissions/pipelines/{pipeline_id}", body=body, headers=headers) - return PipelinePermissions.from_dict(res) - def start_update( self, pipeline_id: str, @@ -6552,10 +6193,7 @@ def start_update( body["rewind_spec"] = rewind_spec.as_dict() if validate_only is not None: body["validate_only"] = validate_only - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -6575,9 +6213,7 @@ def stop(self, pipeline_id: str) -> Wait[GetPipelineResponse]: See :method:wait_get_pipeline_idle for more details. """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -6689,8 +6325,8 @@ def update( Restart window of this pipeline. :param root_path: str (optional) Root path for this pipeline. This is used as the root directory when editing the pipeline in the - Databricks user interface and it is added to sys.path when executing Python sources during pipeline - execution. + user interface and it is added to sys.path when executing Python sources during + pipeline execution. :param run_as: :class:`RunAs` (optional) :param schema: str (optional) The default schema (database) where tables are read from or published to. @@ -6782,40 +6418,10 @@ def update( body["trigger"] = trigger.as_dict() if usage_policy_id is not None: body["usage_policy_id"] = usage_policy_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PUT", f"/api/2.0/pipelines/{pipeline_id}", body=body, headers=headers) - - def update_permissions( - self, pipeline_id: str, *, access_control_list: Optional[List[PipelineAccessControlRequest]] = None - ) -> PipelinePermissions: - """Updates the permissions on a pipeline. Pipelines can inherit permissions from their root object. - - :param pipeline_id: str - The pipeline for which to get or manage permissions. - :param access_control_list: List[:class:`PipelineAccessControlRequest`] (optional) - - :returns: :class:`PipelinePermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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/permissions/pipelines/{pipeline_id}", body=body, headers=headers) - return PipelinePermissions.from_dict(res) diff --git a/databricks/sdk/service/postgres.py b/databricks/sdk/service/postgres.py index 235e4409d..4dd11e028 100644 --- a/databricks/sdk/service/postgres.py +++ b/databricks/sdk/service/postgres.py @@ -142,7 +142,7 @@ def from_dict(cls, d: Dict[str, Any]) -> BranchOperationMetadata: class BranchSpec: expire_time: Optional[Timestamp] = None """Absolute expiration timestamp. When set, the branch will expire at this time. Mutually exclusive - with ``ttl`` and ``no_expiry``.""" + with ``ttl`` and ``no_expiry``. When updating, use ``spec.expiration`` in the update_mask.""" is_protected: Optional[bool] = None """When set to true, protects the branch from deletion and reset. Associated compute endpoints and @@ -151,7 +151,7 @@ class BranchSpec: no_expiry: Optional[bool] = None """Explicitly disable expiration. When set to true, the branch will not expire. If set to false, the request is invalid; provide either ttl or expire_time instead. Mutually exclusive with - ``expire_time`` and ``ttl``.""" + ``expire_time`` and ``ttl``. When updating, use ``spec.expiration`` in the update_mask.""" source_branch: Optional[str] = None """The name of the source branch from which this branch was created (data lineage for point-in-time @@ -172,7 +172,8 @@ class BranchSpec: ttl: Optional[Duration] = None """Relative time-to-live duration. When set, the branch will expire at creation_time + ttl. - Mutually exclusive with ``expire_time`` and ``no_expiry``.""" + Mutually exclusive with ``expire_time`` and ``no_expiry``. When updating, use + ``spec.expiration`` in the update_mask.""" def as_dict(self) -> dict: """Serializes the BranchSpec into a dictionary suitable for use as a JSON request body.""" @@ -1721,14 +1722,15 @@ class EndpointSpec: no_suspension: Optional[bool] = None """When set to true, explicitly disables automatic suspension (never suspend). Should be set to - true when provided. Mutually exclusive with ``suspend_timeout_duration``.""" + true when provided. Mutually exclusive with ``suspend_timeout_duration``. When updating, use + ``spec.suspension`` in the update_mask.""" settings: Optional[EndpointSettings] = None suspend_timeout_duration: Optional[Duration] = None """Duration of inactivity after which the compute endpoint is automatically suspended. If specified should be between 60s and 604800s (1 minute to 1 week). Mutually exclusive with - ``no_suspension``.""" + ``no_suspension``. When updating, use ``spec.suspension`` in the update_mask.""" def as_dict(self) -> dict: """Serializes the EndpointSpec into a dictionary suitable for use as a JSON request body.""" @@ -2695,7 +2697,8 @@ class ProjectDefaultEndpointSettings: no_suspension: Optional[bool] = None """When set to true, explicitly disables automatic suspension (never suspend). Should be set to - true when provided. Mutually exclusive with ``suspend_timeout_duration``.""" + true when provided. Mutually exclusive with ``suspend_timeout_duration``. When updating, use + ``spec.project_default_settings.suspension`` in the update_mask.""" pg_settings: Optional[Dict[str, str]] = None """A raw representation of Postgres settings.""" @@ -2703,7 +2706,8 @@ class ProjectDefaultEndpointSettings: suspend_timeout_duration: Optional[Duration] = None """Duration of inactivity after which the compute endpoint is automatically suspended. If specified should be between 60s and 604800s (1 minute to 1 week). Mutually exclusive with - ``no_suspension``.""" + ``no_suspension``. When updating, use ``spec.project_default_settings.suspension`` in the + update_mask.""" def as_dict(self) -> dict: """Serializes the ProjectDefaultEndpointSettings into a dictionary suitable for use as a JSON request body.""" @@ -3187,8 +3191,8 @@ class RoleAuthMethod(Enum): class RoleIdentityType(Enum): - """The type of the Databricks managed identity that this Role represents. Leave empty if you wish - to create a regular Postgres role not associated with a Databricks identity.""" + """The type of the managed identity that this Role represents. Leave empty if you wish + to create a regular Postgres role not associated with a identity.""" GROUP = "GROUP" SERVICE_PRINCIPAL = "SERVICE_PRINCIPAL" @@ -3229,7 +3233,7 @@ class RoleRoleSpec: Supported values: - LAKEBASE_OAUTH_V1: the role authenticates by presenting a Databricks OAuth access token - derived from the backing managed identity (the Databricks user, service principal, or group + derived from the backing managed identity (the user, service principal, or group named by the role's ``postgres_role``). No static password exists for roles using this method. - PG_PASSWORD_SCRAM_SHA_256: the role authenticates with a Postgres password verified server-side using the SCRAM-SHA-256 mechanism. Lakebase generates a password for the role. @@ -3242,7 +3246,7 @@ class RoleRoleSpec: - For the managed identities, OAUTH is used. - For the regular postgres roles, authentication based on postgres passwords is used. - NOTE: for the Databricks identity type GROUP, LAKEBASE_OAUTH_V1 is the default auth method + NOTE: for the identity type GROUP, LAKEBASE_OAUTH_V1 is the default auth method (group can login as well).""" identity_type: Optional[RoleIdentityType] = None @@ -3263,12 +3267,8 @@ class RoleRoleSpec: Required when creating the Role. - If you wish to create a Postgres Role backed by a managed Databricks identity, then - postgres_role must be one of the following: - - 1. user email for IdentityType.USER - 2. app ID for IdentityType.SERVICE_PRINCIPAL - 3. group name for IdentityType.GROUP""" + If you wish to create a Postgres Role backed by a managed identity, then + postgres_role must be one of the following:""" def as_dict(self) -> dict: """Serializes the RoleRoleSpec into a dictionary suitable for use as a JSON request body.""" @@ -4332,18 +4332,7 @@ def from_dict(cls, d: Dict[str, Any]) -> WeeklySchedule: class PostgresAPI: - """Use the Postgres API to create and manage Lakebase Autoscaling Postgres infrastructure, including - projects, branches, compute endpoints, and roles. - - This API manages database infrastructure only. To query or modify data, use the Data API or direct SQL - connections. - - **About resource IDs and names** - - Resources are identified by hierarchical resource names like - ``projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}``. The ``name`` field on each - resource contains this full path and is output-only. Note that ``name`` refers to this resource path, not - the user-visible ``display_name``.""" + """Front-door (customer facing) service for Brickstore.""" def __init__(self, api_client): self._api = api_client @@ -4374,10 +4363,7 @@ def create_branch( query["branch_id"] = branch_id if replace_existing is not None: query["replace_existing"] = replace_existing - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4402,10 +4388,7 @@ def create_catalog(self, catalog: Catalog, catalog_id: str) -> CreateCatalogOper query = {} if catalog_id is not None: query["catalog_id"] = catalog_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4439,10 +4422,7 @@ def create_cdf_config( query = {} if cdf_config_id is not None: query["cdf_config_id"] = cdf_config_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4465,10 +4445,7 @@ def create_data_api(self, parent: str, data_api: DataApi) -> CreateDataApiOperat body = data_api.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4514,10 +4491,7 @@ def create_database( query["database_id"] = database_id if replace_existing is not None: query["replace_existing"] = replace_existing - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4553,10 +4527,7 @@ def create_endpoint( query["endpoint_id"] = endpoint_id if replace_existing is not None: query["replace_existing"] = replace_existing - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4584,10 +4555,7 @@ def create_project(self, project: Project, project_id: str) -> CreateProjectOper query = {} if project_id is not None: query["project_id"] = project_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4631,10 +4599,7 @@ def create_role( query["replace_existing"] = replace_existing if role_id is not None: query["role_id"] = role_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4662,10 +4627,7 @@ def create_snapshot(self, parent: str, snapshot: Snapshot, snapshot_id: str) -> query = {} if snapshot_id is not None: query["snapshot_id"] = snapshot_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4698,10 +4660,7 @@ def create_synced_table(self, synced_table: SyncedTable, synced_table_id: str) - query = {} if synced_table_id is not None: query["synced_table_id"] = synced_table_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4725,9 +4684,7 @@ def delete_branch(self, name: str, *, purge: Optional[bool] = None) -> DeleteBra query = {} if purge is not None: query["purge"] = purge - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4748,9 +4705,7 @@ def delete_catalog(self, name: str) -> DeleteCatalogOperation: :returns: :class:`Operation` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4778,9 +4733,7 @@ def delete_cdf_config(self, name: str, *, force: Optional[bool] = None) -> Delet query = {} if force is not None: query["force"] = force - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4799,9 +4752,7 @@ def delete_data_api(self, name: str) -> DeleteDataApiOperation: :returns: :class:`Operation` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4821,9 +4772,7 @@ def delete_database(self, name: str) -> DeleteDatabaseOperation: :returns: :class:`Operation` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4843,9 +4792,7 @@ def delete_endpoint(self, name: str) -> DeleteEndpointOperation: :returns: :class:`Operation` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4869,9 +4816,7 @@ def delete_project(self, name: str, *, purge: Optional[bool] = None) -> DeletePr query = {} if purge is not None: query["purge"] = purge - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4899,9 +4844,7 @@ def delete_role(self, name: str, *, reassign_owned_to: Optional[str] = None) -> query = {} if reassign_owned_to is not None: query["reassign_owned_to"] = reassign_owned_to - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4920,9 +4863,7 @@ def delete_snapshot(self, name: str) -> DeleteSnapshotOperation: :returns: :class:`Operation` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4942,9 +4883,7 @@ def delete_synced_table(self, name: str) -> DeleteSyncedTableOperation: :returns: :class:`Operation` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4988,10 +4927,7 @@ def generate_database_credential( body["expire_time"] = expire_time.ToJsonString() if ttl is not None: body["ttl"] = ttl.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5009,9 +4945,7 @@ def get_branch(self, name: str) -> Branch: :returns: :class:`Branch` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5031,9 +4965,7 @@ def get_catalog(self, name: str) -> Catalog: :returns: :class:`Catalog` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5053,9 +4985,7 @@ def get_cdf_config(self, name: str) -> CdfConfig: :returns: :class:`CdfConfig` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5075,9 +5005,7 @@ def get_cdf_status(self, name: str) -> CdfStatus: :returns: :class:`CdfStatus` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5095,9 +5023,7 @@ def get_data_api(self, name: str) -> DataApi: :returns: :class:`DataApi` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5116,9 +5042,7 @@ def get_database(self, name: str) -> Database: :returns: :class:`Database` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5138,9 +5062,7 @@ def get_endpoint(self, name: str) -> Endpoint: :returns: :class:`Endpoint` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5158,9 +5080,7 @@ def get_operation(self, name: str) -> Operation: :returns: :class:`Operation` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5178,9 +5098,7 @@ def get_project(self, name: str) -> Project: :returns: :class:`Project` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5200,9 +5118,7 @@ def get_role(self, name: str) -> Role: :returns: :class:`Role` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5220,9 +5136,7 @@ def get_snapshot(self, name: str) -> Snapshot: :returns: :class:`Snapshot` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5242,9 +5156,7 @@ def get_snapshot_schedule(self, name: str) -> SnapshotSchedule: :returns: :class:`SnapshotSchedule` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5263,9 +5175,7 @@ def get_synced_table(self, name: str) -> SyncedTable: :returns: :class:`SyncedTable` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5304,9 +5214,7 @@ def list_branches( query["page_token"] = page_token if show_deleted is not None: query["show_deleted"] = show_deleted - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5343,9 +5251,7 @@ def list_cdf_configs( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5382,9 +5288,7 @@ def list_cdf_statuses( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5420,9 +5324,7 @@ def list_databases( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5458,9 +5360,7 @@ def list_endpoints( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5498,9 +5398,7 @@ def list_projects( query["page_token"] = page_token if show_deleted is not None: query["show_deleted"] = show_deleted - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5535,9 +5433,7 @@ def list_roles( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5572,9 +5468,7 @@ def list_snapshots( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5598,17 +5492,13 @@ def undelete_branch(self, name: str) -> UndeleteBranchOperation: :returns: :class:`Operation` """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} 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/{name}/undelete", body=body, headers=headers) + res = self._api.do("POST", f"/api/2.0/postgres/{name}/undelete", headers=headers) operation = Operation.from_dict(res) return UndeleteBranchOperation(self, operation) @@ -5621,17 +5511,13 @@ def undelete_project(self, name: str) -> UndeleteProjectOperation: :returns: :class:`Operation` """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} 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/{name}/undelete", body=body, headers=headers) + res = self._api.do("POST", f"/api/2.0/postgres/{name}/undelete", headers=headers) operation = Operation.from_dict(res) return UndeleteProjectOperation(self, operation) @@ -5657,10 +5543,7 @@ def update_branch(self, name: str, branch: Branch, update_mask: FieldMask) -> Up query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5687,10 +5570,7 @@ def update_data_api(self, name: str, data_api: DataApi, update_mask: FieldMask) query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5721,10 +5601,7 @@ def update_database(self, name: str, database: Database, update_mask: FieldMask) query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5756,10 +5633,7 @@ def update_endpoint(self, name: str, endpoint: Endpoint, update_mask: FieldMask) query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5789,10 +5663,7 @@ def update_project(self, name: str, project: Project, update_mask: FieldMask) -> query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5823,10 +5694,7 @@ def update_role(self, name: str, role: Role, update_mask: FieldMask) -> UpdateRo query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5859,10 +5727,7 @@ def update_snapshot_schedule( query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/provisioning.py b/databricks/sdk/service/provisioning.py index fde5bf926..19a618074 100644 --- a/databricks/sdk/service/provisioning.py +++ b/databricks/sdk/service/provisioning.py @@ -415,8 +415,8 @@ class CreateGcpKeyInfo: within the Databricks CP project.""" manual: Optional[bool] = None - """When true, Databricks will not use OAuth to grant the service account access to the KMS key. The - customer is responsible for granting access manually.""" + """When true, will not use OAuth to grant the service account access to the KMS key. + The customer is responsible for granting access manually.""" def as_dict(self) -> dict: """Serializes the CreateGcpKeyInfo into a dictionary suitable for use as a JSON request body.""" @@ -453,7 +453,7 @@ def from_dict(cls, d: Dict[str, Any]) -> CreateGcpKeyInfo: @dataclass class Credential: account_id: Optional[str] = None - """The Databricks account ID that hosts the credential.""" + """The account ID that hosts the credential.""" aws_credentials: Optional[AwsCredentials] = None @@ -461,7 +461,7 @@ class Credential: """Time in epoch milliseconds when the credential was created.""" credentials_id: Optional[str] = None - """Databricks credential configuration ID.""" + """ credential configuration ID.""" credentials_name: Optional[str] = None """The human-readable name of the credential configuration object.""" @@ -548,7 +548,7 @@ class CustomerFacingStorageMode(Enum): @dataclass class CustomerManagedKey: account_id: Optional[str] = None - """The Databricks account ID that holds the customer-managed key.""" + """The account ID that holds the customer-managed key.""" aws_key_info: Optional[AwsKeyInfo] = None @@ -684,8 +684,8 @@ class GcpKeyInfo: within the Databricks CP project.""" manual: Optional[bool] = None - """When true, Databricks will not use OAuth to grant the service account access to the KMS key. The - customer is responsible for granting access manually.""" + """When true, will not use OAuth to grant the service account access to the KMS key. + The customer is responsible for granting access manually.""" def as_dict(self) -> dict: """Serializes the GcpKeyInfo into a dictionary suitable for use as a JSON request body.""" @@ -996,7 +996,7 @@ class KeyUseCase(Enum): @dataclass class Network: account_id: Optional[str] = None - """The Databricks account ID associated with this network configuration.""" + """The account ID associated with this network configuration.""" creation_time: Optional[int] = None """Time in epoch milliseconds when the network was created.""" @@ -1007,7 +1007,7 @@ class Network: gcp_network_info: Optional[GcpNetworkInfo] = None network_id: Optional[str] = None - """The Databricks network configuration ID.""" + """The network configuration ID.""" network_name: Optional[str] = None """The human-readable name of the network configuration.""" @@ -1150,7 +1150,7 @@ def from_dict(cls, d: Dict[str, Any]) -> NetworkHealth: @dataclass class NetworkVpcEndpoints: dataplane_relay: Optional[List[str]] = None - """The VPC endpoint ID used by this network to access the Databricks secure cluster connectivity + """The VPC endpoint ID used by this network to access the secure cluster connectivity relay.""" rest_api: Optional[List[str]] = None @@ -1230,13 +1230,13 @@ class PrivateAccessSettings: """""" account_id: Optional[str] = None - """The Databricks account ID that hosts the private access settings.""" + """The account ID that hosts the private access settings.""" allowed_vpc_endpoint_ids: Optional[List[str]] = None - """An array of Databricks VPC endpoint IDs. This is the Databricks ID that is returned when - registering the VPC endpoint configuration in your Databricks account. This is not the ID of the - VPC endpoint in AWS. Only used when private_access_level is set to ENDPOINT. This is an allow - list of VPC endpoints that in your account that can connect to your workspace over AWS + """An array of Databricks VPC endpoint IDs. This is the ID that is returned when + registering the VPC endpoint configuration in your account. This is not the ID of + the VPC endpoint in AWS. Only used when private_access_level is set to ENDPOINT. This is an + allow list of VPC endpoints that in your account that can connect to your workspace over AWS PrivateLink. If hybrid access to your workspace is enabled by setting public_access_enabled to true, this control only works for PrivateLink connections. To control how your workspace is accessed via public internet, see IP access lists.""" @@ -1244,12 +1244,12 @@ class PrivateAccessSettings: private_access_level: Optional[PrivateAccessLevel] = None """The private access level controls which VPC endpoints can connect to the UI or API of any workspace that attaches this private access settings object. ``ACCOUNT`` level access (the - default) allows only VPC endpoints that are registered in your Databricks account connect to + default) allows only VPC endpoints that are registered in your account connect to your workspace. ``ENDPOINT`` level access allows only specified VPC endpoints connect to your workspace. For details, see allowed_vpc_endpoint_ids.""" private_access_settings_id: Optional[str] = None - """Databricks private access settings ID.""" + """ private access settings ID.""" private_access_settings_name: Optional[str] = None """The human-readable name of the private access settings object.""" @@ -1342,7 +1342,7 @@ def from_dict(cls, d: Dict[str, Any]) -> RootBucketInfo: @dataclass class StorageConfiguration: account_id: Optional[str] = None - """The Databricks account ID associated with this storage configuration.""" + """The account ID associated with this storage configuration.""" creation_time: Optional[int] = None """Time in epoch milliseconds when the storage configuration was created.""" @@ -1358,7 +1358,7 @@ class StorageConfiguration: """The root bucket information for the storage configuration.""" storage_configuration_id: Optional[str] = None - """Databricks storage configuration ID.""" + """ storage configuration ID.""" storage_configuration_name: Optional[str] = None """The human-readable name of the storage configuration.""" @@ -1440,13 +1440,13 @@ class VpcEndpoint: """""" account_id: Optional[str] = None - """The Databricks account ID that hosts the VPC endpoint configuration.""" + """The account ID that hosts the VPC endpoint configuration.""" aws_account_id: Optional[str] = None """The AWS Account in which the VPC endpoint object exists.""" aws_endpoint_service_id: Optional[str] = None - """The ID of the Databricks `endpoint service + """The ID of the `endpoint service `__ that this VPC endpoint is connected to. For a list of endpoint service IDs for each supported AWS region, see the `Databricks PrivateLink documentation @@ -1468,13 +1468,13 @@ class VpcEndpoint: use_case: Optional[EndpointUseCase] = None """This enumeration represents the type of Databricks VPC endpoint service that was used when - creating this VPC endpoint. If the VPC endpoint connects to the Databricks control plane for + creating this VPC endpoint. If the VPC endpoint connects to the control plane for either the front-end connection or the back-end REST API connection, the value is - GENERAL_ACCESS. If the VPC endpoint connects to the Databricks workspace for the back-end secure - cluster connectivity relay, the value is DATAPLANE_RELAY_ACCESS.""" + GENERAL_ACCESS. If the VPC endpoint connects to the workspace for the back-end + secure cluster connectivity relay, the value is DATAPLANE_RELAY_ACCESS.""" vpc_endpoint_id: Optional[str] = None - """Databricks VPC endpoint ID. This is the Databricks-specific name of the VPC endpoint. Do not + """Databricks VPC endpoint ID. This is the -specific name of the VPC endpoint. Do not confuse this with the ``aws_vpc_endpoint_id``, which is the ID within AWS of the VPC endpoint.""" vpc_endpoint_name: Optional[str] = None @@ -1562,7 +1562,7 @@ class WarningType(Enum): @dataclass class Workspace: account_id: Optional[str] = None - """Databricks account ID.""" + """ account ID.""" aws_region: Optional[str] = None @@ -1624,7 +1624,7 @@ class Workspace: either front-end (user-to-workspace connection), back-end (data plane to control plane connection), or both connection types. - Before configuring PrivateLink, read the `Databricks article about PrivateLink + Before configuring PrivateLink, read the ` article about PrivateLink `__.",""" storage_configuration_id: Optional[str] = None @@ -1810,7 +1810,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 + workspace will use. The network config for GCP workspace with managed network. This object is input-only and will not be provided when listing workspaces.""" network_id: Optional[str] = None @@ -1867,19 +1867,14 @@ class WorkspaceStatus(Enum): class CredentialsAPI: - """These APIs manage credential configurations for this workspace. Databricks needs access to a cross-account - service IAM role in your AWS account so that Databricks can deploy clusters in the appropriate VPC for the - new workspace. A credential configuration encapsulates this role information, and its ID is used when - creating a new workspace.""" - def __init__(self, api_client): self._api = api_client def create(self, credentials_name: str, aws_credentials: CreateCredentialAwsCredentials) -> Credential: - """Creates a Databricks credential configuration that represents cloud cross-account credentials for a - specified account. Databricks uses this to set up network infrastructure properly to host Databricks - clusters. For your AWS IAM role, you need to trust the External ID (the Databricks Account API account - ID) in the returned credential object, and configure the required access policy. + """Creates a credential configuration that represents cloud cross-account credentials for a + specified account. uses this to set up network infrastructure properly to host + clusters. For your AWS IAM role, you need to trust the External ID (the Databricks + Account API account ID) in the returned credential object, and configure the required access policy. Save the response's ``credentials_id`` field, which is the ID for your new credential configuration object. @@ -1899,17 +1894,14 @@ def create(self, credentials_name: str, aws_credentials: CreateCredentialAwsCred body["aws_credentials"] = aws_credentials.as_dict() if credentials_name is not None: body["credentials_name"] = credentials_name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do("POST", f"/api/2.0/accounts/{self._api.account_id}/credentials", body=body, headers=headers) return Credential.from_dict(res) def delete(self, credentials_id: str) -> Credential: - """Deletes a Databricks credential configuration object for an account, both specified by ID. You cannot - delete a credential that is associated with any workspace. + """Deletes a credential configuration object for an account, both specified by ID. You + cannot delete a credential that is associated with any workspace. :param credentials_id: str Databricks Account API credential configuration ID @@ -1917,9 +1909,7 @@ def delete(self, credentials_id: str) -> Credential: :returns: :class:`Credential` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "DELETE", f"/api/2.0/accounts/{self._api.account_id}/credentials/{credentials_id}", headers=headers @@ -1927,7 +1917,7 @@ def delete(self, credentials_id: str) -> Credential: return Credential.from_dict(res) def get(self, credentials_id: str) -> Credential: - """Gets a Databricks credential configuration object for an account, both specified by ID. + """Gets a credential configuration object for an account, both specified by ID. :param credentials_id: str Credential configuration ID @@ -1935,9 +1925,7 @@ def get(self, credentials_id: str) -> Credential: :returns: :class:`Credential` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/credentials/{credentials_id}", headers=headers @@ -1945,35 +1933,19 @@ def get(self, credentials_id: str) -> Credential: return Credential.from_dict(res) def list(self) -> Iterator[Credential]: - """List Databricks credential configuration objects for an account, specified by ID. + """List credential configuration objects for an account, specified by ID. :returns: Iterator over :class:`Credential` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/credentials", headers=headers) return [Credential.from_dict(v) for v in res] class EncryptionKeysAPI: - """These APIs manage encryption key configurations for this workspace (optional). A key configuration - encapsulates the AWS KMS key information and some information about how the key configuration can be used. - There are two possible uses for key configurations: - - - Managed services: A key configuration can be used to encrypt a workspace's notebook and secret data in - the control plane, as well as Databricks SQL queries and query history. - - Storage: A key configuration can be used to encrypt a workspace's DBFS and EBS data in the data plane. - - In both of these cases, the key configuration's ID is used when creating a new workspace. This Preview - feature is available if your account is on the E2 version of the platform. Updating a running workspace - with workspace storage encryption requires that the workspace is on the E2 version of the platform. If you - have an older workspace, it might not be on the E2 version of the platform. If you are not sure, contact - your Databricks representative.""" - def __init__(self, api_client): self._api = api_client @@ -1986,15 +1958,15 @@ def create( gcp_key_info: Optional[CreateGcpKeyInfo] = None, ) -> CustomerManagedKey: """Creates a customer-managed key configuration object for an account, specified by ID. This operation - uploads a reference to a customer-managed key to Databricks. If the key is assigned as a workspace's - customer-managed key for managed services, Databricks uses the key to encrypt the workspaces notebooks - and secrets in the control plane, in addition to Databricks SQL queries and query history. If it is - specified as a workspace's customer-managed key for workspace storage, the key encrypts the + uploads a reference to a customer-managed key to . If the key is assigned as a workspace's + customer-managed key for managed services, uses the key to encrypt the workspaces + notebooks and secrets in the control plane, in addition to Databricks SQL queries and query history. + If it is specified as a workspace's customer-managed key for workspace storage, the key encrypts the workspace's root S3 bucket (which contains the workspace's root DBFS and system data) and, optionally, cluster EBS volume data. **Important**: Customer-managed keys are supported only for some deployment types, subscription types, - and AWS regions that currently support creation of Databricks workspaces. + and AWS regions that currently support creation of workspaces. This operation is available only if your account is on the E2 version of the platform or on a select custom plan that allows multiple workspaces per account. @@ -2024,10 +1996,7 @@ def create( body["gcp_key_info"] = gcp_key_info.as_dict() if use_cases is not None: body["use_cases"] = [v.value for v in use_cases] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", f"/api/2.0/accounts/{self._api.account_id}/customer-managed-keys", body=body, headers=headers @@ -2039,14 +2008,12 @@ def delete(self, customer_managed_key_id: str) -> CustomerManagedKey: that is associated with a running workspace. :param customer_managed_key_id: str - Databricks encryption key configuration ID. + encryption key configuration ID. :returns: :class:`CustomerManagedKey` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "DELETE", @@ -2057,12 +2024,12 @@ def delete(self, customer_managed_key_id: str) -> CustomerManagedKey: def get(self, customer_managed_key_id: str) -> CustomerManagedKey: """Gets a customer-managed key configuration object for an account, specified by ID. This operation - uploads a reference to a customer-managed key to Databricks. If assigned as a workspace's - customer-managed key for managed services, Databricks uses the key to encrypt the workspaces notebooks - and secrets in the control plane, in addition to Databricks SQL queries and query history. If it is - specified as a workspace's customer-managed key for storage, the key encrypts the workspace's root S3 - bucket (which contains the workspace's root DBFS and system data) and, optionally, cluster EBS volume - data. + uploads a reference to a customer-managed key to . If assigned as a workspace's + customer-managed key for managed services, uses the key to encrypt the workspaces + notebooks and secrets in the control plane, in addition to Databricks SQL queries and query history. + If it is specified as a workspace's customer-managed key for storage, the key encrypts the workspace's + root S3 bucket (which contains the workspace's root DBFS and system data) and, optionally, cluster EBS + volume data. **Important**: Customer-managed keys are supported only for some deployment types, subscription types, and AWS regions. @@ -2070,14 +2037,12 @@ def get(self, customer_managed_key_id: str) -> CustomerManagedKey: This operation is available only if your account is on the E2 version of the platform.", :param customer_managed_key_id: str - Databricks encryption key configuration ID. + encryption key configuration ID. :returns: :class:`CustomerManagedKey` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -2087,24 +2052,19 @@ def get(self, customer_managed_key_id: str) -> CustomerManagedKey: return CustomerManagedKey.from_dict(res) def list(self) -> Iterator[CustomerManagedKey]: - """Lists Databricks customer-managed key configurations for an account. + """Lists customer-managed key configurations for an account. :returns: Iterator over :class:`CustomerManagedKey` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/customer-managed-keys", headers=headers) return [CustomerManagedKey.from_dict(v) for v in res] class NetworksAPI: - """These APIs manage network configurations for customer-managed VPCs (optional). Its ID is used when - creating a new workspace if you use customer-managed VPCs.""" - def __init__(self, api_client): self._api = api_client @@ -2118,8 +2078,8 @@ def create( vpc_endpoints: Optional[NetworkVpcEndpoints] = None, vpc_id: Optional[str] = None, ) -> Network: - """Creates a Databricks network configuration that represents an VPC and its resources. The VPC will be - used for new Databricks clusters. This requires a pre-existing VPC and subnets. + """Creates a network configuration that represents an VPC and its resources. The VPC will be + used for new clusters. This requires a pre-existing VPC and subnets. :param gcp_network_info: :class:`GcpNetworkInfo` (optional) :param network_name: str (optional) @@ -2151,17 +2111,14 @@ def create( body["vpc_endpoints"] = vpc_endpoints.as_dict() if vpc_id is not None: body["vpc_id"] = vpc_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do("POST", f"/api/2.0/accounts/{self._api.account_id}/networks", body=body, headers=headers) return Network.from_dict(res) def delete(self, network_id: str) -> Network: - """Deletes a Databricks network configuration, which represents a cloud VPC and its resources. You cannot - delete a network that is associated with a workspace. + """Deletes a network configuration, which represents a cloud VPC and its resources. You + cannot delete a network that is associated with a workspace. This operation is available only if your account is on the E2 version of the platform. @@ -2171,15 +2128,13 @@ def delete(self, network_id: str) -> Network: :returns: :class:`Network` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("DELETE", f"/api/2.0/accounts/{self._api.account_id}/networks/{network_id}", headers=headers) return Network.from_dict(res) def get(self, network_id: str) -> Network: - """Gets a Databricks network configuration, which represents a cloud VPC and its resources. + """Gets a network configuration, which represents a cloud VPC and its resources. :param network_id: str Databricks Account API network configuration ID. @@ -2187,31 +2142,25 @@ def get(self, network_id: str) -> Network: :returns: :class:`Network` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/networks/{network_id}", headers=headers) return Network.from_dict(res) def list(self) -> Iterator[Network]: - """Lists Databricks network configurations for an account. + """Lists network configurations for an account. :returns: Iterator over :class:`Network` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/networks", headers=headers) return [Network.from_dict(v) for v in res] class PrivateAccessAPI: - """These APIs manage private access settings for this account.""" - def __init__(self, api_client): self._api = api_client @@ -2229,17 +2178,17 @@ def create( public internet or only from private endpoints. :param allowed_vpc_endpoint_ids: List[str] (optional) - An array of Databricks VPC endpoint IDs. This is the Databricks ID returned when registering the VPC - endpoint configuration in your Databricks account. This is not the ID of the VPC endpoint in AWS. - Only used when private_access_level is set to ENDPOINT. This is an allow list of VPC endpoints - registered in your Databricks account that can connect to your workspace over AWS PrivateLink. Note: - If hybrid access to your workspace is enabled by setting public_access_enabled to true, this control - only works for PrivateLink connections. To control how your workspace is accessed via public + An array of Databricks VPC endpoint IDs. This is the ID returned when registering the + VPC endpoint configuration in your account. This is not the ID of the VPC endpoint in + AWS. Only used when private_access_level is set to ENDPOINT. This is an allow list of VPC endpoints + registered in your account that can connect to your workspace over AWS PrivateLink. + Note: If hybrid access to your workspace is enabled by setting public_access_enabled to true, this + control only works for PrivateLink connections. To control how your workspace is accessed via public internet, see IP access lists. :param private_access_level: :class:`PrivateAccessLevel` (optional) The private access level controls which VPC endpoints can connect to the UI or API of any workspace that attaches this private access settings object. ``ACCOUNT`` level access (the default) allows - only VPC endpoints that are registered in your Databricks account connect to your workspace. + only VPC endpoints that are registered in your account connect to your workspace. ``ENDPOINT`` level access allows only specified VPC endpoints connect to your workspace. For details, see allowed_vpc_endpoint_ids. :param private_access_settings_name: str (optional) @@ -2265,10 +2214,7 @@ def create( body["public_access_enabled"] = public_access_enabled if region is not None: body["region"] = region - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", f"/api/2.0/accounts/{self._api.account_id}/private-access-settings", body=body, headers=headers @@ -2276,16 +2222,14 @@ def create( return PrivateAccessSettings.from_dict(res) def delete(self, private_access_settings_id: str) -> PrivateAccessSettings: - """Deletes a Databricks private access settings configuration, both specified by ID. + """Deletes a private access settings configuration, both specified by ID. :param private_access_settings_id: str :returns: :class:`PrivateAccessSettings` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "DELETE", @@ -2295,16 +2239,14 @@ def delete(self, private_access_settings_id: str) -> PrivateAccessSettings: return PrivateAccessSettings.from_dict(res) def get(self, private_access_settings_id: str) -> PrivateAccessSettings: - """Gets a Databricks private access settings configuration, both specified by ID. + """Gets a private access settings configuration, both specified by ID. :param private_access_settings_id: str :returns: :class:`PrivateAccessSettings` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -2314,15 +2256,13 @@ def get(self, private_access_settings_id: str) -> PrivateAccessSettings: return PrivateAccessSettings.from_dict(res) def list(self) -> Iterator[PrivateAccessSettings]: - """Lists Databricks private access settings for an account. + """Lists private access settings for an account. :returns: Iterator over :class:`PrivateAccessSettings` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/private-access-settings", headers=headers) return [PrivateAccessSettings.from_dict(v) for v in res] @@ -2339,10 +2279,10 @@ def replace( several minutes to propagate to the workspace API. You can share one private access settings object with multiple workspaces in a single account. However, private access settings are specific to AWS regions, so only workspaces in the same AWS region can use a given private access settings object. - Before configuring PrivateLink, read the Databricks article about PrivateLink. + Before configuring PrivateLink, read the article about PrivateLink. :param private_access_settings_id: str - Databricks private access settings ID. + private access settings ID. :param customer_facing_private_access_settings: :class:`PrivateAccessSettings` Properties of the new private access settings object. @@ -2351,14 +2291,11 @@ def replace( body = customer_facing_private_access_settings.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PUT", - f"/api/2.0/accounts/{self._api.account_id}/private-access-settings/{private_access_settings_id}", + f"/api/2.0/accounts/{account_id}/private-access-settings/{private_access_settings_id}", body=body, headers=headers, ) @@ -2366,18 +2303,13 @@ def replace( class StorageAPI: - """These APIs manage storage configurations for this workspace. A root storage S3 bucket in your account is - required to store objects like cluster logs, notebook revisions, and job results. You can also use the - root storage S3 bucket for storage of non-production DBFS data. A storage configuration encapsulates this - bucket information, and its ID is used when creating a new workspace.""" - def __init__(self, api_client): self._api = api_client def create( self, storage_configuration_name: str, root_bucket_info: RootBucketInfo, *, role_arn: Optional[str] = None ) -> StorageConfiguration: - """Creates a Databricks storage configuration for an account. + """Creates a storage configuration for an account. :param storage_configuration_name: str The human-readable name of the storage configuration. @@ -2400,10 +2332,7 @@ def create( body["root_bucket_info"] = root_bucket_info.as_dict() if storage_configuration_name is not None: body["storage_configuration_name"] = storage_configuration_name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", f"/api/2.0/accounts/{self._api.account_id}/storage-configurations", body=body, headers=headers @@ -2411,7 +2340,7 @@ def create( return StorageConfiguration.from_dict(res) def delete(self, storage_configuration_id: str) -> StorageConfiguration: - """Deletes a Databricks storage configuration. You cannot delete a storage configuration that is + """Deletes a storage configuration. You cannot delete a storage configuration that is associated with any workspace. :param storage_configuration_id: str @@ -2419,9 +2348,7 @@ def delete(self, storage_configuration_id: str) -> StorageConfiguration: :returns: :class:`StorageConfiguration` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "DELETE", @@ -2431,16 +2358,14 @@ def delete(self, storage_configuration_id: str) -> StorageConfiguration: return StorageConfiguration.from_dict(res) def get(self, storage_configuration_id: str) -> StorageConfiguration: - """Gets a Databricks storage configuration for an account, both specified by ID. + """Gets a storage configuration for an account, both specified by ID. :param storage_configuration_id: str :returns: :class:`StorageConfiguration` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -2450,23 +2375,19 @@ def get(self, storage_configuration_id: str) -> StorageConfiguration: return StorageConfiguration.from_dict(res) def list(self) -> Iterator[StorageConfiguration]: - """Lists Databricks storage configurations for an account, specified by ID. + """Lists storage configurations for an account, specified by ID. :returns: Iterator over :class:`StorageConfiguration` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/storage-configurations", headers=headers) return [StorageConfiguration.from_dict(v) for v in res] class VpcEndpointsAPI: - """These APIs manage VPC endpoint configurations for this account.""" - def __init__(self, api_client): self._api = api_client @@ -2480,13 +2401,13 @@ def create( ) -> VpcEndpoint: """Creates a VPC endpoint configuration, which represents a `VPC endpoint `__ object in AWS used to - communicate privately with Databricks over `AWS PrivateLink `__. + communicate privately with over `AWS PrivateLink `__. - After you create the VPC endpoint configuration, the Databricks `endpoint service + After you create the VPC endpoint configuration, the `endpoint service `__ automatically accepts the VPC endpoint. - Before configuring PrivateLink, read the `Databricks article about PrivateLink + Before configuring PrivateLink, read the ` article about PrivateLink `__. :param aws_vpc_endpoint_id: str (optional) @@ -2510,10 +2431,7 @@ def create( body["region"] = region if vpc_endpoint_name is not None: body["vpc_endpoint_name"] = vpc_endpoint_name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", f"/api/2.0/accounts/{self._api.account_id}/vpc-endpoints", body=body, headers=headers @@ -2529,9 +2447,7 @@ def delete(self, vpc_endpoint_id: str) -> VpcEndpoint: :returns: :class:`VpcEndpoint` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "DELETE", f"/api/2.0/accounts/{self._api.account_id}/vpc-endpoints/{vpc_endpoint_id}", headers=headers @@ -2541,7 +2457,7 @@ def delete(self, vpc_endpoint_id: str) -> VpcEndpoint: def get(self, vpc_endpoint_id: str) -> VpcEndpoint: """Gets a VPC endpoint configuration, which represents a `VPC endpoint `__ object in AWS used to - communicate privately with Databricks over `AWS PrivateLink `__. + communicate privately with over `AWS PrivateLink `__. :param vpc_endpoint_id: str Databricks VPC endpoint ID. @@ -2549,9 +2465,7 @@ def get(self, vpc_endpoint_id: str) -> VpcEndpoint: :returns: :class:`VpcEndpoint` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/vpc-endpoints/{vpc_endpoint_id}", headers=headers @@ -2565,22 +2479,13 @@ def list(self) -> Iterator[VpcEndpoint]: :returns: Iterator over :class:`VpcEndpoint` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/vpc-endpoints", headers=headers) return [VpcEndpoint.from_dict(v) for v in res] class WorkspacesAPI: - """These APIs manage workspaces for this account. A Databricks workspace is an environment for accessing all - of your Databricks assets. The workspace organizes objects (notebooks, libraries, and experiments) into - folders, and provides access to data and computational resources such as clusters and jobs. - - These endpoints are available if your account is on the E2 version of the platform or on a select custom - plan that allows multiple workspaces per account.""" - def __init__(self, api_client): self._api = api_client @@ -2662,7 +2567,7 @@ def create( Important: Customer-managed VPCs, PrivateLink, and customer-managed keys are supported on a limited set of deployment and subscription types. If you have questions about availability, contact your - Databricks representative. + representative. This operation is available only if your account is on the E2 version of the platform or on a select custom plan that allows multiple workspaces per account. @@ -2689,7 +2594,7 @@ def create( application and REST APIs is .cloud.databricks.com. For example, if the deployment name is abcsales, your workspace URL will be https://abcsales.cloud.databricks.com. Hyphens are allowed. This property supports only the set of characters that are allowed in a - subdomain. To set this value, you must have a deployment name prefix. Contact your Databricks + subdomain. To set this value, you must have a deployment name prefix. Contact your account team to add an account deployment name prefix to your account. Workspace deployment names follow the account prefix and a hyphen. For example, if your account's deployment prefix is acme and the workspace deployment name is workspace-1, the JSON response for the deployment_name field @@ -2721,7 +2626,7 @@ def create( ID of the workspace's private access settings object. Only used for PrivateLink. You must specify this ID if you are using `AWS PrivateLink `__ for either front-end (user-to-workspace connection), back-end (data plane to control plane connection), or both - connection types. Before configuring PrivateLink, read the `Databricks article about PrivateLink + connection types. Before configuring PrivateLink, read the ` article about PrivateLink `__.", :param storage_configuration_id: str (optional) ID of the workspace's storage configuration object. @@ -2774,10 +2679,7 @@ def create( body["storage_customer_managed_key_id"] = storage_customer_managed_key_id if workspace_name is not None: body["workspace_name"] = workspace_name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} op_response = self._api.do( "POST", f"/api/2.0/accounts/{self._api.account_id}/workspaces", body=body, headers=headers @@ -2833,16 +2735,14 @@ def create_and_wait( ).result(timeout=timeout) def delete(self, workspace_id: int) -> Workspace: - """Deletes a Databricks workspace, both specified by ID. + """Deletes a workspace, both specified by ID. :param workspace_id: int :returns: :class:`Workspace` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "DELETE", f"/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}", headers=headers @@ -2850,7 +2750,7 @@ def delete(self, workspace_id: int) -> Workspace: return Workspace.from_dict(res) def get(self, workspace_id: int) -> Workspace: - """Gets information including status for a Databricks workspace, specified by ID. In the response, the + """Gets information including status for a workspace, specified by ID. In the response, the ``workspace_status`` field indicates the current status. After initial workspace creation (which is asynchronous), make repeated ``GET`` requests with the workspace ID and check its status. The workspace becomes available when the status changes to ``RUNNING``. For information about how to @@ -2862,9 +2762,7 @@ def get(self, workspace_id: int) -> Workspace: :returns: :class:`Workspace` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}", headers=headers @@ -2872,15 +2770,13 @@ def get(self, workspace_id: int) -> Workspace: return Workspace.from_dict(res) def list(self) -> Iterator[Workspace]: - """Lists Databricks workspaces for an account. + """Lists workspaces for an account. :returns: Iterator over :class:`Workspace` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/workspaces", headers=headers) return [Workspace.from_dict(v) for v in res] @@ -2894,15 +2790,6 @@ def update( A unique integer ID for the workspace :param customer_facing_workspace: :class:`Workspace` :param update_mask: str (optional) - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: Long-running operation waiter for :class:`Workspace`. @@ -2913,14 +2800,11 @@ def update( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} op_response = self._api.do( "PATCH", - f"/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}", + f"/api/2.0/accounts/{account_id}/workspaces/{workspace_id}", query=query, body=body, headers=headers, diff --git a/databricks/sdk/service/qualitymonitorv2.py b/databricks/sdk/service/qualitymonitorv2.py index 6abfe6a7f..94dc27e87 100644 --- a/databricks/sdk/service/qualitymonitorv2.py +++ b/databricks/sdk/service/qualitymonitorv2.py @@ -314,9 +314,6 @@ def from_dict(cls, d: Dict[str, Any]) -> ValidityCheckConfiguration: class QualityMonitorV2API: - """Deprecated: Please use the Data Quality Monitoring API instead (REST: /api/data-quality/v1/monitors). - Manage data quality of UC objects (currently support ``schema``).""" - def __init__(self, api_client): self._api = api_client @@ -331,10 +328,7 @@ def create_quality_monitor(self, quality_monitor: QualityMonitor) -> QualityMoni body = quality_monitor.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -355,9 +349,7 @@ def delete_quality_monitor(self, object_type: str, object_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -377,9 +369,7 @@ def get_quality_monitor(self, object_type: str, object_id: str) -> QualityMonito :returns: :class:`QualityMonitor` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -405,9 +395,7 @@ def list_quality_monitor( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -439,10 +427,7 @@ def update_quality_monitor( body = quality_monitor.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/sandbox.py b/databricks/sdk/service/sandbox.py index c9f98b747..cec9d5ebe 100644 --- a/databricks/sdk/service/sandbox.py +++ b/databricks/sdk/service/sandbox.py @@ -300,8 +300,7 @@ def from_dict(cls, d: Dict[str, Any]) -> SandboxStatus: class SandboxAPI: - """Create, manage, and control the lifecycle of sandboxes -- isolated, pre-configured, low-latency Serverless - compute environments for running code.""" + """See http://go/protostyleguide/services.""" def __init__(self, api_client): self._api = api_client @@ -321,10 +320,7 @@ def create_sandbox(self, sandbox: Sandbox, sandbox_id: str) -> Sandbox: query = {} if sandbox_id is not None: query["sandbox_id"] = sandbox_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -341,9 +337,7 @@ def delete_sandbox(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -390,10 +384,7 @@ def execute_command_sync( body["envs"] = envs if execution_timeout is not None: body["execution_timeout"] = execution_timeout.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -410,9 +401,7 @@ def get_sandbox(self, name: str) -> Sandbox: :returns: :class:`Sandbox` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -435,9 +424,7 @@ def list_sandboxes(self, *, page_size: Optional[int] = None, page_token: Optiona query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -462,17 +449,13 @@ def start_sandbox(self, name: str) -> Sandbox: :returns: :class:`Sandbox` """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} 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/{name}/start", body=body, headers=headers) + res = self._api.do("POST", f"/api/2.0/{name}/start", headers=headers) return Sandbox.from_dict(res) def stop_sandbox(self, name: str) -> Sandbox: @@ -484,17 +467,13 @@ def stop_sandbox(self, name: str) -> Sandbox: :returns: :class:`Sandbox` """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} 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/{name}/stop", body=body, headers=headers) + res = self._api.do("POST", f"/api/2.0/{name}/stop", headers=headers) return Sandbox.from_dict(res) def update_sandbox(self, name: str, sandbox: Sandbox, update_mask: FieldMask) -> Sandbox: @@ -520,10 +499,7 @@ def update_sandbox(self, name: str, sandbox: Sandbox, update_mask: FieldMask) -> query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/serving.py b/databricks/sdk/service/serving.py index 065cb0ed6..6f36e11d3 100644 --- a/databricks/sdk/service/serving.py +++ b/databricks/sdk/service/serving.py @@ -13,8 +13,6 @@ import time import random import logging -import requests -import threading from ..errors import OperationFailed from databricks.sdk.service._internal import ( @@ -36,7 +34,7 @@ @dataclass class Ai21LabsConfig: ai21labs_api_key: Optional[str] = None - """The Databricks secret key reference for an AI21 Labs API key. If you prefer to paste your API + """The secret key reference for an AI21 Labs API key. If you prefer to paste your API key directly, see ``ai21labs_api_key_plaintext``. You must provide an API key using one of the following fields: ``ai21labs_api_key`` or ``ai21labs_api_key_plaintext``.""" @@ -415,7 +413,7 @@ class AmazonBedrockConfig: Anthropic, Cohere, AI21Labs, Amazon.""" aws_access_key_id: Optional[str] = None - """The Databricks secret key reference for an AWS access key ID with permissions to interact with + """The secret key reference for an AWS access key ID with permissions to interact with Bedrock services. If you prefer to paste your API key directly, see ``aws_access_key_id_plaintext``. You must provide an API key using one of the following fields: ``aws_access_key_id`` or ``aws_access_key_id_plaintext``.""" @@ -427,8 +425,8 @@ class AmazonBedrockConfig: ``aws_access_key_id_plaintext``.""" aws_secret_access_key: Optional[str] = None - """The Databricks secret key reference for an AWS secret access key paired with the access key ID, - with permissions to interact with Bedrock services. If you prefer to paste your API key + """The secret key reference for an AWS secret access key paired with the access key + ID, with permissions to interact with Bedrock services. If you prefer to paste your API key directly, see ``aws_secret_access_key_plaintext``. You must provide an API key using one of the following fields: ``aws_secret_access_key`` or ``aws_secret_access_key_plaintext``.""" @@ -506,7 +504,7 @@ class AmazonBedrockConfigBedrockProvider(Enum): @dataclass class AnthropicConfig: anthropic_api_key: Optional[str] = None - """The Databricks secret key reference for an Anthropic API key. If you prefer to paste your API + """The secret key reference for an Anthropic API key. If you prefer to paste your API key directly, see ``anthropic_api_key_plaintext``. You must provide an API key using one of the following fields: ``anthropic_api_key`` or ``anthropic_api_key_plaintext``.""" @@ -548,8 +546,8 @@ class ApiKeyAuth: """The name of the API key parameter used for authentication.""" value: Optional[str] = None - """The Databricks secret key reference for an API Key. If you prefer to paste your token directly, - see ``value_plaintext``.""" + """The secret key reference for an API Key. If you prefer to paste your token + directly, see ``value_plaintext``.""" value_plaintext: Optional[str] = None """The API Key provided as a plaintext string. If you prefer to reference your token using @@ -731,8 +729,8 @@ def from_dict(cls, d: Dict[str, Any]) -> AutoCaptureState: @dataclass class BearerTokenAuth: token: Optional[str] = None - """The Databricks secret key reference for a token. If you prefer to paste your token directly, see - ``token_plaintext``.""" + """The secret key reference for a token. If you prefer to paste your token directly, + see ``token_plaintext``.""" token_plaintext: Optional[str] = None """The token provided as a plaintext string. If you prefer to reference your token using Databricks @@ -834,7 +832,7 @@ class CohereConfig: unspecified, the standard Cohere base URL is used.""" cohere_api_key: Optional[str] = None - """The Databricks secret key reference for a Cohere API key. If you prefer to paste your API key + """The secret key reference for a Cohere API key. If you prefer to paste your API key directly, see ``cohere_api_key_plaintext``. You must provide an API key using one of the following fields: ``cohere_api_key`` or ``cohere_api_key_plaintext``.""" @@ -959,11 +957,11 @@ def from_dict(cls, d: Dict[str, Any]) -> DataPlaneInfo: @dataclass class DatabricksModelServingConfig: databricks_workspace_url: str - """The URL of the Databricks workspace containing the model serving endpoint pointed to by this + """The URL of the workspace containing the model serving endpoint pointed to by this external model.""" databricks_api_token: Optional[str] = None - """The Databricks secret key reference for a Databricks API token that corresponds to a user or + """The secret key reference for a Databricks API token that corresponds to a user or service principal with Can Query access to the model serving endpoint pointed to by this external model. If you prefer to paste your API key directly, see ``databricks_api_token_plaintext``. You must provide an API key using one of the following @@ -1472,6 +1470,14 @@ def from_dict(cls, d: Dict[str, Any]) -> EndpointTags: @dataclass class ExportMetricsResponse: + """Proto version of com.databricks.rpc.HttpOverRpcResponse. + + This message can be specially handled in UnaryRpcService with JettyRPC when the advanced feature + CustomHandlingForHttpOverRpcProtoResponse is enabled - bypass the RPC serializer and populate + HTTP status, response headers and response body from the proto message directly. + + Don't add/modify the fields before being aware of the implications.""" + contents: Optional[BinaryIO] = None def as_dict(self) -> dict: @@ -1757,6 +1763,8 @@ def from_dict(cls, d: Dict[str, Any]) -> FoundationModel: @dataclass class GetOpenApiResponse: + """The top level proto message that represents an OpenAPI 3.0 document.""" + contents: Optional[BinaryIO] = None def as_dict(self) -> dict: @@ -1779,31 +1787,6 @@ def from_dict(cls, d: Dict[str, Any]) -> GetOpenApiResponse: return cls(contents=d.get("contents", None)) -@dataclass -class GetServingEndpointPermissionLevelsResponse: - permission_levels: Optional[List[ServingEndpointPermissionsDescription]] = None - """Specific permission levels""" - - def as_dict(self) -> dict: - """Serializes the GetServingEndpointPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GetServingEndpointPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.permission_levels: - body["permission_levels"] = self.permission_levels - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GetServingEndpointPermissionLevelsResponse: - """Deserializes the GetServingEndpointPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", ServingEndpointPermissionsDescription)) - - @dataclass class GoogleCloudVertexAiConfig: project_id: str @@ -1815,7 +1798,7 @@ class GoogleCloudVertexAiConfig: only available in specific regions.""" private_key: Optional[str] = None - """The Databricks secret key reference for a private key for the service account which has access + """The secret key reference for a private key for the service account which has access to the Google Cloud Vertex AI Service. See `Bestpractices for managing service account keys `__. If you prefer to paste your API key directly, see ``private_key_plaintext``. You must provide an API @@ -1950,7 +1933,7 @@ class OpenAiConfig: """This field is only required for Azure AD OpenAI and is the Microsoft Entra Client ID.""" microsoft_entra_client_secret: Optional[str] = None - """The Databricks secret key reference for a client secret used for Microsoft Entra ID + """The secret key reference for a client secret used for Microsoft Entra ID authentication. If you prefer to paste your client secret directly, see ``microsoft_entra_client_secret_plaintext``. You must provide an API key using one of the following fields: ``microsoft_entra_client_secret`` or @@ -1972,9 +1955,10 @@ class OpenAiConfig: base URL is used.""" openai_api_key: Optional[str] = None - """The Databricks secret key reference for an OpenAI API key using the OpenAI or Azure service. If - you prefer to paste your API key directly, see ``openai_api_key_plaintext``. You must provide an - API key using one of the following fields: ``openai_api_key`` or ``openai_api_key_plaintext``.""" + """The secret key reference for an OpenAI API key using the OpenAI or Azure service. + If you prefer to paste your API key directly, see ``openai_api_key_plaintext``. You must provide + an API key using one of the following fields: ``openai_api_key`` or + ``openai_api_key_plaintext``.""" openai_api_key_plaintext: Optional[str] = None """The OpenAI API key using the OpenAI or Azure service provided as a plaintext string. If you @@ -2074,7 +2058,7 @@ def from_dict(cls, d: Dict[str, Any]) -> OpenAiConfig: @dataclass class PaLmConfig: palm_api_key: Optional[str] = None - """The Databricks secret key reference for a PaLM API key. If you prefer to paste your API key + """The secret key reference for a PaLM API key. If you prefer to paste your API key directly, see ``palm_api_key_plaintext``. You must provide an API key using one of the following fields: ``palm_api_key`` or ``palm_api_key_plaintext``.""" @@ -2563,13 +2547,13 @@ class ServedEntityInput: environment_vars: Optional[Dict[str, str]] = None """An object containing a set of optional, user-specified environment variable key-value pairs used for serving this entity. Note: this is an experimental feature and subject to change. Example - entity environment variables that refer to Databricks secrets: ``{"OPENAI_API_KEY": + entity environment variables that refer to secrets: ``{"OPENAI_API_KEY": "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": "{{secrets/my_scope2/my_key2}}"}``""" external_model: Optional[ExternalModel] = None """The external model to be served. NOTE: Only one of external_model and (entity_name, entity_version, workload_size, workload_type, and scale_to_zero_enabled) can be specified with - the latter set being used for custom model serving for a Databricks registered model. For an + the latter set being used for custom model serving for a registered model. For an existing endpoint with external_model, it cannot be updated to an endpoint without external_model. If the endpoint is created without external_model, users cannot update it to add external_model later. The task type of all external models within an endpoint must be the same.""" @@ -2613,11 +2597,6 @@ class ServedEntityInput: is 0. Do not use if min_provisioned_concurrency and max_provisioned_concurrency are specified.""" workload_type: Optional[ServingModelWorkloadType] = None - """The workload type of the served entity. The workload type selects which type of compute to use - in the endpoint. The default value for this parameter is "CPU". For deep learning workloads, GPU - acceleration is available by selecting workload types like GPU_SMALL and others. See the - available `GPU types - `__.""" def as_dict(self) -> dict: """Serializes the ServedEntityInput into a dictionary suitable for use as a JSON request body.""" @@ -2733,13 +2712,13 @@ class ServedEntityOutput: environment_vars: Optional[Dict[str, str]] = None """An object containing a set of optional, user-specified environment variable key-value pairs used for serving this entity. Note: this is an experimental feature and subject to change. Example - entity environment variables that refer to Databricks secrets: ``{"OPENAI_API_KEY": + entity environment variables that refer to secrets: ``{"OPENAI_API_KEY": "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": "{{secrets/my_scope2/my_key2}}"}``""" external_model: Optional[ExternalModel] = None """The external model to be served. NOTE: Only one of external_model and (entity_name, entity_version, workload_size, workload_type, and scale_to_zero_enabled) can be specified with - the latter set being used for custom model serving for a Databricks registered model. For an + the latter set being used for custom model serving for a registered model. For an existing endpoint with external_model, it cannot be updated to an endpoint without external_model. If the endpoint is created without external_model, users cannot update it to add external_model later. The task type of all external models within an endpoint must be the same.""" @@ -2787,11 +2766,6 @@ class ServedEntityOutput: is 0. Do not use if min_provisioned_concurrency and max_provisioned_concurrency are specified.""" workload_type: Optional[ServingModelWorkloadType] = None - """The workload type of the served entity. The workload type selects which type of compute to use - in the endpoint. The default value for this parameter is "CPU". For deep learning workloads, GPU - acceleration is available by selecting workload types like GPU_SMALL and others. See the - available `GPU types - `__.""" def as_dict(self) -> dict: """Serializes the ServedEntityOutput into a dictionary suitable for use as a JSON request body.""" @@ -2976,7 +2950,7 @@ class ServedModelInput: environment_vars: Optional[Dict[str, str]] = None """An object containing a set of optional, user-specified environment variable key-value pairs used for serving this entity. Note: this is an experimental feature and subject to change. Example - entity environment variables that refer to Databricks secrets: ``{"OPENAI_API_KEY": + entity environment variables that refer to secrets: ``{"OPENAI_API_KEY": "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": "{{secrets/my_scope2/my_key2}}"}``""" instance_profile_arn: Optional[str] = None @@ -3015,11 +2989,6 @@ class ServedModelInput: is 0. Do not use if min_provisioned_concurrency and max_provisioned_concurrency are specified.""" workload_type: Optional[ServedModelInputWorkloadType] = None - """The workload type of the served entity. The workload type selects which type of compute to use - in the endpoint. The default value for this parameter is "CPU". For deep learning workloads, GPU - acceleration is available by selecting workload types like GPU_SMALL and others. See the - available `GPU types - `__.""" def as_dict(self) -> dict: """Serializes the ServedModelInput into a dictionary suitable for use as a JSON request body.""" @@ -3109,8 +3078,6 @@ def from_dict(cls, d: Dict[str, Any]) -> ServedModelInput: class ServedModelInputWorkloadType(Enum): - """Please keep this in sync with workload types in InferenceEndpointEntities.scala.""" - CPU = "CPU" CPU_LARGE = "CPU_LARGE" CPU_MEDIUM = "CPU_MEDIUM" @@ -3136,7 +3103,7 @@ class ServedModelOutput: environment_vars: Optional[Dict[str, str]] = None """An object containing a set of optional, user-specified environment variable key-value pairs used for serving this entity. Note: this is an experimental feature and subject to change. Example - entity environment variables that refer to Databricks secrets: ``{"OPENAI_API_KEY": + entity environment variables that refer to secrets: ``{"OPENAI_API_KEY": "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": "{{secrets/my_scope2/my_key2}}"}``""" instance_profile_arn: Optional[str] = None @@ -3178,11 +3145,6 @@ class ServedModelOutput: is 0. Do not use if min_provisioned_concurrency and max_provisioned_concurrency are specified.""" workload_type: Optional[ServingModelWorkloadType] = None - """The workload type of the served entity. The workload type selects which type of compute to use - in the endpoint. The default value for this parameter is "CPU". For deep learning workloads, GPU - acceleration is available by selecting workload types like GPU_SMALL and others. See the - available `GPU types - `__.""" def as_dict(self) -> dict: """Serializes the ServedModelOutput into a dictionary suitable for use as a JSON request body.""" @@ -3515,115 +3477,6 @@ def from_dict(cls, d: Dict[str, Any]) -> ServingEndpoint: ) -@dataclass -class ServingEndpointAccessControlRequest: - group_name: Optional[str] = None - """name of the group""" - - permission_level: Optional[ServingEndpointPermissionLevel] = None - - service_principal_name: Optional[str] = None - """application ID of a service principal""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the ServingEndpointAccessControlRequest into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ServingEndpointAccessControlRequest into a shallow dictionary of its immediate attributes.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointAccessControlRequest: - """Deserializes the ServingEndpointAccessControlRequest from a dictionary.""" - return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", ServingEndpointPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class ServingEndpointAccessControlResponse: - all_permissions: Optional[List[ServingEndpointPermission]] = None - """All permissions.""" - - display_name: Optional[str] = None - """Display name of the user or service principal.""" - - group_name: Optional[str] = None - """name of the group""" - - service_principal_name: Optional[str] = None - """Name of the service principal.""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the ServingEndpointAccessControlResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ServingEndpointAccessControlResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.all_permissions: - body["all_permissions"] = self.all_permissions - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointAccessControlResponse: - """Deserializes the ServingEndpointAccessControlResponse from a dictionary.""" - return cls( - all_permissions=_repeated_dict(d, "all_permissions", ServingEndpointPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - @dataclass class ServingEndpointDetailed: ai_gateway: Optional[AiGatewayConfig] = None @@ -3804,130 +3657,7 @@ class ServingEndpointDetailedPermissionLevel(Enum): CAN_VIEW = "CAN_VIEW" -@dataclass -class ServingEndpointPermission: - inherited: Optional[bool] = None - - inherited_from_object: Optional[List[str]] = None - - permission_level: Optional[ServingEndpointPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the ServingEndpointPermission into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ServingEndpointPermission into a shallow dictionary of its immediate attributes.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointPermission: - """Deserializes the ServingEndpointPermission from a dictionary.""" - return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", ServingEndpointPermissionLevel), - ) - - -class ServingEndpointPermissionLevel(Enum): - """Permission level""" - - CAN_MANAGE = "CAN_MANAGE" - CAN_QUERY = "CAN_QUERY" - CAN_VIEW = "CAN_VIEW" - - -@dataclass -class ServingEndpointPermissions: - access_control_list: Optional[List[ServingEndpointAccessControlResponse]] = None - - object_id: Optional[str] = None - - object_type: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the ServingEndpointPermissions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ServingEndpointPermissions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.access_control_list: - body["access_control_list"] = self.access_control_list - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointPermissions: - """Deserializes the ServingEndpointPermissions from a dictionary.""" - return cls( - access_control_list=_repeated_dict(d, "access_control_list", ServingEndpointAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), - ) - - -@dataclass -class ServingEndpointPermissionsDescription: - description: Optional[str] = None - - permission_level: Optional[ServingEndpointPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the ServingEndpointPermissionsDescription into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ServingEndpointPermissionsDescription into a shallow dictionary of its immediate attributes.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointPermissionsDescription: - """Deserializes the ServingEndpointPermissionsDescription from a dictionary.""" - return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", ServingEndpointPermissionLevel), - ) - - class ServingModelWorkloadType(Enum): - """Please keep this in sync with workload types in InferenceEndpointEntities.scala.""" - CPU = "CPU" CPU_LARGE = "CPU_LARGE" CPU_MEDIUM = "CPU_MEDIUM" @@ -4210,17 +3940,6 @@ def from_dict(cls, d: Dict[str, Any]) -> V1ResponseChoiceElement: class ServingEndpointsAPI: - """The Serving Endpoints API allows you to create, update, and delete model serving endpoints. - - You can use a serving endpoint to serve models from the Databricks Model Registry or from Unity Catalog. - Endpoints expose the underlying models as scalable REST API endpoints using serverless compute. This means - the endpoints and associated compute resources are fully managed by Databricks and will not appear in your - cloud account. A serving endpoint can consist of one or more MLflow models from the Databricks Model - Registry, called served entities. A serving endpoint can have at most ten served entities. You can - configure traffic settings to define how requests should be routed to your served entities behind an - endpoint. Additionally, you can configure the scale of resources that should be applied to each served - entity.""" - def __init__(self, api_client): self._api = api_client @@ -4270,9 +3989,7 @@ def build_logs(self, name: str, served_model_name: str) -> BuildLogsResponse: :returns: :class:`BuildLogsResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4300,8 +4017,8 @@ def create( """Create a new serving endpoint. :param name: str - The name of the serving endpoint. This field is required and must be unique across a Databricks - workspace. An endpoint name can consist of alphanumeric characters, dashes, and underscores. + The name of the serving endpoint. This field is required and must be unique across a . An + endpoint name can consist of alphanumeric characters, dashes, and underscores. :param ai_gateway: :class:`AiGatewayConfig` (optional) The AI Gateway configuration for the serving endpoint. NOTE: External model, provisioned throughput, and pay-per-token endpoints are fully supported; agent endpoints currently only support inference @@ -4349,10 +4066,7 @@ def create( body["tags"] = [v.as_dict() for v in tags] if telemetry_config is not None: body["telemetry_config"] = telemetry_config.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4362,7 +4076,7 @@ def create( return Wait( self.wait_get_serving_endpoint_not_updating, response=ServingEndpointDetailed.from_dict(op_response), - name=op_response["name"], + name=name, ) def create_and_wait( @@ -4406,8 +4120,8 @@ def create_provisioned_throughput_endpoint( """Create a new PT serving endpoint. :param name: str - The name of the serving endpoint. This field is required and must be unique across a Databricks - workspace. An endpoint name can consist of alphanumeric characters, dashes, and underscores. + The name of the serving endpoint. This field is required and must be unique across a . An + endpoint name can consist of alphanumeric characters, dashes, and underscores. :param config: :class:`PtEndpointCoreConfig` The core config of the serving endpoint. :param ai_gateway: :class:`AiGatewayConfig` (optional) @@ -4437,10 +4151,7 @@ def create_provisioned_throughput_endpoint( body["name"] = name if tags is not None: body["tags"] = [v.as_dict() for v in tags] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4450,7 +4161,7 @@ def create_provisioned_throughput_endpoint( return Wait( self.wait_get_serving_endpoint_not_updating, response=ServingEndpointDetailed.from_dict(op_response), - name=op_response["name"], + name=name, ) def create_provisioned_throughput_endpoint_and_wait( @@ -4499,15 +4210,13 @@ def export_metrics(self, name: str) -> ExportMetricsResponse: :returns: :class:`ExportMetricsResponse` """ - headers = { - "Accept": "text/plain", - } + headers = {} 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/serving-endpoints/{name}/metrics", headers=headers, raw=True) + res = self._api.do("GET", f"/api/2.0/serving-endpoints/{name}/metrics", headers=headers) return ExportMetricsResponse.from_dict(res) def get(self, name: str) -> ServingEndpointDetailed: @@ -4519,9 +4228,7 @@ def get(self, name: str) -> ServingEndpointDetailed: :returns: :class:`ServingEndpointDetailed` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4540,60 +4247,15 @@ def get_open_api(self, name: str) -> GetOpenApiResponse: :returns: :class:`GetOpenApiResponse` """ - headers = { - "Accept": "text/plain", - } + headers = {} 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/serving-endpoints/{name}/openapi", headers=headers, raw=True) + res = self._api.do("GET", f"/api/2.0/serving-endpoints/{name}/openapi", headers=headers) return GetOpenApiResponse.from_dict(res) - def get_permission_levels(self, serving_endpoint_id: str) -> GetServingEndpointPermissionLevelsResponse: - """Gets the permission levels that a user can have on an object. - - :param serving_endpoint_id: str - The serving endpoint for which to get or manage permissions. - - :returns: :class:`GetServingEndpointPermissionLevelsResponse` - """ - - 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/permissions/serving-endpoints/{serving_endpoint_id}/permissionLevels", headers=headers - ) - return GetServingEndpointPermissionLevelsResponse.from_dict(res) - - def get_permissions(self, serving_endpoint_id: str) -> ServingEndpointPermissions: - """Gets the permissions of a serving endpoint. Serving endpoints can inherit permissions from their root - object. - - :param serving_endpoint_id: str - The serving endpoint for which to get or manage permissions. - - :returns: :class:`ServingEndpointPermissions` - """ - - 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/permissions/serving-endpoints/{serving_endpoint_id}", headers=headers) - return ServingEndpointPermissions.from_dict(res) - def http_request( self, connection_name: str, @@ -4644,16 +4306,13 @@ def http_request( body["path"] = path if sub_domain is not None: body["sub_domain"] = sub_domain - headers = { - "Accept": "text/plain", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id - res = self._api.do("POST", "/api/2.0/external-function", body=body, headers=headers, raw=True) + res = self._api.do("POST", "/api/2.0/external-function", body=body, headers=headers) return HttpRequestResponse.from_dict(res) def list(self) -> Iterator[ServingEndpoint]: @@ -4663,9 +4322,7 @@ def list(self) -> Iterator[ServingEndpoint]: :returns: Iterator over :class:`ServingEndpoint` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4686,9 +4343,7 @@ def logs(self, name: str, served_model_name: str) -> ServerLogsResponse: :returns: :class:`ServerLogsResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4719,10 +4374,7 @@ def patch( body["add_tags"] = [v.as_dict() for v in add_tags] if delete_tags is not None: body["delete_tags"] = [v for v in delete_tags] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4751,10 +4403,7 @@ def patch_telemetry_config( body = {} if telemetry_config is not None: body["telemetry_config"] = telemetry_config.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4777,10 +4426,7 @@ def put(self, name: str, *, rate_limits: Optional[List[RateLimit]] = None) -> Pu body = {} if rate_limits is not None: body["rate_limits"] = [v.as_dict() for v in rate_limits] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4832,10 +4478,7 @@ def put_ai_gateway( body["rate_limits"] = [v.as_dict() for v in rate_limits] if usage_tracking_config is not None: body["usage_tracking_config"] = usage_tracking_config.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4949,10 +4592,7 @@ def query( body["temperature"] = temperature if usage_context is not None: body["usage_context"] = usage_context - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -4970,39 +4610,6 @@ def query( ) return QueryEndpointResponse.from_dict(res) - def set_permissions( - self, - serving_endpoint_id: str, - *, - access_control_list: Optional[List[ServingEndpointAccessControlRequest]] = None, - ) -> ServingEndpointPermissions: - """Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct - permissions if none are specified. Objects can inherit permissions from their root object. - - :param serving_endpoint_id: str - The serving endpoint for which to get or manage permissions. - :param access_control_list: List[:class:`ServingEndpointAccessControlRequest`] (optional) - - :returns: :class:`ServingEndpointPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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( - "PUT", f"/api/2.0/permissions/serving-endpoints/{serving_endpoint_id}", body=body, headers=headers - ) - return ServingEndpointPermissions.from_dict(res) - def update_config( self, name: str, @@ -5044,10 +4651,7 @@ def update_config( body["served_models"] = [v.as_dict() for v in served_models] if traffic_config is not None: body["traffic_config"] = traffic_config.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5057,7 +4661,7 @@ def update_config( return Wait( self.wait_get_serving_endpoint_not_updating, response=ServingEndpointDetailed.from_dict(op_response), - name=op_response["name"], + name=name, ) def update_config_and_wait( @@ -5095,10 +4699,7 @@ def update_notifications( body = {} if email_notifications is not None: body["email_notifications"] = email_notifications.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5107,39 +4708,6 @@ def update_notifications( res = self._api.do("PATCH", f"/api/2.0/serving-endpoints/{name}/notifications", body=body, headers=headers) return UpdateInferenceEndpointNotificationsResponse.from_dict(res) - def update_permissions( - self, - serving_endpoint_id: str, - *, - access_control_list: Optional[List[ServingEndpointAccessControlRequest]] = None, - ) -> ServingEndpointPermissions: - """Updates the permissions on a serving endpoint. Serving endpoints can inherit permissions from their - root object. - - :param serving_endpoint_id: str - The serving endpoint for which to get or manage permissions. - :param access_control_list: List[:class:`ServingEndpointAccessControlRequest`] (optional) - - :returns: :class:`ServingEndpointPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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/permissions/serving-endpoints/{serving_endpoint_id}", body=body, headers=headers - ) - return ServingEndpointPermissions.from_dict(res) - def update_provisioned_throughput_endpoint_config( self, name: str, config: PtEndpointCoreConfig ) -> Wait[ServingEndpointDetailed]: @@ -5159,10 +4727,7 @@ def update_provisioned_throughput_endpoint_config( body = {} if config is not None: body["config"] = config.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -5172,178 +4737,10 @@ def update_provisioned_throughput_endpoint_config( return Wait( self.wait_get_serving_endpoint_not_updating, response=ServingEndpointDetailed.from_dict(op_response), - name=op_response["name"], + name=name, ) def update_provisioned_throughput_endpoint_config_and_wait( self, name: str, config: PtEndpointCoreConfig, timeout=timedelta(minutes=20) ) -> ServingEndpointDetailed: return self.update_provisioned_throughput_endpoint_config(config=config, name=name).result(timeout=timeout) - - -class ServingEndpointsDataPlaneAPI: - """Serving endpoints DataPlane provides a set of operations to interact with data plane endpoints for Serving - endpoints service.""" - - def __init__(self, api_client, control_plane_service, dpts): - self._api = api_client - self._lock = threading.Lock() - self._control_plane_service = control_plane_service - self._dpts = dpts - self._data_plane_details = {} - - def _data_plane_info_query(self, name: str) -> DataPlaneInfo: - key = "query" + "/".join( - [ - str(name), - ] - ) - with self._lock: - if key in self._data_plane_details: - return self._data_plane_details[key] - response = self._control_plane_service.get( - name=name, - ) - if response.data_plane_info is None: - raise Exception("Resource does not support direct Data Plane access") - result = response.data_plane_info.query_info - with self._lock: - self._data_plane_details[key] = result - return result - - def query( - self, - name: str, - *, - client_request_id: Optional[str] = None, - dataframe_records: Optional[List[Any]] = None, - dataframe_split: Optional[DataframeSplitInput] = None, - extra_params: Optional[Dict[str, str]] = None, - input: Optional[Any] = None, - inputs: Optional[Any] = None, - instances: Optional[List[Any]] = None, - max_tokens: Optional[int] = None, - messages: Optional[List[ChatMessage]] = None, - n: Optional[int] = None, - prompt: Optional[Any] = None, - stop: Optional[List[str]] = None, - stream: Optional[bool] = None, - temperature: Optional[float] = None, - usage_context: Optional[Dict[str, str]] = None, - ) -> QueryEndpointResponse: - """Query a serving endpoint - - :param name: str - The name of the serving endpoint. This field is required and is provided via the path parameter. - :param client_request_id: str (optional) - Optional user-provided request identifier that will be recorded in the inference table and the usage - tracking table. - :param dataframe_records: List[Any] (optional) - Pandas Dataframe input in the records orientation. - :param dataframe_split: :class:`DataframeSplitInput` (optional) - Pandas Dataframe input in the split orientation. - :param extra_params: Dict[str,str] (optional) - The extra parameters field used ONLY for **completions, chat,** and **embeddings external & - foundation model** serving endpoints. This is a map of strings and should only be used with other - external/foundation model query fields. - :param input: Any (optional) - The input string (or array of strings) field used ONLY for **embeddings external & foundation - model** serving endpoints and is the only field (along with extra_params if needed) used by - embeddings queries. - :param inputs: Any (optional) - Tensor-based input in columnar format. - :param instances: List[Any] (optional) - Tensor-based input in row format. - :param max_tokens: int (optional) - The max tokens field used ONLY for **completions** and **chat external & foundation model** serving - endpoints. This is an integer and should only be used with other chat/completions query fields. - :param messages: List[:class:`ChatMessage`] (optional) - The messages field used ONLY for **chat external & foundation model** serving endpoints. This is an - array of ChatMessage objects and should only be used with other chat query fields. - :param n: int (optional) - The n (number of candidates) field used ONLY for **completions** and **chat external & foundation - model** serving endpoints. This is an integer between 1 and 5 with a default of 1 and should only be - used with other chat/completions query fields. - :param prompt: Any (optional) - The prompt string (or array of strings) field used ONLY for **completions external & foundation - model** serving endpoints and should only be used with other completions query fields. - :param stop: List[str] (optional) - The stop sequences field used ONLY for **completions** and **chat external & foundation model** - serving endpoints. This is a list of strings and should only be used with other chat/completions - query fields. - :param stream: bool (optional) - The stream field used ONLY for **completions** and **chat external & foundation model** serving - endpoints. This is a boolean defaulting to false and should only be used with other chat/completions - query fields. - :param temperature: float (optional) - The temperature field used ONLY for **completions** and **chat external & foundation model** serving - endpoints. This is a float between 0.0 and 2.0 with a default of 1.0 and should only be used with - other chat/completions query fields. - :param usage_context: Dict[str,str] (optional) - Optional user-provided context that will be recorded in the usage tracking table. - - :returns: :class:`QueryEndpointResponse` - """ - - body = {} - if client_request_id is not None: - body["client_request_id"] = client_request_id - if dataframe_records is not None: - body["dataframe_records"] = [v for v in dataframe_records] - if dataframe_split is not None: - body["dataframe_split"] = dataframe_split.as_dict() - if extra_params is not None: - body["extra_params"] = extra_params - if input is not None: - body["input"] = input - if inputs is not None: - body["inputs"] = inputs - if instances is not None: - body["instances"] = [v for v in instances] - if max_tokens is not None: - body["max_tokens"] = max_tokens - if messages is not None: - body["messages"] = [v.as_dict() for v in messages] - if n is not None: - body["n"] = n - if prompt is not None: - body["prompt"] = prompt - if stop is not None: - body["stop"] = [v for v in stop] - if stream is not None: - body["stream"] = stream - if temperature is not None: - body["temperature"] = temperature - if usage_context is not None: - body["usage_context"] = usage_context - data_plane_info = self._data_plane_info_query( - name=name, - ) - token = self._dpts.token(data_plane_info.endpoint_url, data_plane_info.authorization_details) - - def auth(r: requests.PreparedRequest) -> requests.PreparedRequest: - authorization = f"{token.token_type} {token.access_token}" - r.headers["Authorization"] = authorization - return r - - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } - - cfg = self._api._cfg - if cfg.workspace_id: - headers["X-Databricks-Workspace-Id"] = cfg.workspace_id - - response_headers = [ - "served-model-name", - ] - res = self._api.do( - "POST", - url=data_plane_info.endpoint_url, - body=body, - headers=headers, - response_headers=response_headers, - auth=auth, - ) - return QueryEndpointResponse.from_dict(res) diff --git a/databricks/sdk/service/settings.py b/databricks/sdk/service/settings.py index d8f60e901..568ca01a2 100644 --- a/databricks/sdk/service/settings.py +++ b/databricks/sdk/service/settings.py @@ -22,9 +22,6 @@ from databricks.sdk.common.types.fieldmask import FieldMask -from databricks.sdk.service import iam - - _LOG = logging.getLogger("databricks.sdk") @@ -2050,7 +2047,7 @@ class CustomerFacingNetworkConnectivityConfigAwsPrivateEndpointRule: after initialization.""" account_id: Optional[str] = None - """Databricks account ID. You can find your account ID from the Accounts Console.""" + """ account ID. You can find your account ID from the Accounts Console.""" connection_state: Optional[ CustomerFacingNetworkConnectivityConfigAwsPrivateEndpointRulePrivateLinkConnectionState @@ -2114,7 +2111,7 @@ class CustomerFacingNetworkConnectivityConfigAwsPrivateEndpointRule: """Time in epoch milliseconds when this object was updated.""" vpc_endpoint_id: Optional[str] = None - """The AWS VPC endpoint ID. You can use this ID to identify VPC endpoint created by Databricks.""" + """The AWS VPC endpoint ID. You can use this ID to identify VPC endpoint created by .""" def as_dict(self) -> dict: """Serializes the CustomerFacingNetworkConnectivityConfigAwsPrivateEndpointRule into a dictionary suitable for use as a JSON request body.""" @@ -2269,10 +2266,10 @@ def from_dict(cls, d: Dict[str, Any]) -> DashboardEmailSubscriptions: @dataclass class DefaultNamespaceSetting: - """This represents the setting configuration for the default namespace in the Databricks workspace. - Setting the default catalog for the workspace determines the catalog that is used when queries - do not reference a fully qualified 3 level name. For example, if the default catalog is set to - 'retail_prod' then a query 'SELECT * FROM myTable' would reference the object + """This represents the setting configuration for the default namespace in the + workspace. Setting the default catalog for the workspace determines the catalog that is used + when queries do not reference a fully qualified 3 level name. For example, if the default + catalog is set to 'retail_prod' then a query 'SELECT * FROM myTable' would reference the object 'retail_prod.default.myTable' (the schema 'default' is always assumed). This setting requires a restart of clusters and SQL warehouses to take effect. Additionally, the default namespace only applies when using Unity Catalog-enabled compute.""" @@ -3141,11 +3138,11 @@ class EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType(Enum): class EgressNetworkPolicyInternetAccessPolicyRestrictionMode(Enum): - """At which level can Databricks and Databricks managed compute access Internet. FULL_ACCESS: - Databricks can access Internet. No blocking rules will apply. RESTRICTED_ACCESS: Databricks can - only access explicitly allowed internet and storage destinations, as well as UC connections and - external locations. PRIVATE_ACCESS_ONLY (not used): Databricks can only access destinations via - private link.""" + """At which level can and managed compute access Internet. FULL_ACCESS: + can access Internet. No blocking rules will apply. RESTRICTED_ACCESS: + can only access explicitly allowed internet and storage destinations, as well as UC connections + and external locations. PRIVATE_ACCESS_ONLY (not used): can only access + destinations via private link.""" FULL_ACCESS = "FULL_ACCESS" PRIVATE_ACCESS_ONLY = "PRIVATE_ACCESS_ONLY" @@ -3242,7 +3239,7 @@ class EgressNetworkPolicyNetworkAccessPolicy: """The restriction mode that controls how serverless workloads can access the internet.""" allowed_databricks_destinations: Optional[List[EgressNetworkPolicyNetworkAccessPolicyDatabricksDestination]] = None - """List of Databricks workspace destinations that serverless workloads are allowed to access when + """List of workspace destinations that serverless workloads are allowed to access when in RESTRICTED_ACCESS mode.""" allowed_internet_destinations: Optional[List[EgressNetworkPolicyNetworkAccessPolicyInternetDestination]] = None @@ -3451,10 +3448,10 @@ class EgressNetworkPolicyNetworkAccessPolicyPolicyEnforcementEnforcementMode(Enu class EgressNetworkPolicyNetworkAccessPolicyRestrictionMode(Enum): - """At which level can Databricks and Databricks managed compute access Internet. FULL_ACCESS: - Databricks can access Internet. No blocking rules will apply. RESTRICTED_ACCESS: Databricks can - only access explicitly allowed internet and storage destinations, as well as UC connections and - external locations.""" + """At which level can and managed compute access Internet. FULL_ACCESS: + can access Internet. No blocking rules will apply. RESTRICTED_ACCESS: + can only access explicitly allowed internet and storage destinations, as well as UC connections + and external locations.""" FULL_ACCESS = "FULL_ACCESS" RESTRICTED_ACCESS = "RESTRICTED_ACCESS" @@ -4122,31 +4119,6 @@ def from_dict(cls, d: Dict[str, Any]) -> GetIpAccessListsResponse: return cls(ip_access_lists=_repeated_dict(d, "ip_access_lists", IpAccessListInfo)) -@dataclass -class GetTokenPermissionLevelsResponse: - permission_levels: Optional[List[TokenPermissionsDescription]] = None - """Specific permission levels""" - - def as_dict(self) -> dict: - """Serializes the GetTokenPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GetTokenPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.permission_levels: - body["permission_levels"] = self.permission_levels - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GetTokenPermissionLevelsResponse: - """Deserializes the GetTokenPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", TokenPermissionsDescription)) - - @dataclass class GetTokenResponse: """Token with specified Token ID was successfully returned.""" @@ -4213,7 +4185,7 @@ class IpAccessListInfo: """Creation timestamp in milliseconds.""" created_by: Optional[int] = None - """User ID of the user who created this list.""" + """The ID of the user that created this list.""" enabled: Optional[bool] = None """Specifies whether this IP access list is enabled.""" @@ -4232,7 +4204,7 @@ class IpAccessListInfo: """Update timestamp in milliseconds.""" updated_by: Optional[int] = None - """User ID of the user who updated this list.""" + """The ID of the user that last updated this list.""" def as_dict(self) -> dict: """Serializes the IpAccessListInfo into a dictionary suitable for use as a JSON request body.""" @@ -4827,10 +4799,10 @@ def from_dict(cls, d: Dict[str, Any]) -> MicrosoftTeamsConfig: @dataclass class NccAwsStableIpRule: """The stable AWS IP CIDR blocks. You can use these to configure the firewall of your resources to - allow traffic from your Databricks workspace.""" + allow traffic from your workspace.""" cidr_blocks: Optional[List[str]] = None - """The list of stable IP CIDR blocks from which Databricks network traffic originates when + """The list of stable IP CIDR blocks from which network traffic originates when accessing your resources.""" def as_dict(self) -> dict: @@ -5002,10 +4974,10 @@ class NccAzurePrivateEndpointRuleConnectionState(Enum): @dataclass class NccAzureServiceEndpointRule: """The stable Azure service endpoints. You can configure the firewall of your Azure resources to - allow traffic from your Databricks serverless compute resources.""" + allow traffic from your serverless compute resources.""" subnets: Optional[List[str]] = None - """The list of subnets from which Databricks network traffic originates when accessing your Azure + """The list of subnets from which network traffic originates when accessing your Azure resources.""" target_region: Optional[str] = None @@ -5163,7 +5135,7 @@ class NccPrivateEndpointRule: portal after initialization.""" account_id: Optional[str] = None - """Databricks account ID. You can find your account ID from the Accounts Console.""" + """ account ID. You can find your account ID from the Accounts Console.""" connection_state: Optional[NccPrivateEndpointRulePrivateLinkConnectionState] = None """The current status of this private endpoint. The private endpoint rules are effective only if @@ -5239,7 +5211,8 @@ class NccPrivateEndpointRule: """Time in epoch milliseconds when this object was updated.""" vpc_endpoint_id: Optional[str] = None - """The AWS VPC endpoint ID. You can use this ID to identify the VPC endpoint created by Databricks.""" + """The AWS VPC endpoint ID. You can use this ID to identify the VPC endpoint created by + .""" def as_dict(self) -> dict: """Serializes the NccPrivateEndpointRule into a dictionary suitable for use as a JSON request body.""" @@ -5363,7 +5336,8 @@ class NetworkConnectivityConfiguration: """Properties of the new network connectivity configuration.""" account_id: Optional[str] = None - """Your Databricks account ID. You can find your account ID in your Databricks accounts console.""" + """Your account ID. You can find your account ID in your accounts + console.""" creation_time: Optional[int] = None """Time in epoch milliseconds when this object was created.""" @@ -5378,7 +5352,7 @@ class NetworkConnectivityConfiguration: must match the regular expression ^[0-9a-zA-Z-_]{3,30}$""" network_connectivity_config_id: Optional[str] = None - """Databricks network connectivity configuration ID.""" + """ network connectivity configuration ID.""" region: Optional[str] = None """The region for the network connectivity configuration. Only workspaces in the same region can be @@ -5839,6 +5813,8 @@ def from_dict(cls, d: Dict[str, Any]) -> RestrictWorkspaceAdminsSetting: @dataclass class RevokeTokenResponse: + """The token was successfully deleted.""" + def as_dict(self) -> dict: """Serializes the RevokeTokenResponse into a dictionary suitable for use as a JSON request body.""" body = {} @@ -5997,115 +5973,6 @@ def from_dict(cls, d: Dict[str, Any]) -> StringMessage: return cls(value=d.get("value", None)) -@dataclass -class TokenAccessControlRequest: - group_name: Optional[str] = None - """name of the group""" - - permission_level: Optional[TokenPermissionLevel] = None - - service_principal_name: Optional[str] = None - """application ID of a service principal""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the TokenAccessControlRequest into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the TokenAccessControlRequest into a shallow dictionary of its immediate attributes.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> TokenAccessControlRequest: - """Deserializes the TokenAccessControlRequest from a dictionary.""" - return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", TokenPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class TokenAccessControlResponse: - all_permissions: Optional[List[TokenPermission]] = None - """All permissions.""" - - display_name: Optional[str] = None - """Display name of the user or service principal.""" - - group_name: Optional[str] = None - """name of the group""" - - service_principal_name: Optional[str] = None - """Name of the service principal.""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the TokenAccessControlResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the TokenAccessControlResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.all_permissions: - body["all_permissions"] = self.all_permissions - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> TokenAccessControlResponse: - """Deserializes the TokenAccessControlResponse from a dictionary.""" - return cls( - all_permissions=_repeated_dict(d, "all_permissions", TokenPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - @dataclass class TokenInfo: autoscope_state: Optional[iam.AutoscopeState] = None @@ -6229,124 +6096,6 @@ def from_dict(cls, d: Dict[str, Any]) -> TokenInfo: ) -@dataclass -class TokenPermission: - inherited: Optional[bool] = None - - inherited_from_object: Optional[List[str]] = None - - permission_level: Optional[TokenPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the TokenPermission into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the TokenPermission into a shallow dictionary of its immediate attributes.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> TokenPermission: - """Deserializes the TokenPermission from a dictionary.""" - return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", TokenPermissionLevel), - ) - - -class TokenPermissionLevel(Enum): - """Permission level""" - - CAN_USE = "CAN_USE" - - -@dataclass -class TokenPermissions: - access_control_list: Optional[List[TokenAccessControlResponse]] = None - - object_id: Optional[str] = None - - object_type: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the TokenPermissions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - def as_shallow_dict(self) -> dict: - """Serializes the TokenPermissions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.access_control_list: - body["access_control_list"] = self.access_control_list - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> TokenPermissions: - """Deserializes the TokenPermissions from a dictionary.""" - return cls( - access_control_list=_repeated_dict(d, "access_control_list", TokenAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), - ) - - -@dataclass -class TokenPermissionsDescription: - description: Optional[str] = None - - permission_level: Optional[TokenPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the TokenPermissionsDescription into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the TokenPermissionsDescription into a shallow dictionary of its immediate attributes.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> TokenPermissionsDescription: - """Deserializes the TokenPermissionsDescription from a dictionary.""" - return cls( - description=d.get("description", None), permission_level=_enum(d, "permission_level", TokenPermissionLevel) - ) - - class TokenType(Enum): """The type of token request. As of now, only ``AZURE_ACTIVE_DIRECTORY_TOKEN`` is supported.""" @@ -6483,27 +6232,6 @@ def from_dict(cls, d: Dict[str, Any]) -> WorkspaceNetworkOption: class AccountIpAccessListsAPI: - """The Accounts IP Access List API enables account admins to configure IP access lists for access to the - account console. - - Account IP Access Lists affect web application access and REST API access to the account console and - account APIs. If the feature is disabled for the account, all access is allowed for this account. There is - support for allow lists (inclusion) and block lists (exclusion). - - When a connection is attempted: - - 1. **First, all block lists are checked.** If the connection IP address matches any block list, the - connection is rejected. - 2. **If the connection was not rejected by block lists**, the IP address is compared with the allow lists. - - If there is at least one allow list for the account, the connection is allowed only if the IP address - matches an allow list. If there are no allow lists for the account, all IP addresses are allowed. - - For all allow lists and block lists combined, the account supports a maximum of 1000 IP/CIDR values, where - one CIDR counts as a single value. - - After changes to the account-level IP access lists, it can take a few minutes for changes to take effect.""" - def __init__(self, api_client): self._api = api_client @@ -6526,7 +6254,6 @@ def create( It can take a few minutes for the changes to take effect. :param label: str - Label for the IP access list. This **cannot** be empty. :param list_type: :class:`ListType` :param ip_addresses: List[str] (optional) @@ -6540,10 +6267,7 @@ def create( body["label"] = label if list_type is not None: body["list_type"] = list_type.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", f"/api/2.0/accounts/{self._api.account_id}/ip-access-lists", body=body, headers=headers @@ -6574,9 +6298,7 @@ def get(self, ip_access_list_id: str) -> GetIpAccessListResponse: :returns: :class:`GetIpAccessListResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/ip-access-lists/{ip_access_list_id}", headers=headers @@ -6590,9 +6312,7 @@ def list(self) -> Iterator[IpAccessListInfo]: :returns: Iterator over :class:`IpAccessListInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} json = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/ip-access-lists", headers=headers) parsed = GetIpAccessListsResponse.from_dict(json).ip_access_lists @@ -6639,9 +6359,7 @@ def replace( body["label"] = label if list_type is not None: body["list_type"] = list_type.value - headers = { - "Content-Type": "application/json", - } + headers = {} self._api.do( "PUT", @@ -6695,9 +6413,7 @@ def update( body["label"] = label if list_type is not None: body["list_type"] = list_type.value - headers = { - "Content-Type": "application/json", - } + headers = {} self._api.do( "PATCH", @@ -6708,8 +6424,6 @@ def update( class AccountSettingsAPI: - """Accounts Settings API allows users to manage settings at the account level.""" - def __init__(self, api_client): self._api = api_client @@ -6723,44 +6437,34 @@ def __init__(self, api_client): @property def csp_enablement_account(self) -> CspEnablementAccountAPI: - """The compliance security profile settings at the account level control whether to enable it for new workspaces.""" return self._csp_enablement_account @property def disable_legacy_features(self) -> DisableLegacyFeaturesAPI: - """Disable legacy features for new Databricks workspaces.""" return self._disable_legacy_features @property def enable_ip_access_lists(self) -> EnableIpAccessListsAPI: - """Controls the enforcement of IP access lists for accessing the account console.""" return self._enable_ip_access_lists @property def esm_enablement_account(self) -> EsmEnablementAccountAPI: - """The enhanced security monitoring setting at the account level controls whether to enable the feature on new workspaces.""" return self._esm_enablement_account @property def llm_proxy_partner_powered_account(self) -> LlmProxyPartnerPoweredAccountAPI: - """Determines if partner powered models are enabled or not for a specific account.""" return self._llm_proxy_partner_powered_account @property def llm_proxy_partner_powered_enforce(self) -> LlmProxyPartnerPoweredEnforceAPI: - """Determines if the account-level partner-powered setting value is enforced upon the workspace-level partner-powered setting.""" return self._llm_proxy_partner_powered_enforce @property def personal_compute(self) -> PersonalComputeAPI: - """The Personal Compute enablement setting lets you control which users can use the Personal Compute default policy to create compute resources.""" return self._personal_compute class AibiDashboardEmbeddingAccessPolicyAPI: - """Controls whether AI/BI published dashboard embedding is enabled, conditionally enabled, or disabled at the - workspace level. By default, this setting is conditionally enabled (ALLOW_APPROVED_DOMAINS).""" - def __init__(self, api_client): self._api = api_client @@ -6780,9 +6484,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteAibiDashboardEmbeddingA query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -6813,9 +6515,7 @@ def get(self, *, etag: Optional[str] = None) -> AibiDashboardEmbeddingAccessPoli query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -6835,15 +6535,6 @@ def update( This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`AibiDashboardEmbeddingAccessPolicySetting` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`AibiDashboardEmbeddingAccessPolicySetting` """ @@ -6855,10 +6546,7 @@ def update( body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -6871,9 +6559,6 @@ def update( class AibiDashboardEmbeddingApprovedDomainsAPI: - """Controls the list of domains approved to host the embedded AI/BI dashboards. The approved domains list - can't be mutated when the current access policy is not set to ALLOW_APPROVED_DOMAINS.""" - def __init__(self, api_client): self._api = api_client @@ -6894,9 +6579,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteAibiDashboardEmbeddingA query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -6926,9 +6609,7 @@ def get(self, *, etag: Optional[str] = None) -> AibiDashboardEmbeddingApprovedDo query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -6952,15 +6633,6 @@ def update( This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`AibiDashboardEmbeddingApprovedDomainsSetting` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`AibiDashboardEmbeddingApprovedDomainsSetting` """ @@ -6972,10 +6644,7 @@ def update( body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -6991,9 +6660,6 @@ def update( class AutomaticClusterUpdateAPI: - """Controls whether automatic cluster update is enabled for the current workspace. By default, it is turned - off.""" - def __init__(self, api_client): self._api = api_client @@ -7013,9 +6679,7 @@ def get(self, *, etag: Optional[str] = None) -> AutomaticClusterUpdateSetting: query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7038,15 +6702,6 @@ def update( This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`AutomaticClusterUpdateSetting` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`AutomaticClusterUpdateSetting` """ @@ -7058,10 +6713,7 @@ def update( body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7074,11 +6726,6 @@ def update( class ComplianceSecurityProfileAPI: - """Controls whether to enable the compliance security profile for the current workspace. Enabling it on a - workspace is permanent. By default, it is turned off. - - This settings can NOT be disabled once it is enabled.""" - def __init__(self, api_client): self._api = api_client @@ -7098,9 +6745,7 @@ def get(self, *, etag: Optional[str] = None) -> ComplianceSecurityProfileSetting query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7123,15 +6768,6 @@ def update( This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`ComplianceSecurityProfileSetting` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`ComplianceSecurityProfileSetting` """ @@ -7143,10 +6779,7 @@ def update( body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7159,9 +6792,6 @@ def update( class CredentialsManagerAPI: - """Credentials manager interacts with with Identity Providers to to perform token exchanges using stored - credentials and refresh tokens.""" - def __init__(self, api_client): self._api = api_client @@ -7197,10 +6827,7 @@ def exchange_token( body["scopes"] = [v for v in scopes] if token_type is not None: body["tokenType"] = [v.value for v in token_type] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7211,13 +6838,6 @@ def exchange_token( class CspEnablementAccountAPI: - """The compliance security profile settings at the account level control whether to enable it for new - workspaces. By default, this account-level setting is disabled for new workspaces. After workspace - creation, account admins can enable the compliance security profile individually for each workspace. - - This settings can be disabled so that new workspaces do not have compliance security profile enabled by - default.""" - def __init__(self, api_client): self._api = api_client @@ -7237,9 +6857,7 @@ def get(self, *, etag: Optional[str] = None) -> CspEnablementAccountSetting: query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -7258,15 +6876,6 @@ def update( This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`CspEnablementAccountSetting` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`CspEnablementAccountSetting` """ @@ -7278,10 +6887,7 @@ def update( body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -7293,10 +6899,6 @@ def update( class DashboardEmailSubscriptionsAPI: - """Controls whether schedules or workload tasks for refreshing AI/BI Dashboards in the workspace can send - subscription emails containing PDFs and/or images of the dashboard. By default, this setting is enabled - (set to ``true``)""" - def __init__(self, api_client): self._api = api_client @@ -7316,9 +6918,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDashboardEmailSubscript query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7348,9 +6948,7 @@ def get(self, *, etag: Optional[str] = None) -> DashboardEmailSubscriptions: query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7370,15 +6968,6 @@ def update( This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`DashboardEmailSubscriptions` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`DashboardEmailSubscriptions` """ @@ -7390,10 +6979,7 @@ def update( body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7406,17 +6992,6 @@ def update( class DefaultNamespaceAPI: - """The default namespace setting API allows users to configure the default namespace for a Databricks - workspace. - - Through this API, users can retrieve, set, or modify the default namespace used when queries do not - reference a fully qualified three-level name. For example, if you use the API to set 'retail_prod' as the - default catalog, then a query 'SELECT * FROM myTable' would reference the object - 'retail_prod.default.myTable' (the schema 'default' is always assumed). - - This setting requires a restart of clusters and SQL warehouses to take effect. Additionally, the default - namespace only applies when using Unity Catalog-enabled compute.""" - def __init__(self, api_client): self._api = api_client @@ -7439,9 +7014,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDefaultNamespaceSetting query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7468,9 +7041,7 @@ def get(self, *, etag: Optional[str] = None) -> DefaultNamespaceSetting: query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7493,15 +7064,6 @@ def update(self, allow_missing: bool, setting: DefaultNamespaceSetting, field_ma This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`DefaultNamespaceSetting` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`DefaultNamespaceSetting` """ @@ -7513,10 +7075,7 @@ def update(self, allow_missing: bool, setting: DefaultNamespaceSetting, field_ma body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7529,9 +7088,6 @@ def update(self, allow_missing: bool, setting: DefaultNamespaceSetting, field_ma class DefaultWarehouseIdAPI: - """Warehouse to be selected by default for users in this workspace. Covers SQL workloads only and can be - overridden by users.""" - def __init__(self, api_client): self._api = api_client @@ -7551,9 +7107,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDefaultWarehouseIdRespo query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7580,9 +7134,7 @@ def get(self, *, etag: Optional[str] = None) -> DefaultWarehouseId: query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7600,15 +7152,6 @@ def update(self, allow_missing: bool, setting: DefaultWarehouseId, field_mask: s This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`DefaultWarehouseId` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`DefaultWarehouseId` """ @@ -7620,10 +7163,7 @@ def update(self, allow_missing: bool, setting: DefaultWarehouseId, field_mask: s body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7636,13 +7176,6 @@ def update(self, allow_missing: bool, setting: DefaultWarehouseId, field_mask: s class DisableLegacyAccessAPI: - """'Disabling legacy access' has the following impacts: - - 1. Disables direct access to Hive Metastores from the workspace. However, you can still access a Hive - Metastore through Hive Metastore federation. - 2. Disables fallback mode on external location access from the workspace. - 3. Disables Databricks Runtime versions prior to 13.3LTS.""" - def __init__(self, api_client): self._api = api_client @@ -7662,9 +7195,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDisableLegacyAccessResp query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7691,9 +7222,7 @@ def get(self, *, etag: Optional[str] = None) -> DisableLegacyAccess: query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7711,15 +7240,6 @@ def update(self, allow_missing: bool, setting: DisableLegacyAccess, field_mask: This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`DisableLegacyAccess` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`DisableLegacyAccess` """ @@ -7731,10 +7251,7 @@ def update(self, allow_missing: bool, setting: DisableLegacyAccess, field_mask: body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7747,15 +7264,6 @@ def update(self, allow_missing: bool, setting: DisableLegacyAccess, field_mask: class DisableLegacyDbfsAPI: - """Disabling legacy DBFS has the following implications: - - 1. Access to DBFS root and DBFS mounts is disallowed (as well as the creation of new mounts). - 2. Disables Databricks Runtime versions prior to 13.3LTS. - - When the setting is off, all DBFS functionality is enabled and no restrictions are imposed on Databricks - Runtime versions. This setting can take up to 20 minutes to take effect and requires a manual restart of - all-purpose compute clusters and SQL warehouses.""" - def __init__(self, api_client): self._api = api_client @@ -7775,9 +7283,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDisableLegacyDbfsRespon query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7804,9 +7310,7 @@ def get(self, *, etag: Optional[str] = None) -> DisableLegacyDbfs: query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7824,15 +7328,6 @@ def update(self, allow_missing: bool, setting: DisableLegacyDbfs, field_mask: st This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`DisableLegacyDbfs` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`DisableLegacyDbfs` """ @@ -7844,10 +7339,7 @@ def update(self, allow_missing: bool, setting: DisableLegacyDbfs, field_mask: st body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7860,15 +7352,6 @@ def update(self, allow_missing: bool, setting: DisableLegacyDbfs, field_mask: st class DisableLegacyFeaturesAPI: - """Disable legacy features for new Databricks workspaces. - - For newly created workspaces: - - 1. Disables the use of DBFS root and mounts. - 2. Hive Metastore will not be provisioned. - 3. Disables the use of ‘No-isolation clusters’. - 4. Disables Databricks Runtime versions prior to 13.3LTS.""" - def __init__(self, api_client): self._api = api_client @@ -7888,9 +7371,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDisableLegacyFeaturesRe query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "DELETE", @@ -7916,9 +7397,7 @@ def get(self, *, etag: Optional[str] = None) -> DisableLegacyFeatures: query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -7935,15 +7414,6 @@ def update(self, allow_missing: bool, setting: DisableLegacyFeatures, field_mask This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`DisableLegacyFeatures` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`DisableLegacyFeatures` """ @@ -7955,10 +7425,7 @@ def update(self, allow_missing: bool, setting: DisableLegacyFeatures, field_mask body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -7970,9 +7437,6 @@ def update(self, allow_missing: bool, setting: DisableLegacyFeatures, field_mask class EnableExportNotebookAPI: - """Controls whether users can export notebooks and files from the Workspace UI. By default, this setting is - enabled.""" - def __init__(self, api_client): self._api = api_client @@ -7983,9 +7447,7 @@ def get_enable_export_notebook(self) -> EnableExportNotebook: :returns: :class:`EnableExportNotebook` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8004,15 +7466,6 @@ def patch_enable_export_notebook( This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`EnableExportNotebook` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`EnableExportNotebook` """ @@ -8024,10 +7477,7 @@ def patch_enable_export_notebook( body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8040,9 +7490,6 @@ def patch_enable_export_notebook( class EnableIpAccessListsAPI: - """Controls the enforcement of IP access lists for accessing the account console. Allowing you to enable or - disable restricted access based on IP addresses.""" - def __init__(self, api_client): self._api = api_client @@ -8062,9 +7509,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteAccountIpAccessEnableRe query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "DELETE", @@ -8090,9 +7535,7 @@ def get(self, *, etag: Optional[str] = None) -> AccountIpAccessEnable: query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -8109,15 +7552,6 @@ def update(self, allow_missing: bool, setting: AccountIpAccessEnable, field_mask This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`AccountIpAccessEnable` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`AccountIpAccessEnable` """ @@ -8129,10 +7563,7 @@ def update(self, allow_missing: bool, setting: AccountIpAccessEnable, field_mask body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -8144,9 +7575,6 @@ def update(self, allow_missing: bool, setting: AccountIpAccessEnable, field_mask class EnableNotebookTableClipboardAPI: - """Controls whether users can copy tabular data to the clipboard via the UI. By default, this setting is - enabled.""" - def __init__(self, api_client): self._api = api_client @@ -8157,9 +7585,7 @@ def get_enable_notebook_table_clipboard(self) -> EnableNotebookTableClipboard: :returns: :class:`EnableNotebookTableClipboard` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8180,15 +7606,6 @@ def patch_enable_notebook_table_clipboard( This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`EnableNotebookTableClipboard` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`EnableNotebookTableClipboard` """ @@ -8200,10 +7617,7 @@ def patch_enable_notebook_table_clipboard( body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8216,8 +7630,6 @@ def patch_enable_notebook_table_clipboard( class EnableResultsDownloadingAPI: - """Controls whether users can download notebook results. By default, this setting is enabled.""" - def __init__(self, api_client): self._api = api_client @@ -8228,9 +7640,7 @@ def get_enable_results_downloading(self) -> EnableResultsDownloading: :returns: :class:`EnableResultsDownloading` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8249,15 +7659,6 @@ def patch_enable_results_downloading( This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`EnableResultsDownloading` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`EnableResultsDownloading` """ @@ -8269,10 +7670,7 @@ def patch_enable_results_downloading( body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8285,13 +7683,6 @@ def patch_enable_results_downloading( class EnhancedSecurityMonitoringAPI: - """Controls whether enhanced security monitoring is enabled for the current workspace. If the compliance - security profile is enabled, this is automatically enabled. By default, it is disabled. However, if the - compliance security profile is enabled, this is automatically enabled. - - If the compliance security profile is disabled, you can enable or disable this setting and it is not - permanent.""" - def __init__(self, api_client): self._api = api_client @@ -8311,9 +7702,7 @@ def get(self, *, etag: Optional[str] = None) -> EnhancedSecurityMonitoringSettin query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8336,15 +7725,6 @@ def update( This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`EnhancedSecurityMonitoringSetting` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`EnhancedSecurityMonitoringSetting` """ @@ -8356,10 +7736,7 @@ def update( body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8372,10 +7749,6 @@ def update( class EsmEnablementAccountAPI: - """The enhanced security monitoring setting at the account level controls whether to enable the feature on - new workspaces. By default, this account-level setting is disabled for new workspaces. After workspace - creation, account admins can enable enhanced security monitoring individually for each workspace.""" - def __init__(self, api_client): self._api = api_client @@ -8395,9 +7768,7 @@ def get(self, *, etag: Optional[str] = None) -> EsmEnablementAccountSetting: query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -8416,15 +7787,6 @@ def update( This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`EsmEnablementAccountSetting` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`EsmEnablementAccountSetting` """ @@ -8436,10 +7798,7 @@ def update( body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -8451,26 +7810,6 @@ def update( class IpAccessListsAPI: - """IP Access List enables admins to configure IP access lists. - - IP access lists affect web application access and REST API access to this workspace only. If the feature - is disabled for a workspace, all access is allowed for this workspace. There is support for allow lists - (inclusion) and block lists (exclusion). - - When a connection is attempted: - - 1. **First, all block lists are checked.** If the connection IP address matches any block list, the - connection is rejected. - 2. **If the connection was not rejected by block lists**, the IP address is compared with the allow lists. - - If there is at least one allow list for the workspace, the connection is allowed only if the IP address - matches an allow list. If there are no allow lists for the workspace, all IP addresses are allowed. - - For all allow lists and block lists combined, the workspace supports a maximum of 1000 IP/CIDR values, - where one CIDR counts as a single value. - - After changes to the IP access list feature, it can take a few minutes for changes to take effect.""" - def __init__(self, api_client): self._api = api_client @@ -8495,7 +7834,6 @@ def create( `__ :param label: str - Label for the IP access list. This **cannot** be empty. :param list_type: :class:`ListType` :param ip_addresses: List[str] (optional) @@ -8509,10 +7847,7 @@ def create( body["label"] = label if list_type is not None: body["list_type"] = list_type.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8547,9 +7882,7 @@ def get(self, ip_access_list_id: str) -> FetchIpAccessListResponse: :returns: :class:`FetchIpAccessListResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8565,9 +7898,7 @@ def list(self) -> Iterator[IpAccessListInfo]: :returns: Iterator over :class:`IpAccessListInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8620,9 +7951,7 @@ def replace( body["label"] = label if list_type is not None: body["list_type"] = list_type.value - headers = { - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8677,9 +8006,7 @@ def update( body["label"] = label if list_type is not None: body["list_type"] = list_type.value - headers = { - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8689,8 +8016,6 @@ def update( class LlmProxyPartnerPoweredAccountAPI: - """Determines if partner powered models are enabled or not for a specific account""" - def __init__(self, api_client): self._api = api_client @@ -8710,9 +8035,7 @@ def get(self, *, etag: Optional[str] = None) -> LlmProxyPartnerPoweredAccount: query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -8731,15 +8054,6 @@ def update( This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`LlmProxyPartnerPoweredAccount` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`LlmProxyPartnerPoweredAccount` """ @@ -8751,10 +8065,7 @@ def update( body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -8766,9 +8077,6 @@ def update( class LlmProxyPartnerPoweredEnforceAPI: - """Determines if the account-level partner-powered setting value is enforced upon the workspace-level - partner-powered setting""" - def __init__(self, api_client): self._api = api_client @@ -8788,9 +8096,7 @@ def get(self, *, etag: Optional[str] = None) -> LlmProxyPartnerPoweredEnforce: query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -8809,15 +8115,6 @@ def update( This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`LlmProxyPartnerPoweredEnforce` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`LlmProxyPartnerPoweredEnforce` """ @@ -8829,10 +8126,7 @@ def update( body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -8844,8 +8138,6 @@ def update( class LlmProxyPartnerPoweredWorkspaceAPI: - """Determines if partner powered models are enabled or not for a specific workspace""" - def __init__(self, api_client): self._api = api_client @@ -8865,9 +8157,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteLlmProxyPartnerPoweredW query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8894,9 +8184,7 @@ def get(self, *, etag: Optional[str] = None) -> LlmProxyPartnerPoweredWorkspace: query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8916,15 +8204,6 @@ def update( This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`LlmProxyPartnerPoweredWorkspace` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`LlmProxyPartnerPoweredWorkspace` """ @@ -8936,10 +8215,7 @@ def update( body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8952,13 +8228,6 @@ def update( class NetworkConnectivityAPI: - """These APIs provide configurations for the network connectivity of your workspaces for serverless compute - resources. This API provides stable subnets for your workspace so that you can configure your firewalls on - your Azure Storage accounts to allow access from Databricks. You can also use the API to provision private - endpoints for Databricks to privately connect serverless compute resources to your Azure resources using - Azure Private Link. See `configure serverless secure connectivity - `__.""" - def __init__(self, api_client): self._api = api_client @@ -8967,13 +8236,13 @@ def create_network_connectivity_configuration( ) -> NetworkConnectivityConfiguration: """Creates a network connectivity configuration (NCC), which provides stable Azure service subnets when accessing your Azure Storage accounts. You can also use a network connectivity configuration to create - Databricks managed private endpoints so that Databricks serverless compute resources privately access - your resources. + managed private endpoints so that serverless compute resources privately + access your resources. **IMPORTANT**: After you create the network connectivity configuration, you must assign one or more workspaces to the new network connectivity configuration. You can share one network connectivity - configuration with multiple workspaces from the same Azure region within the same Databricks account. - See `configure serverless secure connectivity + configuration with multiple workspaces from the same Azure region within the same + account. See `configure serverless secure connectivity `__. :param network_connectivity_config: :class:`CreateNetworkConnectivityConfiguration` @@ -8983,10 +8252,7 @@ def create_network_connectivity_configuration( body = network_connectivity_config.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", f"/api/2.0/accounts/{self._api.account_id}/network-connectivity-configs", body=body, headers=headers @@ -8997,8 +8263,8 @@ def create_private_endpoint_rule( self, network_connectivity_config_id: str, private_endpoint_rule: CreatePrivateEndpointRule ) -> NccPrivateEndpointRule: """Create a private endpoint rule for the specified network connectivity config object. Once the object - is created, Databricks asynchronously provisions a new Azure private endpoint to your specified Azure - resource. + is created, asynchronously provisions a new Azure private endpoint to your specified + Azure resource. **IMPORTANT**: You must use Azure portal or other Azure tools to approve the private endpoint to complete the connection. To get the information of the private endpoint created, make a ``GET`` @@ -9014,10 +8280,7 @@ def create_private_endpoint_rule( body = private_endpoint_rule.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", @@ -9036,9 +8299,7 @@ def delete_network_connectivity_configuration(self, network_connectivity_config_ """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do( "DELETE", @@ -9062,9 +8323,7 @@ def delete_private_endpoint_rule( :returns: :class:`NccPrivateEndpointRule` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "DELETE", @@ -9084,9 +8343,7 @@ def get_network_connectivity_configuration( :returns: :class:`NetworkConnectivityConfiguration` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -9108,9 +8365,7 @@ def get_private_endpoint_rule( :returns: :class:`NccPrivateEndpointRule` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -9133,9 +8388,7 @@ def list_network_connectivity_configurations( query = {} if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -9167,9 +8420,7 @@ def list_private_endpoint_rules( query = {} if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -9202,11 +8453,6 @@ def update_private_endpoint_rule( Your private endpoint rule ID. :param private_endpoint_rule: :class:`UpdatePrivateEndpointRule` :param update_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. :returns: :class:`NccPrivateEndpointRule` """ @@ -9215,10 +8461,7 @@ def update_private_endpoint_rule( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -9231,19 +8474,12 @@ def update_private_endpoint_rule( class NetworkPoliciesAPI: - """These APIs manage network policies for this account. Network policies control which network destinations - can be accessed from the Databricks environment. Each Databricks account includes a default policy named - 'default-policy'. 'default-policy' is associated with any workspace lacking an explicit network policy - assignment, and is automatically associated with each newly created workspace. 'default-policy' is - reserved and cannot be deleted, but it can be updated to customize the default network access rules for - your account.""" - def __init__(self, api_client): self._api = api_client def create_network_policy_rpc(self, network_policy: AccountNetworkPolicy) -> AccountNetworkPolicy: - """Creates a new network policy to manage which network destinations can be accessed from the Databricks - environment. + """Creates a new network policy to manage which network destinations can be accessed from the + environment. :param network_policy: :class:`AccountNetworkPolicy` Network policy configuration details. @@ -9253,10 +8489,7 @@ def create_network_policy_rpc(self, network_policy: AccountNetworkPolicy) -> Acc body = network_policy.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "POST", f"/api/2.0/accounts/{self._api.account_id}/network-policies", body=body, headers=headers @@ -9272,9 +8505,7 @@ def delete_network_policy_rpc(self, network_policy_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} self._api.do( "DELETE", f"/api/2.0/accounts/{self._api.account_id}/network-policies/{network_policy_id}", headers=headers @@ -9289,9 +8520,7 @@ def get_network_policy_rpc(self, network_policy_id: str) -> AccountNetworkPolicy :returns: :class:`AccountNetworkPolicy` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/network-policies/{network_policy_id}", headers=headers @@ -9310,9 +8539,7 @@ def list_network_policies_rpc(self, *, page_token: Optional[str] = None) -> Iter query = {} if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -9340,10 +8567,7 @@ def update_network_policy_rpc( body = network_policy.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PUT", @@ -9355,11 +8579,6 @@ def update_network_policy_rpc( class NotificationDestinationsAPI: - """The notification destinations API lets you programmatically manage a workspace's notification - destinations. Notification destinations are used to send notifications for query alerts and jobs to - destinations outside of Databricks. Only workspace admins can create, update, and delete notification - destinations.""" - def __init__(self, api_client): self._api = api_client @@ -9379,10 +8598,7 @@ def create(self, *, config: Optional[Config] = None, display_name: Optional[str] body["config"] = config.as_dict() if display_name is not None: body["display_name"] = display_name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9399,9 +8615,7 @@ def delete(self, id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9417,9 +8631,7 @@ def get(self, id: str) -> NotificationDestination: :returns: :class:`NotificationDestination` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9444,9 +8656,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9482,10 +8692,7 @@ def update( body["config"] = config.as_dict() if display_name is not None: body["display_name"] = display_name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9496,14 +8703,6 @@ def update( class PersonalComputeAPI: - """The Personal Compute enablement setting lets you control which users can use the Personal Compute default - policy to create compute resources. By default all users in all workspaces have access (ON), but you can - change the setting to instead let individual workspaces configure access control (DELEGATE). - - There is only one instance of this setting per account. Since this setting has a default value, this - setting is present on all accounts even though it's never set on a given account. Deletion reverts the - value of the setting back to the default value.""" - def __init__(self, api_client): self._api = api_client @@ -9523,9 +8722,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeletePersonalComputeSettingR query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "DELETE", @@ -9551,9 +8748,7 @@ def get(self, *, etag: Optional[str] = None) -> PersonalComputeSetting: query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", @@ -9570,15 +8765,6 @@ def update(self, allow_missing: bool, setting: PersonalComputeSetting, field_mas This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`PersonalComputeSetting` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`PersonalComputeSetting` """ @@ -9590,10 +8776,7 @@ def update(self, allow_missing: bool, setting: PersonalComputeSetting, field_mas body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -9605,16 +8788,6 @@ def update(self, allow_missing: bool, setting: PersonalComputeSetting, field_mas class RestrictWorkspaceAdminsAPI: - """The Restrict Workspace Admins setting lets you control the capabilities of workspace admins. With the - setting status set to ALLOW_ALL, workspace admins can create service principal personal access tokens on - behalf of any service principal in their workspace. Workspace admins can also change a job owner to any - user in their workspace. And they can change the job run_as setting to any user in their workspace or to a - service principal on which they have the Service Principal User role. With the setting status set to - RESTRICT_TOKENS_AND_JOB_RUN_AS, workspace admins can only create personal access tokens on behalf of - service principals they have the Service Principal User role on. They can also only change a job owner to - themselves. And they can change the job run_as setting to themselves or to a service principal on which - they have the Service Principal User role.""" - def __init__(self, api_client): self._api = api_client @@ -9637,9 +8810,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteRestrictWorkspaceAdmins query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9666,9 +8837,7 @@ def get(self, *, etag: Optional[str] = None) -> RestrictWorkspaceAdminsSetting: query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9691,15 +8860,6 @@ def update( This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`RestrictWorkspaceAdminsSetting` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`RestrictWorkspaceAdminsSetting` """ @@ -9711,10 +8871,7 @@ def update( body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9727,8 +8884,6 @@ def update( class SettingsAPI: - """Workspace Settings API allows users to manage settings at the workspace level.""" - def __init__(self, api_client): self._api = api_client @@ -9751,89 +8906,70 @@ def __init__(self, api_client): @property def aibi_dashboard_embedding_access_policy(self) -> AibiDashboardEmbeddingAccessPolicyAPI: - """Controls whether AI/BI published dashboard embedding is enabled, conditionally enabled, or disabled at the workspace level.""" return self._aibi_dashboard_embedding_access_policy @property def aibi_dashboard_embedding_approved_domains(self) -> AibiDashboardEmbeddingApprovedDomainsAPI: - """Controls the list of domains approved to host the embedded AI/BI dashboards.""" return self._aibi_dashboard_embedding_approved_domains @property def automatic_cluster_update(self) -> AutomaticClusterUpdateAPI: - """Controls whether automatic cluster update is enabled for the current workspace.""" return self._automatic_cluster_update @property def compliance_security_profile(self) -> ComplianceSecurityProfileAPI: - """Controls whether to enable the compliance security profile for the current workspace.""" return self._compliance_security_profile @property def dashboard_email_subscriptions(self) -> DashboardEmailSubscriptionsAPI: - """Controls whether schedules or workload tasks for refreshing AI/BI Dashboards in the workspace can send subscription emails containing PDFs and/or images of the dashboard.""" return self._dashboard_email_subscriptions @property def default_namespace(self) -> DefaultNamespaceAPI: - """The default namespace setting API allows users to configure the default namespace for a Databricks workspace.""" return self._default_namespace @property def default_warehouse_id(self) -> DefaultWarehouseIdAPI: - """Warehouse to be selected by default for users in this workspace.""" return self._default_warehouse_id @property def disable_legacy_access(self) -> DisableLegacyAccessAPI: - """'Disabling legacy access' has the following impacts: 1.""" return self._disable_legacy_access @property def disable_legacy_dbfs(self) -> DisableLegacyDbfsAPI: - """Disabling legacy DBFS has the following implications: 1.""" return self._disable_legacy_dbfs @property def enable_export_notebook(self) -> EnableExportNotebookAPI: - """Controls whether users can export notebooks and files from the Workspace UI.""" return self._enable_export_notebook @property def enable_notebook_table_clipboard(self) -> EnableNotebookTableClipboardAPI: - """Controls whether users can copy tabular data to the clipboard via the UI.""" return self._enable_notebook_table_clipboard @property def enable_results_downloading(self) -> EnableResultsDownloadingAPI: - """Controls whether users can download notebook results.""" return self._enable_results_downloading @property def enhanced_security_monitoring(self) -> EnhancedSecurityMonitoringAPI: - """Controls whether enhanced security monitoring is enabled for the current workspace.""" return self._enhanced_security_monitoring @property def llm_proxy_partner_powered_workspace(self) -> LlmProxyPartnerPoweredWorkspaceAPI: - """Determines if partner powered models are enabled or not for a specific workspace.""" return self._llm_proxy_partner_powered_workspace @property def restrict_workspace_admins(self) -> RestrictWorkspaceAdminsAPI: - """The Restrict Workspace Admins setting lets you control the capabilities of workspace admins.""" return self._restrict_workspace_admins @property def sql_results_download(self) -> SqlResultsDownloadAPI: - """Controls whether users within the workspace are allowed to download results from the SQL Editor and AI/BI Dashboards UIs.""" return self._sql_results_download class SqlResultsDownloadAPI: - """Controls whether users within the workspace are allowed to download results from the SQL Editor and AI/BI - Dashboards UIs. By default, this setting is enabled (set to ``true``)""" - def __init__(self, api_client): self._api = api_client @@ -9853,9 +8989,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteSqlResultsDownloadRespo query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9882,9 +9016,7 @@ def get(self, *, etag: Optional[str] = None) -> SqlResultsDownload: query = {} if etag is not None: query["etag"] = etag - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9902,15 +9034,6 @@ def update(self, allow_missing: bool, setting: SqlResultsDownload, field_mask: s This should always be set to true for Settings API. Added for AIP compliance. :param setting: :class:`SqlResultsDownload` :param field_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`SqlResultsDownload` """ @@ -9922,10 +9045,7 @@ def update(self, allow_missing: bool, setting: SqlResultsDownload, field_mask: s body["field_mask"] = field_mask if setting is not None: body["setting"] = setting.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9938,9 +9058,6 @@ def update(self, allow_missing: bool, setting: SqlResultsDownload, field_mask: s class TokenManagementAPI: - """Enables administrators to get all tokens and delete tokens for other users. Admins can either get every - token, get a specific token by ID, or get all tokens for a particular user.""" - def __init__(self, api_client): self._api = api_client @@ -9979,10 +9096,7 @@ def create_obo_token( body["lifetime_seconds"] = lifetime_seconds if scopes is not None: body["scopes"] = [v for v in scopes] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10017,9 +9131,7 @@ def get(self, token_id: str) -> GetTokenResponse: :returns: :class:`GetTokenResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10028,42 +9140,6 @@ def get(self, token_id: str) -> GetTokenResponse: res = self._api.do("GET", f"/api/2.0/token-management/tokens/{token_id}", headers=headers) return GetTokenResponse.from_dict(res) - def get_permission_levels(self) -> GetTokenPermissionLevelsResponse: - """Gets the permission levels that a user can have on an object. - - - :returns: :class:`GetTokenPermissionLevelsResponse` - """ - - 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", "/api/2.0/permissions/authorization/tokens/permissionLevels", headers=headers) - return GetTokenPermissionLevelsResponse.from_dict(res) - - def get_permissions(self) -> TokenPermissions: - """Gets the permissions of all tokens. Tokens can inherit permissions from their root object. - - - :returns: :class:`TokenPermissions` - """ - - 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", "/api/2.0/permissions/authorization/tokens", headers=headers) - return TokenPermissions.from_dict(res) - def list( self, *, created_by_id: Optional[int] = None, created_by_username: Optional[str] = None ) -> Iterator[TokenInfo]: @@ -10082,9 +9158,7 @@ def list( query["created_by_id"] = created_by_id if created_by_username is not None: query["created_by_username"] = created_by_username - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10094,57 +9168,6 @@ def list( parsed = ListTokensResponse.from_dict(json).token_infos return parsed if parsed is not None else [] - def set_permissions( - self, *, access_control_list: Optional[List[TokenAccessControlRequest]] = None - ) -> TokenPermissions: - """Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct - permissions if none are specified. Objects can inherit permissions from their root object. - - :param access_control_list: List[:class:`TokenAccessControlRequest`] (optional) - - :returns: :class:`TokenPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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("PUT", "/api/2.0/permissions/authorization/tokens", body=body, headers=headers) - return TokenPermissions.from_dict(res) - - def update_permissions( - self, *, access_control_list: Optional[List[TokenAccessControlRequest]] = None - ) -> TokenPermissions: - """Updates the permissions on all tokens. Tokens can inherit permissions from their root object. - - :param access_control_list: List[:class:`TokenAccessControlRequest`] (optional) - - :returns: :class:`TokenPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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", "/api/2.0/permissions/authorization/tokens", body=body, headers=headers) - return TokenPermissions.from_dict(res) - def update_token_management(self, token_id: str, token: TokenInfo, update_mask: FieldMask) -> TokenInfo: """Updates a token, specified by its ID. @@ -10154,16 +9177,6 @@ def update_token_management(self, token_id: str, token: TokenInfo, update_mask: :param update_mask: FieldMask A list of field name under token, For example, {"update_mask": "comment,scopes"} - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. - :returns: :class:`TokenInfo` """ @@ -10172,10 +9185,7 @@ def update_token_management(self, token_id: str, token: TokenInfo, update_mask: body["token"] = token.as_dict() if update_mask is not None: body["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10186,9 +9196,6 @@ def update_token_management(self, token_id: str, token: TokenInfo, update_mask: class TokensAPI: - """The Token API allows you to create, list, and revoke tokens that can be used to authenticate and access - Databricks REST APIs.""" - def __init__(self, api_client): self._api = api_client @@ -10228,10 +9235,7 @@ def create( body["lifetime_seconds"] = lifetime_seconds if scopes is not None: body["scopes"] = [v for v in scopes] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10254,10 +9258,7 @@ def delete(self, token_id: str): body = {} if token_id is not None: body["token_id"] = token_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10272,9 +9273,7 @@ def list(self) -> Iterator[PublicTokenInfo]: :returns: Iterator over :class:`PublicTokenInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10295,16 +9294,6 @@ def update(self, token_id: str, token: PublicTokenInfo, update_mask: FieldMask) :param update_mask: FieldMask A list of field name under token, For example, {"update_mask": "comment,scopes"} - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. - :returns: :class:`UpdateTokenResponse` """ @@ -10313,10 +9302,7 @@ def update(self, token_id: str, token: PublicTokenInfo, update_mask: FieldMask) body["token"] = token.as_dict() if update_mask is not None: body["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10327,8 +9313,6 @@ def update(self, token_id: str, token: PublicTokenInfo, update_mask: FieldMask) class WorkspaceConfAPI: - """This API allows updating known workspace settings for advanced users.""" - def __init__(self, api_client): self._api = api_client @@ -10343,9 +9327,7 @@ def get_status(self, keys: str) -> WorkspaceConf: query = {} if keys is not None: query["keys"] = keys - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10357,9 +9339,7 @@ def get_status(self, keys: str) -> WorkspaceConf: def set_status(self, contents: Dict[str, str]): """Sets the configuration status for a workspace, including enabling or disabling it.""" - headers = { - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10369,12 +9349,6 @@ def set_status(self, contents: Dict[str, str]): class WorkspaceNetworkConfigurationAPI: - """These APIs allow configuration of network settings for Databricks workspaces by selecting which network - policy to associate with the workspace. Each workspace is always associated with exactly one network - policy that controls which network destinations can be accessed from the Databricks environment. By - default, workspaces are associated with the 'default-policy' network policy. You cannot create or delete a - workspace's network option, only update it to associate the workspace with a different policy""" - def __init__(self, api_client): self._api = api_client @@ -10388,9 +9362,7 @@ def get_workspace_network_option_rpc(self, workspace_id: int) -> WorkspaceNetwor :returns: :class:`WorkspaceNetworkOption` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}/network", headers=headers @@ -10413,10 +9385,7 @@ def update_workspace_network_option_rpc( body = workspace_network_option.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PUT", diff --git a/databricks/sdk/service/settingsv2.py b/databricks/sdk/service/settingsv2.py index 103948825..43af9fdc9 100644 --- a/databricks/sdk/service/settingsv2.py +++ b/databricks/sdk/service/settingsv2.py @@ -1056,8 +1056,6 @@ def from_dict(cls, d: Dict[str, Any]) -> UserPreference: class AccountSettingsV2API: - """APIs to manage account level settings""" - def __init__(self, api_client): self._api = api_client @@ -1070,9 +1068,7 @@ def get_public_account_setting(self, name: str) -> Setting: :returns: :class:`Setting` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do("GET", f"/api/2.1/accounts/{self._api.account_id}/settings/{name}", headers=headers) return Setting.from_dict(res) @@ -1091,9 +1087,7 @@ def get_public_account_user_preference(self, user_id: str, name: str) -> UserPre :returns: :class:`UserPreference` """ - headers = { - "Accept": "application/json", - } + headers = {} res = self._api.do( "GET", f"/api/2.1/accounts/{self._api.account_id}/users/{user_id}/settings/{name}", headers=headers @@ -1125,9 +1119,7 @@ def list_account_settings_metadata( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -1169,9 +1161,7 @@ def list_account_user_preferences_metadata( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} while True: json = self._api.do( @@ -1203,10 +1193,7 @@ def patch_public_account_setting(self, name: str, setting: Setting) -> Setting: body = setting.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", f"/api/2.1/accounts/{self._api.account_id}/settings/{name}", body=body, headers=headers @@ -1231,10 +1218,7 @@ def patch_public_account_user_preference(self, user_id: str, name: str, setting: body = setting.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} res = self._api.do( "PATCH", @@ -1246,8 +1230,6 @@ def patch_public_account_user_preference(self, user_id: str, name: str, setting: class WorkspaceSettingsV2API: - """APIs to manage workspace level settings""" - def __init__(self, api_client): self._api = api_client @@ -1261,9 +1243,7 @@ def get_public_workspace_setting(self, name: str) -> Setting: :returns: :class:`Setting` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1298,9 +1278,7 @@ def list_workspace_settings_metadata( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1332,10 +1310,7 @@ def patch_public_workspace_setting(self, name: str, setting: Setting) -> Setting body = setting.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/sharing.py b/databricks/sdk/service/sharing.py index 3c42955e0..219dda7bc 100644 --- a/databricks/sdk/service/sharing.py +++ b/databricks/sdk/service/sharing.py @@ -20,9 +20,6 @@ ) -from databricks.sdk.service import catalog - - _LOG = logging.getLogger("databricks.sdk") @@ -987,10 +984,9 @@ class OidcFederationPolicy: - For Entra ID (AAD): - - U2M flow (group access): Use ``groups``. - - U2M flow (user access): Use ``oid``. - - M2M flow (OAuth App access): Use ``azp``. - + - U2M flow (group access): Use ``groups``. + - U2M flow (user access): Use ``oid``. + - M2M flow (OAuth App access): Use ``azp``. - For other IdPs, refer to the specific IdP documentation. Supported ``subject_claim`` values are: @@ -2459,9 +2455,6 @@ def from_dict(cls, d: Dict[str, Any]) -> Volume: class ProvidersAPI: - """A data provider is an object representing the organization in the real world who shares the data. A - provider contains shares which further contain the shared data.""" - def __init__(self, api_client): self._api = api_client @@ -2497,10 +2490,7 @@ def create( body["name"] = name if recipient_profile_str is not None: body["recipient_profile_str"] = recipient_profile_str - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2537,9 +2527,7 @@ def get(self, name: str) -> ProviderInfo: :returns: :class:`ProviderInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2587,9 +2575,7 @@ def list( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2644,9 +2630,7 @@ def list_provider_share_assets( query["table_max_results"] = table_max_results if volume_max_results is not None: query["volume_max_results"] = volume_max_results - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2689,9 +2673,7 @@ def list_shares( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2745,10 +2727,7 @@ def update( body["owner"] = owner if recipient_profile_str is not None: body["recipient_profile_str"] = recipient_profile_str - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2759,14 +2738,6 @@ def update( class RecipientActivationAPI: - """The Recipient Activation API is only applicable in the open sharing model where the recipient object has - the authentication type of ``TOKEN``. The data recipient follows the activation link shared by the data - provider to download the credential file that includes the access token. The recipient will then use the - credential file to establish a secure connection with the provider to receive the shared data. - - Note that you can download the credential file only once. Recipients should treat the downloaded - credential as a secret and must not share it outside of their organization.""" - def __init__(self, api_client): self._api = api_client @@ -2779,9 +2750,7 @@ def get_activation_url_info(self, activation_url: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2800,9 +2769,7 @@ def retrieve_token(self, activation_url: str) -> RetrieveTokenResponse: :returns: :class:`RetrieveTokenResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2815,37 +2782,14 @@ def retrieve_token(self, activation_url: str) -> RetrieveTokenResponse: class RecipientFederationPoliciesAPI: - """The Recipient Federation Policies APIs are only applicable in the open sharing model where the recipient - object has the authentication type of ``OIDC_RECIPIENT``, enabling data sharing from Databricks to - non-Databricks recipients. OIDC Token Federation enables secure, secret-less authentication for accessing - Delta Sharing servers. Users and applications authenticate using short-lived OIDC tokens issued by their - own Identity Provider (IdP), such as Azure Entra ID or Okta, without the need for managing static - credentials or client secrets. A federation policy defines how non-Databricks recipients authenticate - using OIDC tokens. It validates the OIDC claims in federated tokens and is set at the recipient level. The - caller must be the owner of the recipient to create or manage a federation policy. Federation policies - support the following scenarios: - - - User-to-Machine (U2M) flow: A user accesses Delta Shares using their own identity, such as connecting - through PowerBI Delta Sharing Client. - - Machine-to-Machine (M2M) flow: An application accesses Delta Shares using its own identity, typically - for automation tasks like nightly jobs through Python Delta Sharing Client. OIDC Token Federation - enables fine-grained access control, supports Multi-Factor Authentication (MFA), and enhances security - by minimizing the risk of credential leakage through the use of short-lived, expiring tokens. It is - designed for strong identity governance, secure cross-platform data sharing, and reduced operational - overhead for credential management. - - For more information, see - https://www.databricks.com/blog/announcing-oidc-token-federation-enhanced-delta-sharing-security and - https://docs.databricks.com/en/delta-sharing/create-recipient-oidc-fed""" - def __init__(self, api_client): self._api = api_client def create(self, recipient_name: str, policy: FederationPolicy) -> FederationPolicy: - """Create a federation policy for an OIDC_FEDERATION recipient for sharing data from Databricks to - non-Databricks recipients. The caller must be the owner of the recipient. When sharing data from - Databricks to non-Databricks clients, you can define a federation policy to authenticate - non-Databricks recipients. The federation policy validates OIDC claims in federated tokens and is + """Create a federation policy for an OIDC_FEDERATION recipient for sharing data from to + non- recipients. The caller must be the owner of the recipient. When sharing data from + to non- clients, you can define a federation policy to authenticate + non- recipients. The federation policy validates OIDC claims in federated tokens and is defined at the recipient level. This enables secretless sharing clients to authenticate using OIDC tokens. @@ -2880,10 +2824,7 @@ def create(self, recipient_name: str, policy: FederationPolicy) -> FederationPol body = policy.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2906,9 +2847,7 @@ def delete(self, recipient_name: str, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2919,8 +2858,8 @@ def delete(self, recipient_name: str, name: str): ) def get_federation_policy(self, recipient_name: str, name: str) -> FederationPolicy: - """Reads an existing federation policy for an OIDC_FEDERATION recipient for sharing data from Databricks - to non-Databricks recipients. The caller must have read access to the recipient. + """Reads an existing federation policy for an OIDC_FEDERATION recipient for sharing data from + to non- recipients. The caller must have read access to the recipient. :param recipient_name: str Name of the recipient. This is the name of the recipient for which the policy is being retrieved. @@ -2930,9 +2869,7 @@ def get_federation_policy(self, recipient_name: str, name: str) -> FederationPol :returns: :class:`FederationPolicy` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2946,8 +2883,8 @@ def get_federation_policy(self, recipient_name: str, name: str) -> FederationPol def list( self, recipient_name: str, *, max_results: Optional[int] = None, page_token: Optional[str] = None ) -> Iterator[FederationPolicy]: - """Lists federation policies for an OIDC_FEDERATION recipient for sharing data from Databricks to - non-Databricks recipients. The caller must have read access to the recipient. + """Lists federation policies for an OIDC_FEDERATION recipient for sharing data from to + non- recipients. The caller must have read access to the recipient. :param recipient_name: str Name of the recipient. This is the name of the recipient for which the policies are being listed. @@ -2962,9 +2899,7 @@ def list( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2986,20 +2921,6 @@ def list( class RecipientsAPI: - """A recipient is an object you create using :method:recipients/create to represent an organization which you - want to allow access shares. The way how sharing works differs depending on whether or not your recipient - has access to a Databricks workspace that is enabled for Unity Catalog: - - - For recipients with access to a Databricks workspace that is enabled for Unity Catalog, you can create a - recipient object along with a unique sharing identifier you get from the recipient. The sharing - identifier is the key identifier that enables the secure connection. This sharing mode is called - **Databricks-to-Databricks sharing**. - - For recipients without access to a Databricks workspace that is enabled for Unity Catalog, when you - create a recipient object, Databricks generates an activation link you can send to the recipient. The - recipient follows the activation link to download the credential file, and then uses the credential file - to establish a secure connection to receive the shared data. This sharing mode is called **open - sharing**.""" - def __init__(self, api_client): self._api = api_client @@ -3069,10 +2990,7 @@ def create( body["properties_kvpairs"] = properties_kvpairs.as_dict() if sharing_code is not None: body["sharing_code"] = sharing_code - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3111,9 +3029,7 @@ def get(self, name: str) -> RecipientInfo: :returns: :class:`RecipientInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3161,9 +3077,7 @@ def list( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3197,10 +3111,7 @@ def rotate_token(self, name: str, existing_token_expire_in_seconds: int) -> Reci body = {} if existing_token_expire_in_seconds is not None: body["existing_token_expire_in_seconds"] = existing_token_expire_in_seconds - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3239,9 +3150,7 @@ def share_permissions( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3305,10 +3214,7 @@ def update( body["owner"] = owner if properties_kvpairs is not None: body["properties_kvpairs"] = properties_kvpairs.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3319,11 +3225,6 @@ def update( class SharesAPI: - """A share is a container instantiated with :method:shares/create. Once created you can iteratively register - a collection of existing data assets defined within the metastore using :method:shares/update. You can - register data assets under their original name, qualified by their original schema, or provide alternate - exposed names.""" - def __init__(self, api_client): self._api = api_client @@ -3348,10 +3249,7 @@ def create(self, name: str, *, comment: Optional[str] = None, storage_root: Opti body["name"] = name if storage_root is not None: body["storage_root"] = storage_root - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3392,9 +3290,7 @@ def get(self, name: str, *, include_shared_data: Optional[bool] = None) -> Share query = {} if include_shared_data is not None: query["include_shared_data"] = include_shared_data - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3432,9 +3328,7 @@ def list_shares( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3481,9 +3375,7 @@ def share_permissions( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3545,10 +3437,7 @@ def update( body["storage_root"] = storage_root if updates is not None: body["updates"] = [v.as_dict() for v in updates] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3585,10 +3474,7 @@ def update_permissions( body["changes"] = [v.as_dict() for v in changes] if omit_permissions_list is not None: body["omit_permissions_list"] = omit_permissions_list - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/sql.py b/databricks/sdk/service/sql.py index d657bdfea..82be49ce6 100644 --- a/databricks/sdk/service/sql.py +++ b/databricks/sdk/service/sql.py @@ -97,13 +97,13 @@ class Alert: """The timestamp indicating when the alert was created.""" custom_body: Optional[str] = None - """Custom body of alert notification, if it exists. See `here - `__ for custom templating instructions.""" + """Custom body of alert notification, if it exists. See [here](/sql/user/alerts/index.html) for + custom templating instructions.""" custom_subject: Optional[str] = None """Custom subject of alert notification, if it exists. This can include email subject entries and - Slack notification headers, for example. See `here - `__ for custom templating instructions.""" + Slack notification headers, for example. See [here](/sql/user/alerts/index.html) for custom + templating instructions.""" display_name: Optional[str] = None """The display name of the alert.""" @@ -1497,13 +1497,13 @@ class CreateAlertRequestAlert: """Trigger conditions of the alert.""" custom_body: Optional[str] = None - """Custom body of alert notification, if it exists. See `here - `__ for custom templating instructions.""" + """Custom body of alert notification, if it exists. See [here](/sql/user/alerts/index.html) for + custom templating instructions.""" custom_subject: Optional[str] = None """Custom subject of alert notification, if it exists. This can include email subject entries and - Slack notification headers, for example. See `here - `__ for custom templating instructions.""" + Slack notification headers, for example. See [here](/sql/user/alerts/index.html) for custom + templating instructions.""" display_name: Optional[str] = None """The display name of the alert.""" @@ -3115,31 +3115,6 @@ def from_dict(cls, d: Dict[str, Any]) -> GetResponse: ) -@dataclass -class GetWarehousePermissionLevelsResponse: - permission_levels: Optional[List[WarehousePermissionsDescription]] = None - """Specific permission levels""" - - def as_dict(self) -> dict: - """Serializes the GetWarehousePermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GetWarehousePermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.permission_levels: - body["permission_levels"] = self.permission_levels - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GetWarehousePermissionLevelsResponse: - """Deserializes the GetWarehousePermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", WarehousePermissionsDescription)) - - @dataclass class GetWarehouseResponse: auto_stop_mins: Optional[int] = None @@ -3956,13 +3931,13 @@ class ListAlertsResponseAlert: """The timestamp indicating when the alert was created.""" custom_body: Optional[str] = None - """Custom body of alert notification, if it exists. See `here - `__ for custom templating instructions.""" + """Custom body of alert notification, if it exists. See [here](/sql/user/alerts/index.html) for + custom templating instructions.""" custom_subject: Optional[str] = None """Custom subject of alert notification, if it exists. This can include email subject entries and - Slack notification headers, for example. See `here - `__ for custom templating instructions.""" + Slack notification headers, for example. See [here](/sql/user/alerts/index.html) for custom + templating instructions.""" display_name: Optional[str] = None """The display name of the alert.""" @@ -5046,9 +5021,9 @@ class QueryInfo: """The query ID.""" query_source: Optional[ExternalQuerySource] = None - """A struct that contains key-value pairs representing Databricks entities that were involved in + """A struct that contains key-value pairs representing entities that were involved in the execution of this statement, such as jobs, notebooks, or dashboards. This field only records - Databricks entities.""" + entities.""" query_start_time_ms: Optional[int] = None """The time the query started.""" @@ -6793,13 +6768,13 @@ class UpdateAlertRequestAlert: """Trigger conditions of the alert.""" custom_body: Optional[str] = None - """Custom body of alert notification, if it exists. See `here - `__ for custom templating instructions.""" + """Custom body of alert notification, if it exists. See [here](/sql/user/alerts/index.html) for + custom templating instructions.""" custom_subject: Optional[str] = None """Custom subject of alert notification, if it exists. This can include email subject entries and - Slack notification headers, for example. See `here - `__ for custom templating instructions.""" + Slack notification headers, for example. See [here](/sql/user/alerts/index.html) for custom + templating instructions.""" display_name: Optional[str] = None """The display name of the alert.""" @@ -7172,238 +7147,6 @@ def from_dict(cls, d: Dict[str, Any]) -> Visualization: ) -@dataclass -class WarehouseAccessControlRequest: - group_name: Optional[str] = None - """name of the group""" - - permission_level: Optional[WarehousePermissionLevel] = None - - service_principal_name: Optional[str] = None - """application ID of a service principal""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the WarehouseAccessControlRequest into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the WarehouseAccessControlRequest into a shallow dictionary of its immediate attributes.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> WarehouseAccessControlRequest: - """Deserializes the WarehouseAccessControlRequest from a dictionary.""" - return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", WarehousePermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class WarehouseAccessControlResponse: - all_permissions: Optional[List[WarehousePermission]] = None - """All permissions.""" - - display_name: Optional[str] = None - """Display name of the user or service principal.""" - - group_name: Optional[str] = None - """name of the group""" - - service_principal_name: Optional[str] = None - """Name of the service principal.""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the WarehouseAccessControlResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the WarehouseAccessControlResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.all_permissions: - body["all_permissions"] = self.all_permissions - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> WarehouseAccessControlResponse: - """Deserializes the WarehouseAccessControlResponse from a dictionary.""" - return cls( - all_permissions=_repeated_dict(d, "all_permissions", WarehousePermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class WarehousePermission: - inherited: Optional[bool] = None - - inherited_from_object: Optional[List[str]] = None - - permission_level: Optional[WarehousePermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the WarehousePermission into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the WarehousePermission into a shallow dictionary of its immediate attributes.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> WarehousePermission: - """Deserializes the WarehousePermission from a dictionary.""" - return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", WarehousePermissionLevel), - ) - - -class WarehousePermissionLevel(Enum): - """Permission level""" - - CAN_MANAGE = "CAN_MANAGE" - CAN_MONITOR = "CAN_MONITOR" - CAN_USE = "CAN_USE" - CAN_VIEW = "CAN_VIEW" - IS_OWNER = "IS_OWNER" - - -@dataclass -class WarehousePermissions: - access_control_list: Optional[List[WarehouseAccessControlResponse]] = None - - object_id: Optional[str] = None - - object_type: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the WarehousePermissions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - def as_shallow_dict(self) -> dict: - """Serializes the WarehousePermissions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.access_control_list: - body["access_control_list"] = self.access_control_list - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> WarehousePermissions: - """Deserializes the WarehousePermissions from a dictionary.""" - return cls( - access_control_list=_repeated_dict(d, "access_control_list", WarehouseAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), - ) - - -@dataclass -class WarehousePermissionsDescription: - description: Optional[str] = None - - permission_level: Optional[WarehousePermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the WarehousePermissionsDescription into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the WarehousePermissionsDescription into a shallow dictionary of its immediate attributes.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> WarehousePermissionsDescription: - """Deserializes the WarehousePermissionsDescription from a dictionary.""" - return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", WarehousePermissionLevel), - ) - - @dataclass class WarehouseTypePair: """Configuration values to enable or disable the access to specific warehouse types in the @@ -7640,11 +7383,6 @@ def from_dict(cls, d: Dict[str, Any]) -> WidgetPosition: class AlertsAPI: - """The alerts API can be used to perform CRUD operations on alerts. An alert is a Databricks SQL object that - periodically runs a query, evaluates a condition of its result, and notifies one or more users and/or - notification destinations if the condition was met. Alerts can be scheduled using the ``sql_task`` type of - the Jobs API, e.g. :method:jobs/create.""" - def __init__(self, api_client): self._api = api_client @@ -7666,10 +7404,7 @@ def create( body["alert"] = alert.as_dict() if auto_resolve_display_name is not None: body["auto_resolve_display_name"] = auto_resolve_display_name - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7688,9 +7423,7 @@ def delete(self, id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7706,9 +7439,7 @@ def get(self, id: str) -> Alert: :returns: :class:`Alert` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7734,9 +7465,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7763,15 +7492,6 @@ def update( :param id: str :param update_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :param alert: :class:`UpdateAlertRequestAlert` (optional) :param auto_resolve_display_name: bool (optional) If true, automatically resolve alert display name conflicts. Otherwise, fail the request if the @@ -7787,10 +7507,7 @@ def update( body["auto_resolve_display_name"] = auto_resolve_display_name if update_mask is not None: body["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7801,14 +7518,6 @@ def update( class AlertsLegacyAPI: - """The alerts API can be used to perform CRUD operations on alerts. An alert is a Databricks SQL object that - periodically runs a query, evaluates a condition of its result, and notifies one or more users and/or - notification destinations if the condition was met. Alerts can be scheduled using the ``sql_task`` type of - the Jobs API, e.g. :method:jobs/create. - - **Warning**: This API is deprecated. Please see the latest version of the Databricks SQL API. `Learn more - `__""" - def __init__(self, api_client): self._api = api_client @@ -7853,10 +7562,7 @@ def create( body["query_id"] = query_id if rearm is not None: body["rearm"] = rearm - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7877,9 +7583,7 @@ def delete(self, alert_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7898,9 +7602,7 @@ def get(self, alert_id: str) -> LegacyAlert: :returns: :class:`LegacyAlert` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7919,9 +7621,7 @@ def list(self) -> Iterator[LegacyAlert]: :returns: Iterator over :class:`LegacyAlert` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7959,10 +7659,7 @@ def update(self, alert_id: str, name: str, options: AlertOptions, query_id: str, body["query_id"] = query_id if rearm is not None: body["rearm"] = rearm - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -7972,8 +7669,6 @@ def update(self, alert_id: str, name: str, options: AlertOptions, query_id: str, class AlertsV2API: - """New version of SQL Alerts""" - def __init__(self, api_client): self._api = api_client @@ -7987,10 +7682,7 @@ def create_alert(self, alert: AlertV2) -> AlertV2: body = alert.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8007,9 +7699,7 @@ def get_alert(self, id: str) -> AlertV2: :returns: :class:`AlertV2` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8032,9 +7722,7 @@ def list_alerts(self, *, page_size: Optional[int] = None, page_token: Optional[s query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8064,9 +7752,7 @@ def trash_alert(self, id: str, *, purge: Optional[bool] = None): query = {} if purge is not None: query["purge"] = purge - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8081,15 +7767,6 @@ def update_alert(self, id: str, alert: AlertV2, update_mask: str) -> AlertV2: The canonical identifier of the alert to retrieve information about. :param alert: :class:`AlertV2` :param update_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`AlertV2` """ @@ -8098,10 +7775,7 @@ def update_alert(self, id: str, alert: AlertV2, update_mask: str) -> AlertV2: query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8112,9 +7786,6 @@ def update_alert(self, id: str, alert: AlertV2, update_mask: str) -> AlertV2: class DashboardWidgetsAPI: - """This is an evolving API that facilitates the addition and removal of widgets from existing dashboards - within the Databricks Workspace. Data structures may change over time.""" - def __init__(self, api_client): self._api = api_client @@ -8154,10 +7825,7 @@ def create( body["visualization_id"] = visualization_id if width is not None: body["width"] = width - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8175,9 +7843,7 @@ def delete(self, id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8224,10 +7890,7 @@ def update( body["visualization_id"] = visualization_id if width is not None: body["width"] = width - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8238,15 +7901,6 @@ def update( class DashboardsAPI: - """In general, there is little need to modify dashboards using the API. However, it can be useful to use - dashboard objects to look-up a collection of related query IDs. The API can also be used to duplicate - multiple dashboards at once since you can get a dashboard definition with a GET request and then POST it - to create a new one. Dashboards can be scheduled using the ``sql_task`` type of the Jobs API, e.g. - :method:jobs/create. - - **Warning**: This API is deprecated. Please use the AI/BI Dashboards API instead. `Learn more - `__""" - def __init__(self, api_client): self._api = api_client @@ -8262,9 +7916,7 @@ def delete(self, dashboard_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8283,9 +7935,7 @@ def get(self, dashboard_id: str) -> Dashboard: :returns: :class:`Dashboard` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8331,9 +7981,7 @@ def list( query["page_size"] = page_size if q is not None: query["q"] = q - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8360,9 +8008,7 @@ def restore(self, dashboard_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8404,10 +8050,7 @@ def update( body["run_as_role"] = run_as_role.value if tags is not None: body["tags"] = [v for v in tags] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8418,17 +8061,6 @@ def update( class DataSourcesAPI: - """This API is provided to assist you in making new query objects. When creating a query object, you may - optionally specify a ``data_source_id`` for the SQL warehouse against which it will run. If you don't - already know the ``data_source_id`` for your desired SQL warehouse, this API will help you find it. - - This API does not support searches. It returns the full list of SQL warehouses in your workspace. We - advise you to use any text editor, REST client, or ``grep`` to search the response from this API for the - name of your SQL warehouse as it appears in Databricks SQL. - - **Warning**: This API is deprecated. Please see the latest version of the Databricks SQL API. `Learn more - `__""" - def __init__(self, api_client): self._api = api_client @@ -8444,9 +8076,7 @@ def list(self) -> Iterator[DataSource]: :returns: Iterator over :class:`DataSource` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8457,40 +8087,24 @@ def list(self) -> Iterator[DataSource]: class DbsqlPermissionsAPI: - """The SQL Permissions API is similar to the endpoints of the :method:permissions/set. However, this exposes - only one endpoint, which gets the Access Control List for a given object. You cannot modify any - permissions using this API. - - There are three levels of permission: - - - ``CAN_VIEW``: Allows read-only access - - ``CAN_RUN``: Allows read access and run access (superset of ``CAN_VIEW``) - - ``CAN_MANAGE``: Allows all actions: read, run, edit, delete, modify permissions (superset of - ``CAN_RUN``) - - **Warning**: This API is deprecated. Please see the latest version of the Databricks SQL API. `Learn more - `__""" - def __init__(self, api_client): self._api = api_client - def get(self, object_type: ObjectTypePlural, object_id: str) -> GetResponse: + def get(self, object_id: str, object_type: ObjectTypePlural) -> GetResponse: """Gets a JSON representation of the access control list (ACL) for a specified object. **Warning**: This API is deprecated. Please use :method:workspace/getpermissions instead. `Learn more `__ - :param object_type: :class:`ObjectTypePlural` - The type of object permissions to check. :param object_id: str Object ID. An ACL is returned for the object with this UUID. + :param object_type: :class:`ObjectTypePlural` + The type of object permissions to check. :returns: :class:`GetResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8501,8 +8115,8 @@ def get(self, object_type: ObjectTypePlural, object_id: str) -> GetResponse: def set( self, - object_type: ObjectTypePlural, object_id: str, + object_type: ObjectTypePlural, *, access_control_list: Optional[List[AccessControl]] = None, ) -> SetResponse: @@ -8512,10 +8126,10 @@ def set( **Warning**: This API is deprecated. Please use :method:workspace/setpermissions instead. `Learn more `__ - :param object_type: :class:`ObjectTypePlural` - The type of object permission to set. :param object_id: str Object ID. The ACL for the object with this UUID is overwritten by this request's POST content. + :param object_type: :class:`ObjectTypePlural` + The type of object permission to set. :param access_control_list: List[:class:`AccessControl`] (optional) :returns: :class:`SetResponse` @@ -8524,10 +8138,7 @@ def set( body = {} if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8539,7 +8150,7 @@ def set( return SetResponse.from_dict(res) def transfer_ownership( - self, object_type: OwnableObjectType, object_id: TransferOwnershipObjectId, *, new_owner: Optional[str] = None + self, object_id: TransferOwnershipObjectId, object_type: OwnableObjectType, *, new_owner: Optional[str] = None ) -> Success: """Transfers ownership of a dashboard, query, or alert to an active user. Requires an admin API key. @@ -8547,10 +8158,10 @@ def transfer_ownership( :method:alerts/update respectively instead. `Learn more `__ - :param object_type: :class:`OwnableObjectType` - The type of object on which to change ownership. :param object_id: :class:`TransferOwnershipObjectId` The ID of the object on which to change ownership. + :param object_type: :class:`OwnableObjectType` + The type of object on which to change ownership. :param new_owner: str (optional) Email address for the new owner, who must exist in the workspace. @@ -8560,10 +8171,7 @@ def transfer_ownership( body = {} if new_owner is not None: body["new_owner"] = new_owner - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8579,10 +8187,6 @@ def transfer_ownership( class QueriesAPI: - """The queries API can be used to perform CRUD operations on queries. A query is a Databricks SQL object that - includes the target SQL warehouse, query text, name, description, tags, and parameters. Queries can be - scheduled using the ``sql_task`` type of the Jobs API, e.g. :method:jobs/create.""" - def __init__(self, api_client): self._api = api_client @@ -8604,10 +8208,7 @@ def create( body["auto_resolve_display_name"] = auto_resolve_display_name if query is not None: body["query"] = query.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8626,9 +8227,7 @@ def delete(self, id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8644,9 +8243,7 @@ def get(self, id: str) -> Query: :returns: :class:`Query` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8672,9 +8269,7 @@ def list( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8706,9 +8301,7 @@ def list_visualizations( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8735,15 +8328,6 @@ def update( :param id: str :param update_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :param auto_resolve_display_name: bool (optional) If true, automatically resolve alert display name conflicts. Otherwise, fail the request if the alert's display name conflicts with an existing alert's display name. @@ -8759,10 +8343,7 @@ def update( body["query"] = query.as_dict() if update_mask is not None: body["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8773,13 +8354,6 @@ def update( class QueriesLegacyAPI: - """These endpoints are used for CRUD operations on query definitions. Query definitions include the target - SQL warehouse, query text, name, description, tags, parameters, and visualizations. Queries can be - scheduled using the ``sql_task`` type of the Jobs API, e.g. :method:jobs/create. - - **Warning**: This API is deprecated. Please see the latest version of the Databricks SQL API. `Learn more - `__""" - def __init__(self, api_client): self._api = api_client @@ -8847,10 +8421,7 @@ def create( body["run_as_role"] = run_as_role.value if tags is not None: body["tags"] = [v for v in tags] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8871,9 +8442,7 @@ def delete(self, query_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8893,9 +8462,7 @@ def get(self, query_id: str) -> LegacyQuery: :returns: :class:`LegacyQuery` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8949,9 +8516,7 @@ def list( query["page_size"] = page_size if q is not None: query["q"] = q - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -8979,9 +8544,7 @@ def restore(self, query_id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9045,10 +8608,7 @@ def update( body["run_as_role"] = run_as_role.value if tags is not None: body["tags"] = [v for v in tags] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9059,8 +8619,7 @@ def update( class QueryHistoryAPI: - """A service responsible for storing and retrieving the list of queries run against SQL endpoints and - serverless compute.""" + """History service API""" def __init__(self, api_client): self._api = api_client @@ -9105,9 +8664,7 @@ def list( query["max_results"] = max_results if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9118,9 +8675,6 @@ def list( class QueryVisualizationsAPI: - """This is an evolving API that facilitates the addition and removal of visualizations from existing queries - in the Databricks Workspace. Data structures can change over time.""" - def __init__(self, api_client): self._api = api_client @@ -9135,10 +8689,7 @@ def create(self, *, visualization: Optional[CreateVisualizationRequestVisualizat body = {} if visualization is not None: body["visualization"] = visualization.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9155,9 +8706,7 @@ def delete(self, id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9172,15 +8721,6 @@ def update( :param id: str :param update_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :param visualization: :class:`UpdateVisualizationRequestVisualization` (optional) :returns: :class:`Visualization` @@ -9191,10 +8731,7 @@ def update( body["update_mask"] = update_mask if visualization is not None: body["visualization"] = visualization.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9205,12 +8742,6 @@ def update( class QueryVisualizationsLegacyAPI: - """This is an evolving API that facilitates the addition and removal of visualizations from existing queries - within the Databricks Workspace. Data structures may change over time. - - **Warning**: This API is deprecated. Please see the latest version of the Databricks SQL API. `Learn more - `__""" - def __init__(self, api_client): self._api = api_client @@ -9248,10 +8779,7 @@ def create( body["query_id"] = query_id if type is not None: body["type"] = type - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9272,9 +8800,7 @@ def delete(self, id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9322,8 +8848,6 @@ def update( body["created_at"] = created_at if description is not None: body["description"] = description - if id is not None: - body["id"] = id if name is not None: body["name"] = name if options is not None: @@ -9334,10 +8858,7 @@ def update( body["type"] = type if updated_at is not None: body["updated_at"] = updated_at - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9348,8 +8869,6 @@ def update( class RedashConfigAPI: - """Redash V2 service for workspace configurations (internal)""" - def __init__(self, api_client): self._api = api_client @@ -9360,9 +8879,7 @@ def get_config(self) -> ClientConfig: :returns: :class:`ClientConfig` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9373,97 +8890,6 @@ def get_config(self) -> ClientConfig: class StatementExecutionAPI: - """The Databricks SQL Statement Execution API can be used to execute SQL statements on a SQL warehouse and - fetch the result. - - **Getting started** - - We suggest beginning with the `Databricks SQL Statement Execution API tutorial - `__. - - **Overview of statement execution and result fetching** - - Statement execution begins by issuing a :method:statementexecution/executeStatement request with a valid - SQL statement and warehouse ID, along with optional parameters such as the data catalog and output format. - If no other parameters are specified, the server will wait for up to 10s before returning a response. If - the statement has completed within this timespan, the response will include the result data as a JSON - array and metadata. Otherwise, if no result is available after the 10s timeout expired, the response will - provide the statement ID that can be used to poll for results by using a - :method:statementexecution/getStatement request. - - You can specify whether the call should behave synchronously, asynchronously or start synchronously with a - fallback to asynchronous execution. This is controlled with the ``wait_timeout`` and ``on_wait_timeout`` - settings. If ``wait_timeout`` is set between 5-50 seconds (default: 10s), the call waits for results up to - the specified timeout; when set to ``0s``, the call is asynchronous and responds immediately with a - statement ID. The ``on_wait_timeout`` setting specifies what should happen when the timeout is reached - while the statement execution has not yet finished. This can be set to either ``CONTINUE``, to fallback to - asynchronous mode, or it can be set to ``CANCEL``, which cancels the statement. - - In summary: - - - **Synchronous mode** (``wait_timeout=30s`` and ``on_wait_timeout=CANCEL``): The call waits up to 30 - seconds; if the statement execution finishes within this time, the result data is returned directly in - the response. If the execution takes longer than 30 seconds, the execution is canceled and the call - returns with a ``CANCELED`` state. - - **Asynchronous mode** (``wait_timeout=0s`` and ``on_wait_timeout`` is ignored): The call doesn't wait - for the statement to finish but returns directly with a statement ID. The status of the statement - execution can be polled by issuing :method:statementexecution/getStatement with the statement ID. Once - the execution has succeeded, this call also returns the result and metadata in the response. - - **[Default] Hybrid mode** (``wait_timeout=10s`` and ``on_wait_timeout=CONTINUE``): The call waits for up - to 10 seconds; if the statement execution finishes within this time, the result data is returned - directly in the response. If the execution takes longer than 10 seconds, a statement ID is returned. The - statement ID can be used to fetch status and results in the same way as in the asynchronous mode. - - Depending on the size, the result can be split into multiple chunks. If the statement execution is - successful, the statement response contains a manifest and the first chunk of the result. The manifest - contains schema information and provides metadata for each chunk in the result. Result chunks can be - retrieved by index with :method:statementexecution/getStatementResultChunkN which may be called in any - order and in parallel. For sequential fetching, each chunk, apart from the last, also contains a - ``next_chunk_index`` and ``next_chunk_internal_link`` that point to the next chunk. - - A statement can be canceled with :method:statementexecution/cancelExecution. - - **Fetching result data: format and disposition** - - To specify the format of the result data, use the ``format`` field, which can be set to one of the - following options: ``JSON_ARRAY`` (JSON), ``ARROW_STREAM`` (`Apache Arrow Columnar - `__), or ``CSV``. - - There are two ways to receive statement results, controlled by the ``disposition`` setting, which can be - either ``INLINE`` or ``EXTERNAL_LINKS``: - - - ``INLINE``: In this mode, the result data is directly included in the response. It's best suited for - smaller results. This mode can only be used with the ``JSON_ARRAY`` format. - - ``EXTERNAL_LINKS``: In this mode, the response provides links that can be used to download the result - data in chunks separately. This approach is ideal for larger results and offers higher throughput. This - mode can be used with all the formats: ``JSON_ARRAY``, ``ARROW_STREAM``, and ``CSV``. - - By default, the API uses ``format=JSON_ARRAY`` and ``disposition=INLINE``. - - **Limits and limitations** - - Note: The byte limit for INLINE disposition is based on internal storage metrics and will not exactly - match the byte count of the actual payload. - - - Statements with ``disposition=INLINE`` are limited to 25 MiB and will fail when this limit is exceeded. - - Statements with ``disposition=EXTERNAL_LINKS`` are limited to 100 GiB. Result sets larger than this - limit will be truncated. Truncation is indicated by the ``truncated`` field in the result manifest. - - The maximum query text size is 16 MiB. - - Cancelation might silently fail. A successful response from a cancel request indicates that the cancel - request was successfully received and sent to the processing engine. However, an outstanding statement - might have already completed execution when the cancel request arrives. Polling for status until a - terminal state is reached is a reliable way to determine the final state. - - Wait timeouts are approximate, occur server-side, and cannot account for things such as caller delays - and network latency from caller to service. - - To keep a statement alive, poll for its status at least once every 15 minutes. Regular polling - guarantees the statement stays alive. - - To stop a statement you no longer need, cancel it explicitly with - :method:statementexecution/cancelExecution. Stopping polling does not cancel a statement. Explicit - cancellation is the only way to end statement execution on demand. - - The results are only available for one hour after success; polling does not extend this. - - The SQL Execution API must be used for the entire lifecycle of the statement. For example, you cannot - use the Jobs API to execute the command, and then the SQL Execution API to cancel it.""" - def __init__(self, api_client): self._api = api_client @@ -9478,16 +8904,13 @@ def cancel_execution(self, statement_id: str): """ - body = {} - headers = { - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id - self._api.do("POST", f"/api/2.0/sql/statements/{statement_id}/cancel", body=body, headers=headers) + self._api.do("POST", f"/api/2.0/sql/statements/{statement_id}/cancel", headers=headers) def execute_statement( self, @@ -9538,8 +8961,7 @@ def execute_statement( The ``EXTERNAL_LINKS`` disposition can be disabled upon request by creating a support case. - See also `Security best practices - `__. + See also [Security best practices](/sql/admin/sql-execution-tutorial.html#security-best-practices). StatementResponse contains ``statement_id`` and ``status``; other fields might be absent or present depending on context. If the SQL warehouse fails to execute the provided statement, a 200 response is @@ -9577,7 +8999,7 @@ def execute_statement( allows statements to generate arbitrarily sized result sets for fetching up to 100 GiB. The resulting links have two important properties: - 1. They point to resources *external* to the Databricks compute; therefore any associated + 1. They point to resources *external* to the compute; therefore any associated authentication information (typically a personal access token, OAuth token, or similar) *must be removed* when fetching from these links. 2. These are URLs with a specific expiration, indicated in the response. The behavior when @@ -9596,11 +9018,11 @@ def execute_statement( .. code-block:: - [ - [ "id-1", "1", null ], - [ "id-2", "2", null ], - [ "id-3", "3", null ], - ] + [ + [ "id-1", "1", null ], + [ "id-2", "2", null ], + [ "id-3", "3", null ], + ] When specifying ``format=JSON_ARRAY`` and ``disposition=EXTERNAL_LINKS``, each chunk in the result contains compact JSON with no indentation or extra whitespace. @@ -9645,7 +9067,7 @@ def execute_statement( .. code-block:: - SELECT * FROM my_table WHERE name = :my_name AND date = :my_date + SELECT * FROM my_table WHERE name = :my_name AND date = :my_date The parameters can be passed in the request body as follows: @@ -9665,8 +9087,6 @@ def execute_statement( to ``null`` or white space. Refer to the SQL language reference for the format specification of query tags. There's no significance to the order of tags. Only one value per key will be recorded. A sequence in excess of 20 query tags will be coerced to 20. Example: - - { ..., "query_tags": [ { "key": "team", "value": "eng" }, { "key": "some key only tag" } ] } :param row_limit: int (optional) Applies the given row limit to the statement's result set, but unlike the ``LIMIT`` clause in SQL, it also sets the ``truncated`` field in the response to indicate whether the result was trimmed due @@ -9716,10 +9136,7 @@ def execute_statement( body["wait_timeout"] = wait_timeout if warehouse_id is not None: body["warehouse_id"] = warehouse_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9745,9 +9162,7 @@ def get_statement(self, statement_id: str) -> StatementResponse: :returns: :class:`StatementResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9773,9 +9188,7 @@ def get_statement_result_chunk_n(self, statement_id: str, chunk_index: int) -> R :returns: :class:`ResultData` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -9788,9 +9201,6 @@ def get_statement_result_chunk_n(self, statement_id: str, chunk_index: int) -> R class WarehousesAPI: - """A SQL warehouse is a compute resource that lets you run SQL commands on data objects within Databricks - SQL. Compute resources are infrastructure resources that provide processing capabilities in the cloud.""" - def __init__(self, api_client): self._api = api_client @@ -9985,10 +9395,7 @@ def create( body["tags"] = tags.as_dict() if warehouse_type is not None: body["warehouse_type"] = warehouse_type.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10054,10 +9461,7 @@ def create_default_warehouse_override( query = {} if default_warehouse_override_id is not None: query["default_warehouse_override_id"] = default_warehouse_override_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10077,9 +9481,7 @@ def delete(self, id: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10099,9 +9501,7 @@ def delete_default_warehouse_override(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10242,10 +9642,7 @@ def edit( body["tags"] = tags.as_dict() if warehouse_type is not None: body["warehouse_type"] = warehouse_type.value - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10299,9 +9696,7 @@ def get(self, id: str) -> GetWarehouseResponse: :returns: :class:`GetWarehouseResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10323,9 +9718,7 @@ def get_default_warehouse_override(self, name: str) -> DefaultWarehouseOverride: :returns: :class:`DefaultWarehouseOverride` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10334,47 +9727,6 @@ def get_default_warehouse_override(self, name: str) -> DefaultWarehouseOverride: res = self._api.do("GET", f"/api/warehouses/v1/{name}", headers=headers) return DefaultWarehouseOverride.from_dict(res) - def get_permission_levels(self, warehouse_id: str) -> GetWarehousePermissionLevelsResponse: - """Gets the permission levels that a user can have on an object. - - :param warehouse_id: str - The SQL warehouse for which to get or manage permissions. - - :returns: :class:`GetWarehousePermissionLevelsResponse` - """ - - 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/permissions/warehouses/{warehouse_id}/permissionLevels", headers=headers) - return GetWarehousePermissionLevelsResponse.from_dict(res) - - def get_permissions(self, warehouse_id: str) -> WarehousePermissions: - """Gets the permissions of a SQL warehouse. SQL warehouses can inherit permissions from their root - object. - - :param warehouse_id: str - The SQL warehouse for which to get or manage permissions. - - :returns: :class:`WarehousePermissions` - """ - - 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/permissions/warehouses/{warehouse_id}", headers=headers) - return WarehousePermissions.from_dict(res) - def get_workspace_warehouse_config(self) -> GetWorkspaceWarehouseConfigResponse: """Gets the workspace level configuration that is shared by all SQL warehouses in a workspace. @@ -10382,9 +9734,7 @@ def get_workspace_warehouse_config(self) -> GetWorkspaceWarehouseConfigResponse: :returns: :class:`GetWorkspaceWarehouseConfigResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10420,9 +9770,7 @@ def list( query["page_token"] = page_token if run_as_user_id is not None: query["run_as_user_id"] = run_as_user_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10462,9 +9810,7 @@ def list_default_warehouse_overrides( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10479,34 +9825,6 @@ def list_default_warehouse_overrides( return query["page_token"] = json["next_page_token"] - def set_permissions( - self, warehouse_id: str, *, access_control_list: Optional[List[WarehouseAccessControlRequest]] = None - ) -> WarehousePermissions: - """Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct - permissions if none are specified. Objects can inherit permissions from their root object. - - :param warehouse_id: str - The SQL warehouse for which to get or manage permissions. - :param access_control_list: List[:class:`WarehouseAccessControlRequest`] (optional) - - :returns: :class:`WarehousePermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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("PUT", f"/api/2.0/permissions/warehouses/{warehouse_id}", body=body, headers=headers) - return WarehousePermissions.from_dict(res) - def set_workspace_warehouse_config( self, *, @@ -10573,10 +9891,7 @@ def set_workspace_warehouse_config( body["security_policy"] = security_policy.value if sql_configuration_parameters is not None: body["sql_configuration_parameters"] = sql_configuration_parameters.as_dict() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10595,17 +9910,13 @@ def start(self, id: str) -> Wait[GetWarehouseResponse]: See :method:wait_get_warehouse_running for more details. """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id - op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/start", body=body, headers=headers) + op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/start", headers=headers) return Wait(self.wait_get_warehouse_running, id=id) def start_and_wait(self, id: str, timeout=timedelta(minutes=20)) -> GetWarehouseResponse: @@ -10622,17 +9933,13 @@ def stop(self, id: str) -> Wait[GetWarehouseResponse]: See :method:wait_get_warehouse_stopped for more details. """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id - op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/stop", body=body, headers=headers) + op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/stop", headers=headers) return Wait(self.wait_get_warehouse_stopped, id=id) def stop_and_wait(self, id: str, timeout=timedelta(minutes=20)) -> GetWarehouseResponse: @@ -10673,10 +9980,7 @@ def update_default_warehouse_override( query["allow_missing"] = allow_missing if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -10684,31 +9988,3 @@ def update_default_warehouse_override( res = self._api.do("PATCH", f"/api/warehouses/v1/{name}", query=query, body=body, headers=headers) return DefaultWarehouseOverride.from_dict(res) - - def update_permissions( - self, warehouse_id: str, *, access_control_list: Optional[List[WarehouseAccessControlRequest]] = None - ) -> WarehousePermissions: - """Updates the permissions on a SQL warehouse. SQL warehouses can inherit permissions from their root - object. - - :param warehouse_id: str - The SQL warehouse for which to get or manage permissions. - :param access_control_list: List[:class:`WarehouseAccessControlRequest`] (optional) - - :returns: :class:`WarehousePermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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/permissions/warehouses/{warehouse_id}", body=body, headers=headers) - return WarehousePermissions.from_dict(res) diff --git a/databricks/sdk/service/supervisoragents.py b/databricks/sdk/service/supervisoragents.py index 8ac8b5b36..5cda57edb 100644 --- a/databricks/sdk/service/supervisoragents.py +++ b/databricks/sdk/service/supervisoragents.py @@ -5,7 +5,6 @@ from __future__ import annotations from dataclasses import dataclass -from enum import Enum from typing import Dict, List, Any, Iterator, Optional from google.protobuf.timestamp_pb2 import Timestamp @@ -13,7 +12,6 @@ import logging from databricks.sdk.service._internal import ( - _enum, _from_dict, _repeated_dict, _timestamp, @@ -29,7 +27,7 @@ @dataclass class App: - """Databricks app. Supported app: custom mcp, custom agent.""" + """ app. Supported app: custom mcp, custom agent.""" name: str """App name""" @@ -134,31 +132,6 @@ def from_dict(cls, d: Dict[str, Any]) -> GenieSpace: return cls(id=d.get("id", None)) -@dataclass -class GetSupervisorAgentPermissionLevelsResponse: - permission_levels: Optional[List[SupervisorAgentPermissionsDescription]] = None - """Specific permission levels""" - - def as_dict(self) -> dict: - """Serializes the GetSupervisorAgentPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GetSupervisorAgentPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.permission_levels: - body["permission_levels"] = self.permission_levels - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GetSupervisorAgentPermissionLevelsResponse: - """Deserializes the GetSupervisorAgentPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", SupervisorAgentPermissionsDescription)) - - @dataclass class KnowledgeAssistant: knowledge_assistant_id: str @@ -390,235 +363,6 @@ def from_dict(cls, d: Dict[str, Any]) -> SupervisorAgent: ) -@dataclass -class SupervisorAgentAccessControlRequest: - group_name: Optional[str] = None - """name of the group""" - - permission_level: Optional[SupervisorAgentPermissionLevel] = None - - service_principal_name: Optional[str] = None - """application ID of a service principal""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the SupervisorAgentAccessControlRequest into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the SupervisorAgentAccessControlRequest into a shallow dictionary of its immediate attributes.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> SupervisorAgentAccessControlRequest: - """Deserializes the SupervisorAgentAccessControlRequest from a dictionary.""" - return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", SupervisorAgentPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class SupervisorAgentAccessControlResponse: - all_permissions: Optional[List[SupervisorAgentPermission]] = None - """All permissions.""" - - display_name: Optional[str] = None - """Display name of the user or service principal.""" - - group_name: Optional[str] = None - """name of the group""" - - service_principal_name: Optional[str] = None - """Name of the service principal.""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the SupervisorAgentAccessControlResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the SupervisorAgentAccessControlResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.all_permissions: - body["all_permissions"] = self.all_permissions - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> SupervisorAgentAccessControlResponse: - """Deserializes the SupervisorAgentAccessControlResponse from a dictionary.""" - return cls( - all_permissions=_repeated_dict(d, "all_permissions", SupervisorAgentPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class SupervisorAgentPermission: - inherited: Optional[bool] = None - - inherited_from_object: Optional[List[str]] = None - - permission_level: Optional[SupervisorAgentPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the SupervisorAgentPermission into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the SupervisorAgentPermission into a shallow dictionary of its immediate attributes.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> SupervisorAgentPermission: - """Deserializes the SupervisorAgentPermission from a dictionary.""" - return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", SupervisorAgentPermissionLevel), - ) - - -class SupervisorAgentPermissionLevel(Enum): - """Permission level""" - - CAN_MANAGE = "CAN_MANAGE" - CAN_QUERY = "CAN_QUERY" - - -@dataclass -class SupervisorAgentPermissions: - access_control_list: Optional[List[SupervisorAgentAccessControlResponse]] = None - - object_id: Optional[str] = None - - object_type: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the SupervisorAgentPermissions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - def as_shallow_dict(self) -> dict: - """Serializes the SupervisorAgentPermissions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.access_control_list: - body["access_control_list"] = self.access_control_list - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> SupervisorAgentPermissions: - """Deserializes the SupervisorAgentPermissions from a dictionary.""" - return cls( - access_control_list=_repeated_dict(d, "access_control_list", SupervisorAgentAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), - ) - - -@dataclass -class SupervisorAgentPermissionsDescription: - description: Optional[str] = None - - permission_level: Optional[SupervisorAgentPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the SupervisorAgentPermissionsDescription into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the SupervisorAgentPermissionsDescription into a shallow dictionary of its immediate attributes.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> SupervisorAgentPermissionsDescription: - """Deserializes the SupervisorAgentPermissionsDescription from a dictionary.""" - return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", SupervisorAgentPermissionLevel), - ) - - @dataclass class Tool: tool_type: str @@ -802,8 +546,6 @@ def from_dict(cls, d: Dict[str, Any]) -> Volume: class SupervisorAgentsAPI: - """Manage Supervisor Agents and related resources.""" - def __init__(self, api_client): self._api = api_client @@ -820,10 +562,7 @@ def create_example(self, parent: str, example: Example) -> Example: body = example.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -843,10 +582,7 @@ def create_supervisor_agent(self, supervisor_agent: SupervisorAgent) -> Supervis body = supervisor_agent.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -876,10 +612,7 @@ def create_tool(self, parent: str, tool: Tool, tool_id: str) -> Tool: query = {} if tool_id is not None: query["tool_id"] = tool_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -898,9 +631,7 @@ def delete_example(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -917,9 +648,7 @@ def delete_supervisor_agent(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -936,9 +665,7 @@ def delete_tool(self, name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -956,9 +683,7 @@ def get_example(self, name: str) -> Example: :returns: :class:`Example` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -967,49 +692,6 @@ def get_example(self, name: str) -> Example: res = self._api.do("GET", f"/api/2.1/{name}", headers=headers) return Example.from_dict(res) - def get_permission_levels(self, supervisor_agent_id: str) -> GetSupervisorAgentPermissionLevelsResponse: - """Gets the permission levels that a user can have on an object. - - :param supervisor_agent_id: str - The supervisor agent for which to get or manage permissions. - - :returns: :class:`GetSupervisorAgentPermissionLevelsResponse` - """ - - 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/permissions/supervisor-agents/{supervisor_agent_id}/permissionLevels", headers=headers - ) - return GetSupervisorAgentPermissionLevelsResponse.from_dict(res) - - def get_permissions(self, supervisor_agent_id: str) -> SupervisorAgentPermissions: - """Gets the permissions of a supervisor agent. Supervisor agents can inherit permissions from their root - object. - - :param supervisor_agent_id: str - The supervisor agent for which to get or manage permissions. - - :returns: :class:`SupervisorAgentPermissions` - """ - - 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/permissions/supervisor-agents/{supervisor_agent_id}", headers=headers) - return SupervisorAgentPermissions.from_dict(res) - def get_supervisor_agent(self, name: str) -> SupervisorAgent: """Gets a Supervisor Agent. @@ -1019,9 +701,7 @@ def get_supervisor_agent(self, name: str) -> SupervisorAgent: :returns: :class:`SupervisorAgent` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1039,9 +719,7 @@ def get_tool(self, name: str) -> Tool: :returns: :class:`Tool` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1072,9 +750,7 @@ def list_examples( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1109,9 +785,7 @@ def list_supervisor_agents( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1144,9 +818,7 @@ def list_tools( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1161,39 +833,6 @@ def list_tools( return query["page_token"] = json["next_page_token"] - def set_permissions( - self, - supervisor_agent_id: str, - *, - access_control_list: Optional[List[SupervisorAgentAccessControlRequest]] = None, - ) -> SupervisorAgentPermissions: - """Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct - permissions if none are specified. Objects can inherit permissions from their root object. - - :param supervisor_agent_id: str - The supervisor agent for which to get or manage permissions. - :param access_control_list: List[:class:`SupervisorAgentAccessControlRequest`] (optional) - - :returns: :class:`SupervisorAgentPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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( - "PUT", f"/api/2.0/permissions/supervisor-agents/{supervisor_agent_id}", body=body, headers=headers - ) - return SupervisorAgentPermissions.from_dict(res) - def update_example(self, name: str, example: Example, update_mask: FieldMask) -> Example: """Updates an example in a Supervisor Agent. @@ -1215,10 +854,7 @@ def update_example(self, name: str, example: Example, update_mask: FieldMask) -> query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1227,39 +863,6 @@ def update_example(self, name: str, example: Example, update_mask: FieldMask) -> res = self._api.do("PATCH", f"/api/2.1/{name}", query=query, body=body, headers=headers) return Example.from_dict(res) - def update_permissions( - self, - supervisor_agent_id: str, - *, - access_control_list: Optional[List[SupervisorAgentAccessControlRequest]] = None, - ) -> SupervisorAgentPermissions: - """Updates the permissions on a supervisor agent. Supervisor agents can inherit permissions from their - root object. - - :param supervisor_agent_id: str - The supervisor agent for which to get or manage permissions. - :param access_control_list: List[:class:`SupervisorAgentAccessControlRequest`] (optional) - - :returns: :class:`SupervisorAgentPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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/permissions/supervisor-agents/{supervisor_agent_id}", body=body, headers=headers - ) - return SupervisorAgentPermissions.from_dict(res) - def update_supervisor_agent( self, name: str, supervisor_agent: SupervisorAgent, update_mask: FieldMask ) -> SupervisorAgent: @@ -1280,10 +883,7 @@ def update_supervisor_agent( query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1310,10 +910,7 @@ def update_tool(self, name: str, tool: Tool, update_mask: FieldMask) -> Tool: query = {} if update_mask is not None: query["update_mask"] = update_mask.ToJsonString() - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/tags.py b/databricks/sdk/service/tags.py index 1eb6f3ba4..f91213397 100644 --- a/databricks/sdk/service/tags.py +++ b/databricks/sdk/service/tags.py @@ -228,12 +228,6 @@ def from_dict(cls, d: Dict[str, Any]) -> Value: class TagPoliciesAPI: - """The Tag Policy API allows you to manage policies for governed tags in Databricks. For Terraform usage, see - the `Tag Policy Terraform documentation - `__. - Permissions for tag policies can be managed using the `Account Access Control Proxy API - `__.""" - def __init__(self, api_client): self._api = api_client @@ -251,10 +245,7 @@ def create_tag_policy(self, tag_policy: TagPolicy) -> TagPolicy: body = tag_policy.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -273,9 +264,7 @@ def delete_tag_policy(self, tag_key: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -295,9 +284,7 @@ def get_tag_policy(self, tag_key: str) -> TagPolicy: :returns: :class:`TagPolicy` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -330,9 +317,7 @@ def list_tag_policies( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -357,15 +342,6 @@ def update_tag_policy(self, tag_key: str, tag_policy: TagPolicy, update_mask: st :param tag_key: str :param tag_policy: :class:`TagPolicy` :param update_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`TagPolicy` """ @@ -374,10 +350,7 @@ def update_tag_policy(self, tag_key: str, tag_policy: TagPolicy, update_mask: st query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -388,8 +361,6 @@ def update_tag_policy(self, tag_key: str, tag_policy: TagPolicy, update_mask: st class WorkspaceEntityTagAssignmentsAPI: - """Manage tag assignments on workspace-scoped objects.""" - def __init__(self, api_client): self._api = api_client @@ -403,10 +374,7 @@ def create_tag_assignment(self, tag_assignment: TagAssignment) -> TagAssignment: body = tag_assignment.as_dict() query = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -429,9 +397,7 @@ def delete_tag_assignment(self, entity_type: str, entity_id: str, tag_key: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -455,9 +421,7 @@ def get_tag_assignment(self, entity_type: str, entity_id: str, tag_key: str) -> :returns: :class:`TagAssignment` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -491,9 +455,7 @@ def list_tag_assignments( query["page_size"] = page_size if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -524,15 +486,6 @@ def update_tag_assignment( The key of the tag. The characters , . : / - = and leading/trailing spaces are not allowed :param tag_assignment: :class:`TagAssignment` :param update_mask: str - The field mask must be a single string, with multiple fields separated by commas (no spaces). The - field path is relative to the resource object, using a dot (``.``) to navigate sub-fields (e.g., - ``author.given_name``). Specification of elements in sequence or map fields is not allowed, as only - the entire collection field can be specified. Field names must exactly match the resource field - names. - - A field mask of ``*`` indicates full replacement. It’s recommended to always explicitly list the - fields being updated and avoid using ``*`` wildcards, as it can lead to unintended results if the - API changes in the future. :returns: :class:`TagAssignment` """ @@ -541,10 +494,7 @@ def update_tag_assignment( query = {} if update_mask is not None: query["update_mask"] = update_mask - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/vectorsearch.py b/databricks/sdk/service/vectorsearch.py index f5a1627bf..ada178752 100644 --- a/databricks/sdk/service/vectorsearch.py +++ b/databricks/sdk/service/vectorsearch.py @@ -744,31 +744,6 @@ def from_dict(cls, d: Dict[str, Any]) -> FacetResultData: return cls(facet_array=d.get("facet_array", None), facet_row_count=d.get("facet_row_count", None)) -@dataclass -class GetVectorSearchEndpointPermissionLevelsResponse: - permission_levels: Optional[List[VectorSearchEndpointPermissionsDescription]] = None - """Specific permission levels""" - - def as_dict(self) -> dict: - """Serializes the GetVectorSearchEndpointPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GetVectorSearchEndpointPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.permission_levels: - body["permission_levels"] = self.permission_levels - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GetVectorSearchEndpointPermissionLevelsResponse: - """Deserializes the GetVectorSearchEndpointPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", VectorSearchEndpointPermissionsDescription)) - - class IndexSubtype(Enum): """The subtype of the AI Search index, determining the indexing and retrieval strategy. @@ -1814,239 +1789,7 @@ class VectorIndexType(Enum): DIRECT_ACCESS = "DIRECT_ACCESS" -@dataclass -class VectorSearchEndpointAccessControlRequest: - group_name: Optional[str] = None - """name of the group""" - - permission_level: Optional[VectorSearchEndpointPermissionLevel] = None - - service_principal_name: Optional[str] = None - """application ID of a service principal""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the VectorSearchEndpointAccessControlRequest into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the VectorSearchEndpointAccessControlRequest into a shallow dictionary of its immediate attributes.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> VectorSearchEndpointAccessControlRequest: - """Deserializes the VectorSearchEndpointAccessControlRequest from a dictionary.""" - return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", VectorSearchEndpointPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class VectorSearchEndpointAccessControlResponse: - all_permissions: Optional[List[VectorSearchEndpointPermission]] = None - """All permissions.""" - - display_name: Optional[str] = None - """Display name of the user or service principal.""" - - group_name: Optional[str] = None - """name of the group""" - - service_principal_name: Optional[str] = None - """Name of the service principal.""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the VectorSearchEndpointAccessControlResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the VectorSearchEndpointAccessControlResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.all_permissions: - body["all_permissions"] = self.all_permissions - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> VectorSearchEndpointAccessControlResponse: - """Deserializes the VectorSearchEndpointAccessControlResponse from a dictionary.""" - return cls( - all_permissions=_repeated_dict(d, "all_permissions", VectorSearchEndpointPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class VectorSearchEndpointPermission: - inherited: Optional[bool] = None - - inherited_from_object: Optional[List[str]] = None - - permission_level: Optional[VectorSearchEndpointPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the VectorSearchEndpointPermission into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the VectorSearchEndpointPermission into a shallow dictionary of its immediate attributes.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> VectorSearchEndpointPermission: - """Deserializes the VectorSearchEndpointPermission from a dictionary.""" - return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", VectorSearchEndpointPermissionLevel), - ) - - -class VectorSearchEndpointPermissionLevel(Enum): - """Permission level""" - - CAN_CREATE = "CAN_CREATE" - CAN_MANAGE = "CAN_MANAGE" - CAN_USE = "CAN_USE" - - -@dataclass -class VectorSearchEndpointPermissions: - access_control_list: Optional[List[VectorSearchEndpointAccessControlResponse]] = None - - object_id: Optional[str] = None - - object_type: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the VectorSearchEndpointPermissions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - def as_shallow_dict(self) -> dict: - """Serializes the VectorSearchEndpointPermissions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.access_control_list: - body["access_control_list"] = self.access_control_list - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> VectorSearchEndpointPermissions: - """Deserializes the VectorSearchEndpointPermissions from a dictionary.""" - return cls( - access_control_list=_repeated_dict(d, "access_control_list", VectorSearchEndpointAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), - ) - - -@dataclass -class VectorSearchEndpointPermissionsDescription: - description: Optional[str] = None - - permission_level: Optional[VectorSearchEndpointPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the VectorSearchEndpointPermissionsDescription into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the VectorSearchEndpointPermissionsDescription into a shallow dictionary of its immediate attributes.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> VectorSearchEndpointPermissionsDescription: - """Deserializes the VectorSearchEndpointPermissionsDescription from a dictionary.""" - return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", VectorSearchEndpointPermissionLevel), - ) - - class VectorSearchEndpointsAPI: - """**Endpoint**: Represents the compute resources to host AI Search indexes.""" - def __init__(self, api_client): self._api = api_client @@ -2124,10 +1867,7 @@ def create_endpoint( body["target_qps"] = target_qps if usage_policy_id is not None: body["usage_policy_id"] = usage_policy_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2167,9 +1907,7 @@ def delete_endpoint(self, endpoint_name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2186,9 +1924,7 @@ def get_endpoint(self, endpoint_name: str) -> EndpointInfo: :returns: :class:`EndpointInfo` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2197,49 +1933,6 @@ def get_endpoint(self, endpoint_name: str) -> EndpointInfo: res = self._api.do("GET", f"/api/2.0/vector-search/endpoints/{endpoint_name}", headers=headers) return EndpointInfo.from_dict(res) - def get_permission_levels(self, endpoint_id: str) -> GetVectorSearchEndpointPermissionLevelsResponse: - """Gets the permission levels that a user can have on an object. - - :param endpoint_id: str - The vector search endpoint for which to get or manage permissions. - - :returns: :class:`GetVectorSearchEndpointPermissionLevelsResponse` - """ - - 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/permissions/vector-search-endpoints/{endpoint_id}/permissionLevels", headers=headers - ) - return GetVectorSearchEndpointPermissionLevelsResponse.from_dict(res) - - def get_permissions(self, endpoint_id: str) -> VectorSearchEndpointPermissions: - """Gets the permissions of a vector search endpoint. Vector search endpoints can inherit permissions from - their root object. - - :param endpoint_id: str - The vector search endpoint for which to get or manage permissions. - - :returns: :class:`VectorSearchEndpointPermissions` - """ - - 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/permissions/vector-search-endpoints/{endpoint_id}", headers=headers) - return VectorSearchEndpointPermissions.from_dict(res) - def list_endpoints(self, *, page_token: Optional[str] = None) -> Iterator[EndpointInfo]: """List all AI Search endpoints in the workspace. @@ -2252,9 +1945,7 @@ def list_endpoints(self, *, page_token: Optional[str] = None) -> Iterator[Endpoi query = {} if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2283,10 +1974,7 @@ def patch_endpoint(self, endpoint_name: str, *, target_qps: Optional[int] = None body = {} if target_qps is not None: body["target_qps"] = target_qps - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2334,10 +2022,7 @@ def retrieve_user_visible_metrics( body["page_token"] = page_token if start_time is not None: body["start_time"] = start_time - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2346,36 +2031,6 @@ def retrieve_user_visible_metrics( res = self._api.do("POST", f"/api/2.0/vector-search/endpoints/{name}/metrics", body=body, headers=headers) return RetrieveUserVisibleMetricsResponse.from_dict(res) - def set_permissions( - self, endpoint_id: str, *, access_control_list: Optional[List[VectorSearchEndpointAccessControlRequest]] = None - ) -> VectorSearchEndpointPermissions: - """Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct - permissions if none are specified. Objects can inherit permissions from their root object. - - :param endpoint_id: str - The vector search endpoint for which to get or manage permissions. - :param access_control_list: List[:class:`VectorSearchEndpointAccessControlRequest`] (optional) - - :returns: :class:`VectorSearchEndpointPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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( - "PUT", f"/api/2.0/permissions/vector-search-endpoints/{endpoint_id}", body=body, headers=headers - ) - return VectorSearchEndpointPermissions.from_dict(res) - def update_endpoint_budget_policy( self, endpoint_name: str, budget_policy_id: str ) -> PatchEndpointBudgetPolicyResponse: @@ -2392,10 +2047,7 @@ def update_endpoint_budget_policy( body = {} if budget_policy_id is not None: body["budget_policy_id"] = budget_policy_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2422,10 +2074,7 @@ def update_endpoint_custom_tags( body = {} if custom_tags is not None: body["custom_tags"] = [v.as_dict() for v in custom_tags] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2436,48 +2085,8 @@ def update_endpoint_custom_tags( ) return UpdateEndpointCustomTagsResponse.from_dict(res) - def update_permissions( - self, endpoint_id: str, *, access_control_list: Optional[List[VectorSearchEndpointAccessControlRequest]] = None - ) -> VectorSearchEndpointPermissions: - """Updates the permissions on a vector search endpoint. Vector search endpoints can inherit permissions - from their root object. - - :param endpoint_id: str - The vector search endpoint for which to get or manage permissions. - :param access_control_list: List[:class:`VectorSearchEndpointAccessControlRequest`] (optional) - - :returns: :class:`VectorSearchEndpointPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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/permissions/vector-search-endpoints/{endpoint_id}", body=body, headers=headers - ) - return VectorSearchEndpointPermissions.from_dict(res) - class VectorSearchIndexesAPI: - """**Index**: An efficient representation of your embedding vectors that supports real-time and efficient - approximate nearest neighbor (ANN) search queries. - - There are 2 types of AI Search indexes: - - - **Delta Sync Index**: An index that automatically syncs with a source Delta Table, automatically and - incrementally updating the index as the underlying data in the Delta Table changes. - - **Direct Vector Access Index**: An index that supports direct read and write of vectors and metadata - through our REST and SDK APIs. With this model, the user manages index updates.""" - def __init__(self, api_client): self._api = api_client @@ -2526,10 +2135,7 @@ def create_index( body["name"] = name if primary_key is not None: body["primary_key"] = primary_key - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2552,9 +2158,7 @@ def delete_data_vector_index(self, index_name: str, primary_keys: List[str]) -> query = {} if primary_keys is not None: query["primary_keys"] = [v for v in primary_keys] - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2574,9 +2178,7 @@ def delete_index(self, index_name: str): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2600,9 +2202,7 @@ def get_index(self, index_name: str, *, ensure_reranker_compatible: Optional[boo query = {} if ensure_reranker_compatible is not None: query["ensure_reranker_compatible"] = ensure_reranker_compatible - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2627,9 +2227,7 @@ def list_indexes(self, endpoint_name: str, *, page_token: Optional[str] = None) query["endpoint_name"] = endpoint_name if page_token is not None: query["page_token"] = page_token - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2735,10 +2333,7 @@ def query_index( body["score_threshold"] = score_threshold if sort_columns is not None: body["sort_columns"] = [v for v in sort_columns] - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2768,10 +2363,7 @@ def query_next_page( body["endpoint_name"] = endpoint_name if page_token is not None: body["page_token"] = page_token - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2803,10 +2395,7 @@ def scan_index( body["last_primary_key"] = last_primary_key if num_results is not None: body["num_results"] = num_results - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2824,17 +2413,13 @@ def sync_index(self, index_name: str): """ - body = {} - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id - self._api.do("POST", f"/api/2.0/vector-search/indexes/{index_name}/sync", body=body, headers=headers) + self._api.do("POST", f"/api/2.0/vector-search/indexes/{index_name}/sync", headers=headers) def upsert_data_vector_index(self, index_name: str, inputs_json: str) -> UpsertDataVectorIndexResponse: """Handles the upserting of data into a specified vector index. @@ -2850,10 +2435,7 @@ def upsert_data_vector_index(self, index_name: str, inputs_json: str) -> UpsertD body = {} if inputs_json is not None: body["inputs_json"] = inputs_json - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: diff --git a/databricks/sdk/service/workspace.py b/databricks/sdk/service/workspace.py index 517b4d026..bf1ec4572 100644 --- a/databricks/sdk/service/workspace.py +++ b/databricks/sdk/service/workspace.py @@ -557,31 +557,6 @@ def from_dict(cls, d: Dict[str, Any]) -> GetCredentialsResponse: ) -@dataclass -class GetRepoPermissionLevelsResponse: - permission_levels: Optional[List[RepoPermissionsDescription]] = None - """Specific permission levels""" - - def as_dict(self) -> dict: - """Serializes the GetRepoPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GetRepoPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.permission_levels: - body["permission_levels"] = self.permission_levels - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GetRepoPermissionLevelsResponse: - """Deserializes the GetRepoPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", RepoPermissionsDescription)) - - @dataclass class GetRepoResponse: branch: Optional[str] = None @@ -700,31 +675,6 @@ def from_dict(cls, d: Dict[str, Any]) -> GetSecretResponse: return cls(key=d.get("key", None), value=d.get("value", None)) -@dataclass -class GetWorkspaceObjectPermissionLevelsResponse: - permission_levels: Optional[List[WorkspaceObjectPermissionsDescription]] = None - """Specific permission levels""" - - def as_dict(self) -> dict: - """Serializes the GetWorkspaceObjectPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GetWorkspaceObjectPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.permission_levels: - body["permission_levels"] = self.permission_levels - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GetWorkspaceObjectPermissionLevelsResponse: - """Deserializes the GetWorkspaceObjectPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", WorkspaceObjectPermissionsDescription)) - - class ImportFormat(Enum): """The format for workspace import and export.""" @@ -1052,115 +1002,6 @@ class ObjectType(Enum): REPO = "REPO" -@dataclass -class RepoAccessControlRequest: - group_name: Optional[str] = None - """name of the group""" - - permission_level: Optional[RepoPermissionLevel] = None - - service_principal_name: Optional[str] = None - """application ID of a service principal""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the RepoAccessControlRequest into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the RepoAccessControlRequest into a shallow dictionary of its immediate attributes.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> RepoAccessControlRequest: - """Deserializes the RepoAccessControlRequest from a dictionary.""" - return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", RepoPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class RepoAccessControlResponse: - all_permissions: Optional[List[RepoPermission]] = None - """All permissions.""" - - display_name: Optional[str] = None - """Display name of the user or service principal.""" - - group_name: Optional[str] = None - """name of the group""" - - service_principal_name: Optional[str] = None - """Name of the service principal.""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the RepoAccessControlResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the RepoAccessControlResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.all_permissions: - body["all_permissions"] = self.all_permissions - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> RepoAccessControlResponse: - """Deserializes the RepoAccessControlResponse from a dictionary.""" - return cls( - all_permissions=_repeated_dict(d, "all_permissions", RepoPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - @dataclass class RepoInfo: """Git folder (repo) information.""" @@ -1240,127 +1081,6 @@ def from_dict(cls, d: Dict[str, Any]) -> RepoInfo: ) -@dataclass -class RepoPermission: - inherited: Optional[bool] = None - - inherited_from_object: Optional[List[str]] = None - - permission_level: Optional[RepoPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the RepoPermission into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the RepoPermission into a shallow dictionary of its immediate attributes.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> RepoPermission: - """Deserializes the RepoPermission from a dictionary.""" - return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", RepoPermissionLevel), - ) - - -class RepoPermissionLevel(Enum): - """Permission level""" - - CAN_EDIT = "CAN_EDIT" - CAN_MANAGE = "CAN_MANAGE" - CAN_READ = "CAN_READ" - CAN_RUN = "CAN_RUN" - - -@dataclass -class RepoPermissions: - access_control_list: Optional[List[RepoAccessControlResponse]] = None - - object_id: Optional[str] = None - - object_type: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the RepoPermissions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - def as_shallow_dict(self) -> dict: - """Serializes the RepoPermissions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.access_control_list: - body["access_control_list"] = self.access_control_list - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> RepoPermissions: - """Deserializes the RepoPermissions from a dictionary.""" - return cls( - access_control_list=_repeated_dict(d, "access_control_list", RepoAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), - ) - - -@dataclass -class RepoPermissionsDescription: - description: Optional[str] = None - - permission_level: Optional[RepoPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the RepoPermissionsDescription into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the RepoPermissionsDescription into a shallow dictionary of its immediate attributes.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> RepoPermissionsDescription: - """Deserializes the RepoPermissionsDescription from a dictionary.""" - return cls( - description=d.get("description", None), permission_level=_enum(d, "permission_level", RepoPermissionLevel) - ) - - class ScopeBackendType(Enum): """The types of secret scope backends in the Secret Manager. Azure KeyVault backed secret scopes will be supported in a later release.""" @@ -1543,242 +1263,7 @@ def from_dict(cls, d: Dict[str, Any]) -> UpdateRepoResponse: return cls() -@dataclass -class WorkspaceObjectAccessControlRequest: - group_name: Optional[str] = None - """name of the group""" - - permission_level: Optional[WorkspaceObjectPermissionLevel] = None - - service_principal_name: Optional[str] = None - """application ID of a service principal""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the WorkspaceObjectAccessControlRequest into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the WorkspaceObjectAccessControlRequest into a shallow dictionary of its immediate attributes.""" - body = {} - if self.group_name is not None: - body["group_name"] = self.group_name - if self.permission_level is not None: - body["permission_level"] = self.permission_level - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectAccessControlRequest: - """Deserializes the WorkspaceObjectAccessControlRequest from a dictionary.""" - return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", WorkspaceObjectPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class WorkspaceObjectAccessControlResponse: - all_permissions: Optional[List[WorkspaceObjectPermission]] = None - """All permissions.""" - - display_name: Optional[str] = None - """Display name of the user or service principal.""" - - group_name: Optional[str] = None - """name of the group""" - - service_principal_name: Optional[str] = None - """Name of the service principal.""" - - user_name: Optional[str] = None - """name of the user""" - - def as_dict(self) -> dict: - """Serializes the WorkspaceObjectAccessControlResponse into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - def as_shallow_dict(self) -> dict: - """Serializes the WorkspaceObjectAccessControlResponse into a shallow dictionary of its immediate attributes.""" - body = {} - if self.all_permissions: - body["all_permissions"] = self.all_permissions - if self.display_name is not None: - body["display_name"] = self.display_name - if self.group_name is not None: - body["group_name"] = self.group_name - if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name - if self.user_name is not None: - body["user_name"] = self.user_name - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectAccessControlResponse: - """Deserializes the WorkspaceObjectAccessControlResponse from a dictionary.""" - return cls( - all_permissions=_repeated_dict(d, "all_permissions", WorkspaceObjectPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), - ) - - -@dataclass -class WorkspaceObjectPermission: - inherited: Optional[bool] = None - - inherited_from_object: Optional[List[str]] = None - - permission_level: Optional[WorkspaceObjectPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the WorkspaceObjectPermission into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the WorkspaceObjectPermission into a shallow dictionary of its immediate attributes.""" - body = {} - if self.inherited is not None: - body["inherited"] = self.inherited - if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectPermission: - """Deserializes the WorkspaceObjectPermission from a dictionary.""" - return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", WorkspaceObjectPermissionLevel), - ) - - -class WorkspaceObjectPermissionLevel(Enum): - """Permission level""" - - CAN_EDIT = "CAN_EDIT" - CAN_MANAGE = "CAN_MANAGE" - CAN_READ = "CAN_READ" - CAN_RUN = "CAN_RUN" - - -@dataclass -class WorkspaceObjectPermissions: - access_control_list: Optional[List[WorkspaceObjectAccessControlResponse]] = None - - object_id: Optional[str] = None - - object_type: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the WorkspaceObjectPermissions into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - def as_shallow_dict(self) -> dict: - """Serializes the WorkspaceObjectPermissions into a shallow dictionary of its immediate attributes.""" - body = {} - if self.access_control_list: - body["access_control_list"] = self.access_control_list - if self.object_id is not None: - body["object_id"] = self.object_id - if self.object_type is not None: - body["object_type"] = self.object_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectPermissions: - """Deserializes the WorkspaceObjectPermissions from a dictionary.""" - return cls( - access_control_list=_repeated_dict(d, "access_control_list", WorkspaceObjectAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), - ) - - -@dataclass -class WorkspaceObjectPermissionsDescription: - description: Optional[str] = None - - permission_level: Optional[WorkspaceObjectPermissionLevel] = None - - def as_dict(self) -> dict: - """Serializes the WorkspaceObjectPermissionsDescription into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the WorkspaceObjectPermissionsDescription into a shallow dictionary of its immediate attributes.""" - body = {} - if self.description is not None: - body["description"] = self.description - if self.permission_level is not None: - body["permission_level"] = self.permission_level - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectPermissionsDescription: - """Deserializes the WorkspaceObjectPermissionsDescription from a dictionary.""" - return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", WorkspaceObjectPermissionLevel), - ) - - class GitCredentialsAPI: - """Registers personal access token for Databricks to do operations on behalf of the user. - - See `more info `__.""" - def __init__(self, api_client): self._api = api_client @@ -1841,10 +1326,7 @@ def create( body["personal_access_token"] = personal_access_token if principal_id is not None: body["principal_id"] = principal_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1868,9 +1350,7 @@ def delete(self, credential_id: int, *, principal_id: Optional[int] = None): query = {} if principal_id is not None: query["principal_id"] = principal_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1893,9 +1373,7 @@ def get(self, credential_id: int, *, principal_id: Optional[int] = None) -> GetC query = {} if principal_id is not None: query["principal_id"] = principal_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1917,9 +1395,7 @@ def list(self, *, principal_id: Optional[int] = None) -> Iterator[CredentialInfo query = {} if principal_id is not None: query["principal_id"] = principal_id - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -1990,10 +1466,7 @@ def update( body["personal_access_token"] = personal_access_token if principal_id is not None: body["principal_id"] = principal_id - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2003,16 +1476,6 @@ def update( class ReposAPI: - """The Repos API allows users to manage their git repos. Users can use the API to access all repos that they - have manage permissions on. - - Databricks Repos is a visual Git client in Databricks. It supports common Git operations such a cloning a - repository, committing and pushing, pulling, branch management, and visual comparison of diffs when - committing. - - Within Repos you can develop code in notebooks or other files and follow data science and engineering code - development best practices using Git for version control, collaboration, and CI/CD.""" - def __init__(self, api_client): self._api = api_client @@ -2059,10 +1522,7 @@ def create( body["sparse_checkout"] = sparse_checkout.as_dict() if url is not None: body["url"] = url - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2080,9 +1540,7 @@ def delete(self, repo_id: int): """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2099,9 +1557,7 @@ def get(self, repo_id: int) -> GetRepoResponse: :returns: :class:`GetRepoResponse` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2110,46 +1566,6 @@ def get(self, repo_id: int) -> GetRepoResponse: res = self._api.do("GET", f"/api/2.0/repos/{repo_id}", headers=headers) return GetRepoResponse.from_dict(res) - def get_permission_levels(self, repo_id: str) -> GetRepoPermissionLevelsResponse: - """Gets the permission levels that a user can have on an object. - - :param repo_id: str - The repo for which to get or manage permissions. - - :returns: :class:`GetRepoPermissionLevelsResponse` - """ - - 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/permissions/repos/{repo_id}/permissionLevels", headers=headers) - return GetRepoPermissionLevelsResponse.from_dict(res) - - def get_permissions(self, repo_id: str) -> RepoPermissions: - """Gets the permissions of a repo. Repos can inherit permissions from their root object. - - :param repo_id: str - The repo for which to get or manage permissions. - - :returns: :class:`RepoPermissions` - """ - - 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/permissions/repos/{repo_id}", headers=headers) - return RepoPermissions.from_dict(res) - def list(self, *, next_page_token: Optional[str] = None, path_prefix: Optional[str] = None) -> Iterator[RepoInfo]: """Returns repos that the calling user has Manage permissions on. Use ``next_page_token`` to iterate through additional pages. @@ -2174,9 +1590,7 @@ def list(self, *, next_page_token: Optional[str] = None, path_prefix: Optional[s query["next_page_token"] = next_page_token if path_prefix is not None: query["path_prefix"] = path_prefix - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2191,34 +1605,6 @@ def list(self, *, next_page_token: Optional[str] = None, path_prefix: Optional[s return query["next_page_token"] = json["next_page_token"] - def set_permissions( - self, repo_id: str, *, access_control_list: Optional[List[RepoAccessControlRequest]] = None - ) -> RepoPermissions: - """Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct - permissions if none are specified. Objects can inherit permissions from their root object. - - :param repo_id: str - The repo for which to get or manage permissions. - :param access_control_list: List[:class:`RepoAccessControlRequest`] (optional) - - :returns: :class:`RepoPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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("PUT", f"/api/2.0/permissions/repos/{repo_id}", body=body, headers=headers) - return RepoPermissions.from_dict(res) - def update( self, repo_id: int, @@ -2272,10 +1658,7 @@ def update( body["sparse_checkout"] = sparse_checkout.as_dict() if tag is not None: body["tag"] = tag - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2283,45 +1666,8 @@ def update( self._api.do("PATCH", f"/api/2.0/repos/{repo_id}", body=body, headers=headers) - def update_permissions( - self, repo_id: str, *, access_control_list: Optional[List[RepoAccessControlRequest]] = None - ) -> RepoPermissions: - """Updates the permissions on a repo. Repos can inherit permissions from their root object. - - :param repo_id: str - The repo for which to get or manage permissions. - :param access_control_list: List[:class:`RepoAccessControlRequest`] (optional) - - :returns: :class:`RepoPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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/permissions/repos/{repo_id}", body=body, headers=headers) - return RepoPermissions.from_dict(res) - class SecretsAPI: - """The Secrets API allows you to manage secrets, secret scopes, and access permissions. - - Sometimes accessing data requires that you authenticate to external data sources through JDBC. Instead of - directly entering your credentials into a notebook, use Databricks secrets to store your credentials and - reference them in notebooks and jobs. - - Administrators, secret creators, and users granted permission can read Databricks secrets. While - Databricks makes an effort to redact secret values that might be displayed in notebooks, it is not - possible to prevent such users from reading secrets.""" - def __init__(self, api_client): self._api = api_client @@ -2342,15 +1688,6 @@ def create_scope( .. code:: - { "scope": "my-simple-databricks-scope", "initial_manage_principal": "users" "scope_backend_type": - "databricks|azure_keyvault", - - below is only required if scope type is azure_keyvault - - "backend_azure_keyvault": { "resource_id": - "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxx/providers/Microsoft.KeyVault/vaults/xxxx", - "tenant_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "dns_name": "https://xxxx.vault.azure.net/", } } - If ``initial_manage_principal`` is specified, the initial ACL applied to the scope is applied to the supplied principal (user or group) with ``MANAGE`` permissions. The only supported principal for this option is the group ``users``, which contains all users in the workspace. If @@ -2360,7 +1697,7 @@ def create_scope( If ``scope_backend_type`` is ``azure_keyvault``, a secret scope is created with secrets from a given Azure KeyVault. The caller must provide the keyvault_resource_id and the tenant_id for the key vault. If ``scope_backend_type`` is ``databricks`` or is unspecified, an empty secret scope is created and - stored in Databricks's own storage. + stored in 's own storage. Throws ``RESOURCE_ALREADY_EXISTS`` if a scope with the given name already exists. Throws ``RESOURCE_LIMIT_EXCEEDED`` if maximum number of scopes in the workspace is exceeded. Throws @@ -2390,9 +1727,7 @@ def create_scope( body["scope"] = scope if scope_backend_type is not None: body["scope_backend_type"] = scope_backend_type.value - headers = { - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2409,8 +1744,6 @@ def delete_acl(self, scope: str, principal: str): .. code:: - { "scope": "my-secret-scope", "principal": "data-scientists" } - Throws ``RESOURCE_DOES_NOT_EXIST`` if no such secret scope, principal, or ACL exists. Throws ``PERMISSION_DENIED`` if the user does not have permission to make this API call. Throws ``INVALID_PARAMETER_VALUE`` if the permission or principal is invalid. @@ -2428,9 +1761,7 @@ def delete_acl(self, scope: str, principal: str): body["principal"] = principal if scope is not None: body["scope"] = scope - headers = { - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2445,8 +1776,6 @@ def delete_scope(self, scope: str): .. code:: - { "scope": "my-secret-scope" } - Throws ``RESOURCE_DOES_NOT_EXIST`` if the scope does not exist. Throws ``PERMISSION_DENIED`` if the user does not have permission to make this API call. Throws ``BAD_REQUEST`` if system user attempts to delete internal secret scope. @@ -2460,9 +1789,7 @@ def delete_scope(self, scope: str): body = {} if scope is not None: body["scope"] = scope - headers = { - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2478,8 +1805,6 @@ def delete_secret(self, scope: str, key: str): .. code:: - { "scope": "my-secret-scope", "key": "my-secret-key" } - Throws ``RESOURCE_DOES_NOT_EXIST`` if no such secret scope or secret exists. Throws ``PERMISSION_DENIED`` if the user does not have permission to make this API call. Throws ``BAD_REQUEST`` if system user attempts to delete an internal secret, or request is made against Azure @@ -2498,10 +1823,7 @@ def delete_secret(self, scope: str, key: str): body["key"] = key if scope is not None: body["scope"] = scope - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2518,8 +1840,6 @@ def get_acl(self, scope: str, principal: str) -> AclItem: .. code:: - { "principal": "data-scientists", "permission": "READ" } - Throws ``RESOURCE_DOES_NOT_EXIST`` if no such secret scope exists. Throws ``PERMISSION_DENIED`` if the user does not have permission to make this API call. Throws ``INVALID_PARAMETER_VALUE`` if the permission or principal is invalid. @@ -2537,9 +1857,7 @@ def get_acl(self, scope: str, principal: str) -> AclItem: query["principal"] = principal if scope is not None: query["scope"] = scope - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2587,9 +1905,7 @@ def get_secret(self, scope: str, key: str) -> GetSecretResponse: query["key"] = key if scope is not None: query["scope"] = scope - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2607,9 +1923,6 @@ def list_acls(self, scope: str) -> Iterator[AclItem]: .. code:: - { "acls": [{ "principal": "admins", "permission": "MANAGE" },{ "principal": "data-scientists", - "permission": "READ" }] } - Throws ``RESOURCE_DOES_NOT_EXIST`` if no such secret scope exists. Throws ``PERMISSION_DENIED`` if the user does not have permission to make this API call. @@ -2622,9 +1935,7 @@ def list_acls(self, scope: str) -> Iterator[AclItem]: query = {} if scope is not None: query["scope"] = scope - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2641,18 +1952,13 @@ def list_scopes(self) -> Iterator[SecretScope]: .. code:: - { "scopes": [{ "name": "my-databricks-scope", "backend_type": "DATABRICKS" },{ "name": "mount-points", - "backend_type": "DATABRICKS" }] } - Throws ``PERMISSION_DENIED`` if the user does not have permission to make this API call. :returns: Iterator over :class:`SecretScope` """ - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2670,9 +1976,6 @@ def list_secrets(self, scope: str) -> Iterator[SecretMetadata]: .. code:: - { "secrets": [ { "key": "my-string-key"", "last_updated_timestamp": "1520467595000" }, { "key": - "my-byte-key", "last_updated_timestamp": "1520467595000" }, ] } - The lastUpdatedTimestamp returned is in milliseconds since epoch. Throws ``RESOURCE_DOES_NOT_EXIST`` if no such secret scope exists. Throws ``PERMISSION_DENIED`` if the @@ -2687,9 +1990,7 @@ def list_secrets(self, scope: str) -> Iterator[SecretMetadata]: query = {} if scope is not None: query["scope"] = scope - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2719,10 +2020,8 @@ def put_acl(self, scope: str, principal: str, permission: AclPermission): .. code:: - { "scope": "my-secret-scope", "principal": "data-scientists", "permission": "READ" } - - The principal is a user or group name corresponding to an existing Databricks principal to be granted - or revoked access. + The principal is a user or group name corresponding to an existing principal to be + granted or revoked access. Throws ``RESOURCE_DOES_NOT_EXIST`` if no such secret scope exists. Throws ``RESOURCE_ALREADY_EXISTS`` if a permission for the principal already exists. Throws ``INVALID_PARAMETER_VALUE`` if the permission @@ -2746,9 +2045,7 @@ def put_acl(self, scope: str, principal: str, permission: AclPermission): body["principal"] = principal if scope is not None: body["scope"] = scope - headers = { - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2772,8 +2069,6 @@ def put_secret( .. code:: - { "scope": "my-databricks-scope", "key": "my-string-key", "string_value": "foobar" } - The input fields "string_value" or "bytes_value" specify the type of the secret, which will determine the value returned when the secret value is requested. Exactly one must be specified. @@ -2804,9 +2099,7 @@ def put_secret( body["scope"] = scope if string_value is not None: body["string_value"] = string_value - headers = { - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2816,13 +2109,6 @@ def put_secret( class WorkspaceAPI: - """The Workspace API allows you to list, import, export, and delete workspace objects such as notebooks, - files, folders, and dashboards. Additionally, it provides endpoints to manage permissions for any - workspace object. - - A notebook is a web-based interface to a document that contains runnable code, visualizations, and - explanatory text.""" - def __init__(self, api_client): self._api = api_client @@ -2850,10 +2136,7 @@ def delete(self, path: str, *, recursive: Optional[bool] = None): body["path"] = path if recursive is not None: body["recursive"] = recursive - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2881,8 +2164,8 @@ def export(self, path: str, *, format: Optional[ExportFormat] = None) -> ExportR non-notebook entries. - ``HTML``: The notebook is exported as an HTML file. - ``JUPYTER``: The notebook is exported as a Jupyter/IPython Notebook file. - - ``DBC``: The notebook is exported in Databricks archive format. Directory exports will not include - non-notebook entries. + - ``DBC``: The notebook is exported in archive format. Directory exports will not + include non-notebook entries. - ``R_MARKDOWN``: The notebook is exported to R Markdown format. - ``AUTO``: The object or directory is exported depending on the objects type. Directory exports will include notebooks and workspace files. @@ -2895,9 +2178,7 @@ def export(self, path: str, *, format: Optional[ExportFormat] = None) -> ExportR query["format"] = format.value if path is not None: query["path"] = path - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -2906,63 +2187,6 @@ def export(self, path: str, *, format: Optional[ExportFormat] = None) -> ExportR res = self._api.do("GET", "/api/2.0/workspace/export", query=query, headers=headers) return ExportResponse.from_dict(res) - def get_permission_levels( - self, workspace_object_type: str, workspace_object_id: str - ) -> GetWorkspaceObjectPermissionLevelsResponse: - """Gets the permission levels that a user can have on an object. - - :param workspace_object_type: str - The workspace object type for which to get or manage permissions. Could be one of the following: - alerts, alertsv2, dashboards, dbsql-dashboards, directories, experiments, files, genie, notebooks, - queries - :param workspace_object_id: str - The workspace object for which to get or manage permissions. - - :returns: :class:`GetWorkspaceObjectPermissionLevelsResponse` - """ - - 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/permissions/{workspace_object_type}/{workspace_object_id}/permissionLevels", - headers=headers, - ) - return GetWorkspaceObjectPermissionLevelsResponse.from_dict(res) - - def get_permissions(self, workspace_object_type: str, workspace_object_id: str) -> WorkspaceObjectPermissions: - """Gets the permissions of a workspace object. Workspace objects can inherit permissions from their - parent objects or root object. - - :param workspace_object_type: str - The workspace object type for which to get or manage permissions. Could be one of the following: - alerts, alertsv2, dashboards, dbsql-dashboards, directories, experiments, files, genie, notebooks, - queries - :param workspace_object_id: str - The workspace object for which to get or manage permissions. - - :returns: :class:`WorkspaceObjectPermissions` - """ - - 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/permissions/{workspace_object_type}/{workspace_object_id}", headers=headers - ) - return WorkspaceObjectPermissions.from_dict(res) - def get_status(self, path: str) -> ObjectInfo: """Gets the status of an object or a directory. If ``path`` does not exist, this call returns an error ``RESOURCE_DOES_NOT_EXIST``. @@ -2976,9 +2200,7 @@ def get_status(self, path: str) -> ObjectInfo: query = {} if path is not None: query["path"] = path - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3021,7 +2243,7 @@ def import_( - ``SOURCE``: The notebook or directory is imported as source code. - ``HTML``: The notebook is imported as an HTML file. - ``JUPYTER``: The notebook is imported as a Jupyter/IPython Notebook file. - - ``DBC``: The notebook is imported in Databricks archive format. Required for directories. + - ``DBC``: The notebook is imported in archive format. Required for directories. - ``R_MARKDOWN``: The notebook is imported from R Markdown format. :param language: :class:`Language` (optional) The language of the object. This value is set only if the object type is ``NOTEBOOK``. @@ -3043,10 +2265,7 @@ def import_( body["overwrite"] = overwrite if path is not None: body["path"] = path - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3071,9 +2290,7 @@ def list(self, path: str, *, notebooks_modified_after: Optional[int] = None) -> query["notebooks_modified_after"] = notebooks_modified_after if path is not None: query["path"] = path - headers = { - "Accept": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: @@ -3101,90 +2318,10 @@ def mkdirs(self, path: str): body = {} if path is not None: body["path"] = path - headers = { - "Accept": "application/json", - "Content-Type": "application/json", - } + headers = {} cfg = self._api._cfg if cfg.workspace_id: headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/workspace/mkdirs", body=body, headers=headers) - - def set_permissions( - self, - workspace_object_type: str, - workspace_object_id: str, - *, - access_control_list: Optional[List[WorkspaceObjectAccessControlRequest]] = None, - ) -> WorkspaceObjectPermissions: - """Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct - permissions if none are specified. Objects can inherit permissions from their parent objects or root - object. - - :param workspace_object_type: str - The workspace object type for which to get or manage permissions. Could be one of the following: - alerts, alertsv2, dashboards, dbsql-dashboards, directories, experiments, files, genie, notebooks, - queries - :param workspace_object_id: str - The workspace object for which to get or manage permissions. - :param access_control_list: List[:class:`WorkspaceObjectAccessControlRequest`] (optional) - - :returns: :class:`WorkspaceObjectPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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( - "PUT", f"/api/2.0/permissions/{workspace_object_type}/{workspace_object_id}", body=body, headers=headers - ) - return WorkspaceObjectPermissions.from_dict(res) - - def update_permissions( - self, - workspace_object_type: str, - workspace_object_id: str, - *, - access_control_list: Optional[List[WorkspaceObjectAccessControlRequest]] = None, - ) -> WorkspaceObjectPermissions: - """Updates the permissions on a workspace object. Workspace objects can inherit permissions from their - parent objects or root object. - - :param workspace_object_type: str - The workspace object type for which to get or manage permissions. Could be one of the following: - alerts, alertsv2, dashboards, dbsql-dashboards, directories, experiments, files, genie, notebooks, - queries - :param workspace_object_id: str - The workspace object for which to get or manage permissions. - :param access_control_list: List[:class:`WorkspaceObjectAccessControlRequest`] (optional) - - :returns: :class:`WorkspaceObjectPermissions` - """ - - body = {} - if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] - 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/permissions/{workspace_object_type}/{workspace_object_id}", body=body, headers=headers - ) - return WorkspaceObjectPermissions.from_dict(res) diff --git a/databricks/sdk/version.py b/databricks/sdk/version.py index da56c9c74..dd2dfb407 100644 --- a/databricks/sdk/version.py +++ b/databricks/sdk/version.py @@ -1 +1 @@ -__version__ = "0.137.0" +__version__ = "0.136.0" diff --git a/docs/dbdataclasses/catalog.rst b/docs/dbdataclasses/catalog.rst index dca2c2481..b818fdc99 100644 --- a/docs/dbdataclasses/catalog.rst +++ b/docs/dbdataclasses/catalog.rst @@ -656,10 +656,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: INTERNAL_AND_EXTERNAL :value: "INTERNAL_AND_EXTERNAL" -.. autoclass:: DenyOptions - :members: - :undoc-members: - .. autoclass:: Dependency :members: :undoc-members: @@ -1560,9 +1556,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: POLICY_TYPE_COLUMN_MASK :value: "POLICY_TYPE_COLUMN_MASK" - .. py:attribute:: POLICY_TYPE_DENY - :value: "POLICY_TYPE_DENY" - .. py:attribute:: POLICY_TYPE_GRANT :value: "POLICY_TYPE_GRANT" diff --git a/docs/workspace/domains/domains.rst b/docs/workspace/domains/domains.rst index ced23313f..6c127e85c 100644 --- a/docs/workspace/domains/domains.rst +++ b/docs/workspace/domains/domains.rst @@ -26,7 +26,8 @@ Full resource name of the domain to delete. Format: ``domains/{domain_id}`` :param force: bool (optional) When false (default), DeleteDomain is rejected with FAILED_PRECONDITION if the domain still has - Glossary pages. When true, those pages are deleted first and then the domain is removed. + Glossary pages. When true, those pages are deleted first and then the domain is removed. Forwarded + to the central service. diff --git a/docs/workspace/pipelines/pipelines.rst b/docs/workspace/pipelines/pipelines.rst index 161beed7d..bf54ebc7c 100644 --- a/docs/workspace/pipelines/pipelines.rst +++ b/docs/workspace/pipelines/pipelines.rst @@ -424,9 +424,9 @@ Composite filters are not supported. This field is optional. :param max_results: int (optional) The maximum number of entries to return in a single page. The system may return fewer than - max_results pipelines in a response, even if there are more pipelines available. This field is - optional. The default value is 25. The maximum value is 100. An error is returned if the value of - max_results is greater than 100. + max_results events in a response, even if there are more events available. This field is optional. + The default value is 25. The maximum value is 100. An error is returned if the value of max_results + is greater than 100. :param order_by: List[str] (optional) A list of strings specifying the order of results. Supported order_by fields are id and name. The default is id asc. This field is optional.