Is there a way to create a path under /Repos via API?

JakeP
New Contributor III

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!

Hubert-Dudek
Databricks MVP

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" }'


My blog: https://databrickster.medium.com/

View solution in original post

JakeP
New Contributor III

That works, thanks!

Great. If you can, please select my answer as the best one. Thank you 🙂


My blog: https://databrickster.medium.com/