a.storage: Storage configurations

class databricks.sdk.service.provisioning.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.

create(storage_configuration_name: str, root_bucket_info: RootBucketInfo [, role_arn: Optional[str]]) StorageConfiguration

Usage:

import time

from databricks.sdk import AccountClient
from databricks.sdk.service import provisioning

a = AccountClient()

storage = a.storage.create(
    storage_configuration_name=f"sdk-{time.time_ns()}",
    root_bucket_info=provisioning.RootBucketInfo(bucket_name=f"sdk-{time.time_ns()}"),
)

Creates a Databricks storage configuration for an account.

Parameters:
  • storage_configuration_name – str The human-readable name of the storage configuration.

  • root_bucket_infoRootBucketInfo Root S3 bucket information.

  • role_arn – str (optional) Optional IAM role that is used to access the workspace catalog which is created during workspace creation for UC by Default. If a storage configuration with this field populated is used to create a workspace, then a workspace catalog is created together with the workspace. The workspace catalog shares the root bucket with internal workspace storage (including DBFS root) but uses a dedicated bucket path prefix.

Returns:

StorageConfiguration

delete(storage_configuration_id: str) StorageConfiguration

Deletes a Databricks storage configuration. You cannot delete a storage configuration that is associated with any workspace.

Parameters:

storage_configuration_id – str

Returns:

StorageConfiguration

get(storage_configuration_id: str) StorageConfiguration

Usage:

import time

from databricks.sdk import AccountClient
from databricks.sdk.service import provisioning

a = AccountClient()

storage = a.storage.create(
    storage_configuration_name=f"sdk-{time.time_ns()}",
    root_bucket_info=provisioning.RootBucketInfo(bucket_name=f"sdk-{time.time_ns()}"),
)

by_id = a.storage.get(storage_configuration_id=storage.storage_configuration_id)

Gets a Databricks storage configuration for an account, both specified by ID.

Parameters:

storage_configuration_id – str

Returns:

StorageConfiguration

list() Iterator[StorageConfiguration]

Usage:

from databricks.sdk import AccountClient

a = AccountClient()

configs = a.storage.list()

Lists Databricks storage configurations for an account, specified by ID.

Returns:

Iterator over StorageConfiguration