Skip to main content

volumes

Creates, updates, deletes, gets or lists a volumes resource.

Overview

Namevolumes
TypeResource
Iddatabricks_workspace.catalog.volumes

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the volume
metastore_idstringThe unique identifier of the metastore
volume_idstringThe unique identifier of the volume
catalog_namestringThe name of the catalog where the schema and the volume are
full_namestringThe three-level (fully qualified) name of the volume
schema_namestringThe name of the schema where the volume is
access_pointstring
browse_onlybooleanIndicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request.
commentstringThe comment attached to the volume
created_atinteger
created_bystringThe identifier of the user who created the volume
encryption_detailsobjectEncryption options that apply to clients connecting to cloud storage.
ownerstringThe identifier of the user who owns the volume
storage_locationstringThe storage location on the cloud
updated_atinteger
updated_bystringThe identifier of the user who updated the volume last time
volume_typestringThe type of the volume. An external volume is located in the specified external location. A managed volume is located in the default location which is specified by the parent schema, or the parent catalog, or the Metastore. [Learn more] [Learn more]: https://docs.databricks.com/aws/en/volumes/managed-vs-external (EXTERNAL, MANAGED)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
readselectname, deployment_nameinclude_browseGets a volume from the metastore for a specific catalog and schema.
listselectcatalog_name, schema_name, deployment_nameinclude_browse, max_results, page_tokenGets an array of volumes for the current metastore under the parent catalog and schema.
createinsertdeployment_name, catalog_name, schema_name, name, volume_typeCreates a new volume.
updateupdatename, deployment_nameUpdates the specified volume under the specified parent catalog and schema.
deletedeletename, deployment_nameDeletes a volume from the specified parent catalog and schema.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
catalog_namestringThe identifier of the catalog
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
namestringThe three-level (fully qualified) name of the volume
schema_namestringThe identifier of the schema
include_browsebooleanWhether to include volumes in the response for which the principal can only access selective metadata for
max_resultsintegerMaximum number of volumes to return (page length). If not set, the page length is set to a server configured value (10000, as of 1/29/2024). - when set to a value greater than 0, the page length is the minimum of this value and a server configured value (10000, as of 1/29/2024); - when set to 0, the page length is set to a server configured value (10000, as of 1/29/2024) (recommended); - when set to a value less than 0, an invalid parameter error is returned; Note: this parameter controls only the maximum number of volumes to return. The actual number of volumes returned in a page may be smaller than this value, including 0, even if there are more pages.
page_tokenstringOpaque token returned by a previous request. It must be included in the request to retrieve the next page of results (pagination).

SELECT examples

Gets a volume from the metastore for a specific catalog and schema.

SELECT
name,
metastore_id,
volume_id,
catalog_name,
full_name,
schema_name,
access_point,
browse_only,
comment,
created_at,
created_by,
encryption_details,
owner,
storage_location,
updated_at,
updated_by,
volume_type
FROM databricks_workspace.catalog.volumes
WHERE name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND include_browse = '{{ include_browse }}'
;

INSERT examples

Creates a new volume.

INSERT INTO databricks_workspace.catalog.volumes (
catalog_name,
schema_name,
name,
volume_type,
comment,
storage_location,
deployment_name
)
SELECT
'{{ catalog_name }}' /* required */,
'{{ schema_name }}' /* required */,
'{{ name }}' /* required */,
'{{ volume_type }}' /* required */,
'{{ comment }}',
'{{ storage_location }}',
'{{ deployment_name }}'
RETURNING
name,
metastore_id,
volume_id,
catalog_name,
full_name,
schema_name,
access_point,
browse_only,
comment,
created_at,
created_by,
encryption_details,
owner,
storage_location,
updated_at,
updated_by,
volume_type
;

UPDATE examples

Updates the specified volume under the specified parent catalog and schema.

UPDATE databricks_workspace.catalog.volumes
SET
comment = '{{ comment }}',
new_name = '{{ new_name }}',
owner = '{{ owner }}'
WHERE
name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
RETURNING
name,
metastore_id,
volume_id,
catalog_name,
full_name,
schema_name,
access_point,
browse_only,
comment,
created_at,
created_by,
encryption_details,
owner,
storage_location,
updated_at,
updated_by,
volume_type;

DELETE examples

Deletes a volume from the specified parent catalog and schema.

DELETE FROM databricks_workspace.catalog.volumes
WHERE name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;