cancel
Showing results for 
Search instead for 
Did you mean: 
Community Discussions
cancel
Showing results for 
Search instead for 
Did you mean: 

Can we get the all notebooks attached to an all purpose compute at a particular instant ?

RahulChaubey
New Contributor III

For an all purpose compute, we can see the notebooks attached to a cluster in the UI. Is there a way to get the same details using some api or other method in program. 

RahulChaubey_0-1711954016858.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @RahulChaubey, Good Day! 

We would like to inform you that at this moment, Databricks doesn't support any API to get the numbers or details of notebooks attached to the All-Purpose cluster. You can continue with the approach you are following now to check the number of notebooks. 

And for the more details on the Databricks API, you can keep this document handy for the reference : https://docs.databricks.com/api/workspace/introduction

Also, we do have an internal feature request to address this issue our Product Team prioritizes development based on factors such as the number of upvotes the request receives and the number of customers requesting it. 

Please let me know if this helps and leave a like if this information is useful, followups are appreciated.
Kudos
Ayushi

View solution in original post

3 REPLIES 3

Kaniz
Community Manager
Community Manager

Hi @RahulChaubey, Hi there! 👋

Thank you for reaching out to the Databricks community for assistance. I'm here to help you with your question.

  1. First, obtain the details of the cluster to which the notebooks are attached. You can use the Databricks REST API to fetch information about clusters, including their names, status, and other relevant attributes.
  2. Once you have the cluster details, you can query the Databricks API to get a list of notebooks associated with that cluster. Specifically, you’ll want to look at the Notebooks tab on the cluster details page.
  3. The API response will include information such as notebook names, status (whether they are running or stopped), and the last time a command was executed from each notebook.
  4. The relevant endpoint for retrieving notebook information is typically something like:
    GET /api/2.0/clusters/get?cluster_id=<cluster_id>
    
    Replace <cluster_id> with the actual ID of the cluster you’re interested in.
  5. Ensure that the user or service account making the API request has the necessary permissions to access cluster and notebook details. Specifically, the CAN ATTACH TO cluster-level permission is required to attach a notebook to a cluster.
  6. If you’re using the Databricks workspace UI, you can also configure editor settings by clicking your username, selecting User Settings, and navigating to the Developer section. However, for programmatic access, the REST API is the way to go.
  7. For more detailed information, you can refer to the official Azure Databricks documentation.

RahulChaubey
New Contributor III

Hi @Kaniz Actually, I am looking for some api in which i can pass cluster_id as parameter and it gives the details of currently attached notebooks to this cluster similar to what we are getting in the UI.

Hi @RahulChaubey, Good Day! 

We would like to inform you that at this moment, Databricks doesn't support any API to get the numbers or details of notebooks attached to the All-Purpose cluster. You can continue with the approach you are following now to check the number of notebooks. 

And for the more details on the Databricks API, you can keep this document handy for the reference : https://docs.databricks.com/api/workspace/introduction

Also, we do have an internal feature request to address this issue our Product Team prioritizes development based on factors such as the number of upvotes the request receives and the number of customers requesting it. 

Please let me know if this helps and leave a like if this information is useful, followups are appreciated.
Kudos
Ayushi