Class AutoscalingPolicy.Builder (1.58.0)

public static final class AutoscalingPolicy.Builder extends GeneratedMessageV3.Builder<AutoscalingPolicy.Builder> implements AutoscalingPolicyOrBuilder

Cloud Autoscaler policy.

Protobuf type google.cloud.compute.v1.AutoscalingPolicy

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllCustomMetricUtilizations(Iterable<? extends AutoscalingPolicyCustomMetricUtilization> values)

public AutoscalingPolicy.Builder addAllCustomMetricUtilizations(Iterable<? extends AutoscalingPolicyCustomMetricUtilization> values)

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Parameter
Name Description
values Iterable<? extends com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization>
Returns
Type Description
AutoscalingPolicy.Builder

addCustomMetricUtilizations(AutoscalingPolicyCustomMetricUtilization value)

public AutoscalingPolicy.Builder addCustomMetricUtilizations(AutoscalingPolicyCustomMetricUtilization value)

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Parameter
Name Description
value AutoscalingPolicyCustomMetricUtilization
Returns
Type Description
AutoscalingPolicy.Builder

addCustomMetricUtilizations(AutoscalingPolicyCustomMetricUtilization.Builder builderForValue)

public AutoscalingPolicy.Builder addCustomMetricUtilizations(AutoscalingPolicyCustomMetricUtilization.Builder builderForValue)

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Parameter
Name Description
builderForValue AutoscalingPolicyCustomMetricUtilization.Builder
Returns
Type Description
AutoscalingPolicy.Builder

addCustomMetricUtilizations(int index, AutoscalingPolicyCustomMetricUtilization value)

public AutoscalingPolicy.Builder addCustomMetricUtilizations(int index, AutoscalingPolicyCustomMetricUtilization value)

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Parameters
Name Description
index int
value AutoscalingPolicyCustomMetricUtilization
Returns
Type Description
AutoscalingPolicy.Builder

addCustomMetricUtilizations(int index, AutoscalingPolicyCustomMetricUtilization.Builder builderForValue)

public AutoscalingPolicy.Builder addCustomMetricUtilizations(int index, AutoscalingPolicyCustomMetricUtilization.Builder builderForValue)

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Parameters
Name Description
index int
builderForValue AutoscalingPolicyCustomMetricUtilization.Builder
Returns
Type Description
AutoscalingPolicy.Builder

addCustomMetricUtilizationsBuilder()

public AutoscalingPolicyCustomMetricUtilization.Builder addCustomMetricUtilizationsBuilder()

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Returns
Type Description
AutoscalingPolicyCustomMetricUtilization.Builder

addCustomMetricUtilizationsBuilder(int index)

public AutoscalingPolicyCustomMetricUtilization.Builder addCustomMetricUtilizationsBuilder(int index)

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Parameter
Name Description
index int
Returns
Type Description
AutoscalingPolicyCustomMetricUtilization.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public AutoscalingPolicy.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AutoscalingPolicy.Builder
Overrides

build()

public AutoscalingPolicy build()
Returns
Type Description
AutoscalingPolicy

buildPartial()

public AutoscalingPolicy buildPartial()
Returns
Type Description
AutoscalingPolicy

clear()

public AutoscalingPolicy.Builder clear()
Returns
Type Description
AutoscalingPolicy.Builder
Overrides

clearCoolDownPeriodSec()

public AutoscalingPolicy.Builder clearCoolDownPeriodSec()

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.

optional int32 cool_down_period_sec = 107692954;

Returns
Type Description
AutoscalingPolicy.Builder

This builder for chaining.

clearCpuUtilization()

public AutoscalingPolicy.Builder clearCpuUtilization()

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

optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;

Returns
Type Description
AutoscalingPolicy.Builder

clearCustomMetricUtilizations()

public AutoscalingPolicy.Builder clearCustomMetricUtilizations()

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Returns
Type Description
AutoscalingPolicy.Builder

clearField(Descriptors.FieldDescriptor field)

public AutoscalingPolicy.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
AutoscalingPolicy.Builder
Overrides

clearLoadBalancingUtilization()

public AutoscalingPolicy.Builder clearLoadBalancingUtilization()

Configuration parameters of autoscaling based on load balancer.

optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;

Returns
Type Description
AutoscalingPolicy.Builder

clearMaxNumReplicas()

