# List clusters

Launch stage: GA

`GET /api/2.1/clusters/list`

Return information about all pinned and active clusters, and all clusters terminated within the last 30 days. Clusters terminated prior to this period are not included.

API scopes: clusters

## Query parameters

- `page_token` (string, optional)
  Use next_page_token or prev_page_token returned from the previous request to list the next or previous page of clusters respectively.
  Example: `CAEaFDAzMTUtMTczODQ1LTcwdWExbDhw`
- `page_size` (int32, optional)
  Use this field to specify the maximum number of results to be returned by the server. The server may further constrain the maximum number of results returned in a single page.
  Default: `20`
  Constraints: `[ 1 .. 100 ]`

## Returns

Returns a list of ClusterInfo objects.

## Response

```json
{
  "clusters": [
    {
      "autotermination_minutes": 120,
      "aws_attributes": {
        "availability": "SPOT_WITH_FALLBACK",
        "ebs_volume_count": 0,
        "first_on_demand": 1,
        "spot_bid_price_percent": 100,
        "zone_id": "us-west-2c"
      },
      "cluster_id": "1234-567890-reef123",
      "cluster_name": "my-cluster",
      "cluster_source": "UI",
      "creator_user_name": "someone@example.com",
      "default_tags": {
        "ClusterId": "1234-567890-reef123",
        "ClusterName": "my-cluster",
        "Creator": "someone@example.com",
        "Vendor": "Databricks"
      },
      "disk_spec": {
        "disk_count": 0
      },
      "driver_instance_source": {
        "node_type_id": "i3.xlarge"
      },
      "driver_node_type_id": "i3.xlarge",
      "enable_elastic_disk": false,
      "enable_local_disk_encryption": false,
      "init_scripts_safe_mode": false,
      "instance_source": {
        "node_type_id": "i3.xlarge"
      },
      "last_state_loss_time": 1619739324740,
      "node_type_id": "i3.xlarge",
      "num_workers": 30,
      "spark_context_id": 4020997813441461760,
      "spark_version": "8.2.x-scala2.12",
      "start_time": 1618263108824,
      "state": "TERMINATED",
      "state_message": "Inactive cluster terminated (inactive for 120 minutes).",
      "terminated_time": 1619746525713,
      "termination_reason": {
        "code": "INACTIVITY",
        "parameters": {
          "inactivity_duration_min": "120"
        },
        "type": "SUCCESS"
      }
    }
  ],
  "next_page_token": "CAEaFDA4MTItMTc0Mzk0LTE5c2w5djhh",
  "prev_page_token": "CAEaFDAzMTUtMTczODQ1LTcwdWExbDhw"
}
```

