Skip to main content

external_locations

Creates, updates, deletes, gets or lists an external_locations resource.

Overview

Nameexternal_locations
TypeResource
Iddatabricks_workspace.unitycatalog.external_locations

Fields

The following fields are returned by SELECT queries:

The external location was successfully retrieved.

NameDatatypeDescription
namestring
credential_idstring
metastore_idstring
credential_namestring
access_pointstring
browse_onlyboolean
commentstring
created_atinteger
created_bystring
isolation_modestring
ownerstring
read_onlyboolean
updated_atinteger
updated_bystring
urlstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdeployment_nameGets an external location from the metastore. The caller must be either a metastore admin, the owner of the external location, or a user that has some privilege on the external location.
listselectdeployment_nameGets an array of external locations (
createinsertdeployment_nameCreates a new external location entry in the metastore. The caller must be a metastore admin or have the
updateupdatedeployment_nameUpdates an external location in the metastore. The caller must be the owner of the external location, or be a metastore admin. In the second case, the admin can only update the name of the external location.
deletedeletedeployment_nameDeletes the specified external location from the metastore. The caller must be the owner of the external location.

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

Gets an external location from the metastore. The caller must be either a metastore admin, the owner of the external location, or a user that has some privilege on the external location.

SELECT
name,
credential_id,
metastore_id,
credential_name,
access_point,
browse_only,
comment,
created_at,
created_by,
isolation_mode,
owner,
read_only,
updated_at,
updated_by,
url
FROM databricks_workspace.unitycatalog.external_locations
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

Creates a new external location entry in the metastore. The caller must be a metastore admin or have the

INSERT INTO databricks_workspace.unitycatalog.external_locations (
data__name,
data__url,
data__credential_name,
data__read_only,
data__comment,
data__access_point,
data__skip_validation,
deployment_name
)
SELECT
'{{ name }}',
'{{ url }}',
'{{ credential_name }}',
'{{ read_only }}',
'{{ comment }}',
'{{ access_point }}',
{{ skip_validation }},
'{{ deployment_name }}'
RETURNING
name,
credential_id,
metastore_id,
credential_name,
access_point,
browse_only,
comment,
created_at,
created_by,
isolation_mode,
owner,
read_only,
updated_at,
updated_by,
url
;

UPDATE examples

Updates an external location in the metastore. The caller must be the owner of the external location, or be a metastore admin. In the second case, the admin can only update the name of the external location.

UPDATE databricks_workspace.unitycatalog.external_locations
SET
data__url = '{{ url }}',
data__credential_name = '{{ credential_name }}',
data__read_only = {{ read_only }},
data__comment = '{{ comment }}',
data__owner = '{{ owner }}',
data__access_point = '{{ access_point }}',
data__isolation_mode = '{{ isolation_mode }}',
data__new_name = '{{ new_name }}',
data__force = {{ force }},
data__skip_validation = {{ skip_validation }}
WHERE
deployment_name = '{{ deployment_name }}' --required
RETURNING
name,
credential_id,
metastore_id,
credential_name,
access_point,
browse_only,
comment,
created_at,
created_by,
isolation_mode,
owner,
read_only,
updated_at,
updated_by,
url;

DELETE examples

Deletes the specified external location from the metastore. The caller must be the owner of the external location.

DELETE FROM databricks_workspace.unitycatalog.external_locations
WHERE deployment_name = '{{ deployment_name }}' --required;