Databricks — REST API
In the last post we played around with Databricks CLI. Here is the link: Databricks CLI — a few examples
Today we will cover a REST API by doing a few examples.
We use PowerShell. There are much more possibilities like Postman, curl, .NET, Python, etc.
A link to a code repository is placed at the end of the article.
A first script part is always the same. There is a token and a header.
The first example, we want to list all the Workflows/Jobs.
Let’s assume that you want to get one of jobs more detailed information. There you go:
Here we can run one of the jobs.
It is the time to check what we can do with workspaces. Here is an example how to list files inside an ETL_DBR folder.
Now, we move one of the notebooks from an ETL_DBR folder into an ETL_DBR_SECOND folder. A file name is: Notebook01.py.
The first code part exports the notebook:
The second one imports the exported notebook:
Next topic. Here is an example how to list all workspace clusters.
This way we can start, stop or terminate a cluster.
Or edit it using a JSON file.
Here is the code: Databricks_REST_API_Github