public AutoscalingPolicy.Builder clearMaxNumReplicas()

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.

optional int32 max_num_replicas = 62327375;

Returns
Type Description
AutoscalingPolicy.Builder

This builder for chaining.

clearMinNumReplicas()

public AutoscalingPolicy.Builder clearMinNumReplicas()

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.

optional int32 min_num_replicas = 535329825;

Returns
Type Description
AutoscalingPolicy.Builder

This builder for chaining.

clearMode()

public AutoscalingPolicy.Builder clearMode()

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.

optional string mode = 3357091;

Returns
Type Description
AutoscalingPolicy.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public AutoscalingPolicy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
AutoscalingPolicy.Builder
Overrides

clearScaleInControl()

public AutoscalingPolicy.Builder clearScaleInControl()

optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;

Returns
Type Description
AutoscalingPolicy.Builder

clearScalingSchedules()

public AutoscalingPolicy.Builder clearScalingSchedules()
Returns
Type Description
AutoscalingPolicy.Builder

clone()

public AutoscalingPolicy.Builder clone()
Returns
Type Description
AutoscalingPolicy.Builder
Overrides

containsScalingSchedules(String key)

public boolean containsScalingSchedules(String key)

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.

map<string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule> scaling_schedules = 355416580;

Parameter
Name Description
key String
Returns
Type Description
boolean

getCoolDownPeriodSec()

public int getCoolDownPeriodSec()

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.

optional int32 cool_down_period_sec = 107692954;

Returns
Type Description
int

The coolDownPeriodSec.

getCpuUtilization()

public AutoscalingPolicyCpuUtilization getCpuUtilization()

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

optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;

Returns
Type Description
AutoscalingPolicyCpuUtilization

The cpuUtilization.

getCpuUtilizationBuilder()

public AutoscalingPolicyCpuUtilization.Builder getCpuUtilizationBuilder()

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

optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;

Returns
Type Description
AutoscalingPolicyCpuUtilization.Builder

getCpuUtilizationOrBuilder()

public AutoscalingPolicyCpuUtilizationOrBuilder getCpuUtilizationOrBuilder()

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

optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;

Returns
Type Description
AutoscalingPolicyCpuUtilizationOrBuilder

getCustomMetricUtilizations(int index)

public AutoscalingPolicyCustomMetricUtilization getCustomMetricUtilizations(int index)

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Parameter
Name Description
index int
Returns
Type Description
AutoscalingPolicyCustomMetricUtilization

getCustomMetricUtilizationsBuilder(int index)

public AutoscalingPolicyCustomMetricUtilization.Builder getCustomMetricUtilizationsBuilder(int index)

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Parameter
Name Description
index int
Returns
Type Description
AutoscalingPolicyCustomMetricUtilization.Builder

getCustomMetricUtilizationsBuilderList()

public List<AutoscalingPolicyCustomMetricUtilization.Builder> getCustomMetricUtilizationsBuilderList()

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Returns
Type Description
List<Builder>

getCustomMetricUtilizationsCount()

public int getCustomMetricUtilizationsCount()

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Returns
Type Description
int

getCustomMetricUtilizationsList()

public List<AutoscalingPolicyCustomMetricUtilization> getCustomMetricUtilizationsList()

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Returns
Type Description
List<AutoscalingPolicyCustomMetricUtilization>

getCustomMetricUtilizationsOrBuilder(int index)

public AutoscalingPolicyCustomMetricUtilizationOrBuilder getCustomMetricUtilizationsOrBuilder(int index)

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Parameter
Name Description
index int
Returns
Type Description
AutoscalingPolicyCustomMetricUtilizationOrBuilder

getCustomMetricUtilizationsOrBuilderList()

public List<? extends AutoscalingPolicyCustomMetricUtilizationOrBuilder> getCustomMetricUtilizationsOrBuilderList()

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Returns
Type Description
List<? extends com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilizationOrBuilder>

getDefaultInstanceForType()

public AutoscalingPolicy getDefaultInstanceForType()
Returns
Type Description
AutoscalingPolicy

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getLoadBalancingUtilization()

public AutoscalingPolicyLoadBalancingUtilization getLoadBalancingUtilization()

Configuration parameters of autoscaling based on load balancer.

optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;

Returns
Type Description
AutoscalingPolicyLoadBalancingUtilization

The loadBalancingUtilization.

