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.



689
690
691
# File 'lib/google/apis/batch_v1/classes.rb', line 689

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



647
648
649
# File 'lib/google/apis/batch_v1/classes.rb', line 647

def instances
  @instances
end

#labelsHash<String,String>

Custom labels to apply to the job and all the Compute Engine resources that both are created by this allocation policy and support labels. Use labels to group and describe the resources they are applied to. Batch automatically applies predefined labels and supports multiple labels fields for each job, which each let you apply custom labels to various resources. Label names that start with "goog-" or "google-" are reserved for predefined labels. For more information about labels with Batch, see Organize resources using labels. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


659
660
661
# File 'lib/google/apis/batch_v1/classes.rb', line 659

def labels
  @labels
end

#locationGoogle::Apis::BatchV1::LocationPolicy

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



664
665
666
# File 'lib/google/apis/batch_v1/classes.rb', line 664

def location
  @location
end

#networkGoogle::Apis::BatchV1::NetworkPolicy

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



669
670
671
# File 'lib/google/apis/batch_v1/classes.rb', line 669

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



675
676
677
# File 'lib/google/apis/batch_v1/classes.rb', line 675

def placement
  @placement
end

#service_accountGoogle::Apis::BatchV1::ServiceAccount

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



680
681
682
# File 'lib/google/apis/batch_v1/classes.rb', line 680

def 
  @service_account
end

#tagsArray<String>

Optional. Tags applied to the VM instances. The tags identify valid sources or targets for network firewalls. Each tag must be 1-63 characters long, and comply with RFC1035. Corresponds to the JSON property tags

Returns:

  • (Array<String>)


687
688
689
# File 'lib/google/apis/batch_v1/classes.rb', line 687

def tags
  @tags
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



694
695
696
697
698
699
700
701
702
# File 'lib/google/apis/batch_v1/classes.rb', line 694

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)
  @tags = args[:tags] if args.key?(:tags)
end