user_tokens
Operations on a user_tokens
resource.
Overview
Name | user_tokens |
Type | Resource |
Id | databricks_workspace.workspace.user_tokens |
Fields
Name | Datatype |
---|---|
comment | string |
creation_time | integer |
expiry_time | integer |
token_id | string |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
listtokens | SELECT | deployment_name | Lists all the valid tokens for a user-workspace pair. |
create | INSERT | deployment_name | Creates 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 |
revoketoken | EXEC | deployment_name | Revokes 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.
- user_tokens
- Manifest
/*+ create */
INSERT INTO databricks_workspace.workspace.user_tokens (
deployment_name,
data__lifetime_seconds,
data__comment
)
SELECT
'{{ deployment_name }}',
'{{ lifetime_seconds }}',
'{{ comment }}'
;
- name: your_resource_model_name
props:
- name: lifetime_seconds
value: 0
- name: comment
value: string