Clusters CLI

You run Databricks clusters CLI subcommands by appending them to databricks clusters.

databricks clusters -h
Usage: databricks clusters [OPTIONS] COMMAND [ARGS]...

  Utility to interact with Databricks clusters.

Options:
  -v, --version  [VERSION]
  -h, --help     Show this message and exit.

Commands:
  create           Creates a Databricks cluster.
    Options:
      --json-file PATH  File containing JSON request to POST to /api/2.0/clusters/create.
      --json JSON       JSON string to POST to /api/2.0/clusters/create.
  delete           Removes a Databricks cluster.
    Options:
      --cluster-id CLUSTER_ID Can be found in the URL at https://<databricks-instance>/?o=<16-digit-number>#/setting/clusters/$CLUSTER_ID/configuration.
  edit             Edits a Databricks cluster.
    Options:
      --json-file PATH  File containing JSON request to POST to /api/2.0/clusters/edit.
      --json JSON       JSON string to POST to /api/2.0/clusters/edit.
  get              Retrieves metadata about a cluster.
    Options:
      --cluster-id CLUSTER_ID Can be found in the URL at https://<databricks-instance>/?o=<16-digit-number>#/setting/clusters/$CLUSTER_ID/configuration.
  list             Lists active and recently terminated clusters.
    Options:
      --output FORMAT          JSON or TABLE. Set to TABLE by default.
  list-node-types  Lists node types for a cluster.
  list-zones       Lists zones where clusters can be created.
  permanent-delete Permanently deletes a cluster.
    Options:
      --cluster-id CLUSTER_ID  Can be found in the URL at https://<databricks-instance>/?o=<16-digit-number>#/setting/clusters/$CLUSTER_ID/configuration.
  resize           Resizes a Databricks cluster given its ID.
    Options:
      --cluster-id CLUSTER_ID  Can be found in the URL at https://<databricks-instance>/?o=<16-digit-number>#/setting/clusters/$CLUSTER_ID/configuration.
      --num-workers INTEGER    Number of workers. [required]
  restart          Restarts a Databricks cluster.
    Options:
      --cluster-id CLUSTER_ID  Can be found in the URL at https://<databricks-instance>/?o=<16-digit-number>#/setting/clusters/$CLUSTER_ID/configuration.
  spark-versions   Lists possible Databricks Runtime versions.
  start            Starts a terminated Databricks cluster.
    Options:
      --cluster-id CLUSTER_ID  Can be found in the URL at https://<databricks-instance>/?o=<16-digit-number>#/setting/clusters/$CLUSTER_ID/configuration.

List runtime versions

databricks clusters spark-versions

List node types

databricks clusters list-node-types

Instance Pools CLI

Note

The instance pools CLI requires Databricks CLI 0.9.0 or above.

You run subcommands by appending them to databricks instance-pools.

databricks instance-pools -h
Usage: databricks instance-pools [OPTIONS] COMMAND [ARGS]...

  Utility to interact with Databricks instance pools.

Options:
  -v, --version  [VERSION]
  -h, --help     Show this message and exit.

Commands:
  create           Creates a Databricks instance pool.
    Options:
      --json-file PATH         File containing JSON request to POST to /api/2.0/cluster-pools/create.
      --json JSON              JSON string to POST to /api/2.0/cluster-pools/create.
  delete           Deletes a Databricks instance pool.
    Options:
  get              Retrieves metadata about an instance pool.
    Options:
      --instance-pool-id INSTANCE_POOL_ID Can be found in the URL at https://<databricks-instance>/?o=<16-digit-number>#/setting/clusters/instance-pools/view/$INSTANCE_POOL_ID.
  list             Lists active instance pools with the stats of the pools.
    Options:
      --output FORMAT          JSON or TABLE. Set to TABLE by default.
  edit            Edits a Databricks instance pool
    Options:
      --json-file PATH         File containing JSON request to POST to /api/2.0/cluster-pools/create.
      --json JSON              JSON string to POST to /api/2.0/cluster-pools/create.