cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

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!

1 ACCEPTED SOLUTION

Accepted Solutions

Hubert-Dudek
Esteemed Contributor III

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

View solution in original post

3 REPLIES 3

Hubert-Dudek
Esteemed Contributor III

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

JakeP
New Contributor III

That works, thanks!

Hubert-Dudek
Esteemed Contributor III

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

Connect with Databricks Users in Your Area

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