users
Creates, updates, deletes, gets or lists a users resource.
Overview​
| Name | users |
| Type | Resource |
| Id | databricks_account.iamv2.users |
Fields​
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
account_id | string | The accountId parent of the user in Databricks. |
external_id | string | ExternalId of the user in the customer's IdP. |
user_id | string | Internal userId of the user in Databricks. |
full_name | object | |
account_user_status | string | The activity status of a user in a Databricks account. (ACTIVE, INACTIVE) |
username | string | Username/email of the user. |
| Name | Datatype | Description |
|---|---|---|
account_id | string | The accountId parent of the user in Databricks. |
external_id | string | ExternalId of the user in the customer's IdP. |
user_id | string | Internal userId of the user in Databricks. |
full_name | object | |
account_user_status | string | The activity status of a user in a Databricks account. (ACTIVE, INACTIVE) |
username | string | Username/email of the user. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | account_id, user_id, account_host | Fetches a user from the Databricks account by its internal ID. | |
list | select | account_id, account_host | filter, page_size, page_token | Lists the users in the Databricks account, returning one page per call. Supports filtering by username |
create | insert | account_id, account_host, username, full_name, account_user_status | Creates a local user in the Databricks account and returns the created user. A local user is one that | |
update | update | account_id, user_id, update_mask, account_host, username, full_name, account_user_status | Updates an existing user in the Databricks account and returns the updated user. Only the fields named | |
delete | delete | account_id, user_id, account_host | Deletes a user from the Databricks account by its internal ID. | |
resolve | exec | account_id, account_host, external_id | Resolves a user with the given external ID from the customer's IdP. If the user does not exist, it |
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.
| Name | Datatype | Description |
|---|---|---|
account_host | string | The Databricks account console host. Selected by DATABRICKS_CLOUD (aws, azure or gcp; default aws), or set explicitly with DATABRICKS_ACCOUNT_HOST (bare host, no scheme). (default: accounts.cloud.databricks.com, x-stackQL-envVar: DATABRICKS_ACCOUNT_HOST, x-stackQL-envVarSelector: {"envVar":"DATABRICKS_CLOUD","default":"aws","values":{"aws":"accounts.cloud.databricks.com","azure":"accounts.azuredatabricks.net","gcp":"accounts.gcp.databricks.com"}}) |
account_id | string | |
update_mask | string | Required. The list of fields to update. |
user_id | string | Required. Internal ID of the user in Databricks. |
filter | string | Optional. Allows filtering users by username or external id. |
page_size | integer | The maximum number of users to return. The service may return fewer than this value. If not provided, defaults to 1000, which is also the maximum allowed. Requests for more than the maximum are clamped to 1000. |
page_token | string | A page token, received from a previous ListUsers call. Provide this to retrieve the subsequent page. |
SELECT examples​
- get
- list
Fetches a user from the Databricks account by its internal ID.
SELECT
account_id,
external_id,
user_id,
full_name,
account_user_status,
username
FROM databricks_account.iamv2.users
WHERE account_id = '{{ account_id }}' -- required
AND user_id = '{{ user_id }}' -- required
AND account_host = '{{ account_host }}' -- required
;
Lists the users in the Databricks account, returning one page per call. Supports filtering by username
SELECT
account_id,
external_id,
user_id,
full_name,
account_user_status,
username
FROM databricks_account.iamv2.users
WHERE account_id = '{{ account_id }}' -- required
AND account_host = '{{ account_host }}' -- required
AND filter = '{{ filter }}'
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
INSERT examples​
- create
- Manifest
Creates a local user in the Databricks account and returns the created user. A local user is one that
INSERT INTO databricks_account.iamv2.users (
username,
full_name,
account_user_status,
account_id,
external_id,
user_id,
account_id,
account_host
)
SELECT
'{{ username }}' /* required */,
'{{ full_name }}' /* required */,
'{{ account_user_status }}' /* required */,
'{{ account_id }}',
'{{ external_id }}',
'{{ user_id }}',
'{{ account_id }}',
'{{ account_host }}'
RETURNING
account_id,
external_id,
user_id,
full_name,
account_user_status,
username
;
# Description fields are for documentation purposes
- name: users
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the users resource.
- name: account_host
value: "{{ account_host }}"
description: Required parameter for the users resource.
- name: username
value: "{{ username }}"
description: |
Username/email of the user.
- name: full_name
value:
family_name: "{{ family_name }}"
given_name: "{{ given_name }}"
- name: account_user_status
value: "{{ account_user_status }}"
description: |
The activity status of a user in a Databricks account.
- name: account_id
value: "{{ account_id }}"
description: |
The accountId parent of the user in Databricks.
- name: external_id
value: "{{ external_id }}"
description: |
ExternalId of the user in the customer's IdP.
- name: user_id
value: "{{ user_id }}"
description: |
Internal userId of the user in Databricks.
UPDATE examples​
- update
Updates an existing user in the Databricks account and returns the updated user. Only the fields named
UPDATE databricks_account.iamv2.users
SET
username = '{{ username }}',
full_name = '{{ full_name }}',
account_user_status = '{{ account_user_status }}',
account_id = '{{ account_id }}',
external_id = '{{ external_id }}',
user_id = '{{ user_id }}'
WHERE
account_id = '{{ account_id }}' --required
AND user_id = '{{ user_id }}' --required
AND update_mask = '{{ update_mask }}' --required
AND account_host = '{{ account_host }}' --required
AND username = '{{ username }}' --required
AND full_name = '{{ full_name }}' --required
AND account_user_status = '{{ account_user_status }}' --required
RETURNING
account_id,
external_id,
user_id,
full_name,
account_user_status,
username;
DELETE examples​
- delete
Deletes a user from the Databricks account by its internal ID.
DELETE FROM databricks_account.iamv2.users
WHERE account_id = '{{ account_id }}' --required
AND user_id = '{{ user_id }}' --required
AND account_host = '{{ account_host }}' --required
;
Lifecycle Methods​
- resolve
Resolves a user with the given external ID from the customer's IdP. If the user does not exist, it
EXEC databricks_account.iamv2.users.resolve
@account_id='{{ account_id }}' --required,
@account_host='{{ account_host }}' --required
@@json=
'{
"external_id": "{{ external_id }}"
}'
;