Class AllocationPolicy.Builder (0.53.0)

public static final class AllocationPolicy.Builder extends GeneratedMessageV3.Builder<AllocationPolicy.Builder> implements AllocationPolicyOrBuilder

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

Protobuf type google.cloud.batch.v1.AllocationPolicy

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllInstances(Iterable<? extends AllocationPolicy.InstancePolicyOrTemplate> values)

public AllocationPolicy.Builder addAllInstances(Iterable<? extends AllocationPolicy.InstancePolicyOrTemplate> values)

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Parameter
Name Description
values Iterable<? extends com.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate>
Returns
Type Description
AllocationPolicy.Builder

addAllTags(Iterable<String> values)

public AllocationPolicy.Builder addAllTags(Iterable<String> values)

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.

repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
values Iterable<String>

The tags to add.

Returns
Type Description
AllocationPolicy.Builder

This builder for chaining.

addInstances(AllocationPolicy.InstancePolicyOrTemplate value)

public AllocationPolicy.Builder addInstances(AllocationPolicy.InstancePolicyOrTemplate value)

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Parameter
Name Description
value AllocationPolicy.InstancePolicyOrTemplate
Returns
Type Description
AllocationPolicy.Builder

addInstances(AllocationPolicy.InstancePolicyOrTemplate.Builder builderForValue)

public AllocationPolicy.Builder addInstances(AllocationPolicy.InstancePolicyOrTemplate.Builder builderForValue)

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Parameter
Name Description
builderForValue AllocationPolicy.InstancePolicyOrTemplate.Builder
Returns
Type Description
AllocationPolicy.Builder

addInstances(int index, AllocationPolicy.InstancePolicyOrTemplate value)

public AllocationPolicy.Builder addInstances(int index, AllocationPolicy.InstancePolicyOrTemplate value)

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Parameters
Name Description
index int
value AllocationPolicy.InstancePolicyOrTemplate
Returns
Type Description
AllocationPolicy.Builder

addInstances(int index, AllocationPolicy.InstancePolicyOrTemplate.Builder builderForValue)

public AllocationPolicy.Builder addInstances(int index, AllocationPolicy.InstancePolicyOrTemplate.Builder builderForValue)

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Parameters
Name Description
index int
builderForValue AllocationPolicy.InstancePolicyOrTemplate.Builder
Returns
Type Description
AllocationPolicy.Builder

addInstancesBuilder()

public AllocationPolicy.InstancePolicyOrTemplate.Builder addInstancesBuilder()

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Returns
Type Description
AllocationPolicy.InstancePolicyOrTemplate.Builder

addInstancesBuilder(int index)

public AllocationPolicy.InstancePolicyOrTemplate.Builder addInstancesBuilder(int index)

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Parameter
Name Description
index int
Returns
Type Description
AllocationPolicy.InstancePolicyOrTemplate.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public AllocationPolicy.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AllocationPolicy.Builder
Overrides

addTags(String value)

public AllocationPolicy.Builder addTags(String value)

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.

repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The tags to add.

Returns
Type Description
AllocationPolicy.Builder

This builder for chaining.

addTagsBytes(ByteString value)

public AllocationPolicy.Builder addTagsBytes(ByteString value)

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.

repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes of the tags to add.

Returns
Type Description
AllocationPolicy.Builder

This builder for chaining.

build()

public AllocationPolicy build()
Returns
Type Description
AllocationPolicy

buildPartial()

public AllocationPolicy buildPartial()
Returns
Type Description
AllocationPolicy

clear()

public AllocationPolicy.Builder clear()
Returns
Type Description
AllocationPolicy.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public AllocationPolicy.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
AllocationPolicy.Builder
Overrides

clearInstances()

public AllocationPolicy.Builder clearInstances()

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Returns
Type Description
AllocationPolicy.Builder

clearLabels()

public AllocationPolicy.Builder clearLabels()
Returns
Type Description
AllocationPolicy.Builder

clearLocation()

public AllocationPolicy.Builder clearLocation()

Location where compute resources should be allocated for the Job.

.google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;

Returns
Type Description
AllocationPolicy.Builder

clearNetwork()

public AllocationPolicy.Builder clearNetwork()

The network policy.