getLoadBalancingUtilizationBuilder()

public AutoscalingPolicyLoadBalancingUtilization.Builder getLoadBalancingUtilizationBuilder()

Configuration parameters of autoscaling based on load balancer.

optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;

Returns
Type Description
AutoscalingPolicyLoadBalancingUtilization.Builder

getLoadBalancingUtilizationOrBuilder()

public AutoscalingPolicyLoadBalancingUtilizationOrBuilder getLoadBalancingUtilizationOrBuilder()

Configuration parameters of autoscaling based on load balancer.

optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;

Returns
Type Description
AutoscalingPolicyLoadBalancingUtilizationOrBuilder

getMaxNumReplicas()

public int getMaxNumReplicas()

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.

optional int32 max_num_replicas = 62327375;

Returns
Type Description
int

The maxNumReplicas.

getMinNumReplicas()

public int getMinNumReplicas()

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.

optional int32 min_num_replicas = 535329825;

Returns
Type Description
int

The minNumReplicas.

getMode()

public String getMode()

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.

optional string mode = 3357091;

Returns
Type Description
String

The mode.

getModeBytes()

public ByteString getModeBytes()

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.

optional string mode = 3357091;

Returns
Type Description
ByteString

The bytes for mode.

getMutableScalingSchedules() (deprecated)

public Map<String,AutoscalingPolicyScalingSchedule> getMutableScalingSchedules()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,AutoscalingPolicyScalingSchedule>

getScaleInControl()

public AutoscalingPolicyScaleInControl getScaleInControl()

optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;

Returns
Type Description
AutoscalingPolicyScaleInControl

The scaleInControl.

getScaleInControlBuilder()

public AutoscalingPolicyScaleInControl.Builder getScaleInControlBuilder()

optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;

Returns
Type Description
AutoscalingPolicyScaleInControl.Builder

getScaleInControlOrBuilder()

public AutoscalingPolicyScaleInControlOrBuilder getScaleInControlOrBuilder()

optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;

Returns
Type Description
AutoscalingPolicyScaleInControlOrBuilder

getScalingSchedules() (deprecated)

public Map<String,AutoscalingPolicyScalingSchedule> getScalingSchedules()
Returns
Type Description
Map<String,AutoscalingPolicyScalingSchedule>

getScalingSchedulesCount()

public int getScalingSchedulesCount()

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.

map<string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule> scaling_schedules = 355416580;

Returns
Type Description
int

getScalingSchedulesMap()

public Map<String,AutoscalingPolicyScalingSchedule> getScalingSchedulesMap()

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.

map<string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule> scaling_schedules = 355416580;

Returns
Type Description
Map<String,AutoscalingPolicyScalingSchedule>

getScalingSchedulesOrDefault(String key, AutoscalingPolicyScalingSchedule defaultValue)

public AutoscalingPolicyScalingSchedule getScalingSchedulesOrDefault(String key, AutoscalingPolicyScalingSchedule defaultValue)

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.

map<string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule> scaling_schedules = 355416580;

Parameters
Name Description
key String
defaultValue AutoscalingPolicyScalingSchedule
Returns
Type Description
AutoscalingPolicyScalingSchedule

getScalingSchedulesOrThrow(String key)

public AutoscalingPolicyScalingSchedule getScalingSchedulesOrThrow(String key)

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.

map<string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule> scaling_schedules = 355416580;

Parameter
Name Description
key String
Returns
Type Description
AutoscalingPolicyScalingSchedule

hasCoolDownPeriodSec()

public boolean hasCoolDownPeriodSec()

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.

optional int32 cool_down_period_sec = 107692954;

Returns
Type Description
boolean

Whether the coolDownPeriodSec field is set.

hasCpuUtilization()

public boolean hasCpuUtilization()

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

optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;

Returns
Type Description
boolean

Whether the cpuUtilization field is set.

hasLoadBalancingUtilization()

public boolean hasLoadBalancingUtilization()

Configuration parameters of autoscaling based on load balancer.

optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;

Returns
Type Description
boolean

Whether the loadBalancingUtilization field is set.

hasMaxNumReplicas()

public boolean hasMaxNumReplicas()

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.

optional int32 max_num_replicas = 62327375;

Returns
Type Description
boolean

Whether the maxNumReplicas field is set.

hasMinNumReplicas()

public boolean hasMinNumReplicas()

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.

