Class AllocationPolicy.InstanceSelection.Builder (0.95.0)

public static final class AllocationPolicy.InstanceSelection.Builder extends GeneratedMessage.Builder<AllocationPolicy.InstanceSelection.Builder> implements AllocationPolicy.InstanceSelectionOrBuilder

Defines an instance selection for a given instance flexibility policy.

Protobuf type google.cloud.batch.v1alpha.AllocationPolicy.InstanceSelection

Static Methods

getDescriptor()

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

Methods

addAllMachineTypes(Iterable<String> values)

public AllocationPolicy.InstanceSelection.Builder addAllMachineTypes(Iterable<String> values)

Required. The Compute Engine machine type IDs. Only the machine type ID is supported, such as n1-standard-16. Full or partial URLs are not accepted. The total maximum number of machine types across all instance selections is 200. Exceeding this limit results in a validation error with code INVALID_ARGUMENT.

repeated string machine_types = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
values Iterable<String>

The machineTypes to add.

Returns
Type Description
AllocationPolicy.InstanceSelection.Builder

This builder for chaining.

addMachineTypes(String value)

public AllocationPolicy.InstanceSelection.Builder addMachineTypes(String value)

Required. The Compute Engine machine type IDs. Only the machine type ID is supported, such as n1-standard-16. Full or partial URLs are not accepted. The total maximum number of machine types across all instance selections is 200. Exceeding this limit results in a validation error with code INVALID_ARGUMENT.

repeated string machine_types = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value String

The machineTypes to add.

Returns
Type Description
AllocationPolicy.InstanceSelection.Builder

This builder for chaining.

addMachineTypesBytes(ByteString value)

public AllocationPolicy.InstanceSelection.Builder addMachineTypesBytes(ByteString value)

Required. The Compute Engine machine type IDs. Only the machine type ID is supported, such as n1-standard-16. Full or partial URLs are not accepted. The total maximum number of machine types across all instance selections is 200. Exceeding this limit results in a validation error with code INVALID_ARGUMENT.

repeated string machine_types = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value ByteString

The bytes of the machineTypes to add.

Returns
Type Description
AllocationPolicy.InstanceSelection.Builder

This builder for chaining.

build()

public AllocationPolicy.InstanceSelection build()
Returns
Type Description
AllocationPolicy.InstanceSelection

buildPartial()

public AllocationPolicy.InstanceSelection buildPartial()
Returns
Type Description
AllocationPolicy.InstanceSelection

clear()

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

clearMachineTypes()

public AllocationPolicy.InstanceSelection.Builder clearMachineTypes()

Required. The Compute Engine machine type IDs. Only the machine type ID is supported, such as n1-standard-16. Full or partial URLs are not accepted. The total maximum number of machine types across all instance selections is 200. Exceeding this limit results in a validation error with code INVALID_ARGUMENT.

repeated string machine_types = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
AllocationPolicy.InstanceSelection.Builder

This builder for chaining.

clearRank()

public AllocationPolicy.InstanceSelection.Builder clearRank()

Optional. Indicates the preference of this instance selection. Lower number means higher preference. First try is to create a VM based on the machine-type with lowest rank and fallback to next rank based on availability. Machine types and instance selections with the same rank have the same preference.

optional int32 rank = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AllocationPolicy.InstanceSelection.Builder

This builder for chaining.

getDefaultInstanceForType()

public AllocationPolicy.InstanceSelection getDefaultInstanceForType()
Returns
Type Description
AllocationPolicy.InstanceSelection

getDescriptorForType()

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

getMachineTypes(int index)

public String getMachineTypes(int index)

Required. The Compute Engine machine type IDs. Only the machine type ID is supported, such as n1-standard-16. Full or partial URLs are not accepted. The total maximum number of machine types across all instance selections is 200. Exceeding this limit results in a validation error with code INVALID_ARGUMENT.

repeated string machine_types = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The machineTypes at the given index.

getMachineTypesBytes(int index)

public ByteString getMachineTypesBytes(int index)

Required. The Compute Engine machine type IDs. Only the machine type ID is supported, such as n1-standard-16. Full or partial URLs are not accepted. The total maximum number of machine types across all instance selections is 200. Exceeding this limit results in a validation error with code INVALID_ARGUMENT.

repeated string machine_types = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the machineTypes at the given index.

getMachineTypesCount()

public int getMachineTypesCount()

Required. The Compute Engine machine type IDs. Only the machine type ID is supported, such as n1-standard-16. Full or partial URLs are not accepted. The total maximum number of machine types across all instance selections is 200. Exceeding this limit results in a validation error with code INVALID_ARGUMENT.

repeated string machine_types = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The count of machineTypes.

getMachineTypesList()

public ProtocolStringList getMachineTypesList()

Required. The Compute Engine machine type IDs. Only the machine type ID is supported, such as n1-standard-16. Full or partial URLs are not accepted. The total maximum number of machine types across all instance selections is 200. Exceeding this limit results in a validation error with code INVALID_ARGUMENT.

repeated string machine_types = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ProtocolStringList

A list containing the machineTypes.

getRank()

public int getRank()

Optional. Indicates the preference of this instance selection. Lower number means higher preference. First try is to create a VM based on the machine-type with lowest rank and fallback to next rank based on availability. Machine types and instance selections with the same rank have the same preference.

optional int32 rank = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The rank.

hasRank()

public boolean hasRank()

Optional. Indicates the preference of this instance selection. Lower number means higher preference. First try is to create a VM based on the machine-type with lowest rank and fallback to next rank based on availability. Machine types and instance selections with the same rank have the same preference.

optional int32 rank = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the rank field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(AllocationPolicy.InstanceSelection other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

setMachineTypes(int index, String value)

public AllocationPolicy.InstanceSelection.Builder setMachineTypes(int index, String value)

Required. The Compute Engine machine type IDs. Only the machine type ID is supported, such as n1-standard-16. Full or partial URLs are not accepted. The total maximum number of machine types across all instance selections is 200. Exceeding this limit results in a validation error with code INVALID_ARGUMENT.

repeated string machine_types = 1 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int

The index to set the value at.

value String

The machineTypes to set.

Returns
Type Description
AllocationPolicy.InstanceSelection.Builder

This builder for chaining.

setRank(int value)

public AllocationPolicy.InstanceSelection.Builder setRank(int value)

Optional. Indicates the preference of this instance selection. Lower number means higher preference. First try is to create a VM based on the machine-type with lowest rank and fallback to next rank based on availability. Machine types and instance selections with the same rank have the same preference.

optional int32 rank = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value int

The rank to set.

Returns
Type Description
AllocationPolicy.InstanceSelection.Builder

This builder for chaining.