If you define an instance template in the InstancePolicyOrTemplate field, Batch will use the network settings in the instance template instead of this field.

.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;

Returns
Type Description
AllocationPolicy.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public AllocationPolicy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
AllocationPolicy.Builder
Overrides

clearPlacement()

public AllocationPolicy.Builder clearPlacement()

The placement policy.

.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;

Returns
Type Description
AllocationPolicy.Builder

clearServiceAccount()

public AllocationPolicy.Builder clearServiceAccount()

Defines the service account for Batch-created VMs. If omitted, the default Compute Engine service account is used. Must match the service account specified in any used instance template configured in the Batch job.

Includes the following fields:

  • email: The service account's email address. If not set, the default Compute Engine service account is used.
  • scopes: Additional OAuth scopes to grant the service account, beyond the default cloud-platform scope. (list of strings)

.google.cloud.batch.v1.ServiceAccount service_account = 9;

Returns
Type Description
AllocationPolicy.Builder

clearTags()

public AllocationPolicy.Builder clearTags()

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.

repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AllocationPolicy.Builder

This builder for chaining.

clone()

public AllocationPolicy.Builder clone()
Returns
Type Description
AllocationPolicy.Builder
Overrides

containsLabels(String key)

public boolean containsLabels(String key)

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.

map<string, string> labels = 6;

Parameter
Name Description
key String
Returns
Type Description
boolean

getDefaultInstanceForType()

public AllocationPolicy getDefaultInstanceForType()
Returns
Type Description
AllocationPolicy

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getInstances(int index)

public AllocationPolicy.InstancePolicyOrTemplate getInstances(int index)

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Parameter
Name Description
index int
Returns
Type Description
AllocationPolicy.InstancePolicyOrTemplate

getInstancesBuilder(int index)

public AllocationPolicy.InstancePolicyOrTemplate.Builder getInstancesBuilder(int index)

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Parameter
Name Description
index int
Returns
Type Description
AllocationPolicy.InstancePolicyOrTemplate.Builder

getInstancesBuilderList()

public List<AllocationPolicy.InstancePolicyOrTemplate.Builder> getInstancesBuilderList()

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Returns
Type Description
List<Builder>

getInstancesCount()

public int getInstancesCount()

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Returns
Type Description
int

getInstancesList()

public List<AllocationPolicy.InstancePolicyOrTemplate> getInstancesList()

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Returns
Type Description
List<InstancePolicyOrTemplate>

getInstancesOrBuilder(int index)

public AllocationPolicy.InstancePolicyOrTemplateOrBuilder getInstancesOrBuilder(int index)

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Parameter
Name Description
index int
Returns
Type Description
AllocationPolicy.InstancePolicyOrTemplateOrBuilder

getInstancesOrBuilderList()

public List<? extends AllocationPolicy.InstancePolicyOrTemplateOrBuilder> getInstancesOrBuilderList()

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Returns
Type Description
List<? extends com.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplateOrBuilder>

getLabels() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
Type Description
Map<String,String>

getLabelsCount()

public int getLabelsCount()

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.

map<string, string> labels = 6;

Returns
Type Description
int

getLabelsMap()

public Map<String,String> getLabelsMap()

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.

map<string, string> labels = 6;

Returns
Type Description
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

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.

map<string, string> labels = 6;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

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.

map<string, string> labels = 6;

Parameter
Name Description
key String
Returns
Type Description
String

getLocation()

public AllocationPolicy.LocationPolicy getLocation()

Location where compute resources should be allocated for the Job.

.google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;

Returns
Type Description
AllocationPolicy.LocationPolicy

The location.

getLocationBuilder()

public AllocationPolicy.LocationPolicy.Builder getLocationBuilder()

Location where compute resources should be allocated for the Job.

.google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;

Returns
Type Description
AllocationPolicy.LocationPolicy.Builder

getLocationOrBuilder()

public AllocationPolicy.LocationPolicyOrBuilder getLocationOrBuilder()

Location where compute resources should be allocated for the Job.

.google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;

Returns
Type Description
AllocationPolicy.LocationPolicyOrBuilder

getMutableLabels() (deprecated)

public Map<String,String> getMutableLabels()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,String>

getNetwork()

public AllocationPolicy.NetworkPolicy getNetwork()

