user_tokens
Creates, updates, deletes, gets or lists a user_tokens
resource.
Overview
Name | user_tokens |
Type | Resource |
Id | databricks_workspace.workspace.user_tokens |
Fields
The following fields are returned by SELECT
queries:
- listtokens
Request completed successfully.
Name | Datatype | Description |
---|---|---|
token_id | string | |
comment | string | |
creation_time | integer | |
expiry_time | integer |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional 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. |
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) |
SELECT
examples
- listtokens
Lists all the valid tokens for a user-workspace pair.
SELECT
token_id,
comment,
creation_time,
expiry_time
FROM databricks_workspace.workspace.user_tokens
WHERE deployment_name = '{{ deployment_name }}' -- required;
INSERT
examples
- create
- Manifest
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
INSERT INTO databricks_workspace.workspace.user_tokens (
data__lifetime_seconds,
data__comment,
deployment_name
)
SELECT
{{ lifetime_seconds }},
'{{ comment }}',
'{{ deployment_name }}'
RETURNING
token_info,
token_value
;
# Description fields are for documentation purposes
- name: user_tokens
props:
- name: deployment_name
value: string
description: Required parameter for the user_tokens resource.
- name: lifetime_seconds
value: integer
- name: comment
value: string
Lifecycle Methods
- revoketoken
Revokes an access token.
EXEC databricks_workspace.workspace.user_tokens.revoketoken
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"token_id": "{{ token_id }}"
}';