Get workspace, cluster, notebook, model, and job identifiers

This article explains how to get workspace, cluster, model, notebook, and job identifiers and URLs in Databricks.

Workspace instance names, URLs, and IDs

An instance name is assigned to each Databricks deployment. To segregate the workload and grant access to relevant users only, usually Databricks customers create separate instances for development, staging, and production. The instance name is the first part of the URL when you log into your Databricks deployment:

Workspace

In this case, the instance name is 8757561887652360.0.gcp.databricks.com.

Cluster URL and ID

A Databricks cluster provides a unified platform for various use cases such as running production ETL pipelines, streaming analytics, ad-hoc analytics, and machine learning. Each cluster has a unique ID called the cluster ID. This applies to both all-purpose and job clusters. To get the details of a cluster using the REST API, the cluster ID is essential.

To get the cluster ID, click the Clusters tab in sidebar and then select a cluster name. The cluster ID is the number after the /clusters/ component in the URL of this page

https://<databricks-instance>/#/setting/clusters/<cluster-id>

In the following screenshot, the cluster ID is 0206-231114-irony170.

Cluster URL

Notebook URL and ID

A notebook is a web-based interface to a document that contains runnable code, visualizations, and narrative text. Notebooks are one interface for interacting with Databricks. Each notebook has a unique ID. The notebook URL has the notebook ID, hence the notebook URL is unique to a notebook. It can be shared with anyone on Databricks platform with permission to view and edit the notebook. In addition, each notebook command (cell) has a different URL.

To get to a notebook URL, open a notebook. To get to a cell URL, click the contents of the command.

Notebook URL

In this notebook:

  • The notebook URL is:

    https://8757561887652360.0.gcp.databricks.com/?o=8757561887652360#notebook/1451020452210597`
    
  • The notebook ID is 1451020452210597.

  • The command (cell) URL is

    https://8757561887652360.0.gcp.databricks.com/?o=8757561887652360#notebook/1451020452210597/command/1451020452210598
    

Model ID

A model refers to an MLflow registered model, which lets you manage MLflow Models in production through stage transitions and versioning. The registered model ID is required for changing the permissions on the model programmatically through the Permissions API 2.0.

To get the ID of a registered model, you can use the REST API (latest) endpoint mlflow/databricks/registered-models/get. For example, the following code returns the registered model object with its properties, including its ID:

curl -n -X GET -H 'Content-Type: application/json' -d '{"name": "model_name"}' \
https://<databricks-instance>/api/2.0/mlflow/databricks/registered-models/get

The returned value has the format:

{
  "registered_model_databricks": {
    "name":"model_name",
    "id":"ceb0477eba94418e973f170e626f4471"
  }
}

Job URL and ID

A job is a way of running a notebook or JAR either immediately or on a scheduled basis.

To get to a job URL, click the Jobs tab in sidebar and click a job name. This job URL is critical piece of information needed to troubleshoot job runs that have failed and investigate the root cause. The job ID is after the text #job/ in the URL.

In the following screenshot, the job URL is

https://8757561887652360.0.gcp.databricks.com/?o=8757561887652360#job/2

In this example, the job ID is 2.

Job URL