04-20-2022 11:19 AM
Trying to use Repos API to automate creation and updates to repos under paths not specific to a user, i.e. /Repos/Admin/<repo-name>. It seems that creating a repo via POST to /api/2.0/repos will fail if you don't include a path, and will also fail if you include a path that does not yet exist (i.e. /Repos/Admin in my example). The path can be created manually via UI, however, hoping to automate this process and not require manual steps. It doesn't appear the Repos API provides a way to do this (in Azure Databricks) so wondering if there is any other way? If not, could I suggest this as a feature request? Thanks!
04-20-2022 11:23 AM
https://docs.databricks.com/dev-tools/api/latest/workspace.html#mkdirs try through Workspace API:
curl --netrc --request POST \
https://dbc-a1b2345c-d6e7.cloud.databricks.com/api/2.0/workspace/mkdirs \
--header 'Accept: application/json' \
--data '{ "path": "/Repos/me@example.com/MyFolder" }'
04-20-2022 11:23 AM
https://docs.databricks.com/dev-tools/api/latest/workspace.html#mkdirs try through Workspace API:
curl --netrc --request POST \
https://dbc-a1b2345c-d6e7.cloud.databricks.com/api/2.0/workspace/mkdirs \
--header 'Accept: application/json' \
--data '{ "path": "/Repos/me@example.com/MyFolder" }'
04-20-2022 11:36 AM
That works, thanks!
04-20-2022 12:18 PM
Great. If you can, please select my answer as the best one. Thank you 🙂
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.
If there isn’t a group near you, start one and help create a community that brings people together.
Request a New Group