# Resize Cluster

Launch stage: GA

`POST /api/2.1/clusters/resize`

Resizes a cluster to have a desired number of workers. This will fail unless the cluster is in a `RUNNING` state.

API scopes: clusters

## Request body

- `cluster_id` (string, optional)
  The cluster to be resized.
- `num_workers` (int32, required)
  Number of worker nodes that this cluster should have. A cluster has one Spark Driver
   and `num_workers` Executors for a total of `num_workers` + 1 Spark nodes.
  
   Note: When reading the properties of a cluster, this field reflects the desired number
   of workers rather than the actual current number of workers. For instance, if a cluster
   is resized from 5 to 10 workers, this field will immediately be updated to reflect
   the target size of 10 workers, whereas the workers listed in `spark_info` will gradually
   increase from 5 to 10 as the new nodes are provisioned.
- `autoscale` (object, required)
  Parameters needed in order to automatically scale clusters up and down based on load.
   Note: autoscaling works best with DB runtime versions 3.0 or later.
  - `min_workers` (int32, optional)
    The minimum number of workers to which the cluster can scale down when underutilized.
     It is also the initial number of workers the cluster will have after creation.
  - `max_workers` (int32, optional)
    The maximum number of workers to which the cluster can scale up when overloaded.
     Note that `max_workers` must be strictly greater than `min_workers`.

## Request

```json
{
  "cluster_id": "1202-211320-brick1",
  "num_workers": 30
}
```

## Response

```json
{}
```

