public static final class AllocationPolicy.InstancePolicyOrTemplate.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.InstancePolicyOrTemplate.Builder> implements AllocationPolicy.InstancePolicyOrTemplateOrBuilder
InstancePolicyOrTemplate lets you define the type of resources to use for this job either with an InstancePolicy or an instance template. If undefined, Batch picks the type of VM to use and doesn't include optional VM resources such as GPUs and extra disks.Protobuf type
google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplategetAllFields, 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.InstancePolicyOrTemplate.Builder>public AllocationPolicy.InstancePolicyOrTemplate.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.InstancePolicyOrTemplate.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.InstancePolicyOrTemplate.Builder>public AllocationPolicy.InstancePolicyOrTemplate getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic AllocationPolicy.InstancePolicyOrTemplate build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic AllocationPolicy.InstancePolicyOrTemplate buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic AllocationPolicy.InstancePolicyOrTemplate.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.InstancePolicyOrTemplate.Builder>public AllocationPolicy.InstancePolicyOrTemplate.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.InstancePolicyOrTemplate.Builder>public AllocationPolicy.InstancePolicyOrTemplate.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.InstancePolicyOrTemplate.Builder>public AllocationPolicy.InstancePolicyOrTemplate.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.InstancePolicyOrTemplate.Builder>public AllocationPolicy.InstancePolicyOrTemplate.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.InstancePolicyOrTemplate.Builder>public AllocationPolicy.InstancePolicyOrTemplate.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.InstancePolicyOrTemplate.Builder>public AllocationPolicy.InstancePolicyOrTemplate.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<AllocationPolicy.InstancePolicyOrTemplate.Builder>public AllocationPolicy.InstancePolicyOrTemplate.Builder mergeFrom(AllocationPolicy.InstancePolicyOrTemplate other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.InstancePolicyOrTemplate.Builder>public AllocationPolicy.InstancePolicyOrTemplate.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.InstancePolicyOrTemplate.Builder>IOExceptionpublic AllocationPolicy.InstancePolicyOrTemplate.PolicyTemplateCase getPolicyTemplateCase()
getPolicyTemplateCase in interface AllocationPolicy.InstancePolicyOrTemplateOrBuilderpublic AllocationPolicy.InstancePolicyOrTemplate.Builder clearPolicyTemplate()
public boolean hasPolicy()
InstancePolicy.
.google.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1;hasPolicy in interface AllocationPolicy.InstancePolicyOrTemplateOrBuilderpublic AllocationPolicy.InstancePolicy getPolicy()
InstancePolicy.
.google.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1;getPolicy in interface AllocationPolicy.InstancePolicyOrTemplateOrBuilderpublic AllocationPolicy.InstancePolicyOrTemplate.Builder setPolicy(AllocationPolicy.InstancePolicy value)
InstancePolicy.
.google.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1;public AllocationPolicy.InstancePolicyOrTemplate.Builder setPolicy(AllocationPolicy.InstancePolicy.Builder builderForValue)
InstancePolicy.
.google.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1;public AllocationPolicy.InstancePolicyOrTemplate.Builder mergePolicy(AllocationPolicy.InstancePolicy value)
InstancePolicy.
.google.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1;public AllocationPolicy.InstancePolicyOrTemplate.Builder clearPolicy()
InstancePolicy.
.google.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1;public AllocationPolicy.InstancePolicy.Builder getPolicyBuilder()
InstancePolicy.
.google.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1;public AllocationPolicy.InstancePolicyOrBuilder getPolicyOrBuilder()
InstancePolicy.
.google.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1;getPolicyOrBuilder in interface AllocationPolicy.InstancePolicyOrTemplateOrBuilderpublic boolean hasInstanceTemplate()
Name of an instance template used to create VMs. Named the field as 'instance_template' instead of 'template' to avoid C++ keyword conflict. Batch only supports global instance templates from the same project as the job. You can specify the global instance template as a full or partial URL.
string instance_template = 2;hasInstanceTemplate in interface AllocationPolicy.InstancePolicyOrTemplateOrBuilderpublic String getInstanceTemplate()
Name of an instance template used to create VMs. Named the field as 'instance_template' instead of 'template' to avoid C++ keyword conflict. Batch only supports global instance templates from the same project as the job. You can specify the global instance template as a full or partial URL.
string instance_template = 2;getInstanceTemplate in interface AllocationPolicy.InstancePolicyOrTemplateOrBuilderpublic com.google.protobuf.ByteString getInstanceTemplateBytes()
Name of an instance template used to create VMs. Named the field as 'instance_template' instead of 'template' to avoid C++ keyword conflict. Batch only supports global instance templates from the same project as the job. You can specify the global instance template as a full or partial URL.
string instance_template = 2;getInstanceTemplateBytes in interface AllocationPolicy.InstancePolicyOrTemplateOrBuilderpublic AllocationPolicy.InstancePolicyOrTemplate.Builder setInstanceTemplate(String value)
Name of an instance template used to create VMs. Named the field as 'instance_template' instead of 'template' to avoid C++ keyword conflict. Batch only supports global instance templates from the same project as the job. You can specify the global instance template as a full or partial URL.
string instance_template = 2;value - The instanceTemplate to set.public AllocationPolicy.InstancePolicyOrTemplate.Builder clearInstanceTemplate()
Name of an instance template used to create VMs. Named the field as 'instance_template' instead of 'template' to avoid C++ keyword conflict. Batch only supports global instance templates from the same project as the job. You can specify the global instance template as a full or partial URL.
string instance_template = 2;public AllocationPolicy.InstancePolicyOrTemplate.Builder setInstanceTemplateBytes(com.google.protobuf.ByteString value)
Name of an instance template used to create VMs. Named the field as 'instance_template' instead of 'template' to avoid C++ keyword conflict. Batch only supports global instance templates from the same project as the job. You can specify the global instance template as a full or partial URL.
string instance_template = 2;value - The bytes for instanceTemplate to set.public boolean getInstallGpuDrivers()
Set this field true if you want Batch to help fetch drivers from a third party location and install them for GPUs specified in `policy.accelerators` or `instance_template` on your behalf. Default is false. For Container-Optimized Image cases, Batch will install the accelerator driver following milestones of https://cloud.google.com/container-optimized-os/docs/release-notes. For non Container-Optimized Image cases, following https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py.
bool install_gpu_drivers = 3;getInstallGpuDrivers in interface AllocationPolicy.InstancePolicyOrTemplateOrBuilderpublic AllocationPolicy.InstancePolicyOrTemplate.Builder setInstallGpuDrivers(boolean value)
Set this field true if you want Batch to help fetch drivers from a third party location and install them for GPUs specified in `policy.accelerators` or `instance_template` on your behalf. Default is false. For Container-Optimized Image cases, Batch will install the accelerator driver following milestones of https://cloud.google.com/container-optimized-os/docs/release-notes. For non Container-Optimized Image cases, following https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py.
bool install_gpu_drivers = 3;value - The installGpuDrivers to set.public AllocationPolicy.InstancePolicyOrTemplate.Builder clearInstallGpuDrivers()
Set this field true if you want Batch to help fetch drivers from a third party location and install them for GPUs specified in `policy.accelerators` or `instance_template` on your behalf. Default is false. For Container-Optimized Image cases, Batch will install the accelerator driver following milestones of https://cloud.google.com/container-optimized-os/docs/release-notes. For non Container-Optimized Image cases, following https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py.
bool install_gpu_drivers = 3;public boolean getInstallOpsAgent()
Optional. Set this field true if you want Batch to install Ops Agent on your behalf. Default is false.
bool install_ops_agent = 4 [(.google.api.field_behavior) = OPTIONAL];getInstallOpsAgent in interface AllocationPolicy.InstancePolicyOrTemplateOrBuilderpublic AllocationPolicy.InstancePolicyOrTemplate.Builder setInstallOpsAgent(boolean value)
Optional. Set this field true if you want Batch to install Ops Agent on your behalf. Default is false.
bool install_ops_agent = 4 [(.google.api.field_behavior) = OPTIONAL];value - The installOpsAgent to set.public AllocationPolicy.InstancePolicyOrTemplate.Builder clearInstallOpsAgent()
Optional. Set this field true if you want Batch to install Ops Agent on your behalf. Default is false.
bool install_ops_agent = 4 [(.google.api.field_behavior) = OPTIONAL];public boolean getBlockProjectSshKeys()
Optional. Set this field to `true` if you want Batch to block project-level SSH keys from accessing this job's VMs. Alternatively, you can configure the job to specify a VM instance template that blocks project-level SSH keys. In either case, Batch blocks project-level SSH keys while creating the VMs for this job. Batch allows project-level SSH keys for a job's VMs only if all the following are true: + This field is undefined or set to `false`. + The job's VM instance template (if any) doesn't block project-level SSH keys. Notably, you can override this behavior by manually updating a VM to block or allow project-level SSH keys. For more information about blocking project-level SSH keys, see the Compute Engine documentation: https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys
bool block_project_ssh_keys = 5 [(.google.api.field_behavior) = OPTIONAL];getBlockProjectSshKeys in interface AllocationPolicy.InstancePolicyOrTemplateOrBuilderpublic AllocationPolicy.InstancePolicyOrTemplate.Builder setBlockProjectSshKeys(boolean value)
Optional. Set this field to `true` if you want Batch to block project-level SSH keys from accessing this job's VMs. Alternatively, you can configure the job to specify a VM instance template that blocks project-level SSH keys. In either case, Batch blocks project-level SSH keys while creating the VMs for this job. Batch allows project-level SSH keys for a job's VMs only if all the following are true: + This field is undefined or set to `false`. + The job's VM instance template (if any) doesn't block project-level SSH keys. Notably, you can override this behavior by manually updating a VM to block or allow project-level SSH keys. For more information about blocking project-level SSH keys, see the Compute Engine documentation: https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys
bool block_project_ssh_keys = 5 [(.google.api.field_behavior) = OPTIONAL];value - The blockProjectSshKeys to set.public AllocationPolicy.InstancePolicyOrTemplate.Builder clearBlockProjectSshKeys()
Optional. Set this field to `true` if you want Batch to block project-level SSH keys from accessing this job's VMs. Alternatively, you can configure the job to specify a VM instance template that blocks project-level SSH keys. In either case, Batch blocks project-level SSH keys while creating the VMs for this job. Batch allows project-level SSH keys for a job's VMs only if all the following are true: + This field is undefined or set to `false`. + The job's VM instance template (if any) doesn't block project-level SSH keys. Notably, you can override this behavior by manually updating a VM to block or allow project-level SSH keys. For more information about blocking project-level SSH keys, see the Compute Engine documentation: https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys
bool block_project_ssh_keys = 5 [(.google.api.field_behavior) = OPTIONAL];public final AllocationPolicy.InstancePolicyOrTemplate.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.InstancePolicyOrTemplate.Builder>public final AllocationPolicy.InstancePolicyOrTemplate.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.InstancePolicyOrTemplate.Builder>Copyright © 2025 Google LLC. All rights reserved.