Class: Google::Apis::ComputeAlpha::Autoscaler

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/compute_alpha/classes.rb,
lib/google/apis/compute_alpha/representations.rb,
lib/google/apis/compute_alpha/representations.rb

Overview

Represents an Autoscaler resource. Google Compute Engine has two Autoscaler resources: * Zonal * Regional Use autoscalers to automatically add or delete instances from a managed instance group according to your defined autoscaling policy. For more information, read Autoscaling Groups of Instances. For zonal managed instance groups resource, use the autoscaler resource. For regional managed instance groups, use the regionAutoscalers resource.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Autoscaler

Returns a new instance of Autoscaler.



2034
2035
2036
# File 'lib/google/apis/compute_alpha/classes.rb', line 2034

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

Instance Attribute Details

#autoscaling_policyGoogle::Apis::ComputeAlpha::AutoscalingPolicy

Cloud Autoscaler policy. Corresponds to the JSON property autoscalingPolicy



1940
1941
1942
# File 'lib/google/apis/compute_alpha/classes.rb', line 1940

def autoscaling_policy
  @autoscaling_policy
end

#creation_timestampString

[Output Only] Creation timestamp in RFC3339 text format. Corresponds to the JSON property creationTimestamp

Returns:

  • (String)


1945
1946
1947
# File 'lib/google/apis/compute_alpha/classes.rb', line 1945

def creation_timestamp
  @creation_timestamp
end

#descriptionString

An optional description of this resource. Provide this property when you create the resource. Corresponds to the JSON property description

Returns:

  • (String)


1951
1952
1953
# File 'lib/google/apis/compute_alpha/classes.rb', line 1951

def description
  @description
end

#idFixnum

[Output Only] The unique identifier for the resource. This identifier is defined by the server. Corresponds to the JSON property id

Returns:

  • (Fixnum)


1957
1958
1959
# File 'lib/google/apis/compute_alpha/classes.rb', line 1957

def id
  @id
end

#kindString

[Output Only] Type of the resource. Always compute#autoscaler for autoscalers. Corresponds to the JSON property kind

Returns:

  • (String)


1962
1963
1964
# File 'lib/google/apis/compute_alpha/classes.rb', line 1962

def kind
  @kind
end

#nameString

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a- z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. Corresponds to the JSON property name

Returns:

  • (String)


1972
1973
1974
# File 'lib/google/apis/compute_alpha/classes.rb', line 1972

def name
  @name
end

[Output Only] Target recommended MIG size (number of instances) computed by autoscaler. Autoscaler calculates the recommended MIG size even when the autoscaling policy mode is different from ON. This field is empty when autoscaler is not connected to an existing managed instance group or autoscaler did not generate its prediction. Corresponds to the JSON property recommendedSize

Returns:

  • (Fixnum)


1981
1982
1983
# File 'lib/google/apis/compute_alpha/classes.rb', line 1981

def recommended_size
  @recommended_size
end

#regionString

[Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). Corresponds to the JSON property region

Returns:

  • (String)


1987
1988
1989
# File 'lib/google/apis/compute_alpha/classes.rb', line 1987

def region
  @region
end

#scaling_schedule_statusHash<String,Google::Apis::ComputeAlpha::ScalingScheduleStatus>

[Output Only] Status information of existing scaling schedules. Corresponds to the JSON property scalingScheduleStatus



1992
1993
1994
# File 'lib/google/apis/compute_alpha/classes.rb', line 1992

def scaling_schedule_status
  @scaling_schedule_status
end

[Output Only] Server-defined URL for the resource. Corresponds to the JSON property selfLink

Returns:

  • (String)


1997
1998
1999
# File 'lib/google/apis/compute_alpha/classes.rb', line 1997

def self_link
  @self_link
end

[Output Only] Server-defined URL for this resource with the resource id. Corresponds to the JSON property selfLinkWithId

Returns:

  • (String)


2002
2003
2004
# File 'lib/google/apis/compute_alpha/classes.rb', line 2002

def self_link_with_id
  @self_link_with_id
end

#statusString

[Output Only] The status of the autoscaler configuration. Current set of possible values: - PENDING: Autoscaler backend hasn't read new/updated configuration. - DELETING: Configuration is being deleted. - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field. - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future. Corresponds to the JSON property status

Returns:

  • (String)


2013
2014
2015
# File 'lib/google/apis/compute_alpha/classes.rb', line 2013

def status
  @status
end

#status_detailsArray<Google::Apis::ComputeAlpha::AutoscalerStatusDetails>

[Output Only] Human-readable details about the current state of the autoscaler. Read the documentation for Commonly returned status messages for examples of status messages you might encounter. Corresponds to the JSON property statusDetails



2020
2021
2022
# File 'lib/google/apis/compute_alpha/classes.rb', line 2020

def status_details
  @status_details
end

#targetString

URL of the managed instance group that this autoscaler will scale. This field is required when creating an autoscaler. Corresponds to the JSON property target

Returns:

  • (String)


2026
2027
2028
# File 'lib/google/apis/compute_alpha/classes.rb', line 2026

def target
  @target
end

#zoneString

[Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope). Corresponds to the JSON property zone

Returns:

  • (String)


2032
2033
2034
# File 'lib/google/apis/compute_alpha/classes.rb', line 2032

def zone
  @zone
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
# File 'lib/google/apis/compute_alpha/classes.rb', line 2039

def update!(**args)
  @autoscaling_policy = args[:autoscaling_policy] if args.key?(:autoscaling_policy)
  @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp)
  @description = args[:description] if args.key?(:description)
  @id = args[:id] if args.key?(:id)
  @kind = args[:kind] if args.key?(:kind)
  @name = args[:name] if args.key?(:name)
  @recommended_size = args[:recommended_size] if args.key?(:recommended_size)
  @region = args[:region] if args.key?(:region)
  @scaling_schedule_status = args[:scaling_schedule_status] if args.key?(:scaling_schedule_status)
  @self_link = args[:self_link] if args.key?(:self_link)
  @self_link_with_id = args[:self_link_with_id] if args.key?(:self_link_with_id)
  @status = args[:status] if args.key?(:status)
  @status_details = args[:status_details] if args.key?(:status_details)
  @target = args[:target] if args.key?(:target)
  @zone = args[:zone] if args.key?(:zone)
end