1.57.0 (latest) 1.56.0 1.55.0 1.54.0 1.53.0 1.52.0 1.51.0 1.50.0 1.49.0 1.48.0 1.41.0 1.40.0 1.39.0 1.38.0 1.37.0 1.36.0 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 1.24.0 1.23.0 1.22.0 1.21.0 1.20.1 1.19.2 1.18.0 1.17.0 1.16.1 1.15.0 1.14.1 1.13.0 1.12.1 1.11.0 1.10.1 1.9.0 1.8.0 1.7.0 1.6.1 1.5.2 1.4.0 1.3.2 1.2.0 1.1.0 1.0.0 0.9.0 0.8.0 0.7.0 0.6.0 0.5.0 0.4.2 0.3.0 0.2.1 0.1.0

```python
AutoscalingPolicy(mapping=None, *, ignore_unknown_fields=False, **kwargs)
```
Cloud Autoscaler policy.

.. _oneof: <https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields>

| ## Attributes ||
|---|---|
| **Name** | **Description** |
| `cool_down_period_sec` | `int` The number of seconds that your application takes to initialize on a VM instance. This is referred to as the \`initialization period \`__. Specifying an accurate initialization period improves autoscaler decisions. For example, when scaling out, the autoscaler ignores data from VMs that are still initializing because those VMs might not yet represent normal usage of your application. The default initialization period is 60 seconds. Initialization periods might vary because of numerous factors. We recommend that you test how long your application takes to initialize. To do this, create a VM and time your application's startup process. This field is a member of `oneof`_ `_cool_down_period_sec`. |
| `cpu_utilization` | `google.cloud.compute_v1.types.AutoscalingPolicyCpuUtilization` Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. This field is a member of `oneof`_ `_cpu_utilization`. |
| `custom_metric_utilizations` | `MutableSequence[google.cloud.compute_v1.types.AutoscalingPolicyCustomMetricUtilization]` Configuration parameters of autoscaling based on a custom metric. |
| `load_balancing_utilization` | `google.cloud.compute_v1.types.AutoscalingPolicyLoadBalancingUtilization` Configuration parameters of autoscaling based on load balancer. This field is a member of `oneof`_ `_load_balancing_utilization`. |
| `max_num_replicas` | `int` The maximum number of instances that the autoscaler can scale out to. This is required when creating or updating an autoscaler. The maximum number of replicas must not be lower than minimal number of replicas. This field is a member of `oneof`_ `_max_num_replicas`. |
| `min_num_replicas` | `int` The minimum number of replicas that the autoscaler can scale in to. This cannot be less than 0. If not provided, autoscaler chooses a default value depending on maximum number of instances allowed. This field is a member of `oneof`_ `_min_num_replicas`. |
| `mode` | `str` Defines the operating mode for this policy. The following modes are available: :: - OFF: Disables the autoscaler but maintains its configuration. - ONLY_SCALE_OUT: Restricts the autoscaler to add VM instances only. - ON: Enables all autoscaler activities according to its policy. For more information, see "Turning off or restricting an autoscaler" Check the Mode enum for the list of possible values. This field is a member of `oneof`_ `_mode`. |
| `scale_in_control` | `google.cloud.compute_v1.types.AutoscalingPolicyScaleInControl` This field is a member of `oneof`_ `_scale_in_control`. |
| `scaling_schedules` | `MutableMapping[str, google.cloud.compute_v1.types.AutoscalingPolicyScalingSchedule]` Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed. |
| `stabilization_period_sec` | `int` The number of seconds that autoscaler waits for load stabilization before making scale-in decisions. This is referred to as the \`stabilization period \`__. This might appear as a delay in scaling in but it is an important mechanism for your application to not have fluctuating size due to short term load fluctuations. The default stabilization period is 600 seconds. This field is a member of `oneof`_ `_stabilization_period_sec`. |

## Classes

### Mode

```python
Mode(value)
```
Defines the operating mode for this policy. The following modes are
available:

::

- OFF: Disables the autoscaler but maintains its configuration.
- ONLY_SCALE_OUT: Restricts the autoscaler to add VM instances only.
- ON: Enables all autoscaler activities according to its policy.

For more information, see "Turning off or restricting an autoscaler"

### ScalingSchedulesEntry

```python
ScalingSchedulesEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)
```
The abstract base class for a message.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `kwargs` | `dict` Keys and values corresponding to the fields of the message. |
| `mapping` | ``Union[dict, `.Message`]`` A dictionary or message to be used to determine the values for this message. |
| `ignore_unknown_fields` | `Optional(bool)` If True, do not raise errors for unknown fields. Only applied if `mapping` is a mapping type or there are keyword parameters. |