Skip to main content

groups_v2

Creates, updates, deletes, gets or lists a groups_v2 resource.

Overview

Namegroups_v2
TypeResource
Iddatabricks_workspace.iam.groups_v2

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringDatabricks group ID
displayNamestring
entitlementsarrayEntitlements assigned to the group. See [assigning entitlements] for a full list of supported values. [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements
externalIdstringexternal_id should be unique for identifying groups
groupsarray
membersarray
metaobjectContainer for the group identifier. Workspace local versus account.
rolesarrayCorresponds to AWS instance profile/arn role.
schemasarrayThe schema of the group.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, deployment_nameGets the information for a specific group in the Databricks workspace.
listselectdeployment_nameattributes, count, excluded_attributes, filter, sort_by, sort_order, start_indexGets all details of the groups associated with the Databricks workspace.
createinsertdeployment_nameCreates a group in the Databricks workspace with a unique name, using the supplied group details.
patchupdateid, deployment_namePartially updates the details of a group.
replacereplaceid, deployment_nameUpdates the details of a group by replacing the entire group entity.
deletedeleteid, deployment_nameDeletes a group from the Databricks workspace.

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
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
idstringUnique ID for a group in the Databricks workspace.
attributesstringComma-separated list of attributes to return in response.
countintegerDesired number of results per page.
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.
sort_orderstringThe order to sort the results.
start_indexintegerSpecifies the index of the first result. First item is number 1.

SELECT examples

Gets the information for a specific group in the Databricks workspace.

SELECT
id,
displayName,
entitlements,
externalId,
groups,
members,
meta,
roles,
schemas
FROM databricks_workspace.iam.groups_v2
WHERE id = '{{ id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Creates a group in the Databricks workspace with a unique name, using the supplied group details.

INSERT INTO databricks_workspace.iam.groups_v2 (
display_name,
entitlements,
external_id,
groups,
id,
members,
meta,
roles,
schemas,
deployment_name
)
SELECT
'{{ display_name }}',
'{{ entitlements }}',
'{{ external_id }}',
'{{ groups }}',
'{{ id }}',
'{{ members }}',
'{{ meta }}',
'{{ roles }}',
'{{ schemas }}',
'{{ deployment_name }}'
RETURNING
id,
displayName,
entitlements,
externalId,
groups,
members,
meta,
roles,
schemas
;

UPDATE examples

Partially updates the details of a group.

UPDATE databricks_workspace.iam.groups_v2
SET
operations = '{{ operations }}',
schemas = '{{ schemas }}'
WHERE
id = '{{ id }}' --required
AND deployment_name = '{{ deployment_name }}' --required;

REPLACE examples

Updates the details of a group by replacing the entire group entity.

REPLACE databricks_workspace.iam.groups_v2
SET
display_name = '{{ display_name }}',
entitlements = '{{ entitlements }}',
external_id = '{{ external_id }}',
groups = '{{ groups }}',
members = '{{ members }}',
meta = '{{ meta }}',
roles = '{{ roles }}',
schemas = '{{ schemas }}'
WHERE
id = '{{ id }}' --required
AND deployment_name = '{{ deployment_name }}' --required;

DELETE examples

Deletes a group from the Databricks workspace.

DELETE FROM databricks_workspace.iam.groups_v2
WHERE id = '{{ id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;