# Documentation for `scw autoscaling`


:::note{title="The CLI documentation pages are currently under construction"}
The content is up to date. We're making improvements to the site over the next few weeks for a better experience.
:::

<!-- DO NOT EDIT: this file is automatically generated using scw-doc-gen -->
Autoscaling Groups API

## Alerts management commands

Alerts notify you of issues affecting your autoscaling groups, such as quota limits, stock issues, or configuration problems.


### List autoscaling group alerts

List active and historical alerts for a specified autoscaling group.

**Usage:**

```shell
scw autoscaling alerts list [arg=value ...]
```


**Arguments:**

| Name       | Description                                                              | Argument Specifications                                             |
|------------|--------------------------------------------------------------------------|---------------------------------------------------------------------|
| group-id   |                                                                          |                                                                     |
| page-token |                                                                          |                                                                     |
| page-size  |                                                                          |                                                                     |
| project-id | Project ID to use. If none is passed the default project ID will be used |                                                                     |
| zone       | Zone to target. If none is passed will use default zone from the config  | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3` |


**Examples:**


List all alerts for an autoscaling group
```shell
scw autoscaling alerts list group-id=11111111-1111-1111-1111-111111111111
```




## Groups management commands

Autoscaling groups automatically adjust the number of Instances based on metrics like CPU or memory usage.
This allows you to automatically scale your infrastructure up or down to meet demand while optimizing costs.


### Create an autoscaling group

Create a new autoscaling group with the specified configuration
including template, scaling policy, and optional load balancer
settings.

**Usage:**

```shell
scw autoscaling group create [arg=value ...]
```


**Arguments:**

| Name                                                                 | Description                                                              | Argument Specifications                                             |
|----------------------------------------------------------------------|--------------------------------------------------------------------------|---------------------------------------------------------------------|
| project-id                                                           | Project ID to use. If none is passed the default project ID will be used |                                                                     |
| name                                                                 | Name of the autoscaling group                                            | Default: `<generated>`                                              |
| tags.{index}                                                         | Tags associated with the group                                           |                                                                     |
| template-id                                                          | Template ID for instances in this group                                  |                                                                     |
| scaling-policy-spec.minimum-size                                     | Minimum number of instances in the group                                 | Required                                                            |
| scaling-policy-spec.maximum-size                                     | Maximum number of instances in the group                                 | Required                                                            |
| scaling-policy-spec.scale-out-cooldown                               | Cooldown period after a scale out event                                  |                                                                     |
| scaling-policy-spec.scale-in-cooldown                                | Cooldown period after a scale in event                                   |                                                                     |
| scaling-policy-spec.scale-in-step                                    | Number of instances to remove in a single scale in event                 |                                                                     |
| scaling-policy-spec.scale-out-step                                   | Number of instances to add in a single scale out event                   |                                                                     |
| scaling-policy-spec.fixed-size.size                                  |                                                                          |                                                                     |
| scaling-policy-spec.cpu-target.target-avg-percent                    |                                                                          |                                                                     |
| scaling-policy-spec.memory-target.target-avg-percent                 |                                                                          |                                                                     |
| load-balancer-configuration-spec.load-balancer-id                    | ID of the load balancer (set to empty to disable)                        |                                                                     |
| load-balancer-configuration-spec.backends.{index}.backend-id         | ID of the load balancer backend                                          |                                                                     |
| load-balancer-configuration-spec.backends.{index}.address-family     | IP address family (IPv4 or IPv6)                                         | One of: `unknown_address_family`, `ipv4`, `ipv6`                    |
| load-balancer-configuration-spec.backends.{index}.private-network-id | Optional private network ID                                              |                                                                     |
| load-balancer-configuration-spec.auto-healing.enabled                | Whether auto-healing is enabled                                          |                                                                     |
| load-balancer-configuration-spec.auto-healing.grace-period           | Grace period for health checks                                           |                                                                     |
| zone                                                                 | Zone to target. If none is passed will use default zone from the config  | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3` |


**Examples:**


Create an autoscaling group with a fixed size
```shell
scw autoscaling group create scaling-policy-spec.fixed-size.size=3 scaling-policy-spec.maximum-size=5 scaling-policy-spec.minimum-size=1 name=my-autoscaling-group template-id=11111111-1111-1111-1111-111111111111 project-id=11111111-1111-1111-1111-111111111111
```




### Delete an autoscaling group

Delete a specified autoscaling group and all its associated
resources.

**Usage:**

```shell
scw autoscaling group delete <group-id ...> [arg=value ...]
```


**Arguments:**

| Name     | Description                                                             | Argument Specifications                                             |
|----------|-------------------------------------------------------------------------|---------------------------------------------------------------------|
| group-id | ID of the group to delete                                               | Required                                                            |
| zone     | Zone to target. If none is passed will use default zone from the config | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3` |


**Examples:**


Delete a specified autoscaling group
```shell
scw autoscaling group delete 11111111-1111-1111-1111-111111111111
```




### Get an autoscaling group

Get details of a specified autoscaling group including its
configuration, current size, and status.

**Usage:**

```shell
scw autoscaling group get <group-id ...> [arg=value ...]
```


**Arguments:**

| Name     | Description                                                             | Argument Specifications                                             |
|----------|-------------------------------------------------------------------------|---------------------------------------------------------------------|
| group-id | ID of the group to get                                                  | Required                                                            |
| zone     | Zone to target. If none is passed will use default zone from the config | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3` |


**Examples:**


Get a specified autoscaling group
```shell
scw autoscaling group get 11111111-1111-1111-1111-111111111111
```




### List autoscaling groups

List all autoscaling groups in a project.

**Usage:**

