Compute Engine v1 API - Class AutoscalingPolicy (3.2.0)

public sealed class AutoscalingPolicy : IMessage<AutoscalingPolicy>, IEquatable<AutoscalingPolicy>, IDeepCloneable<AutoscalingPolicy>, IBufferMessage, IMessage

Reference documentation and code samples for the Compute Engine v1 API class AutoscalingPolicy.

Cloud Autoscaler policy.

Inheritance

object > AutoscalingPolicy

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Constructors

AutoscalingPolicy()

public AutoscalingPolicy()

AutoscalingPolicy(AutoscalingPolicy)

public AutoscalingPolicy(AutoscalingPolicy other)
Parameter
Name Description
other AutoscalingPolicy

Properties

CoolDownPeriodSec

public int CoolDownPeriodSec { get; set; }

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.

Property Value
Type Description
int

CpuUtilization

public AutoscalingPolicyCpuUtilization CpuUtilization { get; set; }

Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.

Property Value
Type Description
AutoscalingPolicyCpuUtilization

CustomMetricUtilizations

public RepeatedField<AutoscalingPolicyCustomMetricUtilization> CustomMetricUtilizations { get; }

Configuration parameters of autoscaling based on a custom metric.

Property Value
Type Description
RepeatedFieldAutoscalingPolicyCustomMetricUtilization

HasCoolDownPeriodSec

public bool HasCoolDownPeriodSec { get; }

Gets whether the "cool_down_period_sec" field is set

Property Value
Type Description
bool

HasMaxNumReplicas

public bool HasMaxNumReplicas { get; }

Gets whether the "max_num_replicas" field is set

Property Value
Type Description
bool

HasMinNumReplicas

public bool HasMinNumReplicas { get; }

Gets whether the "min_num_replicas" field is set

Property Value
Type Description
bool

HasMode

public bool HasMode { get; }

Gets whether the "mode" field is set

Property Value
Type Description
bool

LoadBalancingUtilization

public AutoscalingPolicyLoadBalancingUtilization LoadBalancingUtilization { get; set; }

Configuration parameters of autoscaling based on load balancer.

Property Value
Type Description
AutoscalingPolicyLoadBalancingUtilization

MaxNumReplicas

public int MaxNumReplicas { get; set; }

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.

Property Value
Type Description
int

MinNumReplicas

public int MinNumReplicas { get; set; }

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.

Property Value
Type Description
int

Mode

public string Mode { get; set; }

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.

Property Value
Type Description
string

ScaleInControl

public AutoscalingPolicyScaleInControl ScaleInControl { get; set; }
Property Value
Type Description
AutoscalingPolicyScaleInControl

ScalingSchedules

public MapField<string, AutoscalingPolicyScalingSchedule> ScalingSchedules { get; }

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.

Property Value
Type Description
MapFieldstringAutoscalingPolicyScalingSchedule