Closed DGossman closed 1 year ago
There are new properties added to the API on a very fast pace and it is hard to keep everything updated and expose dedicated parameters for all new properties.
I would recommend to use the -ClusterObject
parameter instead and pass in an object with all properties you need.
So you would get the current cluster object, change it and push it back. Something like this:
$obj = Get-DatabricksCluster -ClusterID "asdf-asdf-asdf"
§obj.myProperty = 123
$obj | Update-DatabricksCluster
Thanks @gbrueckl. This worked in principle but the Update-DatabricksCluster
cmdlet gave the bellow error and so I ended up using Invoke-DatabricksApiRequest -Method "POST" -EndPoint "/2.0/clusters/edit" -Body $config
instead which did work. Where
$config = @{}
$obj.psobject.properties | ForEach-Object { $config[$_.Name] = $_.Value }
When I update a cluster that has been created using the UI to be a single user cluster with Unity Catalog enabled using the Update-DatabricksCluster endpoint the cluster access mode changes to "Custom" without Unity Catalog enabled.
Looking at the cluster JSON before and after the update it looks like data_security_mode and single_user_name are gone which are the only things related to Unity Catalog and come back if I manually edit the access mode back to single user through the UI.
JSON Before:
JSON After:
It seems like these two parameters need to be specified when doing an update through the API but are not available in the Update cmdlets. Is this something that can be added or is a workaround to the above issue?