A list of allowed location names represented by internal URLs.
Each location can be a region or a zone.
Only one region or multiple zones in one region is supported now.
For example,
["regions/us-central1"] allow VMs in any zones in region us-central1.
["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
in zones us-central1-a and us-central1-c.
All locations end up in different regions would cause errors.
For example,
["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
"zones/us-west1-a"] contains 2 regions "us-central1" and
"us-west1". An error is expected in this case.
A list of allowed location names represented by internal URLs.
Each location can be a region or a zone.
Only one region or multiple zones in one region is supported now.
For example,
["regions/us-central1"] allow VMs in any zones in region us-central1.
["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
in zones us-central1-a and us-central1-c.
All locations end up in different regions would cause errors.
For example,
["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
"zones/us-west1-a"] contains 2 regions "us-central1" and
"us-west1". An error is expected in this case.
The bytes of the allowedLocations at the given index.
getAllowedLocationsCount()
publicabstractintgetAllowedLocationsCount()
A list of allowed location names represented by internal URLs.
Each location can be a region or a zone.
Only one region or multiple zones in one region is supported now.
For example,
["regions/us-central1"] allow VMs in any zones in region us-central1.
["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
in zones us-central1-a and us-central1-c.
All locations end up in different regions would cause errors.
For example,
["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
"zones/us-west1-a"] contains 2 regions "us-central1" and
"us-west1". An error is expected in this case.
A list of allowed location names represented by internal URLs.
Each location can be a region or a zone.
Only one region or multiple zones in one region is supported now.
For example,
["regions/us-central1"] allow VMs in any zones in region us-central1.
["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
in zones us-central1-a and us-central1-c.
All locations end up in different regions would cause errors.
For example,
["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
"zones/us-west1-a"] contains 2 regions "us-central1" and
"us-west1". An error is expected in this case.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Interface AllocationPolicy.LocationPolicyOrBuilder (0.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.16.0 (latest)](/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicyOrBuilder)\n- [0.15.0](/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicyOrBuilder)\n- [0.14.1](/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicyOrBuilder) \n\n public static interface AllocationPolicy.LocationPolicyOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### getAllowedLocations(int index)\n\n public abstract String getAllowedLocations(int index)\n\nA list of allowed location names represented by internal URLs.\nEach location can be a region or a zone.\nOnly one region or multiple zones in one region is supported now.\nFor example,\n\\[\"regions/us-central1\"\\] allow VMs in any zones in region us-central1.\n\\[\"zones/us-central1-a\", \"zones/us-central1-c\"\\] only allow VMs\nin zones us-central1-a and us-central1-c.\nAll locations end up in different regions would cause errors.\nFor example,\n\\[\"regions/us-central1\", \"zones/us-central1-a\", \"zones/us-central1-b\",\n\"zones/us-west1-a\"\\] contains 2 regions \"us-central1\" and\n\"us-west1\". An error is expected in this case.\n\n`repeated string allowed_locations = 1;`\n\n### getAllowedLocationsBytes(int index)\n\n public abstract ByteString getAllowedLocationsBytes(int index)\n\nA list of allowed location names represented by internal URLs.\nEach location can be a region or a zone.\nOnly one region or multiple zones in one region is supported now.\nFor example,\n\\[\"regions/us-central1\"\\] allow VMs in any zones in region us-central1.\n\\[\"zones/us-central1-a\", \"zones/us-central1-c\"\\] only allow VMs\nin zones us-central1-a and us-central1-c.\nAll locations end up in different regions would cause errors.\nFor example,\n\\[\"regions/us-central1\", \"zones/us-central1-a\", \"zones/us-central1-b\",\n\"zones/us-west1-a\"\\] contains 2 regions \"us-central1\" and\n\"us-west1\". An error is expected in this case.\n\n`repeated string allowed_locations = 1;`\n\n### getAllowedLocationsCount()\n\n public abstract int getAllowedLocationsCount()\n\nA list of allowed location names represented by internal URLs.\nEach location can be a region or a zone.\nOnly one region or multiple zones in one region is supported now.\nFor example,\n\\[\"regions/us-central1\"\\] allow VMs in any zones in region us-central1.\n\\[\"zones/us-central1-a\", \"zones/us-central1-c\"\\] only allow VMs\nin zones us-central1-a and us-central1-c.\nAll locations end up in different regions would cause errors.\nFor example,\n\\[\"regions/us-central1\", \"zones/us-central1-a\", \"zones/us-central1-b\",\n\"zones/us-west1-a\"\\] contains 2 regions \"us-central1\" and\n\"us-west1\". An error is expected in this case.\n\n`repeated string allowed_locations = 1;`\n\n### getAllowedLocationsList()\n\n public abstract List\u003cString\u003e getAllowedLocationsList()\n\nA list of allowed location names represented by internal URLs.\nEach location can be a region or a zone.\nOnly one region or multiple zones in one region is supported now.\nFor example,\n\\[\"regions/us-central1\"\\] allow VMs in any zones in region us-central1.\n\\[\"zones/us-central1-a\", \"zones/us-central1-c\"\\] only allow VMs\nin zones us-central1-a and us-central1-c.\nAll locations end up in different regions would cause errors.\nFor example,\n\\[\"regions/us-central1\", \"zones/us-central1-a\", \"zones/us-central1-b\",\n\"zones/us-west1-a\"\\] contains 2 regions \"us-central1\" and\n\"us-west1\". An error is expected in this case.\n\n`repeated string allowed_locations = 1;`"]]