Class: Google::Apis::ComputeAlpha::LocationPolicy

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

Configuration for location policy among multiple possible locations (e.g. preferences for zone selection among zones in a single region).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ LocationPolicy

Returns a new instance of LocationPolicy.



40047
40048
40049
# File 'lib/google/apis/compute_alpha/classes.rb', line 40047

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

Instance Attribute Details

#locationsHash<String,Google::Apis::ComputeAlpha::LocationPolicyLocation>

Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a. The bulkInsert operation doesn't create instances in an AI zone, even if an AI zone is available in the specified region. For example, if you set a DENY preference for us-central1-a, Compute Engine will consider us-central1-b and us-central1-c for instance creation, but not us-central1-ai1a. Also, you can't use the locations[] configuration to allow instance creation in an AI zone. To include an AI zone in bulkInsert operations, use the locationPolicy.zones[] field. Corresponds to the JSON property locations



40033
40034
40035
# File 'lib/google/apis/compute_alpha/classes.rb', line 40033

def locations
  @locations
end

#target_shapeString

Strategy for distributing VMs across zones in a region. Corresponds to the JSON property targetShape

Returns:

  • (String)


40038
40039
40040
# File 'lib/google/apis/compute_alpha/classes.rb', line 40038

def target_shape
  @target_shape
end

#zonesArray<Google::Apis::ComputeAlpha::LocationPolicyZoneConfiguration>

The bulkInsert operation applies any preferences set in the locations field to the specific zones listed in the zones field if the same zones are specified in both fields. Corresponds to the JSON property zones



40045
40046
40047
# File 'lib/google/apis/compute_alpha/classes.rb', line 40045

def zones
  @zones
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



40052
40053
40054
40055
40056
# File 'lib/google/apis/compute_alpha/classes.rb', line 40052

def update!(**args)
  @locations = args[:locations] if args.key?(:locations)
  @target_shape = args[:target_shape] if args.key?(:target_shape)
  @zones = args[:zones] if args.key?(:zones)
end