commands
Creates, updates, deletes, gets or lists a commands
resource.
Overview
Name | commands |
Type | Resource |
Id | databricks_workspace.compute.commands |
Fields
The following fields are returned by SELECT
queries:
- commandstatus
Status was returned successfully.
Name | Datatype | Description |
---|---|---|
id | string | |
results | object | |
status | string |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
commandstatus | select | deployment_name | Gets the status of and, if available, the results from a currently executing command. | |
create | insert | deployment_name | Creates an execution context for running cluster commands. | |
cancel | exec | deployment_name | Cancels a currently running command within an execution context. | |
destroy | exec | deployment_name | Deletes an execution context. | |
execute | exec | deployment_name | Runs a cluster command in the given execution context, using the provided language. |
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
- commandstatus
Gets the status of and, if available, the results from a currently executing command.
SELECT
id,
results,
status
FROM databricks_workspace.compute.commands
WHERE deployment_name = '{{ deployment_name }}' -- required;
INSERT
examples
- create
- Manifest
Creates an execution context for running cluster commands.
INSERT INTO databricks_workspace.compute.commands (
data__clusterId,
data__language,
deployment_name
)
SELECT
'{{ clusterId }}',
'{{ language }}',
'{{ deployment_name }}'
RETURNING
id
;
# Description fields are for documentation purposes
- name: commands
props:
- name: deployment_name
value: string
description: Required parameter for the commands resource.
- name: clusterId
value: string
- name: language
value: string
Lifecycle Methods
- cancel
- destroy
- execute
Cancels a currently running command within an execution context.
EXEC databricks_workspace.compute.commands.cancel
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"clusterId": "{{ clusterId }}",
"contextId": "{{ contextId }}",
"commandId": "{{ commandId }}"
}';
Deletes an execution context.
EXEC databricks_workspace.compute.commands.destroy
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"clusterId": "{{ clusterId }}",
"contextId": "{{ contextId }}"
}';
Runs a cluster command in the given execution context, using the provided language.
EXEC databricks_workspace.compute.commands.execute
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"clusterId": "{{ clusterId }}",
"contextId": "{{ contextId }}",
"language": "{{ language }}",
"command": "{{ command }}"
}';