public static final class AllocationPolicy.InstancePolicyOrTemplate extends com.google.protobuf.GeneratedMessageV3 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.InstancePolicyOrTemplate| Modifier and Type | Class and Description |
|---|---|
static class |
AllocationPolicy.InstancePolicyOrTemplate.Builder
InstancePolicyOrTemplate lets you define the type of resources to use for
this job either with an InstancePolicy or an instance template.
|
static class |
AllocationPolicy.InstancePolicyOrTemplate.PolicyTemplateCase |
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
BLOCK_PROJECT_SSH_KEYS_FIELD_NUMBER |
static int |
INSTALL_GPU_DRIVERS_FIELD_NUMBER |
static int |
INSTALL_OPS_AGENT_FIELD_NUMBER |
static int |
INSTANCE_TEMPLATE_FIELD_NUMBER |
static int |
POLICY_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
boolean |
getBlockProjectSshKeys()
Optional.
|
static AllocationPolicy.InstancePolicyOrTemplate |
getDefaultInstance() |
AllocationPolicy.InstancePolicyOrTemplate |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
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.
|
boolean |
getInstallOpsAgent()
Optional.
|
String |
getInstanceTemplate()
Name of an instance template used to create VMs.
|
com.google.protobuf.ByteString |
getInstanceTemplateBytes()
Name of an instance template used to create VMs.
|
com.google.protobuf.Parser<AllocationPolicy.InstancePolicyOrTemplate> |
getParserForType() |
AllocationPolicy.InstancePolicy |
getPolicy()
InstancePolicy.
|
AllocationPolicy.InstancePolicyOrBuilder |
getPolicyOrBuilder()
InstancePolicy.
|
AllocationPolicy.InstancePolicyOrTemplate.PolicyTemplateCase |
getPolicyTemplateCase() |
int |
getSerializedSize() |
int |
hashCode() |
boolean |
hasInstanceTemplate()
Name of an instance template used to create VMs.
|
boolean |
hasPolicy()
InstancePolicy.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static AllocationPolicy.InstancePolicyOrTemplate.Builder |
newBuilder() |
static AllocationPolicy.InstancePolicyOrTemplate.Builder |
newBuilder(AllocationPolicy.InstancePolicyOrTemplate prototype) |
AllocationPolicy.InstancePolicyOrTemplate.Builder |
newBuilderForType() |
protected AllocationPolicy.InstancePolicyOrTemplate.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static AllocationPolicy.InstancePolicyOrTemplate |
parseDelimitedFrom(InputStream input) |
static AllocationPolicy.InstancePolicyOrTemplate |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static AllocationPolicy.InstancePolicyOrTemplate |
parseFrom(byte[] data) |
static AllocationPolicy.InstancePolicyOrTemplate |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static AllocationPolicy.InstancePolicyOrTemplate |
parseFrom(ByteBuffer data) |
static AllocationPolicy.InstancePolicyOrTemplate |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static AllocationPolicy.InstancePolicyOrTemplate |
parseFrom(com.google.protobuf.ByteString data) |
static AllocationPolicy.InstancePolicyOrTemplate |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static AllocationPolicy.InstancePolicyOrTemplate |
parseFrom(com.google.protobuf.CodedInputStream input) |
static AllocationPolicy.InstancePolicyOrTemplate |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static AllocationPolicy.InstancePolicyOrTemplate |
parseFrom(InputStream input) |
static AllocationPolicy.InstancePolicyOrTemplate |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<AllocationPolicy.InstancePolicyOrTemplate> |
parser() |
AllocationPolicy.InstancePolicyOrTemplate.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int POLICY_FIELD_NUMBER
public static final int INSTANCE_TEMPLATE_FIELD_NUMBER
public static final int INSTALL_GPU_DRIVERS_FIELD_NUMBER
public static final int INSTALL_OPS_AGENT_FIELD_NUMBER
public static final int BLOCK_PROJECT_SSH_KEYS_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public AllocationPolicy.InstancePolicyOrTemplate.PolicyTemplateCase getPolicyTemplateCase()
getPolicyTemplateCase in interface AllocationPolicy.InstancePolicyOrTemplateOrBuilderpublic 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.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 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 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 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 final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static AllocationPolicy.InstancePolicyOrTemplate parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static AllocationPolicy.InstancePolicyOrTemplate parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static AllocationPolicy.InstancePolicyOrTemplate parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static AllocationPolicy.InstancePolicyOrTemplate parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static AllocationPolicy.InstancePolicyOrTemplate parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static AllocationPolicy.InstancePolicyOrTemplate parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static AllocationPolicy.InstancePolicyOrTemplate parseFrom(InputStream input) throws IOException
IOExceptionpublic static AllocationPolicy.InstancePolicyOrTemplate parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static AllocationPolicy.InstancePolicyOrTemplate parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static AllocationPolicy.InstancePolicyOrTemplate parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static AllocationPolicy.InstancePolicyOrTemplate parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static AllocationPolicy.InstancePolicyOrTemplate parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic AllocationPolicy.InstancePolicyOrTemplate.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static AllocationPolicy.InstancePolicyOrTemplate.Builder newBuilder()
public static AllocationPolicy.InstancePolicyOrTemplate.Builder newBuilder(AllocationPolicy.InstancePolicyOrTemplate prototype)
public AllocationPolicy.InstancePolicyOrTemplate.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected AllocationPolicy.InstancePolicyOrTemplate.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static AllocationPolicy.InstancePolicyOrTemplate getDefaultInstance()
public static com.google.protobuf.Parser<AllocationPolicy.InstancePolicyOrTemplate> parser()
public com.google.protobuf.Parser<AllocationPolicy.InstancePolicyOrTemplate> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public AllocationPolicy.InstancePolicyOrTemplate getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2025 Google LLC. All rights reserved.