Skip to main content

recipients

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

Overview

Namerecipients
TypeResource
Iddatabricks_workspace.deltasharing.recipients

Fields

The following fields are returned by SELECT queries:

The recipient was successfully retrieved.

NameDatatypeDescription
namestring
data_recipient_global_metastore_idstring
metastore_idstring
activatedboolean
activation_urlstring
authentication_typestring
cloudstring
commentstring
created_atinteger
created_bystring
ip_access_listobject
ownerstring
properties_kvpairsobject
regionstring
sharing_codestring
tokensarray
updated_atinteger
updated_bystring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdeployment_nameGets a share recipient from the metastore if:
listselectdeployment_nameGets an array of all share recipients within the current metastore where:
createinsertdeployment_nameCreates a new recipient with the delta sharing authentication type in the metastore. The caller must be a metastore admin or has the
updateupdatedeployment_nameUpdates an existing recipient in the metastore. The caller must be a metastore admin or the owner of the recipient. If the recipient name will be updated, the user must be both a metastore admin and the owner of the recipient.
deletedeletedeployment_nameDeletes the specified recipient from the metastore. The caller must be the owner of the recipient.
rotatetokenexecdeployment_nameRefreshes the specified recipient's delta sharing authentication token with the provided token info. 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)

SELECT examples

Gets a share recipient from the metastore if:

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

INSERT examples

Creates a new recipient with the delta sharing authentication type in the metastore. The caller must be a metastore admin or has the

INSERT INTO databricks_workspace.deltasharing.recipients (
data__name,
data__authentication_type,
data__owner,
data__comment,
data__data_recipient_global_metastore_id,
data__sharing_code,
data__expiration_time,
data__ip_access_list,
data__properties_kvpairs,
deployment_name
)
SELECT
'{{ name }}',
'{{ authentication_type }}',
'{{ owner }}',
'{{ comment }}',
'{{ data_recipient_global_metastore_id }}',
'{{ sharing_code }}',
'{{ expiration_time }}',
'{{ ip_access_list }}',
'{{ properties_kvpairs }}',
'{{ deployment_name }}'
RETURNING
name,
data_recipient_global_metastore_id,
metastore_id,
activated,
activation_url,
authentication_type,
cloud,
comment,
created_at,
created_by,
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 the recipient. If the recipient name will be updated, the user must be both a metastore admin and the owner of the recipient.

UPDATE databricks_workspace.deltasharing.recipients
SET
data__owner = '{{ owner }}',
data__comment = '{{ comment }}',
data__new_name = '{{ new_name }}',
data__expiration_time = {{ expiration_time }},
data__ip_access_list = '{{ ip_access_list }}',
data__properties_kvpairs = '{{ properties_kvpairs }}'
WHERE
deployment_name = '{{ deployment_name }}' --required;

DELETE examples

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

DELETE FROM databricks_workspace.deltasharing.recipients
WHERE deployment_name = '{{ deployment_name }}' --required;

Lifecycle Methods

Refreshes the specified recipient's delta sharing authentication token with the provided token info. The caller must be the owner of the recipient.

EXEC databricks_workspace.deltasharing.recipients.rotatetoken 
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"existing_token_expire_in_seconds": "{{ existing_token_expire_in_seconds }}"
}';