public static final class AllocationPolicy.Disk.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Disk.Builder> 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| Modifier and Type | Method and Description |
|---|---|
AllocationPolicy.Disk.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
AllocationPolicy.Disk |
build() |
AllocationPolicy.Disk |
buildPartial() |
AllocationPolicy.Disk.Builder |
clear() |
AllocationPolicy.Disk.Builder |
clearDataSource() |
AllocationPolicy.Disk.Builder |
clearDiskInterface()
Local SSDs are available through both "SCSI" and "NVMe" interfaces.
|
AllocationPolicy.Disk.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
AllocationPolicy.Disk.Builder |
clearImage()
URL for a VM image to use as the data source for this disk.
|
AllocationPolicy.Disk.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
AllocationPolicy.Disk.Builder |
clearSizeGb()
Disk size in GB.
|
AllocationPolicy.Disk.Builder |
clearSnapshot()
Name of a snapshot used as the data source.
|
AllocationPolicy.Disk.Builder |
clearType()
Disk type as shown in `gcloud compute disk-types list`.
|
AllocationPolicy.Disk.Builder |
clone() |
AllocationPolicy.Disk.DataSourceCase |
getDataSourceCase() |
AllocationPolicy.Disk |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
String |
getDiskInterface()
Local SSDs are available through both "SCSI" and "NVMe" interfaces.
|
com.google.protobuf.ByteString |
getDiskInterfaceBytes()
Local SSDs are available through both "SCSI" and "NVMe" interfaces.
|
String |
getImage()
URL for a VM image to use as the data source for this disk.
|
com.google.protobuf.ByteString |
getImageBytes()
URL for a VM image to use as the data source for this disk.
|
long |
getSizeGb()
Disk size in GB.
|
String |
getSnapshot()
Name of a snapshot used as the data source.
|
com.google.protobuf.ByteString |
getSnapshotBytes()
Name of a snapshot used as the data source.
|
String |
getType()
Disk type as shown in `gcloud compute disk-types list`.
|
com.google.protobuf.ByteString |
getTypeBytes()
Disk type as shown in `gcloud compute disk-types list`.
|
boolean |
hasImage()
URL for a VM image to use as the data source for this disk.
|
boolean |
hasSnapshot()
Name of a snapshot used as the data source.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
AllocationPolicy.Disk.Builder |
mergeFrom(AllocationPolicy.Disk other) |
AllocationPolicy.Disk.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
AllocationPolicy.Disk.Builder |
mergeFrom(com.google.protobuf.Message other) |
AllocationPolicy.Disk.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
AllocationPolicy.Disk.Builder |
setDiskInterface(String value)
Local SSDs are available through both "SCSI" and "NVMe" interfaces.
|
AllocationPolicy.Disk.Builder |
setDiskInterfaceBytes(com.google.protobuf.ByteString value)
Local SSDs are available through both "SCSI" and "NVMe" interfaces.
|
AllocationPolicy.Disk.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
AllocationPolicy.Disk.Builder |
setImage(String value)
URL for a VM image to use as the data source for this disk.
|
AllocationPolicy.Disk.Builder |
setImageBytes(com.google.protobuf.ByteString value)
URL for a VM image to use as the data source for this disk.
|
AllocationPolicy.Disk.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
AllocationPolicy.Disk.Builder |
setSizeGb(long value)
Disk size in GB.
|
AllocationPolicy.Disk.Builder |
setSnapshot(String value)
Name of a snapshot used as the data source.
|
AllocationPolicy.Disk.Builder |
setSnapshotBytes(com.google.protobuf.ByteString value)
Name of a snapshot used as the data source.
|
AllocationPolicy.Disk.Builder |
setType(String value)
Disk type as shown in `gcloud compute disk-types list`.
|
AllocationPolicy.Disk.Builder |
setTypeBytes(com.google.protobuf.ByteString value)
Disk type as shown in `gcloud compute disk-types list`.
|
AllocationPolicy.Disk.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Disk.Builder>public AllocationPolicy.Disk.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Disk.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Disk.Builder>public AllocationPolicy.Disk getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic AllocationPolicy.Disk build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic AllocationPolicy.Disk buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic AllocationPolicy.Disk.Builder clone()
clone in interface com.google.protobuf.Message.Builderclone in interface com.google.protobuf.MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Disk.Builder>public AllocationPolicy.Disk.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField in interface com.google.protobuf.Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Disk.Builder>public AllocationPolicy.Disk.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Disk.Builder>public AllocationPolicy.Disk.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Disk.Builder>public AllocationPolicy.Disk.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface com.google.protobuf.Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Disk.Builder>public AllocationPolicy.Disk.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface com.google.protobuf.Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Disk.Builder>public AllocationPolicy.Disk.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<AllocationPolicy.Disk.Builder>public AllocationPolicy.Disk.Builder mergeFrom(AllocationPolicy.Disk other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Disk.Builder>public AllocationPolicy.Disk.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<AllocationPolicy.Disk.Builder>IOExceptionpublic AllocationPolicy.Disk.DataSourceCase getDataSourceCase()
getDataSourceCase in interface AllocationPolicy.DiskOrBuilderpublic AllocationPolicy.Disk.Builder clearDataSource()
public boolean hasImage()
URL for a VM image to use as the data source for this disk.
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-cos`: use Batch Container-Optimized images.
* `batch-hpc-rocky`: use Batch HPC Rocky Linux images.
string image = 4;hasImage in interface AllocationPolicy.DiskOrBuilderpublic String getImage()
URL for a VM image to use as the data source for this disk.
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-cos`: use Batch Container-Optimized images.
* `batch-hpc-rocky`: use Batch HPC Rocky Linux images.
string image = 4;getImage in interface AllocationPolicy.DiskOrBuilderpublic com.google.protobuf.ByteString getImageBytes()
URL for a VM image to use as the data source for this disk.
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-cos`: use Batch Container-Optimized images.
* `batch-hpc-rocky`: use Batch HPC Rocky Linux images.
string image = 4;getImageBytes in interface AllocationPolicy.DiskOrBuilderpublic AllocationPolicy.Disk.Builder setImage(String value)
URL for a VM image to use as the data source for this disk.
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-cos`: use Batch Container-Optimized images.
* `batch-hpc-rocky`: use Batch HPC Rocky Linux images.
string image = 4;value - The image to set.public AllocationPolicy.Disk.Builder clearImage()
URL for a VM image to use as the data source for this disk.
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-cos`: use Batch Container-Optimized images.
* `batch-hpc-rocky`: use Batch HPC Rocky Linux images.
string image = 4;public AllocationPolicy.Disk.Builder setImageBytes(com.google.protobuf.ByteString value)
URL for a VM image to use as the data source for this disk.
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-cos`: use Batch Container-Optimized images.
* `batch-hpc-rocky`: use Batch HPC Rocky Linux images.
string image = 4;value - The bytes for image to set.public boolean hasSnapshot()
Name of a snapshot used as the data source. Snapshot is not supported as boot disk now.
string snapshot = 5;hasSnapshot in interface AllocationPolicy.DiskOrBuilderpublic String getSnapshot()
Name of a snapshot used as the data source. Snapshot is not supported as boot disk now.
string snapshot = 5;getSnapshot in interface AllocationPolicy.DiskOrBuilderpublic com.google.protobuf.ByteString getSnapshotBytes()
Name of a snapshot used as the data source. Snapshot is not supported as boot disk now.
string snapshot = 5;getSnapshotBytes in interface AllocationPolicy.DiskOrBuilderpublic AllocationPolicy.Disk.Builder setSnapshot(String value)
Name of a snapshot used as the data source. Snapshot is not supported as boot disk now.
string snapshot = 5;value - The snapshot to set.public AllocationPolicy.Disk.Builder clearSnapshot()
Name of a snapshot used as the data source. Snapshot is not supported as boot disk now.
string snapshot = 5;public AllocationPolicy.Disk.Builder setSnapshotBytes(com.google.protobuf.ByteString value)
Name of a snapshot used as the data source. Snapshot is not supported as boot disk now.
string snapshot = 5;value - The bytes for snapshot to set.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". If not specified, "pd-standard" will be used as the default type for non-boot disks, "pd-balanced" will be used as the default type for boot disks.
string type = 1;getType in interface AllocationPolicy.DiskOrBuilderpublic com.google.protobuf.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". If not specified, "pd-standard" will be used as the default type for non-boot disks, "pd-balanced" will be used as the default type for boot disks.
string type = 1;getTypeBytes in interface AllocationPolicy.DiskOrBuilderpublic AllocationPolicy.Disk.Builder setType(String value)
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". If not specified, "pd-standard" will be used as the default type for non-boot disks, "pd-balanced" will be used as the default type for boot disks.
string type = 1;value - The type to set.public AllocationPolicy.Disk.Builder clearType()
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". If not specified, "pd-standard" will be used as the default type for non-boot disks, "pd-balanced" will be used as the default type for boot disks.
string type = 1;public AllocationPolicy.Disk.Builder setTypeBytes(com.google.protobuf.ByteString value)
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". If not specified, "pd-standard" will be used as the default type for non-boot disks, "pd-balanced" will be used as the default type for boot disks.
string type = 1;value - The bytes for type to set.public long getSizeGb()
Disk size in GB. **Non-Boot Disk**: If the `type` specifies a persistent disk, this field is ignored if `data_source` is set as `image` or `snapshot`. If the `type` specifies a local SSD, this field should be a multiple of 375 GB, otherwise, the final size will be the next greater multiple of 375 GB. **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. Also, this field should be no smaller than the source disk's size when the `data_source` is set as `snapshot` or `image`. For example, if you set an image as the `data_source` field and the image's default disk size 30 GB, you can only use this field to make the disk larger or equal to 30 GB.
int64 size_gb = 2;getSizeGb in interface AllocationPolicy.DiskOrBuilderpublic AllocationPolicy.Disk.Builder setSizeGb(long value)
Disk size in GB. **Non-Boot Disk**: If the `type` specifies a persistent disk, this field is ignored if `data_source` is set as `image` or `snapshot`. If the `type` specifies a local SSD, this field should be a multiple of 375 GB, otherwise, the final size will be the next greater multiple of 375 GB. **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. Also, this field should be no smaller than the source disk's size when the `data_source` is set as `snapshot` or `image`. For example, if you set an image as the `data_source` field and the image's default disk size 30 GB, you can only use this field to make the disk larger or equal to 30 GB.
int64 size_gb = 2;value - The sizeGb to set.public AllocationPolicy.Disk.Builder clearSizeGb()
Disk size in GB. **Non-Boot Disk**: If the `type` specifies a persistent disk, this field is ignored if `data_source` is set as `image` or `snapshot`. If the `type` specifies a local SSD, this field should be a multiple of 375 GB, otherwise, the final size will be the next greater multiple of 375 GB. **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. Also, this field should be no smaller than the source disk's size when the `data_source` is set as `snapshot` or `image`. For example, if you set an image as the `data_source` field and the image's default disk size 30 GB, you can only use this field to make the disk larger or equal to 30 GB.
int64 size_gb = 2;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. This field is ignored for persistent disks as the interface is chosen automatically. See https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface.
string disk_interface = 6;getDiskInterface in interface AllocationPolicy.DiskOrBuilderpublic com.google.protobuf.ByteString getDiskInterfaceBytes()
Local SSDs are available through both "SCSI" and "NVMe" interfaces. If not indicated, "NVMe" will be the default one for local ssds. This field is ignored for persistent disks as the interface is chosen automatically. See https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface.
string disk_interface = 6;getDiskInterfaceBytes in interface AllocationPolicy.DiskOrBuilderpublic AllocationPolicy.Disk.Builder setDiskInterface(String value)
Local SSDs are available through both "SCSI" and "NVMe" interfaces. If not indicated, "NVMe" will be the default one for local ssds. This field is ignored for persistent disks as the interface is chosen automatically. See https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface.
string disk_interface = 6;value - The diskInterface to set.public AllocationPolicy.Disk.Builder clearDiskInterface()
Local SSDs are available through both "SCSI" and "NVMe" interfaces. If not indicated, "NVMe" will be the default one for local ssds. This field is ignored for persistent disks as the interface is chosen automatically. See https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface.
string disk_interface = 6;public AllocationPolicy.Disk.Builder setDiskInterfaceBytes(com.google.protobuf.ByteString value)
Local SSDs are available through both "SCSI" and "NVMe" interfaces. If not indicated, "NVMe" will be the default one for local ssds. This field is ignored for persistent disks as the interface is chosen automatically. See https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface.
string disk_interface = 6;value - The bytes for diskInterface to set.public final AllocationPolicy.Disk.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Disk.Builder>public final AllocationPolicy.Disk.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Disk.Builder>Copyright © 2025 Google LLC. All rights reserved.