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.
allowed_acceptance_typesarrayAuthentication types the invitee may choose from when activating. Each value must be TOKEN or DATABRICKS. Empty means all supported types are allowed. This field is only present when the **authentication_type** is **EMAIL**.
allowed_data_recipient_global_metastore_idsarrayOptional allowlist of the data recipient's global metastore IDs permitted to accept the invite with the DATABRICKS acceptance type. Each ID is of the form **cloud**:**region**:**metastore-uuid**. Empty means any metastore is allowed. If non-empty, **allowed_acceptance_types** must include **DATABRICKS**. This field is only present when the **authentication_type** is **EMAIL**.
authentication_typestringThe delta sharing authentication type. (DATABRICKS, EMAIL, 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.
emailstringThe invited email address. This field is only present when the **authentication_type** is **EMAIL**. The 320-character cap follows RFC 5321 (64-octet local-part + ``@`` + 255-octet domain).
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:
listselectdeployment_namedata_recipient_global_metastore_id, max_results, page_token, parent_recipient_nameGets 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.
parent_recipient_namestringIf set, the response is scoped to the child recipients of the named parent recipient. Child recipients are otherwise hidden from the default list response. Only applicable to email recipient parents — non-email recipients have no children to scope to.

SELECT examples

Gets a share recipient from the metastore. The caller must be one of:

SELECT
id,
name,
data_recipient_global_metastore_id,
metastore_id,
activated,
activation_url,
allowed_acceptance_types,
allowed_data_recipient_global_metastore_ids,
authentication_type,
cloud,
comment,
created_at,
created_by,
email,
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,
allowed_acceptance_types,
allowed_data_recipient_global_metastore_ids,
authentication_type,
cloud,
comment,
created_at,
created_by,
email,
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
allowed_acceptance_types = '{{ allowed_acceptance_types }}',
allowed_data_recipient_global_metastore_ids = '{{ allowed_data_recipient_global_metastore_ids }}',
comment = '{{ comment }}',
email = '{{ email }}',
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,
allowed_acceptance_types,
allowed_data_recipient_global_metastore_ids,
authentication_type,
cloud,
comment,
created_at,
created_by,
email,
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
;