Skip to main content

account_users

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

Overview

Nameaccount_users
TypeResource
Iddatabricks_account.iam.account_users

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringDatabricks user ID.
nameobject
account_idstring
activebooleanIf this user is active
displayNamestringString that represents a concatenation of given and family names. For example `John Smith`.
emailsarrayAll the emails associated with the Databricks user.
externalIdstringExternal ID is not currently supported. It is reserved for future use.
rolesarrayIndicates if the group has the admin role.
userNamestringEmail address of the Databricks user.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
account_users_v2_getselectaccount_id, idattributes, count, excluded_attributes, filter, sort_by, sort_order, start_indexGets information for a specific user in Databricks account.
account_users_v2_listselectaccount_idattributes, count, excluded_attributes, filter, sort_by, sort_order, start_indexGets details for all the users associated with a Databricks account.
account_users_v2_createinsertaccount_idCreates a new user in the Databricks account. This new user will also be added to the Databricks
account_users_v2_patchupdateaccount_id, idPartially updates a user resource by applying the supplied operations on specific user attributes.
account_users_v2_updatereplaceaccount_id, idReplaces a user's information with the data supplied in request.
account_users_v2_deletedeleteaccount_id, idDeletes a user. Deleting a user from a Databricks account also removes objects associated with 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
account_idstring
idstringUnique ID for a user in the Databricks account.
attributesstringComma-separated list of attributes to return in response.
countintegerDesired number of results per page. Default is 10000.
excluded_attributesstringComma-separated list of attributes to exclude in response.
filterstringQuery by which the results have to be filtered. Supported operators are equals(eq), contains(co), starts with(sw) and not equals(ne). Additionally, simple expressions can be formed using logical operators - and and or. The [SCIM RFC] has more details but we currently only support simple expressions. [SCIM RFC]: https://tools.ietf.org/html/rfc7644#section-3.4.2.2
sort_bystringAttribute to sort the results. Multi-part paths are supported. For example, userName, name.givenName, and emails.
sort_orderstringThe order to sort the results.
start_indexintegerSpecifies the index of the first result. First item is number 1.

SELECT examples

Gets information for a specific user in Databricks account.

SELECT
id,
name,
account_id,
active,
displayName,
emails,
externalId,
roles,
userName
FROM databricks_account.iam.account_users
WHERE account_id = '{{ account_id }}' -- required
AND id = '{{ id }}' -- required
AND attributes = '{{ attributes }}'
AND count = '{{ count }}'
AND excluded_attributes = '{{ excluded_attributes }}'
AND filter = '{{ filter }}'
AND sort_by = '{{ sort_by }}'
AND sort_order = '{{ sort_order }}'
AND start_index = '{{ start_index }}'
;

INSERT examples

Creates a new user in the Databricks account. This new user will also be added to the Databricks

INSERT INTO databricks_account.iam.account_users (
active,
displayName,
emails,
externalId,
id,
name,
roles,
userName,
account_id
)
SELECT
{{ active }},
'{{ displayName }}',
'{{ emails }}',
'{{ externalId }}',
'{{ id }}',
'{{ name }}',
'{{ roles }}',
'{{ userName }}',
'{{ account_id }}'
RETURNING
id,
name,
account_id,
active,
displayName,
emails,
externalId,
roles,
userName
;

UPDATE examples

Partially updates a user resource by applying the supplied operations on specific user attributes.

UPDATE databricks_account.iam.account_users
SET
Operations = '{{ Operations }}',
schemas = '{{ schemas }}'
WHERE
account_id = '{{ account_id }}' --required
AND id = '{{ id }}' --required;

REPLACE examples

Replaces a user's information with the data supplied in request.

REPLACE databricks_account.iam.account_users
SET
active = {{ active }},
displayName = '{{ displayName }}',
emails = '{{ emails }}',
externalId = '{{ externalId }}',
name = '{{ name }}',
roles = '{{ roles }}',
userName = '{{ userName }}'
WHERE
account_id = '{{ account_id }}' --required
AND id = '{{ id }}' --required;

DELETE examples

Deletes a user. Deleting a user from a Databricks account also removes objects associated with the

DELETE FROM databricks_account.iam.account_users
WHERE account_id = '{{ account_id }}' --required
AND id = '{{ id }}' --required
;