Class AllocationPolicy.Disk (0.22.0)

public static final class AllocationPolicy.Disk extends GeneratedMessageV3 implements AllocationPolicy.DiskOrBuilder

A new persistent disk or a local ssd. A VM can only have one local SSD setting but multiple local SSD partitions. See https://cloud.google.com/compute/docs/disks#pdspecs and https://cloud.google.com/compute/docs/disks#localssds.

Protobuf type google.cloud.batch.v1.AllocationPolicy.Disk

Static Fields

DISK_INTERFACE_FIELD_NUMBER

public static final int DISK_INTERFACE_FIELD_NUMBER
Field Value
TypeDescription
int

IMAGE_FIELD_NUMBER

public static final int IMAGE_FIELD_NUMBER
Field Value
TypeDescription
int

SIZE_GB_FIELD_NUMBER

public static final int SIZE_GB_FIELD_NUMBER
Field Value
TypeDescription
int

SNAPSHOT_FIELD_NUMBER

public static final int SNAPSHOT_FIELD_NUMBER
Field Value
TypeDescription
int

TYPE_FIELD_NUMBER

public static final int TYPE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static AllocationPolicy.Disk getDefaultInstance()
Returns
TypeDescription
AllocationPolicy.Disk

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static AllocationPolicy.Disk.Builder newBuilder()
Returns
TypeDescription
AllocationPolicy.Disk.Builder

newBuilder(AllocationPolicy.Disk prototype)

public static AllocationPolicy.Disk.Builder newBuilder(AllocationPolicy.Disk prototype)
Parameter
NameDescription
prototypeAllocationPolicy.Disk
Returns
TypeDescription
AllocationPolicy.Disk.Builder

parseDelimitedFrom(InputStream input)

public static AllocationPolicy.Disk parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
AllocationPolicy.Disk
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy.Disk parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AllocationPolicy.Disk
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static AllocationPolicy.Disk parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
AllocationPolicy.Disk
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy.Disk parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AllocationPolicy.Disk
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static AllocationPolicy.Disk parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
AllocationPolicy.Disk
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy.Disk parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AllocationPolicy.Disk
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static AllocationPolicy.Disk parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
AllocationPolicy.Disk
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy.Disk parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AllocationPolicy.Disk
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static AllocationPolicy.Disk parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
AllocationPolicy.Disk
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy.Disk parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AllocationPolicy.Disk
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static AllocationPolicy.Disk parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
AllocationPolicy.Disk
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy.Disk parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AllocationPolicy.Disk
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<AllocationPolicy.Disk> parser()
Returns
TypeDescription
Parser<Disk>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDataSourceCase()

public AllocationPolicy.Disk.DataSourceCase getDataSourceCase()
Returns
TypeDescription
AllocationPolicy.Disk.DataSourceCase

getDefaultInstanceForType()

public AllocationPolicy.Disk getDefaultInstanceForType()
Returns
TypeDescription
AllocationPolicy.Disk

getDiskInterface()

public String getDiskInterface()

Local SSDs are available through both "SCSI" and "NVMe" interfaces. If not indicated, "NVMe" will be the default one for local ssds. We only support "SCSI" for persistent disks now.

string disk_interface = 6;

Returns
TypeDescription
String

The diskInterface.

getDiskInterfaceBytes()

public ByteString getDiskInterfaceBytes()

Local SSDs are available through both "SCSI" and "NVMe" interfaces. If not indicated, "NVMe" will be the default one for local ssds. We only support "SCSI" for persistent disks now.

string disk_interface = 6;

Returns
TypeDescription
ByteString

The bytes for diskInterface.

getImage()

public String getImage()

Name of a public or custom image used as the data source. For example, the following are all valid URLs:

  • Specify the image by its family name: projects/{project}/global/images/family/{image_family}
  • Specify the image version: projects/{project}/global/images/{image_version}

    You can also use Batch customized image in short names. The following image values are supported for a boot disk:

  • "batch-debian": use Batch Debian images.

  • "batch-centos": use Batch CentOS images.
  • "batch-cos": use Batch Container-Optimized images.
  • "batch-hpc-centos": use Batch HPC CentOS images.

string image = 4;

Returns
TypeDescription
String

The image.

getImageBytes()

public ByteString getImageBytes()

Name of a public or custom image used as the data source. For example, the following are all valid URLs:

  • Specify the image by its family name: projects/{project}/global/images/family/{image_family}
  • Specify the image version: projects/{project}/global/images/{image_version}

    You can also use Batch customized image in short names. The following image values are supported for a boot disk:

  • "batch-debian": use Batch Debian images.

  • "batch-centos": use Batch CentOS images.
  • "batch-cos": use Batch Container-Optimized images.
  • "batch-hpc-centos": use Batch HPC CentOS images.

string image = 4;

Returns
TypeDescription
ByteString

The bytes for image.

getParserForType()

public Parser<AllocationPolicy.Disk> getParserForType()
Returns
TypeDescription
Parser<Disk>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getSizeGb()

public long getSizeGb()

Disk size in GB.

For persistent disk, this field is ignored if data_source is image or snapshot. For local SSD, size_gb should be a multiple of 375GB, otherwise, the final size will be the next greater multiple of 375 GB. For boot disk, Batch will calculate the boot disk size based on source image and task requirements if you do not speicify the size. If both this field and the boot_disk_mib field in task spec's compute_resource are defined, Batch will only honor this field.

int64 size_gb = 2;

Returns
TypeDescription
long

The sizeGb.

getSnapshot()

public String getSnapshot()

Name of a snapshot used as the data source. Snapshot is not supported as boot disk now.

string snapshot = 5;

Returns
TypeDescription
String

The snapshot.

getSnapshotBytes()

public ByteString getSnapshotBytes()

Name of a snapshot used as the data source. Snapshot is not supported as boot disk now.

string snapshot = 5;

Returns
TypeDescription
ByteString

The bytes for snapshot.

getType()

public String getType()

Disk type as shown in gcloud compute disk-types list. For example, local SSD uses type "local-ssd". Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" or "pd-standard".

string type = 1;

Returns
TypeDescription
String

The type.

getTypeBytes()

public ByteString getTypeBytes()

Disk type as shown in gcloud compute disk-types list. For example, local SSD uses type "local-ssd". Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" or "pd-standard".

string type = 1;

Returns
TypeDescription
ByteString

The bytes for type.

hasImage()

public boolean hasImage()

Name of a public or custom image used as the data source. For example, the following are all valid URLs:

  • Specify the image by its family name: projects/{project}/global/images/family/{image_family}
  • Specify the image version: projects/{project}/global/images/{image_version}

    You can also use Batch customized image in short names. The following image values are supported for a boot disk:

  • "batch-debian": use Batch Debian images.

  • "batch-centos": use Batch CentOS images.
  • "batch-cos": use Batch Container-Optimized images.
  • "batch-hpc-centos": use Batch HPC CentOS images.

string image = 4;

Returns
TypeDescription
boolean

Whether the image field is set.

hasSnapshot()

public boolean hasSnapshot()

Name of a snapshot used as the data source. Snapshot is not supported as boot disk now.

string snapshot = 5;

Returns
TypeDescription
boolean

Whether the snapshot field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public AllocationPolicy.Disk.Builder newBuilderForType()
Returns
TypeDescription
AllocationPolicy.Disk.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected AllocationPolicy.Disk.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
AllocationPolicy.Disk.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public AllocationPolicy.Disk.Builder toBuilder()
Returns
TypeDescription
AllocationPolicy.Disk.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException