Class: Google::Apis::ComputeV1::Scheduling

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

Overview

Sets the scheduling options for an Instance.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Scheduling

Returns a new instance of Scheduling



18036
18037
18038
# File 'generated/google/apis/compute_v1/classes.rb', line 18036

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

Instance Attribute Details

#automatic_restartBoolean Also known as: automatic_restart?

Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted. By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine. Corresponds to the JSON property automaticRestart

Returns:

  • (Boolean)


18012
18013
18014
# File 'generated/google/apis/compute_v1/classes.rb', line 18012

def automatic_restart
  @automatic_restart
end

#node_affinitiesArray<Google::Apis::ComputeV1::SchedulingNodeAffinity>

A set of node affinity and anti-affinity. Corresponds to the JSON property nodeAffinities



18018
18019
18020
# File 'generated/google/apis/compute_v1/classes.rb', line 18018

def node_affinities
  @node_affinities
end

#on_host_maintenanceString

Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Setting Instance Scheduling Options. Corresponds to the JSON property onHostMaintenance

Returns:

  • (String)


18026
18027
18028
# File 'generated/google/apis/compute_v1/classes.rb', line 18026

def on_host_maintenance
  @on_host_maintenance
end

#preemptibleBoolean Also known as: preemptible?

Defines whether the instance is preemptible. This can only be set during instance creation, it cannot be set or changed after the instance has been created. Corresponds to the JSON property preemptible

Returns:

  • (Boolean)


18033
18034
18035
# File 'generated/google/apis/compute_v1/classes.rb', line 18033

def preemptible
  @preemptible
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



18041
18042
18043
18044
18045
18046
# File 'generated/google/apis/compute_v1/classes.rb', line 18041

def update!(**args)
  @automatic_restart = args[:automatic_restart] if args.key?(:automatic_restart)
  @node_affinities = args[:node_affinities] if args.key?(:node_affinities)
  @on_host_maintenance = args[:on_host_maintenance] if args.key?(:on_host_maintenance)
  @preemptible = args[:preemptible] if args.key?(:preemptible)
end