public final class AllocationPolicy extends GeneratedMessageV3 implements AllocationPolicyOrBuilder
A Job's resource allocation policy describes when, where, and how compute
resources should be allocated for the Job.
Protobuf type google.cloud.batch.v1.AllocationPolicy
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
INSTANCES_FIELD_NUMBER
public static final int INSTANCES_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
LABELS_FIELD_NUMBER
public static final int LABELS_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
LOCATION_FIELD_NUMBER
public static final int LOCATION_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
NETWORK_FIELD_NUMBER
public static final int NETWORK_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
PLACEMENT_FIELD_NUMBER
public static final int PLACEMENT_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
SERVICE_ACCOUNT_FIELD_NUMBER
public static final int SERVICE_ACCOUNT_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
public static final int TAGS_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
Static Methods
getDefaultInstance()
public static AllocationPolicy getDefaultInstance()
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
newBuilder()
public static AllocationPolicy.Builder newBuilder()
newBuilder(AllocationPolicy prototype)
public static AllocationPolicy.Builder newBuilder(AllocationPolicy prototype)
public static AllocationPolicy parseDelimitedFrom(InputStream input)
public static AllocationPolicy parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(byte[] data)
public static AllocationPolicy parseFrom(byte[] data)
Parameter |
Name |
Description |
data |
byte[]
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static AllocationPolicy parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteString data)
public static AllocationPolicy parseFrom(ByteString data)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static AllocationPolicy parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static AllocationPolicy parseFrom(CodedInputStream input)
public static AllocationPolicy parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static AllocationPolicy parseFrom(InputStream input)
public static AllocationPolicy parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteBuffer data)
public static AllocationPolicy parseFrom(ByteBuffer data)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static AllocationPolicy parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
parser()
public static Parser<AllocationPolicy> parser()
Methods
containsLabels(String key)
public boolean containsLabels(String key)
Custom labels to apply to the job and all the Compute Engine resources
that both are created by this allocation policy and support labels.
Use labels to group and describe the resources they are applied to. Batch
automatically applies predefined labels and supports multiple labels
fields for each job, which each let you apply custom labels to various
resources. Label names that start with "goog-" or "google-" are
reserved for predefined labels. For more information about labels with
Batch, see
Organize resources using
labels.
map<string, string> labels = 6;
Parameter |
Name |
Description |
key |
String
|
equals(Object obj)
public boolean equals(Object obj)
Parameter |
Name |
Description |
obj |
Object
|
Overrides
getDefaultInstanceForType()
public AllocationPolicy getDefaultInstanceForType()
getInstances(int index)
public AllocationPolicy.InstancePolicyOrTemplate getInstances(int index)
Describe instances that can be created by this AllocationPolicy.
Only instances[0] is supported now.
repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;
Parameter |
Name |
Description |
index |
int
|
getInstancesCount()
public int getInstancesCount()
Describe instances that can be created by this AllocationPolicy.
Only instances[0] is supported now.
repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;
Returns |
Type |
Description |
int |
|
getInstancesList()
public List<AllocationPolicy.InstancePolicyOrTemplate> getInstancesList()
Describe instances that can be created by this AllocationPolicy.
Only instances[0] is supported now.
repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;
getInstancesOrBuilder(int index)
public AllocationPolicy.InstancePolicyOrTemplateOrBuilder getInstancesOrBuilder(int index)
Describe instances that can be created by this AllocationPolicy.
Only instances[0] is supported now.
repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;
Parameter |
Name |
Description |
index |
int
|
getInstancesOrBuilderList()
public List<? extends AllocationPolicy.InstancePolicyOrTemplateOrBuilder> getInstancesOrBuilderList()
Describe instances that can be created by this AllocationPolicy.
Only instances[0] is supported now.
repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;
Returns |
Type |
Description |
List<? extends com.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplateOrBuilder> |
|
getLabels() (deprecated)
public Map<String,String> getLabels()
getLabelsCount()
public int getLabelsCount()
Custom labels to apply to the job and all the Compute Engine resources
that both are created by this allocation policy and support labels.
Use labels to group and describe the resources they are applied to. Batch
automatically applies predefined labels and supports multiple labels
fields for each job, which each let you apply custom labels to various
resources. Label names that start with "goog-" or "google-" are
reserved for predefined labels. For more information about labels with
Batch, see
Organize resources using
labels.
map<string, string> labels = 6;
Returns |
Type |
Description |
int |
|
getLabelsMap()
public Map<String,String> getLabelsMap()
Custom labels to apply to the job and all the Compute Engine resources
that both are created by this allocation policy and support labels.
Use labels to group and describe the resources they are applied to. Batch
automatically applies predefined labels and supports multiple labels
fields for each job, which each let you apply custom labels to various
resources. Label names that start with "goog-" or "google-" are
reserved for predefined labels. For more information about labels with
Batch, see
Organize resources using
labels.
map<string, string> labels = 6;
getLabelsOrDefault(String key, String defaultValue)
public String getLabelsOrDefault(String key, String defaultValue)
Custom labels to apply to the job and all the Compute Engine resources
that both are created by this allocation policy and support labels.
Use labels to group and describe the resources they are applied to. Batch
automatically applies predefined labels and supports multiple labels
fields for each job, which each let you apply custom labels to various
resources. Label names that start with "goog-" or "google-" are
reserved for predefined labels. For more information about labels with
Batch, see
Organize resources using
labels.
map<string, string> labels = 6;
Returns |
Type |
Description |
String |
|
getLabelsOrThrow(String key)
public String getLabelsOrThrow(String key)
Custom labels to apply to the job and all the Compute Engine resources
that both are created by this allocation policy and support labels.
Use labels to group and describe the resources they are applied to. Batch
automatically applies predefined labels and supports multiple labels
fields for each job, which each let you apply custom labels to various
resources. Label names that start with "goog-" or "google-" are
reserved for predefined labels. For more information about labels with
Batch, see
Organize resources using
labels.
map<string, string> labels = 6;
Parameter |
Name |
Description |
key |
String
|
Returns |
Type |
Description |
String |
|
getLocation()
public AllocationPolicy.LocationPolicy getLocation()
Location where compute resources should be allocated for the Job.
.google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;
getLocationOrBuilder()
public AllocationPolicy.LocationPolicyOrBuilder getLocationOrBuilder()
Location where compute resources should be allocated for the Job.
.google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;
getNetwork()
public AllocationPolicy.NetworkPolicy getNetwork()
The network policy.
If you define an instance template in the InstancePolicyOrTemplate
field,
Batch will use the network settings in the instance template instead of
this field.
.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;
getNetworkOrBuilder()
public AllocationPolicy.NetworkPolicyOrBuilder getNetworkOrBuilder()
The network policy.
If you define an instance template in the InstancePolicyOrTemplate
field,
Batch will use the network settings in the instance template instead of
this field.
.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;
getParserForType()
public Parser<AllocationPolicy> getParserForType()
Overrides
getPlacement()
public AllocationPolicy.PlacementPolicy getPlacement()
The placement policy.
.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;
getPlacementOrBuilder()
public AllocationPolicy.PlacementPolicyOrBuilder getPlacementOrBuilder()
The placement policy.
.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;
getSerializedSize()
public int getSerializedSize()
Returns |
Type |
Description |
int |
|
Overrides
getServiceAccount()
public ServiceAccount getServiceAccount()
Defines the service account for Batch-created VMs. If omitted, the default
Compute Engine service
account
is used. Must match the service account specified in any used instance
template configured in the Batch job.
Includes the following fields:
- email: The service account's email address. If not set, the default
Compute Engine service account is used.
- scopes: Additional OAuth scopes to grant the service account, beyond the
default cloud-platform scope. (list of strings)
.google.cloud.batch.v1.ServiceAccount service_account = 9;
getServiceAccountOrBuilder()
public ServiceAccountOrBuilder getServiceAccountOrBuilder()
Defines the service account for Batch-created VMs. If omitted, the default
Compute Engine service
account
is used. Must match the service account specified in any used instance
template configured in the Batch job.
Includes the following fields:
- email: The service account's email address. If not set, the default
Compute Engine service account is used.
- scopes: Additional OAuth scopes to grant the service account, beyond the
default cloud-platform scope. (list of strings)
.google.cloud.batch.v1.ServiceAccount service_account = 9;
public String getTags(int index)
Optional. Tags applied to the VM instances.
The tags identify valid sources or targets for network firewalls.
Each tag must be 1-63 characters long, and comply with
RFC1035.
repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];
Parameter |
Name |
Description |
index |
int
The index of the element to return.
|
Returns |
Type |
Description |
String |
The tags at the given index.
|
public ByteString getTagsBytes(int index)
Optional. Tags applied to the VM instances.
The tags identify valid sources or targets for network firewalls.
Each tag must be 1-63 characters long, and comply with
RFC1035.
repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];
Parameter |
Name |
Description |
index |
int
The index of the value to return.
|
Returns |
Type |
Description |
ByteString |
The bytes of the tags at the given index.
|
public int getTagsCount()
Optional. Tags applied to the VM instances.
The tags identify valid sources or targets for network firewalls.
Each tag must be 1-63 characters long, and comply with
RFC1035.
repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];
Returns |
Type |
Description |
int |
The count of tags.
|
public ProtocolStringList getTagsList()
Optional. Tags applied to the VM instances.
The tags identify valid sources or targets for network firewalls.
Each tag must be 1-63 characters long, and comply with
RFC1035.
repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];
hasLocation()
public boolean hasLocation()
Location where compute resources should be allocated for the Job.
.google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;
Returns |
Type |
Description |
boolean |
Whether the location field is set.
|
hasNetwork()
public boolean hasNetwork()
The network policy.
If you define an instance template in the InstancePolicyOrTemplate
field,
Batch will use the network settings in the instance template instead of
this field.
.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;
Returns |
Type |
Description |
boolean |
Whether the network field is set.
|
hasPlacement()
public boolean hasPlacement()
The placement policy.
.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;
Returns |
Type |
Description |
boolean |
Whether the placement field is set.
|
hasServiceAccount()
public boolean hasServiceAccount()
Defines the service account for Batch-created VMs. If omitted, the default
Compute Engine service
account
is used. Must match the service account specified in any used instance
template configured in the Batch job.
Includes the following fields:
- email: The service account's email address. If not set, the default
Compute Engine service account is used.
- scopes: Additional OAuth scopes to grant the service account, beyond the
default cloud-platform scope. (list of strings)
.google.cloud.batch.v1.ServiceAccount service_account = 9;
Returns |
Type |
Description |
boolean |
Whether the serviceAccount field is set.
|
hashCode()
Returns |
Type |
Description |
int |
|
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
internalGetMapFieldReflection(int number)
protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter |
Name |
Description |
number |
int
|
Returns |
Type |
Description |
com.google.protobuf.MapFieldReflectionAccessor |
|
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public AllocationPolicy.Builder newBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected AllocationPolicy.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Returns |
Type |
Description |
Object |
|
Overrides
toBuilder()
public AllocationPolicy.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Overrides