如何使用 Databricks API 创建目录

问题描述 投票:0回答:1

我正在尝试使用 Databricks API 创建一个目录,但我很难在 cURL 请求中找到正确的占位符。

我尝试使用 mkdirs 创建目录,但没有成功!

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

但是下面的 GET 请求在我的环境中与提供的主机和令牌一起工作正常:

curl -X GET "https://${DATABRICKS_HOST}/api/2.0/clusters/get" -H "Authorization: Bearer ${DATABRICKS_TOKEN}" -d '{ "cluster_id": "<0101-654123-is5wcaq7>" }'
curl databricks azure-databricks
1个回答
0
投票

您需要像 get 一样以 JSON 字符串格式传递数据 对集群的请求。

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

© www.soinside.com 2019 - 2024. All rights reserved.