Class: Google::Apis::AutoscalerV1beta2::AutoscalingPolicy

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/autoscaler_v1beta2/classes.rb,
generated/google/apis/autoscaler_v1beta2/representations.rb,
generated/google/apis/autoscaler_v1beta2/representations.rb

Overview

Cloud Autoscaler policy.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ AutoscalingPolicy

Returns a new instance of AutoscalingPolicy.


157
158
159
# File 'generated/google/apis/autoscaler_v1beta2/classes.rb', line 157

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#cool_down_period_secFixnum

The number of seconds that the Autoscaler should wait between two succeeding changes to the number of virtual machines. You should define an interval that is at least as long as the initialization time of a virtual machine and the time it may take for replica pool to create the virtual machine. The default is 60 seconds. Corresponds to the JSON property coolDownPeriodSec

Returns:

  • (Fixnum)

130
131
132
# File 'generated/google/apis/autoscaler_v1beta2/classes.rb', line 130

def cool_down_period_sec
  @cool_down_period_sec
end

#cpu_utilizationGoogle::Apis::AutoscalerV1beta2::AutoscalingPolicyCpuUtilization

CPU utilization policy. Corresponds to the JSON property cpuUtilization


135
136
137
# File 'generated/google/apis/autoscaler_v1beta2/classes.rb', line 135

def cpu_utilization
  @cpu_utilization
end

#custom_metric_utilizationsArray<Google::Apis::AutoscalerV1beta2::AutoscalingPolicyCustomMetricUtilization>

Configuration parameters of autoscaling based on custom metric. Corresponds to the JSON property customMetricUtilizations


140
141
142
# File 'generated/google/apis/autoscaler_v1beta2/classes.rb', line 140

def custom_metric_utilizations
  @custom_metric_utilizations
end

#load_balancing_utilizationGoogle::Apis::AutoscalerV1beta2::AutoscalingPolicyLoadBalancingUtilization

Load balancing utilization policy. Corresponds to the JSON property loadBalancingUtilization


145
146
147
# File 'generated/google/apis/autoscaler_v1beta2/classes.rb', line 145

def load_balancing_utilization
  @load_balancing_utilization
end

#max_num_replicasFixnum

The maximum number of replicas that the Autoscaler can scale up to. Corresponds to the JSON property maxNumReplicas

Returns:

  • (Fixnum)

150
151
152
# File 'generated/google/apis/autoscaler_v1beta2/classes.rb', line 150

def max_num_replicas
  @max_num_replicas
end

#min_num_replicasFixnum

The minimum number of replicas that the Autoscaler can scale down to. Corresponds to the JSON property minNumReplicas

Returns:

  • (Fixnum)

155
156
157
# File 'generated/google/apis/autoscaler_v1beta2/classes.rb', line 155

def min_num_replicas
  @min_num_replicas
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object


162
163
164
165
166
167
168
169
# File 'generated/google/apis/autoscaler_v1beta2/classes.rb', line 162

def update!(**args)
  @cool_down_period_sec = args[:cool_down_period_sec] if args.key?(:cool_down_period_sec)
  @cpu_utilization = args[:cpu_utilization] if args.key?(:cpu_utilization)
  @custom_metric_utilizations = args[:custom_metric_utilizations] if args.key?(:custom_metric_utilizations)
  @load_balancing_utilization = args[:load_balancing_utilization] if args.key?(:load_balancing_utilization)
  @max_num_replicas = args[:max_num_replicas] if args.key?(:max_num_replicas)
  @min_num_replicas = args[:min_num_replicas] if args.key?(:min_num_replicas)
end