optional int32 min_num_replicas = 535329825;

Returns
Type Description
boolean

Whether the minNumReplicas field is set.

hasMode()

public boolean hasMode()

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.

optional string mode = 3357091;

Returns
Type Description
boolean

Whether the mode field is set.

hasScaleInControl()

public boolean hasScaleInControl()

optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;

Returns
Type Description
boolean

Whether the scaleInControl field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeCpuUtilization(AutoscalingPolicyCpuUtilization value)

public AutoscalingPolicy.Builder mergeCpuUtilization(AutoscalingPolicyCpuUtilization value)

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

optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;

Parameter
Name Description
value AutoscalingPolicyCpuUtilization
Returns
Type Description
AutoscalingPolicy.Builder

mergeFrom(AutoscalingPolicy other)

public AutoscalingPolicy.Builder mergeFrom(AutoscalingPolicy other)
Parameter
Name Description
other AutoscalingPolicy
Returns
Type Description
AutoscalingPolicy.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public AutoscalingPolicy.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AutoscalingPolicy.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public AutoscalingPolicy.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
AutoscalingPolicy.Builder
Overrides

mergeLoadBalancingUtilization(AutoscalingPolicyLoadBalancingUtilization value)

public AutoscalingPolicy.Builder mergeLoadBalancingUtilization(AutoscalingPolicyLoadBalancingUtilization value)

Configuration parameters of autoscaling based on load balancer.

optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;

Parameter
Name Description
value AutoscalingPolicyLoadBalancingUtilization
Returns
Type Description
AutoscalingPolicy.Builder

mergeScaleInControl(AutoscalingPolicyScaleInControl value)

public AutoscalingPolicy.Builder mergeScaleInControl(AutoscalingPolicyScaleInControl value)

optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;

Parameter
Name Description
value AutoscalingPolicyScaleInControl
Returns
Type Description
AutoscalingPolicy.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final AutoscalingPolicy.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AutoscalingPolicy.Builder
Overrides

putAllScalingSchedules(Map<String,AutoscalingPolicyScalingSchedule> values)

public AutoscalingPolicy.Builder putAllScalingSchedules(Map<String,AutoscalingPolicyScalingSchedule> values)

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.

map<string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule> scaling_schedules = 355416580;

Parameter
Name Description
values Map<String,AutoscalingPolicyScalingSchedule>
Returns
Type Description
AutoscalingPolicy.Builder

putScalingSchedules(String key, AutoscalingPolicyScalingSchedule value)

public AutoscalingPolicy.Builder putScalingSchedules(String key, AutoscalingPolicyScalingSchedule value)

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.

map<string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule> scaling_schedules = 355416580;

Parameters
Name Description
key String
value AutoscalingPolicyScalingSchedule
Returns
Type Description
AutoscalingPolicy.Builder

putScalingSchedulesBuilderIfAbsent(String key)

public AutoscalingPolicyScalingSchedule.Builder putScalingSchedulesBuilderIfAbsent(String key)

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.

map<string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule> scaling_schedules = 355416580;

Parameter
Name Description
key String
Returns
Type Description
AutoscalingPolicyScalingSchedule.Builder

removeCustomMetricUtilizations(int index)

public AutoscalingPolicy.Builder removeCustomMetricUtilizations(int index)

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Parameter
Name Description
index int
Returns
Type Description
AutoscalingPolicy.Builder

removeScalingSchedules(String key)

public AutoscalingPolicy.Builder removeScalingSchedules(String key)

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.

map<string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule> scaling_schedules = 355416580;

Parameter
Name Description
key String
Returns
Type Description
AutoscalingPolicy.Builder

setCoolDownPeriodSec(int value)

public AutoscalingPolicy.Builder setCoolDownPeriodSec(int value)

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.

optional int32 cool_down_period_sec = 107692954;

Parameter
Name Description
value int

The coolDownPeriodSec to set.

Returns
Type Description
AutoscalingPolicy.Builder

This builder for chaining.

setCpuUtilization(AutoscalingPolicyCpuUtilization value)

public AutoscalingPolicy.Builder setCpuUtilization(AutoscalingPolicyCpuUtilization value)

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

optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;

Parameter
Name Description
value AutoscalingPolicyCpuUtilization
Returns
Type Description
AutoscalingPolicy.Builder

