Class AllocationPolicy.InstanceSelection (0.103.0)

public static final class AllocationPolicy.InstanceSelection extends GeneratedMessage implements AllocationPolicy.InstanceSelectionOrBuilder

Defines an instance selection for a given instance flexibility policy.

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

Inheritance

Object > AbstractMessageLite<MessageType,BuilderType> > AbstractMessage > GeneratedMessage > AllocationPolicy.InstanceSelection

Static Fields

BOOT_DISK_FIELD_NUMBER

public static final int BOOT_DISK_FIELD_NUMBER
Field Value
Type Description
int

DISKS_FIELD_NUMBER

public static final int DISKS_FIELD_NUMBER
Field Value
Type Description
int

MACHINE_TYPES_FIELD_NUMBER

public static final int MACHINE_TYPES_FIELD_NUMBER
Field Value
Type Description
int

RANK_FIELD_NUMBER

public static final int RANK_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static AllocationPolicy.InstanceSelection getDefaultInstance()
Returns
Type Description
AllocationPolicy.InstanceSelection

getDescriptor()

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

newBuilder()

public static AllocationPolicy.InstanceSelection.Builder newBuilder()
Returns
Type Description
AllocationPolicy.InstanceSelection.Builder

newBuilder(AllocationPolicy.InstanceSelection prototype)

public static AllocationPolicy.InstanceSelection.Builder newBuilder(AllocationPolicy.InstanceSelection prototype)
Parameter
Name Description
prototype AllocationPolicy.InstanceSelection
Returns
Type Description
AllocationPolicy.InstanceSelection.Builder

parseDelimitedFrom(InputStream input)

public static AllocationPolicy.InstanceSelection parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
AllocationPolicy.InstanceSelection
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy.InstanceSelection parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AllocationPolicy.InstanceSelection
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static AllocationPolicy.InstanceSelection parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
AllocationPolicy.InstanceSelection
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy.InstanceSelection parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AllocationPolicy.InstanceSelection
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static AllocationPolicy.InstanceSelection parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
AllocationPolicy.InstanceSelection
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy.InstanceSelection parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AllocationPolicy.InstanceSelection
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static AllocationPolicy.InstanceSelection parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
AllocationPolicy.InstanceSelection
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy.InstanceSelection parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AllocationPolicy.InstanceSelection
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static AllocationPolicy.InstanceSelection parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
AllocationPolicy.InstanceSelection
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy.InstanceSelection parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AllocationPolicy.InstanceSelection
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static AllocationPolicy.InstanceSelection parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
AllocationPolicy.InstanceSelection
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy.InstanceSelection parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AllocationPolicy.InstanceSelection
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<AllocationPolicy.InstanceSelection> parser()
Returns
Type Description
Parser<InstanceSelection>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getBootDisk()

public AllocationPolicy.Disk getBootDisk()

Optional. Boot disk to be created and attached to instances created from this selection. It overrides the boot disk specified in the instance properties. (e.g., overriding boot disk type to Hyperdisk for 4th-gen machine types)

.google.cloud.batch.v1alpha.AllocationPolicy.Disk boot_disk = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AllocationPolicy.Disk

The bootDisk.

getBootDiskOrBuilder()

public AllocationPolicy.DiskOrBuilder getBootDiskOrBuilder()

Optional. Boot disk to be created and attached to instances created from this selection. It overrides the boot disk specified in the instance properties. (e.g., overriding boot disk type to Hyperdisk for 4th-gen machine types)

.google.cloud.batch.v1alpha.AllocationPolicy.Disk boot_disk = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AllocationPolicy.DiskOrBuilder

getDefaultInstanceForType()

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

getDisks(int index)

public AllocationPolicy.AttachedDisk getDisks(int index)

Optional. List of disks to be attached to instances created from this selection. They override the disks specified in the instance properties.

repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
AllocationPolicy.AttachedDisk

getDisksCount()

public int getDisksCount()

Optional. List of disks to be attached to instances created from this selection. They override the disks specified in the instance properties.

repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getDisksList()

public List<AllocationPolicy.AttachedDisk> getDisksList()

Optional. List of disks to be attached to instances created from this selection. They override the disks specified in the instance properties.

repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<AttachedDisk>

getDisksOrBuilder(int index)

public AllocationPolicy.AttachedDiskOrBuilder getDisksOrBuilder(int index)

Optional. List of disks to be attached to instances created from this selection. They override the disks specified in the instance properties.

repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
AllocationPolicy.AttachedDiskOrBuilder

getDisksOrBuilderList()

public List<? extends AllocationPolicy.AttachedDiskOrBuilder> getDisksOrBuilderList()

Optional. List of disks to be attached to instances created from this selection. They override the disks specified in the instance properties.

repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<? extends com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDiskOrBuilder>

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.

getParserForType()

public Parser<AllocationPolicy.InstanceSelection> getParserForType()
Returns
Type Description
Parser<InstanceSelection>
Overrides

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.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hasBootDisk()

public boolean hasBootDisk()

Optional. Boot disk to be created and attached to instances created from this selection. It overrides the boot disk specified in the instance properties. (e.g., overriding boot disk type to Hyperdisk for 4th-gen machine types)

.google.cloud.batch.v1alpha.AllocationPolicy.Disk boot_disk = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the bootDisk field is set.

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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public AllocationPolicy.InstanceSelection.Builder newBuilderForType()
Returns
Type Description
AllocationPolicy.InstanceSelection.Builder

newBuilderForType(AbstractMessage.BuilderParent parent)

protected AllocationPolicy.InstanceSelection.Builder newBuilderForType(AbstractMessage.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
AllocationPolicy.InstanceSelection.Builder
Overrides

toBuilder()

public AllocationPolicy.InstanceSelection.Builder toBuilder()
Returns
Type Description
AllocationPolicy.InstanceSelection.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException