我想务实地删除一组集群。比方说,它们只是某些测试的一个目的,我想立即删除它们。
当我将所有集群分配给特定池时,我认为也许这是可能的,但似乎 Pool API 不会返回有关分配给它的集群的信息。
还有其他想法吗?
谢谢
最佳答案
您可以使用此 module 在 PowerShell 中轻松完成此操作。我在下面测试了这个脚本,效果非常好
$databricksBearerToken = "" # enter your manually generated token here
$databricksRegion = "" # enter region for the workspace here
$databricksWorkSpaceName = "" # enter the name of your databricks workspace
# Return a list of existing clusters
$myclusters = Get-DatabricksClusters -BearerToken $databricksBearerToken -Region $databricksRegion
# Iterate through these clusters and remove them one by one
Foreach($cluster in $myclusters)
{
$clusterName = $cluster.cluster_name
$clusterID = $cluster.cluster_id
Write-Host $clusterName
Remove-DatabricksCluster -BearerToken $databricksBearerToken -Region $databricksRegion -ClusterName $clusterName -ClusterId $clusterID
}
关于azure - 如何删除databricks azure中的所有集群,而不是搜索和复制cluster_id?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59737687/