setCpuUtilization(AutoscalingPolicyCpuUtilization.Builder builderForValue)

public AutoscalingPolicy.Builder setCpuUtilization(AutoscalingPolicyCpuUtilization.Builder builderForValue)

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

optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;

Parameter
Name Description
builderForValue AutoscalingPolicyCpuUtilization.Builder
Returns
Type Description
AutoscalingPolicy.Builder

setCustomMetricUtilizations(int index, AutoscalingPolicyCustomMetricUtilization value)

public AutoscalingPolicy.Builder setCustomMetricUtilizations(int index, AutoscalingPolicyCustomMetricUtilization value)

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Parameters
Name Description
index int
value AutoscalingPolicyCustomMetricUtilization
Returns
Type Description
AutoscalingPolicy.Builder

setCustomMetricUtilizations(int index, AutoscalingPolicyCustomMetricUtilization.Builder builderForValue)

public AutoscalingPolicy.Builder setCustomMetricUtilizations(int index, AutoscalingPolicyCustomMetricUtilization.Builder builderForValue)

Configuration parameters of autoscaling based on a custom metric.

repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;

Parameters
Name Description
index int
builderForValue AutoscalingPolicyCustomMetricUtilization.Builder
Returns
Type Description
AutoscalingPolicy.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public AutoscalingPolicy.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AutoscalingPolicy.Builder
Overrides

setLoadBalancingUtilization(AutoscalingPolicyLoadBalancingUtilization value)

public AutoscalingPolicy.Builder setLoadBalancingUtilization(AutoscalingPolicyLoadBalancingUtilization value)

Configuration parameters of autoscaling based on load balancer.

optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;

Parameter
Name Description
value AutoscalingPolicyLoadBalancingUtilization
Returns
Type Description
AutoscalingPolicy.Builder

setLoadBalancingUtilization(AutoscalingPolicyLoadBalancingUtilization.Builder builderForValue)

public AutoscalingPolicy.Builder setLoadBalancingUtilization(AutoscalingPolicyLoadBalancingUtilization.Builder builderForValue)

Configuration parameters of autoscaling based on load balancer.

optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;

Parameter
Name Description
builderForValue AutoscalingPolicyLoadBalancingUtilization.Builder
Returns
Type Description
AutoscalingPolicy.Builder

setMaxNumReplicas(int value)

public AutoscalingPolicy.Builder setMaxNumReplicas(int value)

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.

optional int32 max_num_replicas = 62327375;

Parameter
Name Description
value int

The maxNumReplicas to set.

Returns
Type Description
AutoscalingPolicy.Builder

This builder for chaining.

setMinNumReplicas(int value)

public AutoscalingPolicy.Builder setMinNumReplicas(int value)

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.

optional int32 min_num_replicas = 535329825;

Parameter
Name Description
value int

The minNumReplicas to set.

Returns
Type Description
AutoscalingPolicy.Builder

This builder for chaining.

setMode(String value)

public AutoscalingPolicy.Builder setMode(String 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" Check the Mode enum for the list of possible values.

optional string mode = 3357091;

Parameter
Name Description
value String

The mode to set.

Returns
Type Description
AutoscalingPolicy.Builder

This builder for chaining.

setModeBytes(ByteString value)

public AutoscalingPolicy.Builder setModeBytes(ByteString 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" Check the Mode enum for the list of possible values.

optional string mode = 3357091;

Parameter
Name Description
value ByteString

The bytes for mode to set.

Returns
Type Description
AutoscalingPolicy.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public AutoscalingPolicy.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
AutoscalingPolicy.Builder
Overrides

setScaleInControl(AutoscalingPolicyScaleInControl value)

public AutoscalingPolicy.Builder setScaleInControl(AutoscalingPolicyScaleInControl value)

optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;

Parameter
Name Description
value AutoscalingPolicyScaleInControl
Returns
Type Description
AutoscalingPolicy.Builder

setScaleInControl(AutoscalingPolicyScaleInControl.Builder builderForValue)

public AutoscalingPolicy.Builder setScaleInControl(AutoscalingPolicyScaleInControl.Builder builderForValue)

optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;

Parameter
Name Description
builderForValue AutoscalingPolicyScaleInControl.Builder
Returns
Type Description
AutoscalingPolicy.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final AutoscalingPolicy.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AutoscalingPolicy.Builder
Overrides