The network policy.

If you define an instance template in the InstancePolicyOrTemplate field, Batch will use the network settings in the instance template instead of this field.

.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;

Returns
Type Description
AllocationPolicy.NetworkPolicy

The network.

getNetworkBuilder()

public AllocationPolicy.NetworkPolicy.Builder getNetworkBuilder()

The network policy.

If you define an instance template in the InstancePolicyOrTemplate field, Batch will use the network settings in the instance template instead of this field.

.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;

Returns
Type Description
AllocationPolicy.NetworkPolicy.Builder

getNetworkOrBuilder()

public AllocationPolicy.NetworkPolicyOrBuilder getNetworkOrBuilder()

The network policy.

If you define an instance template in the InstancePolicyOrTemplate field, Batch will use the network settings in the instance template instead of this field.

.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;

Returns
Type Description
AllocationPolicy.NetworkPolicyOrBuilder

getPlacement()

public AllocationPolicy.PlacementPolicy getPlacement()

The placement policy.

.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;

Returns
Type Description
AllocationPolicy.PlacementPolicy

The placement.

getPlacementBuilder()

public AllocationPolicy.PlacementPolicy.Builder getPlacementBuilder()

The placement policy.

.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;

Returns
Type Description
AllocationPolicy.PlacementPolicy.Builder

getPlacementOrBuilder()

public AllocationPolicy.PlacementPolicyOrBuilder getPlacementOrBuilder()

The placement policy.

.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;

Returns
Type Description
AllocationPolicy.PlacementPolicyOrBuilder

getServiceAccount()

public ServiceAccount getServiceAccount()

Defines the service account for Batch-created VMs. If omitted, the default Compute Engine service account is used. Must match the service account specified in any used instance template configured in the Batch job.

Includes the following fields:

  • email: The service account's email address. If not set, the default Compute Engine service account is used.
  • scopes: Additional OAuth scopes to grant the service account, beyond the default cloud-platform scope. (list of strings)

.google.cloud.batch.v1.ServiceAccount service_account = 9;

Returns
Type Description
ServiceAccount

The serviceAccount.

getServiceAccountBuilder()

public ServiceAccount.Builder getServiceAccountBuilder()

Defines the service account for Batch-created VMs. If omitted, the default Compute Engine service account is used. Must match the service account specified in any used instance template configured in the Batch job.

Includes the following fields:

  • email: The service account's email address. If not set, the default Compute Engine service account is used.
  • scopes: Additional OAuth scopes to grant the service account, beyond the default cloud-platform scope. (list of strings)

.google.cloud.batch.v1.ServiceAccount service_account = 9;

Returns
Type Description
ServiceAccount.Builder

getServiceAccountOrBuilder()

public ServiceAccountOrBuilder getServiceAccountOrBuilder()

Defines the service account for Batch-created VMs. If omitted, the default Compute Engine service account is used. Must match the service account specified in any used instance template configured in the Batch job.

Includes the following fields:

  • email: The service account's email address. If not set, the default Compute Engine service account is used.
  • scopes: Additional OAuth scopes to grant the service account, beyond the default cloud-platform scope. (list of strings)

.google.cloud.batch.v1.ServiceAccount service_account = 9;

Returns
Type Description
ServiceAccountOrBuilder

getTags(int index)

public String getTags(int index)

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.

repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The tags at the given index.

getTagsBytes(int index)

public ByteString getTagsBytes(int index)

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.

repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the tags at the given index.

getTagsCount()

public int getTagsCount()

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.

repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The count of tags.

getTagsList()

public ProtocolStringList getTagsList()

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.

repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ProtocolStringList

A list containing the tags.

hasLocation()

public boolean hasLocation()

Location where compute resources should be allocated for the Job.

.google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;

Returns
Type Description
boolean

Whether the location field is set.

hasNetwork()

public boolean hasNetwork()

The network policy.

If you define an instance template in the InstancePolicyOrTemplate field, Batch will use the network settings in the instance template instead of this field.

.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;

Returns
Type Description
boolean

Whether the network field is set.

hasPlacement()

public boolean hasPlacement()

The placement policy.

.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;

Returns
Type Description
boolean

Whether the placement field is set.

hasServiceAccount()

