Skip to main content

external_locations

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

Overview

Nameexternal_locations
TypeResource
Iddatabricks_workspace.catalog.external_locations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringName of the external location.
credential_idstringUnique ID of the location's storage credential.
metastore_idstringUnique identifier of metastore hosting the external location.
credential_namestringName of the storage credential used with this location.
browse_onlyboolean
commentstringUser-provided free-form text description.
created_atintegerTime at which this external location was created, in epoch milliseconds.
created_bystringUsername of external location creator.
enable_file_eventsbooleanWhether to enable file events on this external location. Default to `true`. Set to `false` to disable file events.
encryption_detailsobjectEncryption options that apply to clients connecting to cloud storage.
fallbackbooleanIndicates whether fallback mode is enabled for this external location. When fallback mode is enabled, the access to the location falls back to cluster credentials if UC credentials are not sufficient.
file_event_queueobjectFile event queue settings. If `enable_file_events` is not `false`, must be defined and have exactly one of the documented properties.
isolation_modestringCreate a collection of name/value pairs.<br /><br />Example enumeration:<br /><br />&gt;&gt;&gt; class Color(Enum):<br />... RED = 1<br />... BLUE = 2<br />... GREEN = 3<br /><br />Access them by:<br /><br />- attribute access::<br /><br />&gt;&gt;&gt; Color.RED<br />&lt;Color.RED: 1&gt;<br /><br />- value lookup:<br /><br />&gt;&gt;&gt; Color(1)<br />&lt;Color.RED: 1&gt;<br /><br />- name lookup:<br /><br />&gt;&gt;&gt; Color['RED']<br />&lt;Color.RED: 1&gt;<br /><br />Enumerations can be iterated over, and know how many members they have:<br /><br />&gt;&gt;&gt; len(Color)<br />3<br /><br />&gt;&gt;&gt; list(Color)<br />[&lt;Color.RED: 1&gt;, &lt;Color.BLUE: 2&gt;, &lt;Color.GREEN: 3&gt;]<br /><br />Methods can be added to enumerations, and members can have their own<br />attributes -- see the documentation for details. (ISOLATION_MODE_ISOLATED, ISOLATION_MODE_OPEN)
ownerstringThe owner of the external location.
read_onlybooleanIndicates whether the external location is read-only.
updated_atintegerTime at which external location this was last modified, in epoch milliseconds.
updated_bystringUsername of user who last modified the external location.
urlstringPath URL of the external location.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectname, deployment_nameinclude_browseGets an external location from the metastore. The caller must be either a metastore admin, the owner
listselectdeployment_nameinclude_browse, include_unbound, max_results, page_tokenGets an array of external locations (ExternalLocationInfo objects) from the metastore. The caller
createinsertdeployment_name, name, url, credential_nameCreates a new external location entry in the metastore. The caller must be a metastore admin or have
updateupdatename, deployment_nameUpdates an external location in the metastore. The caller must be the owner of the external location,
deletedeletename, deployment_nameforceDeletes the specified external location from the metastore. The caller must be the owner of the

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)
namestringName of the external location.
forcebooleanForce deletion even if there are dependent external tables or mounts.
include_browsebooleanWhether to include external locations in the response for which the principal can only access selective metadata for
include_unboundbooleanWhether to include external locations not bound to the workspace. Effective only if the user has permission to update the location–workspace binding.
max_resultsintegerMaximum number of external locations to return. If not set, all the external locations are returned (not recommended). - when set to a value greater than 0, the page length is the minimum of this value and a server configured value; - when set to 0, the page length is set to a server configured value (recommended); - when set to a value less than 0, an invalid parameter error is returned;
page_tokenstringOpaque pagination token to go to next page based on previous query.

SELECT examples

Gets an external location from the metastore. The caller must be either a metastore admin, the owner

SELECT
name,
credential_id,
metastore_id,
credential_name,
browse_only,
comment,
created_at,
created_by,
enable_file_events,
encryption_details,
fallback,
file_event_queue,
isolation_mode,
owner,
read_only,
updated_at,
updated_by,
url
FROM databricks_workspace.catalog.external_locations
WHERE name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND include_browse = '{{ include_browse }}'
;

INSERT examples

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

INSERT INTO databricks_workspace.catalog.external_locations (
name,
url,
credential_name,
comment,
enable_file_events,
encryption_details,
fallback,
file_event_queue,
read_only,
skip_validation,
deployment_name
)
SELECT
'{{ name }}' /* required */,
'{{ url }}' /* required */,
'{{ credential_name }}' /* required */,
'{{ comment }}',
{{ enable_file_events }},
'{{ encryption_details }}',
{{ fallback }},
'{{ file_event_queue }}',
{{ read_only }},
{{ skip_validation }},
'{{ deployment_name }}'
RETURNING
name,
credential_id,
metastore_id,
credential_name,
browse_only,
comment,
created_at,
created_by,
enable_file_events,
encryption_details,
fallback,
file_event_queue,
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,

UPDATE databricks_workspace.catalog.external_locations
SET
comment = '{{ comment }}',
credential_name = '{{ credential_name }}',
enable_file_events = {{ enable_file_events }},
encryption_details = '{{ encryption_details }}',
fallback = {{ fallback }},
file_event_queue = '{{ file_event_queue }}',
force = {{ force }},
isolation_mode = '{{ isolation_mode }}',
new_name = '{{ new_name }}',
owner = '{{ owner }}',
read_only = {{ read_only }},
skip_validation = {{ skip_validation }},
url = '{{ url }}'
WHERE
name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
RETURNING
name,
credential_id,
metastore_id,
credential_name,
browse_only,
comment,
created_at,
created_by,
enable_file_events,
encryption_details,
fallback,
file_event_queue,
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

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