users
Operations on a users
resource.
Overview
Name | users |
Type | Resource |
Id | databricks_account.iam.users |
Fields
Name | Datatype |
---|---|
id | string |
name | object |
active | boolean |
displayName | string |
emails | array |
externalId | string |
roles | array |
userName | string |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | account_id, id | Gets information for a specific user in Databricks account. |
list | SELECT | account_id | Gets details for all the users associated with a Databricks account. |
create | INSERT | account_id | Creates a new user in the Databricks account. This new user will also be added to the Databricks account. |
delete | DELETE | account_id, id | Deletes a user. Deleting a user from a Databricks account also removes objects associated with the user. |
patch | UPDATE | account_id, id | Partially updates a user resource by applying the supplied operations on specific user attributes. |
update | REPLACE | account_id, id | Replaces a user's information with the data supplied in request. |
SELECT
examples
- users (list)
- users (get)
SELECT
id,
name,
active,
displayName,
emails,
externalId,
roles,
userName
FROM databricks_account.iam.users
WHERE account_id = '{{ account_id }}';
SELECT
id,
name,
active,
displayName,
emails,
externalId,
roles,
userName
FROM databricks_account.iam.users
WHERE account_id = '{{ account_id }}' AND
id = '{{ id }}';
INSERT
example
Use the following StackQL query and manifest file to create a new users
resource.
- users
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: userName
value: user@example.com
- name: emails
value:
- $ref: string
value: string
display: string
primary: true
type: string
- name: name
value:
givenName: string
familyName: string
- name: displayName
value: string
- name: roles
value:
- $ref: string
value: string
display: string
primary: true
type: string
- name: externalId
value: string
- name: active
value: true
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 }}';