Is it possible to run a cell of a databricks notebook via REST API?

1.3k views Asked by At

I would like to run a notebook cell automatically via REST API to make the usability of a dev tool we created better. Is that possible in databricks?

1

There are 1 answers

0
Alex Ott On BEST ANSWER

Yes, it's possible by using an older API version 1.2. You need to create an execution context with /api/1.2/contexts/create API (it requires cluster ID and what language is used), and then you can submit code using the /api/1.2/commands/execute API, and get command execution status using /api/1.2/commands/status API. Please note that you need to keep context to execute multiple commands depending on each other...

You can find an example of such execution using the Go language in the source code of Databricks Terraform provider