public boolean hasServiceAccount()

Defines the service account for Batch-created VMs. If omitted, the default Compute Engine service account is used. Must match the service account specified in any used instance template configured in the Batch job.

Includes the following fields:

  • email: The service account's email address. If not set, the default Compute Engine service account is used.
  • scopes: Additional OAuth scopes to grant the service account, beyond the default cloud-platform scope. (list of strings)

.google.cloud.batch.v1.ServiceAccount service_account = 9;

Returns
Type Description
boolean

Whether the serviceAccount field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(AllocationPolicy other)

public AllocationPolicy.Builder mergeFrom(AllocationPolicy other)
Parameter
Name Description
other AllocationPolicy
Returns
Type Description
AllocationPolicy.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public AllocationPolicy.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AllocationPolicy.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public AllocationPolicy.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
AllocationPolicy.Builder
Overrides

mergeLocation(AllocationPolicy.LocationPolicy value)

public AllocationPolicy.Builder mergeLocation(AllocationPolicy.LocationPolicy value)

Location where compute resources should be allocated for the Job.

.google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;

Parameter
Name Description
value AllocationPolicy.LocationPolicy
Returns
Type Description
AllocationPolicy.Builder

mergeNetwork(AllocationPolicy.NetworkPolicy value)

public AllocationPolicy.Builder mergeNetwork(AllocationPolicy.NetworkPolicy value)

The network policy.

If you define an instance template in the InstancePolicyOrTemplate field, Batch will use the network settings in the instance template instead of this field.

.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;

Parameter
Name Description
value AllocationPolicy.NetworkPolicy
Returns
Type Description
AllocationPolicy.Builder

mergePlacement(AllocationPolicy.PlacementPolicy value)

public AllocationPolicy.Builder mergePlacement(AllocationPolicy.PlacementPolicy value)

The placement policy.

.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;

Parameter
Name Description
value AllocationPolicy.PlacementPolicy
Returns
Type Description
AllocationPolicy.Builder

mergeServiceAccount(ServiceAccount value)

public AllocationPolicy.Builder mergeServiceAccount(ServiceAccount value)

Defines the service account for Batch-created VMs. If omitted, the default Compute Engine service account is used. Must match the service account specified in any used instance template configured in the Batch job.

Includes the following fields:

  • email: The service account's email address. If not set, the default Compute Engine service account is used.
  • scopes: Additional OAuth scopes to grant the service account, beyond the default cloud-platform scope. (list of strings)

.google.cloud.batch.v1.ServiceAccount service_account = 9;

Parameter
Name Description
value ServiceAccount
Returns
Type Description
AllocationPolicy.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final AllocationPolicy.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AllocationPolicy.Builder
Overrides

putAllLabels(Map<String,String> values)

public AllocationPolicy.Builder putAllLabels(Map<String,String> values)

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.

map<string, string> labels = 6;

Parameter
Name Description
values Map<String,String>
Returns
Type Description
AllocationPolicy.Builder

putLabels(String key, String value)

public AllocationPolicy.Builder putLabels(String key, String value)

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.

map<string, string> labels = 6;

Parameters
Name Description
key String
value String
Returns
Type Description
AllocationPolicy.Builder

removeInstances(int index)

public AllocationPolicy.Builder removeInstances(int index)

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Parameter
Name Description
index int
Returns
Type Description
AllocationPolicy.Builder

removeLabels(String key)

public AllocationPolicy.Builder removeLabels(String key)

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.

map<string, string> labels = 6;

Parameter
Name Description
key String
Returns
Type Description
AllocationPolicy.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public AllocationPolicy.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AllocationPolicy.Builder
Overrides

setInstances(int index, AllocationPolicy.InstancePolicyOrTemplate value)

public AllocationPolicy.Builder setInstances(int index, AllocationPolicy.InstancePolicyOrTemplate value)

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Parameters
Name Description
index int
value AllocationPolicy.InstancePolicyOrTemplate
Returns
Type Description
AllocationPolicy.Builder

setInstances(int index, AllocationPolicy.InstancePolicyOrTemplate.Builder builderForValue)

