0

Trying to make directory using Databricks API, struggling to find the right placeholders in cURL request, please help!

Tried to create directory using mkdirs, no luck!

curl -X POST https://${DATABRICKS_HOST}/api/2.0/dbfs/mkdirs -H "Authorization: Bearer ${DATABRICKS_TOKEN}" -d {path:dbfs/mnt}

But below GET requests works fine with the provided host and token in env.

curl -X GET "https://${DATABRICKS_HOST}/api/2.0/clusters/get" -H "Authorization: Bearer ${DATABRICKS_TOKEN}" -d '{ "cluster_id": "<0101-654123-is5wcaq7>" }'
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

0

You need to pass data in json string format as how you did for get request on cluster. enter image description here

 curl -X POST "https://<host>/api/2.0/dbfs/mkdirs" -H "Authorization: Bearer <token>" -d '{"path": "/curl_dir/"}'

enter image description here

JayashankarGS
  • 1,501
  • 2
  • 2
  • 6