Skip to main content

recipients

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

Overview

Namerecipients
TypeResource
Iddatabricks_workspace.sharing.recipients

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring[Create,Update:IGN] common - id of the recipient
namestringName of Recipient.
data_recipient_global_metastore_idstringThe global Unity Catalog metastore id provided by the data recipient. This field is only present when the __authentication_type__ is **DATABRICKS**. The identifier is of format __cloud__:__region__:__metastore-uuid__.
metastore_idstringUnique identifier of recipient's Unity Catalog Metastore. This field is only present when the __authentication_type__ is **DATABRICKS**.
activatedboolean
activation_urlstringFull activation url to retrieve the access token. It will be empty if the token is already retrieved.
authentication_typestringThe delta sharing authentication type. (DATABRICKS, OAUTH_CLIENT_CREDENTIALS, OIDC_FEDERATION, TOKEN)
cloudstringCloud vendor of the recipient's Unity Catalog Metastore. This field is only present when the __authentication_type__ is **DATABRICKS**.
commentstringDescription about the recipient.
created_atintegerTime at which this recipient was created, in epoch milliseconds.
created_bystringUsername of recipient creator.
expiration_timeintegerExpiration timestamp of the token, in epoch milliseconds.
ip_access_listobjectIP Access List
ownerstringUsername of the recipient owner.
properties_kvpairsobjectRecipient properties as map of string key-value pairs. When provided in update request, the specified properties will override the existing properties. To add and remove properties, one would need to perform a read-modify-write.
regionstringCloud region of the recipient's Unity Catalog Metastore. This field is only present when the __authentication_type__ is **DATABRICKS**.
sharing_codestringThe one-time sharing code provided by the data recipient. This field is only present when the __authentication_type__ is **DATABRICKS**.
tokensarrayThis field is only present when the __authentication_type__ is **TOKEN**.
updated_atintegerTime at which the recipient was updated, in epoch milliseconds.
updated_bystringUsername of recipient updater.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectname, deployment_nameGets a share recipient from the metastore. The caller must be one of: * A user with USE_RECIPIENT
listselectdeployment_namedata_recipient_global_metastore_id, max_results, page_tokenGets an array of all share recipients within the current metastore where:
rotate_tokeninsertname, deployment_name, existing_token_expire_in_secondsRefreshes the specified recipient's delta sharing authentication token with the provided token info.
createinsertdeployment_name, name, authentication_typeCreates a new recipient with the delta sharing authentication type in the metastore. The caller must
updateupdatename, deployment_nameUpdates an existing recipient in the metastore. The caller must be a metastore admin or the owner of
deletedeletename, deployment_nameDeletes the specified recipient from the metastore. The caller must be the owner of the recipient.

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 recipient.
data_recipient_global_metastore_idstringIf not provided, all recipients will be returned. If no recipients exist with this ID, no results will be returned.
max_resultsintegerMaximum number of recipients to return. - when set to 0, the page length is set to a server configured value (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 a value less than 0, an invalid parameter error is returned; - If not set, all valid recipients are returned (not recommended). - Note: The number of returned recipients might be less than the specified max_results size, even zero. The only definitive indication that no further recipients can be fetched is when the next_page_token is unset from the response.
page_tokenstringOpaque pagination token to go to next page based on previous query.

SELECT examples

Gets a share recipient from the metastore. The caller must be one of: * A user with USE_RECIPIENT

SELECT
id,
name,
data_recipient_global_metastore_id,
metastore_id,
activated,
activation_url,
authentication_type,
cloud,
comment,
created_at,
created_by,
expiration_time,
ip_access_list,
owner,
properties_kvpairs,
region,
sharing_code,
tokens,
updated_at,
updated_by
FROM databricks_workspace.sharing.recipients
WHERE name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Refreshes the specified recipient's delta sharing authentication token with the provided token info.

INSERT INTO databricks_workspace.sharing.recipients (
existing_token_expire_in_seconds,
name,
deployment_name
)
SELECT
{{ existing_token_expire_in_seconds }} /* required */,
'{{ name }}',
'{{ deployment_name }}'
RETURNING
id,
name,
data_recipient_global_metastore_id,
metastore_id,
activated,
activation_url,
authentication_type,
cloud,
comment,
created_at,
created_by,
expiration_time,
ip_access_list,
owner,
properties_kvpairs,
region,
sharing_code,
tokens,
updated_at,
updated_by
;

UPDATE examples

Updates an existing recipient in the metastore. The caller must be a metastore admin or the owner of

UPDATE databricks_workspace.sharing.recipients
SET
comment = '{{ comment }}',
expiration_time = {{ expiration_time }},
id = '{{ id }}',
ip_access_list = '{{ ip_access_list }}',
new_name = '{{ new_name }}',
owner = '{{ owner }}',
properties_kvpairs = '{{ properties_kvpairs }}'
WHERE
name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
RETURNING
id,
name,
data_recipient_global_metastore_id,
metastore_id,
activated,
activation_url,
authentication_type,
cloud,
comment,
created_at,
created_by,
expiration_time,
ip_access_list,
owner,
properties_kvpairs,
region,
sharing_code,
tokens,
updated_at,
updated_by;

DELETE examples

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

DELETE FROM databricks_workspace.sharing.recipients
WHERE name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;