public AllocationPolicy.Builder setInstances(int index, AllocationPolicy.InstancePolicyOrTemplate.Builder builderForValue)

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Parameters
Name Description
index int
builderForValue AllocationPolicy.InstancePolicyOrTemplate.Builder
Returns
Type Description
AllocationPolicy.Builder

setLocation(AllocationPolicy.LocationPolicy value)

public AllocationPolicy.Builder setLocation(AllocationPolicy.LocationPolicy value)

Location where compute resources should be allocated for the Job.

.google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;

Parameter
Name Description
value AllocationPolicy.LocationPolicy
Returns
Type Description
AllocationPolicy.Builder

setLocation(AllocationPolicy.LocationPolicy.Builder builderForValue)

public AllocationPolicy.Builder setLocation(AllocationPolicy.LocationPolicy.Builder builderForValue)

Location where compute resources should be allocated for the Job.

.google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;

Parameter
Name Description
builderForValue AllocationPolicy.LocationPolicy.Builder
Returns
Type Description
AllocationPolicy.Builder

setNetwork(AllocationPolicy.NetworkPolicy value)

public AllocationPolicy.Builder setNetwork(AllocationPolicy.NetworkPolicy value)

The network policy.

If you define an instance template in the InstancePolicyOrTemplate field, Batch will use the network settings in the instance template instead of this field.

.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;

Parameter
Name Description
value AllocationPolicy.NetworkPolicy
Returns
Type Description
AllocationPolicy.Builder

setNetwork(AllocationPolicy.NetworkPolicy.Builder builderForValue)

public AllocationPolicy.Builder setNetwork(AllocationPolicy.NetworkPolicy.Builder builderForValue)

The network policy.

If you define an instance template in the InstancePolicyOrTemplate field, Batch will use the network settings in the instance template instead of this field.

.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;

Parameter
Name Description
builderForValue AllocationPolicy.NetworkPolicy.Builder
Returns
Type Description
AllocationPolicy.Builder

setPlacement(AllocationPolicy.PlacementPolicy value)

public AllocationPolicy.Builder setPlacement(AllocationPolicy.PlacementPolicy value)

The placement policy.

.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;

Parameter
Name Description
value AllocationPolicy.PlacementPolicy
Returns
Type Description
AllocationPolicy.Builder

setPlacement(AllocationPolicy.PlacementPolicy.Builder builderForValue)

public AllocationPolicy.Builder setPlacement(AllocationPolicy.PlacementPolicy.Builder builderForValue)

The placement policy.

.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;

Parameter
Name Description
builderForValue AllocationPolicy.PlacementPolicy.Builder
Returns
Type Description
AllocationPolicy.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public AllocationPolicy.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
AllocationPolicy.Builder
Overrides

setServiceAccount(ServiceAccount value)

public AllocationPolicy.Builder setServiceAccount(ServiceAccount value)

Defines the service account for Batch-created VMs. If omitted, the default Compute Engine service account is used. Must match the service account specified in any used instance template configured in the Batch job.

Includes the following fields:

  • email: The service account's email address. If not set, the default Compute Engine service account is used.
  • scopes: Additional OAuth scopes to grant the service account, beyond the default cloud-platform scope. (list of strings)

.google.cloud.batch.v1.ServiceAccount service_account = 9;

Parameter
Name Description
value ServiceAccount
Returns
Type Description
AllocationPolicy.Builder

setServiceAccount(ServiceAccount.Builder builderForValue)

public AllocationPolicy.Builder setServiceAccount(ServiceAccount.Builder builderForValue)

Defines the service account for Batch-created VMs. If omitted, the default Compute Engine service account is used. Must match the service account specified in any used instance template configured in the Batch job.

Includes the following fields:

  • email: The service account's email address. If not set, the default Compute Engine service account is used.
  • scopes: Additional OAuth scopes to grant the service account, beyond the default cloud-platform scope. (list of strings)

.google.cloud.batch.v1.ServiceAccount service_account = 9;

Parameter
Name Description
builderForValue ServiceAccount.Builder
Returns
Type Description
AllocationPolicy.Builder

setTags(int index, String value)

public AllocationPolicy.Builder setTags(int index, String value)

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.

repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int

The index to set the value at.

value String

The tags to set.

Returns
Type Description
AllocationPolicy.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final AllocationPolicy.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AllocationPolicy.Builder
Overrides