Skip to main content

user_tokens

Operations on a user_tokens resource.

Overview

Nameuser_tokens
TypeResource
Iddatabricks_workspace.workspace.user_tokens

Fields

NameDatatype
commentstring
creation_timeinteger
expiry_timeinteger
token_idstring

Methods

NameAccessible byRequired ParamsDescription
listtokensSELECTdeployment_nameLists all the valid tokens for a user-workspace pair.
createINSERTdeployment_nameCreates and returns a token for a user. If this call is made through token authentication, it creates a token with the same client ID as the authenticated token. If the user's token quota is exceeded, this call returns an error
revoketokenEXECdeployment_nameRevokes an access token.

SELECT examples

SELECT
comment,
creation_time,
expiry_time,
token_id
FROM databricks_workspace.workspace.user_tokens
WHERE deployment_name = '{{ deployment_name }}';

INSERT example

Use the following StackQL query and manifest file to create a new user_tokens resource.

/*+ create */
INSERT INTO databricks_workspace.workspace.user_tokens (
deployment_name,
data__lifetime_seconds,
data__comment
)
SELECT
'{{ deployment_name }}',
'{{ lifetime_seconds }}',
'{{ comment }}'
;