target.apidocs.com.google.api.services.compute.model.AutoscalingPolicy.html Maven / Gradle / Ivy
AutoscalingPolicy (Compute Engine API v1-rev20250107-2.0.0)
com.google.api.services.compute.model
Class AutoscalingPolicy
- java.lang.Object
-
- java.util.AbstractMap<String,Object>
-
- com.google.api.client.util.GenericData
-
- com.google.api.client.json.GenericJson
-
- com.google.api.services.compute.model.AutoscalingPolicy
-
public final class AutoscalingPolicy
extends com.google.api.client.json.GenericJson
Cloud Autoscaler policy.
This is the Java data model class that specifies how to parse/serialize into the JSON that is
transmitted over HTTP when working with the Compute Engine API. For a detailed explanation see:
https://developers.google.com/api-client-library/java/google-http-java-client/json
- Author:
- Google, Inc.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.Flags
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
-
Constructor Summary
Constructors
Constructor and Description
AutoscalingPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
AutoscalingPolicy
clone()
Integer
getCoolDownPeriodSec()
The number of seconds that your application takes to initialize on a VM instance.
AutoscalingPolicyCpuUtilization
getCpuUtilization()
Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU
utilization of a managed instance group.
List<AutoscalingPolicyCustomMetricUtilization>
getCustomMetricUtilizations()
Configuration parameters of autoscaling based on a custom metric.
AutoscalingPolicyLoadBalancingUtilization
getLoadBalancingUtilization()
Configuration parameters of autoscaling based on load balancer.
Integer
getMaxNumReplicas()
The maximum number of instances that the autoscaler can scale out to.
Integer
getMinNumReplicas()
The minimum number of replicas that the autoscaler can scale in to.
String
getMode()
Defines the operating mode for this policy.
AutoscalingPolicyScaleInControl
getScaleInControl()
Map<String,AutoscalingPolicyScalingSchedule>
getScalingSchedules()
Scaling schedules defined for an autoscaler.
AutoscalingPolicy
set(String fieldName,
Object value)
AutoscalingPolicy
setCoolDownPeriodSec(Integer coolDownPeriodSec)
The number of seconds that your application takes to initialize on a VM instance.
AutoscalingPolicy
setCpuUtilization(AutoscalingPolicyCpuUtilization cpuUtilization)
Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU
utilization of a managed instance group.
AutoscalingPolicy
setCustomMetricUtilizations(List<AutoscalingPolicyCustomMetricUtilization> customMetricUtilizations)
Configuration parameters of autoscaling based on a custom metric.
AutoscalingPolicy
setLoadBalancingUtilization(AutoscalingPolicyLoadBalancingUtilization loadBalancingUtilization)
Configuration parameters of autoscaling based on load balancer.
AutoscalingPolicy
setMaxNumReplicas(Integer maxNumReplicas)
The maximum number of instances that the autoscaler can scale out to.
AutoscalingPolicy
setMinNumReplicas(Integer minNumReplicas)
The minimum number of replicas that the autoscaler can scale in to.
AutoscalingPolicy
setMode(String mode)
Defines the operating mode for this policy.
AutoscalingPolicy
setScaleInControl(AutoscalingPolicyScaleInControl scaleInControl)
AutoscalingPolicy
setScalingSchedules(Map<String,AutoscalingPolicyScalingSchedule> scalingSchedules)
Scaling schedules defined for an autoscaler.
-
Methods inherited from class com.google.api.client.json.GenericJson
getFactory, setFactory, toPrettyString, toString
-
Methods inherited from class com.google.api.client.util.GenericData
entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeys
-
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, size, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
Method Detail
-
getCoolDownPeriodSec
public Integer getCoolDownPeriodSec()
The number of seconds that your application takes to initialize on a VM instance. This is
referred to as the [initialization period](/compute/docs/autoscaler#cool_down_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.
- Returns:
- value or
null for none
-
setCoolDownPeriodSec
public AutoscalingPolicy setCoolDownPeriodSec(Integer coolDownPeriodSec)
The number of seconds that your application takes to initialize on a VM instance. This is
referred to as the [initialization period](/compute/docs/autoscaler#cool_down_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.
- Parameters:
coolDownPeriodSec - coolDownPeriodSec or null for none
-
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.
- Returns:
- value or
null for none
-
setCpuUtilization
public AutoscalingPolicy setCpuUtilization(AutoscalingPolicyCpuUtilization cpuUtilization)
Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU
utilization of a managed instance group.
- Parameters:
cpuUtilization - cpuUtilization or null for none
-
getCustomMetricUtilizations
public List<AutoscalingPolicyCustomMetricUtilization> getCustomMetricUtilizations()
Configuration parameters of autoscaling based on a custom metric.
- Returns:
- value or
null for none
-
setCustomMetricUtilizations
public AutoscalingPolicy setCustomMetricUtilizations(List<AutoscalingPolicyCustomMetricUtilization> customMetricUtilizations)
Configuration parameters of autoscaling based on a custom metric.
- Parameters:
customMetricUtilizations - customMetricUtilizations or null for none
-
getLoadBalancingUtilization
public AutoscalingPolicyLoadBalancingUtilization getLoadBalancingUtilization()
Configuration parameters of autoscaling based on load balancer.
- Returns:
- value or
null for none
-
setLoadBalancingUtilization
public AutoscalingPolicy setLoadBalancingUtilization(AutoscalingPolicyLoadBalancingUtilization loadBalancingUtilization)
Configuration parameters of autoscaling based on load balancer.
- Parameters:
loadBalancingUtilization - loadBalancingUtilization or null for none
-
getMaxNumReplicas
public Integer 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.
- Returns:
- value or
null for none
-
setMaxNumReplicas
public AutoscalingPolicy setMaxNumReplicas(Integer maxNumReplicas)
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.
- Parameters:
maxNumReplicas - maxNumReplicas or null for none
-
getMinNumReplicas
public Integer 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.
- Returns:
- value or
null for none
-
setMinNumReplicas
public AutoscalingPolicy setMinNumReplicas(Integer minNumReplicas)
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.
- Parameters:
minNumReplicas - minNumReplicas or null for none
-
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"
- Returns:
- value or
null for none
-
setMode
public AutoscalingPolicy setMode(String mode)
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"
- Parameters:
mode - mode or null for none
-
getScaleInControl
public AutoscalingPolicyScaleInControl getScaleInControl()
- Returns:
- value or
null for none
-
setScaleInControl
public AutoscalingPolicy setScaleInControl(AutoscalingPolicyScaleInControl scaleInControl)
- Parameters:
scaleInControl - scaleInControl or null for none
-
getScalingSchedules
public Map<String,AutoscalingPolicyScalingSchedule> getScalingSchedules()
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.
- Returns:
- value or
null for none
-
setScalingSchedules
public AutoscalingPolicy setScalingSchedules(Map<String,AutoscalingPolicyScalingSchedule> scalingSchedules)
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.
- Parameters:
scalingSchedules - scalingSchedules or null for none
-
set
public AutoscalingPolicy set(String fieldName,
Object value)
- Overrides:
set in class com.google.api.client.json.GenericJson
-
clone
public AutoscalingPolicy clone()
- Overrides:
clone in class com.google.api.client.json.GenericJson
Copyright © 2011–2025 Google. All rights reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy