users
Operations on a users
resource.
Overview
Name | users |
Type | Resource |
Id | databricks_workspace.iam.users |
Fields
Name | Datatype |
---|---|
id | string |
name | object |
active | boolean |
displayName | string |
emails | array |
entitlements | array |
externalId | string |
groups | array |
roles | array |
schemas | array |
userName | string |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | id, deployment_name | Gets information for a specific user in Databricks workspace. |
list | SELECT | deployment_name | Gets details for all the users associated with a Databricks workspace. |
create | INSERT | deployment_name | Creates a new user in the Databricks workspace. This new user will also be added to the Databricks account. |
delete | DELETE | id, deployment_name | Deletes a user. Deleting a user from a Databricks workspace also removes objects associated with the user. |
patch | UPDATE | id, deployment_name | Partially updates a user resource by applying the supplied operations on specific user attributes. |
update | UPDATE | id, deployment_name | Replaces a user's information with the data supplied in request. |
SELECT
examples
- users (list)
- users (get)
SELECT
id,
name,
active,
displayName,
emails,
entitlements,
externalId,
groups,
roles,
schemas,
userName
FROM databricks_workspace.iam.users
WHERE deployment_name = '{{ deployment_name }}';
SELECT
id,
name,
active,
displayName,
emails,
entitlements,
externalId,
groups,
roles,
schemas,
userName
FROM databricks_workspace.iam.users
WHERE id = '{{ id }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new users
resource.
- users
- Manifest
/*+ create */
INSERT INTO databricks_workspace.iam.users (
deployment_name,
data__schemas,
data__userName,
data__emails,
data__name,
data__displayName,
data__groups,
data__roles,
data__entitlements,
data__externalId,
data__active
)
SELECT
'{{ deployment_name }}',
'{{ schemas }}',
'{{ userName }}',
'{{ emails }}',
'{{ name }}',
'{{ displayName }}',
'{{ groups }}',
'{{ roles }}',
'{{ entitlements }}',
'{{ externalId }}',
'{{ active }}'
;
- name: your_resource_model_name
props:
- name: schemas
value:
- urn:ietf:params:scim:schemas:core:2.0:User
- 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: groups
value:
- $ref: string
value: string
display: string
primary: true
type: string
- name: roles
value:
- $ref: string
value: string
display: string
primary: true
type: string
- name: entitlements
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.
- patch
- update
/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.iam.users
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE id = '{{ id }}' AND
deployment_name = '{{ deployment_name }}';
/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.iam.users
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE id = '{{ id }}' AND
deployment_name = '{{ deployment_name }}';
DELETE
example
Deletes a users
resource.
/*+ delete */
DELETE FROM databricks_workspace.iam.users
WHERE id = '{{ id }}' AND
deployment_name = '{{ deployment_name }}';