users_v2
Creates, updates, deletes, gets or lists a users_v2 resource.
Overview
| Name | users_v2 |
| Type | Resource |
| Id | databricks_workspace.iam.users_v2 |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Databricks user ID. |
name | object | |
active | boolean | |
displayName | string | String that represents a concatenation of given and family names. For example `John Smith`. This field cannot be updated through the Workspace SCIM APIs when [identity federation is enabled]. Use Account SCIM APIs to update `displayName`. [identity federation is enabled]: https://docs.databricks.com/administration-guide/users-groups/best-practices.html#enable-identity-federation |
emails | array | All the emails associated with the Databricks user. |
entitlements | array | Entitlements assigned to the user. See [assigning entitlements] for a full list of supported values. [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements |
externalId | string | External ID is not currently supported. It is reserved for future use. |
groups | array | |
roles | array | Corresponds to AWS instance profile/arn role. |
schemas | array | The schema of the user. |
userName | string | Email address of the Databricks user. |
| Name | Datatype | Description |
|---|---|---|
id | string | Databricks user ID. |
name | object | |
active | boolean | |
displayName | string | String that represents a concatenation of given and family names. For example `John Smith`. This field cannot be updated through the Workspace SCIM APIs when [identity federation is enabled]. Use Account SCIM APIs to update `displayName`. [identity federation is enabled]: https://docs.databricks.com/administration-guide/users-groups/best-practices.html#enable-identity-federation |
emails | array | All the emails associated with the Databricks user. |
entitlements | array | Entitlements assigned to the user. See [assigning entitlements] for a full list of supported values. [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements |
externalId | string | External ID is not currently supported. It is reserved for future use. |
groups | array | |
roles | array | Corresponds to AWS instance profile/arn role. |
schemas | array | The schema of the user. |
userName | string | Email address of the Databricks user. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, deployment_name | attributes, count, excluded_attributes, filter, sort_by, sort_order, start_index | Gets information for a specific user in Databricks workspace. |
list | select | deployment_name | attributes, count, excluded_attributes, filter, sort_by, sort_order, start_index | 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 | |
patch | update | id, deployment_name | Partially updates a user resource by applying the supplied operations on specific user attributes. | |
replace | replace | id, deployment_name | Replaces a user's information with the data supplied in request. | |
delete | delete | id, deployment_name | Deletes a user. Deleting a user from a Databricks workspace 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.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
id | string | Unique ID for a user in the Databricks workspace. |
attributes | string | Comma-separated list of attributes to return in response. |
count | integer | Desired number of results per page. |
excluded_attributes | string | Comma-separated list of attributes to exclude in response. |
filter | string | Query 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_by | string | Attribute to sort the results. Multi-part paths are supported. For example, userName, name.givenName, and emails. |
sort_order | string | The order to sort the results. |
start_index | integer | Specifies the index of the first result. First item is number 1. |
SELECT examples
- get
- list
Gets information for a specific user in Databricks workspace.
SELECT
id,
name,
active,
displayName,
emails,
entitlements,
externalId,
groups,
roles,
schemas,
userName
FROM databricks_workspace.iam.users_v2
WHERE id = '{{ id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- 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 }}'
;
Gets details for all the users associated with a Databricks workspace.
SELECT
id,
name,
active,
displayName,
emails,
entitlements,
externalId,
groups,
roles,
schemas,
userName
FROM databricks_workspace.iam.users_v2
WHERE deployment_name = '{{ deployment_name }}' -- 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
- create
- Manifest
Creates a new user in the Databricks workspace. This new user will also be added to the Databricks
INSERT INTO databricks_workspace.iam.users_v2 (
active,
display_name,
emails,
entitlements,
external_id,
groups,
id,
name,
roles,
schemas,
user_name,
deployment_name
)
SELECT
{{ active }},
'{{ display_name }}',
'{{ emails }}',
'{{ entitlements }}',
'{{ external_id }}',
'{{ groups }}',
'{{ id }}',
'{{ name }}',
'{{ roles }}',
'{{ schemas }}',
'{{ user_name }}',
'{{ deployment_name }}'
RETURNING
id,
name,
active,
displayName,
emails,
entitlements,
externalId,
groups,
roles,
schemas,
userName
;
# Description fields are for documentation purposes
- name: users_v2
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the users_v2 resource.
- name: active
value: {{ active }}
description: |
If this user is active
- name: display_name
value: "{{ display_name }}"
description: |
String that represents a concatenation of given and family names. For example `John Smith`. This field cannot be updated through the Workspace SCIM APIs when [identity federation is enabled]. Use Account SCIM APIs to update `displayName`. [identity federation is enabled]: https://docs.databricks.com/administration-guide/users-groups/best-practices.html#enable-identity-federation
- name: emails
description: |
All the emails associated with the Databricks user.
value:
- display: "{{ display }}"
primary: {{ primary }}
$ref: "{{ $ref }}"
type: "{{ type }}"
value: "{{ value }}"
- name: entitlements
description: |
Entitlements assigned to the user. See [assigning entitlements] for a full list of supported values. [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements
value:
- display: "{{ display }}"
primary: {{ primary }}
$ref: "{{ $ref }}"
type: "{{ type }}"
value: "{{ value }}"
- name: external_id
value: "{{ external_id }}"
description: |
External ID is not currently supported. It is reserved for future use.
- name: groups
description: |
:param id: str (optional) Databricks user ID.
value:
- display: "{{ display }}"
primary: {{ primary }}
$ref: "{{ $ref }}"
type: "{{ type }}"
value: "{{ value }}"
- name: id
value: "{{ id }}"
- name: name
description: |
:param roles: List[:class:`ComplexValue`] (optional) Corresponds to AWS instance profile/arn role.
value:
familyName: "{{ familyName }}"
givenName: "{{ givenName }}"
- name: roles
value:
- display: "{{ display }}"
primary: {{ primary }}
$ref: "{{ $ref }}"
type: "{{ type }}"
value: "{{ value }}"
- name: schemas
value:
- "{{ schemas }}"
description: |
The schema of the user.
- name: user_name
value: "{{ user_name }}"
description: |
Email address of the Databricks user.
UPDATE examples
- patch
Partially updates a user resource by applying the supplied operations on specific user attributes.
UPDATE databricks_workspace.iam.users_v2
SET
operations = '{{ operations }}',
schemas = '{{ schemas }}'
WHERE
id = '{{ id }}' --required
AND deployment_name = '{{ deployment_name }}' --required;
REPLACE examples
- replace
Replaces a user's information with the data supplied in request.
REPLACE databricks_workspace.iam.users_v2
SET
active = {{ active }},
display_name = '{{ display_name }}',
emails = '{{ emails }}',
entitlements = '{{ entitlements }}',
external_id = '{{ external_id }}',
groups = '{{ groups }}',
name = '{{ name }}',
roles = '{{ roles }}',
schemas = '{{ schemas }}',
user_name = '{{ user_name }}'
WHERE
id = '{{ id }}' --required
AND deployment_name = '{{ deployment_name }}' --required;
DELETE examples
- delete
Deletes a user. Deleting a user from a Databricks workspace also removes objects associated with the
DELETE FROM databricks_workspace.iam.users_v2
WHERE id = '{{ id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;