public static final class AllocationPolicy.LocationPolicy.Builder extends GeneratedMessage.Builder<AllocationPolicy.LocationPolicy.Builder> implements AllocationPolicy.LocationPolicyOrBuilderProtobuf type google.cloud.batch.v1.AllocationPolicy.LocationPolicy
Inheritance
java.lang.Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessage.Builder > AllocationPolicy.LocationPolicy.BuilderImplements
AllocationPolicy.LocationPolicyOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
Methods
addAllAllowedLocations(Iterable<String> values)
public AllocationPolicy.LocationPolicy.Builder addAllAllowedLocations(Iterable<String> values) A list of location names that are allowed for the job's VMs formatted
as URLs. Each location can be a region or a zone, but you can only
specify one region or multiple zones in one region per job. For example,
["regions/us-central1"] allow VMs in any zones in region
us-central1, and ["zones/us-central1-a", "zones/us-central1-c"]
only allow VMs in zones us-central1-a and us-central1-c. However,
["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
"zones/us-west1-a"] causes an error because it contains multiple regions
(us-central1 and us-west1).
The specified region or zones must be in the same region in which the job is created starting on the following dates:
For projects that have successfully submitted before July 31, 2026 at least one job that uses the
allowedLocations[]field with any region or zones outside of the job's location, the changes are starting on June 30, 2027.For all other projects, the changes are starting on July 31, 2026.
For example, for job
projects/123/locations/us-central1/jobs/jobid, the specified region or zones must be inus-central1. Using a different region (e.g.regions/us-west1) or a zone not inus-central1(e.g.zones/us-west1-a) causes an error.
repeated string allowed_locations = 1;
| Parameter | |
|---|---|
| Name | Description |
values |
Iterable<String>The allowedLocations to add. |
| Returns | |
|---|---|
| Type | Description |
AllocationPolicy.LocationPolicy.Builder |
This builder for chaining. |
addAllowedLocations(String value)
public AllocationPolicy.LocationPolicy.Builder addAllowedLocations(String value) A list of location names that are allowed for the job's VMs formatted
as URLs. Each location can be a region or a zone, but you can only
specify one region or multiple zones in one region per job. For example,
["regions/us-central1"] allow VMs in any zones in region
us-central1, and ["zones/us-central1-a", "zones/us-central1-c"]
only allow VMs in zones us-central1-a and us-central1-c. However,
["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
"zones/us-west1-a"] causes an error because it contains multiple regions
(us-central1 and us-west1).
The specified region or zones must be in the same region in which the job is created starting on the following dates:
For projects that have successfully submitted before July 31, 2026 at least one job that uses the
allowedLocations[]field with any region or zones outside of the job's location, the changes are starting on June 30, 2027.For all other projects, the changes are starting on July 31, 2026.
For example, for job
projects/123/locations/us-central1/jobs/jobid, the specified region or zones must be inus-central1. Using a different region (e.g.regions/us-west1) or a zone not inus-central1(e.g.zones/us-west1-a) causes an error.
repeated string allowed_locations = 1;
| Parameter | |
|---|---|
| Name | Description |
value |
StringThe allowedLocations to add. |
| Returns | |
|---|---|
| Type | Description |
AllocationPolicy.LocationPolicy.Builder |
This builder for chaining. |
addAllowedLocationsBytes(ByteString value)
public AllocationPolicy.LocationPolicy.Builder addAllowedLocationsBytes(ByteString value) A list of location names that are allowed for the job's VMs formatted
as URLs. Each location can be a region or a zone, but you can only
specify one region or multiple zones in one region per job. For example,
["regions/us-central1"] allow VMs in any zones in region
us-central1, and ["zones/us-central1-a", "zones/us-central1-c"]
only allow VMs in zones us-central1-a and us-central1-c. However,
["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
"zones/us-west1-a"] causes an error because it contains multiple regions
(us-central1 and us-west1).
The specified region or zones must be in the same region in which the job is created starting on the following dates:
For projects that have successfully submitted before July 31, 2026 at least one job that uses the
allowedLocations[]field with any region or zones outside of the job's location, the changes are starting on June 30, 2027.For all other projects, the changes are starting on July 31, 2026.
For example, for job
projects/123/locations/us-central1/jobs/jobid, the specified region or zones must be inus-central1. Using a different region (e.g.regions/us-west1) or a zone not inus-central1(e.g.zones/us-west1-a) causes an error.
repeated string allowed_locations = 1;
| Parameter | |
|---|---|
| Name | Description |
value |
ByteStringThe bytes of the allowedLocations to add. |
| Returns | |
|---|---|
| Type | Description |
AllocationPolicy.LocationPolicy.Builder |
This builder for chaining. |
build()
public AllocationPolicy.LocationPolicy build()| Returns | |
|---|---|
| Type | Description |
AllocationPolicy.LocationPolicy |
|
buildPartial()
public AllocationPolicy.LocationPolicy buildPartial()| Returns | |
|---|---|
| Type | Description |
AllocationPolicy.LocationPolicy |
|
clear()
public AllocationPolicy.LocationPolicy.Builder clear()| Returns | |
|---|---|
| Type | Description |
AllocationPolicy.LocationPolicy.Builder |
|
clearAllowedLocations()
public AllocationPolicy.LocationPolicy.Builder clearAllowedLocations() A list of location names that are allowed for the job's VMs formatted
as URLs. Each location can be a region or a zone, but you can only
specify one region or multiple zones in one region per job. For example,
["regions/us-central1"] allow VMs in any zones in region
us-central1, and ["zones/us-central1-a", "zones/us-central1-c"]
only allow VMs in zones us-central1-a and us-central1-c. However,
["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
"zones/us-west1-a"] causes an error because it contains multiple regions
(us-central1 and us-west1).
The specified region or zones must be in the same region in which the job is created starting on the following dates:
For projects that have successfully submitted before July 31, 2026 at least one job that uses the
allowedLocations[]field with any region or zones outside of the job's location, the changes are starting on June 30, 2027.For all other projects, the changes are starting on July 31, 2026.
For example, for job
projects/123/locations/us-central1/jobs/jobid, the specified region or zones must be inus-central1. Using a different region (e.g.regions/us-west1) or a zone not inus-central1(e.g.zones/us-west1-a) causes an error.
repeated string allowed_locations = 1;
| Returns | |
|---|---|
| Type | Description |
AllocationPolicy.LocationPolicy.Builder |
This builder for chaining. |
getAllowedLocations(int index)
public String getAllowedLocations(int index) A list of location names that are allowed for the job's VMs formatted
as URLs. Each location can be a region or a zone, but you can only
specify one region or multiple zones in one region per job. For example,
["regions/us-central1"] allow VMs in any zones in region
us-central1, and ["zones/us-central1-a", "zones/us-central1-c"]
only allow VMs in zones us-central1-a and us-central1-c. However,
["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
"zones/us-west1-a"] causes an error because it contains multiple regions
(us-central1 and us-west1).
The specified region or zones must be in the same region in which the job is created starting on the following dates:
For projects that have successfully submitted before July 31, 2026 at least one job that uses the
allowedLocations[]field with any region or zones outside of the job's location, the changes are starting on June 30, 2027.For all other projects, the changes are starting on July 31, 2026.
For example, for job
projects/123/locations/us-central1/jobs/jobid, the specified region or zones must be inus-central1. Using a different region (e.g.regions/us-west1) or a zone not inus-central1(e.g.zones/us-west1-a) causes an error.
repeated string allowed_locations = 1;
| Parameter | |
|---|---|
| Name | Description |
index |
intThe index of the element to return. |
| Returns | |
|---|---|
| Type | Description |
String |
The allowedLocations at the given index. |
getAllowedLocationsBytes(int index)
public ByteString getAllowedLocationsBytes(int index) A list of location names that are allowed for the job's VMs formatted
as URLs. Each location can be a region or a zone, but you can only
specify one region or multiple zones in one region per job. For example,
["regions/us-central1"] allow VMs in any zones in region
us-central1, and ["zones/us-central1-a", "zones/us-central1-c"]
only allow VMs in zones us-central1-a and us-central1-c. However,
["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
"zones/us-west1-a"] causes an error because it contains multiple regions
(us-central1 and us-west1).
The specified region or zones must be in the same region in which the job is created starting on the following dates:
For projects that have successfully submitted before July 31, 2026 at least one job that uses the
allowedLocations[]field with any region or zones outside of the job's location, the changes are starting on June 30, 2027.For all other projects, the changes are starting on July 31, 2026.
For example, for job
projects/123/locations/us-central1/jobs/jobid, the specified region or zones must be inus-central1. Using a different region (e.g.regions/us-west1) or a zone not inus-central1(e.g.zones/us-west1-a) causes an error.
repeated string allowed_locations = 1;
| Parameter | |
|---|---|
| Name | Description |
index |
intThe index of the value to return. |
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes of the allowedLocations at the given index. |
getAllowedLocationsCount()
public int getAllowedLocationsCount() A list of location names that are allowed for the job's VMs formatted
as URLs. Each location can be a region or a zone, but you can only
specify one region or multiple zones in one region per job. For example,
["regions/us-central1"] allow VMs in any zones in region
us-central1, and ["zones/us-central1-a", "zones/us-central1-c"]
only allow VMs in zones us-central1-a and us-central1-c. However,
["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
"zones/us-west1-a"] causes an error because it contains multiple regions
(us-central1 and us-west1).
The specified region or zones must be in the same region in which the job is created starting on the following dates:
For projects that have successfully submitted before July 31, 2026 at least one job that uses the
allowedLocations[]field with any region or zones outside of the job's location, the changes are starting on June 30, 2027.For all other projects, the changes are starting on July 31, 2026.
For example, for job
projects/123/locations/us-central1/jobs/jobid, the specified region or zones must be inus-central1. Using a different region (e.g.regions/us-west1) or a zone not inus-central1(e.g.zones/us-west1-a) causes an error.
repeated string allowed_locations = 1;
| Returns | |
|---|---|
| Type | Description |
int |
The count of allowedLocations. |
getAllowedLocationsList()
public ProtocolStringList getAllowedLocationsList() A list of location names that are allowed for the job's VMs formatted
as URLs. Each location can be a region or a zone, but you can only
specify one region or multiple zones in one region per job. For example,
["regions/us-central1"] allow VMs in any zones in region
us-central1, and ["zones/us-central1-a", "zones/us-central1-c"]
only allow VMs in zones us-central1-a and us-central1-c. However,
["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
"zones/us-west1-a"] causes an error because it contains multiple regions
(us-central1 and us-west1).
The specified region or zones must be in the same region in which the job is created starting on the following dates:
For projects that have successfully submitted before July 31, 2026 at least one job that uses the
allowedLocations[]field with any region or zones outside of the job's location, the changes are starting on June 30, 2027.For all other projects, the changes are starting on July 31, 2026.
For example, for job
projects/123/locations/us-central1/jobs/jobid, the specified region or zones must be inus-central1. Using a different region (e.g.regions/us-west1) or a zone not inus-central1(e.g.zones/us-west1-a) causes an error.
repeated string allowed_locations = 1;
| Returns | |
|---|---|
| Type | Description |
ProtocolStringList |
A list containing the allowedLocations. |
getDefaultInstanceForType()
public AllocationPolicy.LocationPolicy getDefaultInstanceForType()| Returns | |
|---|---|
| Type | Description |
AllocationPolicy.LocationPolicy |
|
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
internalGetFieldAccessorTable()
protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()| Returns | |
|---|---|
| Type | Description |
FieldAccessorTable |
|
isInitialized()
public final boolean isInitialized()| Returns | |
|---|---|
| Type | Description |
boolean |
|
mergeFrom(AllocationPolicy.LocationPolicy other)
public AllocationPolicy.LocationPolicy.Builder mergeFrom(AllocationPolicy.LocationPolicy other)| Parameter | |
|---|---|
| Name | Description |
other |
AllocationPolicy.LocationPolicy |
| Returns | |
|---|---|
| Type | Description |
AllocationPolicy.LocationPolicy.Builder |
|
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public AllocationPolicy.LocationPolicy.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)| Parameters | |
|---|---|
| Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
AllocationPolicy.LocationPolicy.Builder |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
mergeFrom(Message other)
public AllocationPolicy.LocationPolicy.Builder mergeFrom(Message other)| Parameter | |
|---|---|
| Name | Description |
other |
Message |
| Returns | |
|---|---|
| Type | Description |
AllocationPolicy.LocationPolicy.Builder |
|
setAllowedLocations(int index, String value)
public AllocationPolicy.LocationPolicy.Builder setAllowedLocations(int index, String value) A list of location names that are allowed for the job's VMs formatted
as URLs. Each location can be a region or a zone, but you can only
specify one region or multiple zones in one region per job. For example,
["regions/us-central1"] allow VMs in any zones in region
us-central1, and ["zones/us-central1-a", "zones/us-central1-c"]
only allow VMs in zones us-central1-a and us-central1-c. However,
["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
"zones/us-west1-a"] causes an error because it contains multiple regions
(us-central1 and us-west1).
The specified region or zones must be in the same region in which the job is created starting on the following dates:
For projects that have successfully submitted before July 31, 2026 at least one job that uses the
allowedLocations[]field with any region or zones outside of the job's location, the changes are starting on June 30, 2027.For all other projects, the changes are starting on July 31, 2026.
For example, for job
projects/123/locations/us-central1/jobs/jobid, the specified region or zones must be inus-central1. Using a different region (e.g.regions/us-west1) or a zone not inus-central1(e.g.zones/us-west1-a) causes an error.
repeated string allowed_locations = 1;
| Parameters | |
|---|---|
| Name | Description |
index |
intThe index to set the value at. |
value |
StringThe allowedLocations to set. |
| Returns | |
|---|---|
| Type | Description |
AllocationPolicy.LocationPolicy.Builder |
This builder for chaining. |