Skip to main content

directory_contents

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

Overview

Namedirectory_contents
TypeResource
Iddatabricks_workspace.filemanagement.directory_contents

Fields

The following fields are returned by SELECT queries:

An array of DirectoryEntry for the contents of the directory. If next_page_token is set, there may be more entries in the directory.

NameDatatypeDescription
namestring
file_sizeinteger
is_directoryboolean
last_modifiedinteger
pathstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listdirectorycontentsselectdeployment_nameReturns the contents of a directory. If there is no directory at the specified path, the API returns a HTTP 404 error.

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
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)

SELECT examples

Returns the contents of a directory. If there is no directory at the specified path, the API returns a HTTP 404 error.

SELECT
name,
file_size,
is_directory,
last_modified,
path
FROM databricks_workspace.filemanagement.directory_contents
WHERE deployment_name = '{{ deployment_name }}' -- required;