Unable to create Cluster via REST API
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have tried all 3 of the example payloads listed here to create a Compute Cluster: https://docs.databricks.com/api/azure/workspace/clusters/create
All return the same error: Invalid JSON given in the body of the request - expected a map
Other Compute Cluster REST APIs work just fine (List clusters, etc). Also, this documentation seems to be incorrect for the Azure flavor of Databricks. Has anyone else run into this issue and solved it?
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@jeffn - I was able to successfully create a cluster using the same Azure documentation, both via the REST API and the Databricks SDK. Hopefully it helps.
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.compute import CreateCluster
w = WorkspaceClient(
host="<workspace_url>",
token="<databricks_token>"
)
cluster = w.clusters.create(
cluster_name="test-cluster-api",
spark_version="14.3.x-scala2.12",
node_type_id="Standard_DS3_v2",
driver_node_type_id="Standard_DS3_v2",
num_workers=1,
autotermination_minutes=30,
)

