我想实用地删除一组群集。假设,它们只是进行某些测试的目的之一,我想立即将其删除。

我以为将所有群集分配给特定的池可能是可行的,但是池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
}

10-06 01:06