Skip to main content

users

Operations on a users resource.

Overview

Nameusers
TypeResource
Iddatabricks_account.iam.users

Fields

NameDatatype
idstring
nameobject
activeboolean
displayNamestring
emailsarray
externalIdstring
rolesarray
userNamestring

Methods

NameAccessible byRequired ParamsDescription
getSELECTaccount_id, idGets information for a specific user in Databricks account.
listSELECTaccount_idGets details for all the users associated with a Databricks account.
createINSERTaccount_idCreates a new user in the Databricks account. This new user will also be added to the Databricks account.
deleteDELETEaccount_id, idDeletes a user. Deleting a user from a Databricks account also removes objects associated with the user.
patchUPDATEaccount_id, idPartially updates a user resource by applying the supplied operations on specific user attributes.
updateREPLACEaccount_id, idReplaces a user's information with the data supplied in request.

SELECT examples

SELECT
id,
name,
active,
displayName,
emails,
externalId,
roles,
userName
FROM databricks_account.iam.users
WHERE account_id = '{{ account_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new users resource.

/*+ create */
INSERT INTO databricks_account.iam.users (
account_id,
data__userName,
data__emails,
data__name,
data__displayName,
data__roles,
data__externalId,
data__active
)
SELECT
'{{ account_id }}',
'{{ userName }}',
'{{ emails }}',
'{{ name }}',
'{{ displayName }}',
'{{ roles }}',
'{{ externalId }}',
'{{ active }}'
;

UPDATE example

Updates a users resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_account.iam.users
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE account_id = '{{ account_id }}' AND
id = '{{ id }}';

REPLACE example

Replaces a users resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
REPLACE databricks_account.iam.users
SET field1 = '{ value1 }',
field2 = '{ value2 }', ...
WHERE account_id = '{{ account_id }}' AND
id = '{{ id }}';

DELETE example

Deletes a users resource.

/*+ delete */
DELETE FROM databricks_account.iam.users
WHERE account_id = '{{ account_id }}' AND
id = '{{ id }}';