```shell
scw autoscaling group list [arg=value ...]
```


**Arguments:**

| Name             | Description                                                              | Argument Specifications                                             |
|------------------|--------------------------------------------------------------------------|---------------------------------------------------------------------|
| order-by         | Order criteria for listing groups                                        | One of: `created_at_desc`, `created_at_asc`                         |
| page-size        | Page size for pagination                                                 |                                                                     |
| page-token       | Token for pagination                                                     |                                                                     |
| project-id       | Project ID to use. If none is passed the default project ID will be used |                                                                     |
| template-id      | Template ID to filter groups                                             |                                                                     |
| load-balancer-id | Load balancer ID to filter groups                                        |                                                                     |
| zone             | Zone to target. If none is passed will use default zone from the config  | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3` |


**Examples:**


List all autoscaling groups in your default zone
```shell
scw autoscaling group list
```

List autoscaling groups filtered by template
```shell
scw autoscaling group list template-id=11111111-1111-1111-1111-111111111111
```

List autoscaling groups filtered by load balancer
```shell
scw autoscaling group list load-balancer-id=11111111-1111-1111-1111-111111111111
```




### Update an autoscaling group

Update the configuration of a specified autoscaling group including
name, tags, template, scaling policy, and load balancer settings.

**Usage:**

```shell
scw autoscaling group update <group-id ...> [arg=value ...]
```


**Arguments:**

| Name                                                                 | Description                                                             | Argument Specifications                                             |
|----------------------------------------------------------------------|-------------------------------------------------------------------------|---------------------------------------------------------------------|
| group-id                                                             | ID of the group to update                                               | Required                                                            |
| name                                                                 | New name for the group                                                  |                                                                     |
| tags.{index}                                                         | New tags for the group                                                  |                                                                     |
| template-id                                                          | New template ID for instances                                           |                                                                     |
| scaling-policy-spec.minimum-size                                     | Minimum number of instances in the group                                |                                                                     |
| scaling-policy-spec.maximum-size                                     | Maximum number of instances in the group                                |                                                                     |
| scaling-policy-spec.scale-out-cooldown                               | Cooldown period after a scale out event                                 |                                                                     |
| scaling-policy-spec.scale-in-cooldown                                | Cooldown period after a scale in event                                  |                                                                     |
| scaling-policy-spec.scale-in-step                                    | Number of instances to remove in a single scale in event                |                                                                     |
| scaling-policy-spec.scale-out-step                                   | Number of instances to add in a single scale out event                  |                                                                     |
| scaling-policy-spec.fixed-size.size                                  |                                                                         |                                                                     |
| scaling-policy-spec.cpu-target.target-avg-percent                    |                                                                         |                                                                     |
| scaling-policy-spec.memory-target.target-avg-percent                 |                                                                         |                                                                     |
| load-balancer-configuration-spec.load-balancer-id                    | ID of the load balancer (set to empty to disable)                       |                                                                     |
| load-balancer-configuration-spec.backends.{index}.backend-id         | ID of the load balancer backend                                         |                                                                     |
| load-balancer-configuration-spec.backends.{index}.address-family     | IP address family (IPv4 or IPv6)                                        | One of: `unknown_address_family`, `ipv4`, `ipv6`                    |
| load-balancer-configuration-spec.backends.{index}.private-network-id | Optional private network ID                                             |                                                                     |
| load-balancer-configuration-spec.auto-healing.enabled                | Whether auto-healing is enabled                                         |                                                                     |
| load-balancer-configuration-spec.auto-healing.grace-period           | Grace period for health checks                                          |                                                                     |
| zone                                                                 | Zone to target. If none is passed will use default zone from the config | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3` |


**Examples:**


Update the name of an autoscaling group
```shell
scw autoscaling group update 11111111-1111-1111-1111-111111111111 name=new-name
```

Update the scaling policy of an autoscaling group
```shell
scw autoscaling group update group-id=11111111-1111-1111-1111-111111111111 scaling_policy_spec.cpu_target.target_avg_percent=70
```




## Logs management commands

Logs provide visibility into the autoscaling group activities and events.
You can query logs to understand scaling decisions and troubleshoot issues.


### List autoscaling group logs

List logs for a specified autoscaling group to view scaling events
and activities.

**Usage:**

```shell
scw autoscaling logs list <group-id ...> [arg=value ...]
```


**Arguments:**

| Name       | Description                                                             | Argument Specifications                                             |
|------------|-------------------------------------------------------------------------|---------------------------------------------------------------------|
| group-id   |                                                                         | Required                                                            |
| page-token |                                                                         |                                                                     |
| page-size  |                                                                         |                                                                     |
| start-time |                                                                         |                                                                     |
| end-time   |                                                                         |                                                                     |
| zone       | Zone to target. If none is passed will use default zone from the config | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3` |


**Examples:**


List all logs for an autoscaling group
```shell
scw autoscaling logs list 11111111-1111-1111-1111-111111111111
```




## Servers management commands

List the Instances that belong to an autoscaling group.


### List autoscaling group servers

List all Instances belonging to a specified autoscaling group.

**Usage:**

```shell
scw autoscaling servers list <group-id ...> [arg=value ...]
```


**Arguments:**

| Name       | Description                                                             | Argument Specifications                                             |
|------------|-------------------------------------------------------------------------|---------------------------------------------------------------------|
| group-id   |                                                                         | Required                                                            |
| page-token |                                                                         |                                                                     |
| page-size  |                                                                         |                                                                     |
| zone       | Zone to target. If none is passed will use default zone from the config | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3` |


**Examples:**


List all servers in an autoscaling group
```shell
scw autoscaling servers list 11111111-1111-1111-1111-111111111111
```




