Reference documentation and code samples for the Compute V1 Client class AutoscalingPolicy.
Cloud Autoscaler policy.
Generated from protobuf message google.cloud.compute.v1.AutoscalingPolicy
Methods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ cool_down_period_sec |
int
The number of seconds that the autoscaler waits before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process. |
↳ cpu_utilization |
Google\Cloud\Compute\V1\AutoscalingPolicyCpuUtilization
Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. |
↳ custom_metric_utilizations |
array<Google\Cloud\Compute\V1\AutoscalingPolicyCustomMetricUtilization>
Configuration parameters of autoscaling based on a custom metric. |
↳ load_balancing_utilization |
Google\Cloud\Compute\V1\AutoscalingPolicyLoadBalancingUtilization
Configuration parameters of autoscaling based on load balancer. |
↳ 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. |
↳ 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. |
↳ mode |
string
Defines operating mode for this policy. Check the Mode enum for the list of possible values. |
↳ scale_in_control |
Google\Cloud\Compute\V1\AutoscalingPolicyScaleInControl
|
↳ scaling_schedules |
array|Google\Protobuf\Internal\MapField
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. |
getCoolDownPeriodSec
The number of seconds that the autoscaler waits before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.
Generated from protobuf field optional int32 cool_down_period_sec = 107692954;
Returns | |
---|---|
Type | Description |
int |
hasCoolDownPeriodSec
clearCoolDownPeriodSec
setCoolDownPeriodSec
The number of seconds that the autoscaler waits before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.
Generated from protobuf field optional int32 cool_down_period_sec = 107692954;
Parameter | |
---|---|
Name | Description |
var |
int
|
Returns | |
---|---|
Type | Description |
$this |
getCpuUtilization
Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;
Returns | |
---|---|
Type | Description |
Google\Cloud\Compute\V1\AutoscalingPolicyCpuUtilization|null |
hasCpuUtilization
clearCpuUtilization
setCpuUtilization
Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147;
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Compute\V1\AutoscalingPolicyCpuUtilization
|
Returns | |
---|---|
Type | Description |
$this |
getCustomMetricUtilizations
Configuration parameters of autoscaling based on a custom metric.
Generated from protobuf field repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\RepeatedField |
setCustomMetricUtilizations
Configuration parameters of autoscaling based on a custom metric.
Generated from protobuf field repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850;
Parameter | |
---|---|
Name | Description |
var |
array<Google\Cloud\Compute\V1\AutoscalingPolicyCustomMetricUtilization>
|
Returns | |
---|---|
Type | Description |
$this |
getLoadBalancingUtilization
Configuration parameters of autoscaling based on load balancer.
Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;
Returns | |
---|---|
Type | Description |
Google\Cloud\Compute\V1\AutoscalingPolicyLoadBalancingUtilization|null |
hasLoadBalancingUtilization
clearLoadBalancingUtilization
setLoadBalancingUtilization
Configuration parameters of autoscaling based on load balancer.
Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403;
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Compute\V1\AutoscalingPolicyLoadBalancingUtilization
|
Returns | |
---|---|
Type | Description |
$this |
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.
Generated from protobuf field optional int32 max_num_replicas = 62327375;
Returns | |
---|---|
Type | Description |
int |
hasMaxNumReplicas
clearMaxNumReplicas
setMaxNumReplicas
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.
Generated from protobuf field optional int32 max_num_replicas = 62327375;
Parameter | |
---|---|
Name | Description |
var |
int
|
Returns | |
---|---|
Type | Description |
$this |
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.
Generated from protobuf field optional int32 min_num_replicas = 535329825;
Returns | |
---|---|
Type | Description |
int |
hasMinNumReplicas
clearMinNumReplicas
setMinNumReplicas
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.
Generated from protobuf field optional int32 min_num_replicas = 535329825;
Parameter | |
---|---|
Name | Description |
var |
int
|
Returns | |
---|---|
Type | Description |
$this |
getMode
Defines operating mode for this policy.
Check the Mode enum for the list of possible values.
Generated from protobuf field optional string mode = 3357091;
Returns | |
---|---|
Type | Description |
string |
hasMode
clearMode
setMode
Defines operating mode for this policy.
Check the Mode enum for the list of possible values.
Generated from protobuf field optional string mode = 3357091;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getScaleInControl
Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;
Returns | |
---|---|
Type | Description |
Google\Cloud\Compute\V1\AutoscalingPolicyScaleInControl|null |
hasScaleInControl
clearScaleInControl
setScaleInControl
Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872;
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Compute\V1\AutoscalingPolicyScaleInControl
|
Returns | |
---|---|
Type | Description |
$this |
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.
Generated from protobuf field map<string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule> scaling_schedules = 355416580;
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\MapField |
setScalingSchedules
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.
Generated from protobuf field map<string, .google.cloud.compute.v1.AutoscalingPolicyScalingSchedule> scaling_schedules = 355416580;
Parameter | |
---|---|
Name | Description |
var |
array|Google\Protobuf\Internal\MapField
|
Returns | |
---|---|
Type | Description |
$this |