libraries
Creates, updates, deletes, gets or lists a libraries resource.
Overview
| Name | libraries |
| Type | Resource |
| Id | databricks_workspace.compute.libraries |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
is_library_for_all_clusters | boolean | Whether the library was set to be installed on all clusters via the libraries UI. |
library | object | Unique identifier for the library. |
messages | array | All the info and warning messages that have occurred so far for this library. |
status | string | Status of installing the library on the cluster. (FAILED, INSTALLED, INSTALLING, PENDING, RESOLVING, RESTORED, SKIPPED, UNINSTALL_ON_RESTART) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | cluster_id, deployment_name | Get the status of libraries on a cluster. A status is returned for all libraries installed on this | |
install | insert | deployment_name, cluster_id, libraries | Add libraries to install on a cluster. The installation is asynchronous; it happens in the background | |
uninstall | exec | deployment_name, cluster_id, libraries | Set libraries to uninstall from a cluster. The libraries won't be uninstalled until the cluster is |
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 |
|---|---|---|
cluster_id | string | Unique identifier of the cluster whose status should be retrieved. |
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
SELECT examples
- get
Get the status of libraries on a cluster. A status is returned for all libraries installed on this
SELECT
is_library_for_all_clusters,
library,
messages,
status
FROM databricks_workspace.compute.libraries
WHERE cluster_id = '{{ cluster_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
INSERT examples
- install
- Manifest
Add libraries to install on a cluster. The installation is asynchronous; it happens in the background
INSERT INTO databricks_workspace.compute.libraries (
cluster_id,
libraries,
deployment_name
)
SELECT
'{{ cluster_id }}' /* required */,
'{{ libraries }}' /* required */,
'{{ deployment_name }}'
;
# Description fields are for documentation purposes
- name: libraries
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the libraries resource.
- name: cluster_id
value: "{{ cluster_id }}"
description: |
Unique identifier for the cluster on which to install these libraries.
- name: libraries
description: |
The libraries to install.
value:
- cran:
package: "{{ package }}"
repo: "{{ repo }}"
egg: "{{ egg }}"
jar: "{{ jar }}"
maven:
coordinates: "{{ coordinates }}"
exclusions:
- "{{ exclusions }}"
repo: "{{ repo }}"
pypi:
package: "{{ package }}"
repo: "{{ repo }}"
requirements: "{{ requirements }}"
whl: "{{ whl }}"
Lifecycle Methods
- uninstall
Set libraries to uninstall from a cluster. The libraries won't be uninstalled until the cluster is
EXEC databricks_workspace.compute.libraries.uninstall
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"cluster_id": "{{ cluster_id }}",
"libraries": "{{ libraries }}"
}'
;