1) Find the corresponding library definition from an existing cluster using "libraries/cluster-status?cluster_id=<cluster_id>".
$ curl -X GET 'https://cust-success.cloud.databricks.com/api/2.0/libraries/cluster-status?cluster_id=1226-232931-cuffs129' -H 'Content-Type: application/json' -H "Authorization: Bearer MY_TOKEN"
{"cluster_id":"1226-232931-cuffs129","library_statuses":[{"library":{"pypi":{"package":"pyhive"}},"status":"INSTALLED","is_library_for_all_clusters":true}]}
2) Use "libraries/uninstall-library-on-all-clusters" to uninstall library using definition found with step 1:
$request_body=$(cat <<EOF
{
"library": {
"pypi": {
"package": "pyhive"
}
}
}
EOF
)
$ curl -X POST 'https://cust-success.cloud.databricks.com/api/2.0/libraries/uninstall-library-on-all-clusters' -H 'Content-Type: application/json' -H "Authorization: Bearer MY_TOKEN" -d "$request_body"
3) Verify the library status from UI. The running clusters would need to be restarted to uninstallation to take into effect.