tokens
Creates, updates, deletes, gets or lists a tokens
resource.
Overview
Name | tokens |
Type | Resource |
Id | databricks_workspace.workspace.tokens |
Fields
The following fields are returned by SELECT
queries:
- list
- get
Request completed successfully.
Name | Datatype | Description |
---|---|---|
created_by_id | integer | |
owner_id | integer | |
token_id | string | |
workspace_id | integer | |
comment | string | |
created_by_username | string | |
creation_time | integer | |
expiry_time | integer | |
last_used_day | integer |
Request completed successfully.
Name | Datatype | Description |
---|---|---|
created_by_id | integer | |
owner_id | integer | |
token_id | string | |
workspace_id | integer | |
comment | string | |
created_by_username | string | |
creation_time | integer | |
expiry_time | integer | |
last_used_day | integer |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list | select | deployment_name | Lists all tokens associated with the specified workspace or user. | |
get | select | deployment_name | Gets information about a token, specified by its ID. | |
createobotoken | insert | deployment_name | Creates a token on behalf of a service principal. | |
delete | delete | deployment_name | Deletes a token, specified by its ID. |
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
- list
- get
Lists all tokens associated with the specified workspace or user.
SELECT
created_by_id,
owner_id,
token_id,
workspace_id,
comment,
created_by_username,
creation_time,
expiry_time,
last_used_day
FROM databricks_workspace.workspace.tokens
WHERE deployment_name = '{{ deployment_name }}' -- required;
Gets information about a token, specified by its ID.
SELECT
created_by_id,
owner_id,
token_id,
workspace_id,
comment,
created_by_username,
creation_time,
expiry_time,
last_used_day
FROM databricks_workspace.workspace.tokens
WHERE deployment_name = '{{ deployment_name }}' -- required;
INSERT
examples
- createobotoken
- Manifest
Creates a token on behalf of a service principal.
INSERT INTO databricks_workspace.workspace.tokens (
data__application_id,
data__lifetime_seconds,
data__comment,
deployment_name
)
SELECT
'{{ application_id }}',
'{{ lifetime_seconds }}',
{{ comment }},
'{{ deployment_name }}'
RETURNING
token_info,
token_value
;
# Description fields are for documentation purposes
- name: tokens
props:
- name: deployment_name
value: string
description: Required parameter for the tokens resource.
- name: application_id
value: required
- name: lifetime_seconds
value: string
- name: comment
value: integer
DELETE
examples
- delete
Deletes a token, specified by its ID.
DELETE FROM databricks_workspace.workspace.tokens
WHERE deployment_name = '{{ deployment_name }}' --required;