Class: Google::Apis::BatchV1::AllocationPolicy

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

Overview

A Job's resource allocation policy describes when, where, and how compute resources should be allocated for the Job.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ AllocationPolicy

Returns a new instance of AllocationPolicy.



607
608
609
# File 'lib/google/apis/batch_v1/classes.rb', line 607

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

Instance Attribute Details

#instancesArray<Google::Apis::BatchV1::InstancePolicyOrTemplate>

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now. Corresponds to the JSON property instances



575
576
577
# File 'lib/google/apis/batch_v1/classes.rb', line 575

def instances
  @instances
end

#labelsHash<String,String>

Labels applied to all VM instances and other resources created by AllocationPolicy. Labels could be user provided or system generated. You can assign up to 64 labels. Google Compute Engine label restrictions apply. Label names that start with "goog-" or "google-" are reserved. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


584
585
586
# File 'lib/google/apis/batch_v1/classes.rb', line 584

def labels
  @labels
end

#locationGoogle::Apis::BatchV1::LocationPolicy

Location where compute resources should be allocated for the Job. Corresponds to the JSON property location



589
590
591
# File 'lib/google/apis/batch_v1/classes.rb', line 589

def location
  @location
end

#networkGoogle::Apis::BatchV1::NetworkPolicy

NetworkPolicy describes VM instance network configurations. Corresponds to the JSON property network



594
595
596
# File 'lib/google/apis/batch_v1/classes.rb', line 594

def network
  @network
end

#placementGoogle::Apis::BatchV1::PlacementPolicy

PlacementPolicy describes a group placement policy for the VMs controlled by this AllocationPolicy. Corresponds to the JSON property placement



600
601
602
# File 'lib/google/apis/batch_v1/classes.rb', line 600

def placement
  @placement
end

#service_accountGoogle::Apis::BatchV1::ServiceAccount

Carries information about a Google Cloud service account. Corresponds to the JSON property serviceAccount



605
606
607
# File 'lib/google/apis/batch_v1/classes.rb', line 605

def 
  @service_account
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



612
613
614
615
616
617
618
619
# File 'lib/google/apis/batch_v1/classes.rb', line 612

def update!(**args)
  @instances = args[:instances] if args.key?(:instances)
  @labels = args[:labels] if args.key?(:labels)
  @location = args[:location] if args.key?(:location)
  @network = args[:network] if args.key?(:network)
  @placement = args[:placement] if args.key?(:placement)
  @service_account = args[:service_account] if args.key?(:service_account)
end