public sealed class AllocationPolicy.Types.LocationPolicy : IMessage<AllocationPolicy.Types.LocationPolicy>, IEquatable<AllocationPolicy.Types.LocationPolicy>, IDeepCloneable<AllocationPolicy.Types.LocationPolicy>, IBufferMessage, IMessage
public RepeatedField<string> AllowedLocations { get; }
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.
Mixing locations from different regions would cause errors.
For example,
["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
"zones/us-west1-a"] contains locations from two distinct regions:
us-central1 and us-west1. This combination will trigger an error.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis webpage provides documentation for the \u003ccode\u003eAllocationPolicy.Types.LocationPolicy\u003c/code\u003e class within the \u003ccode\u003eGoogle.Cloud.Batch.V1\u003c/code\u003e namespace, detailing its structure and functionalities.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of this class is 2.13.0, with historical versions available back to 1.0.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAllocationPolicy.Types.LocationPolicy\u003c/code\u003e class inherits from \u003ccode\u003eobject\u003c/code\u003e and implements several interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis class includes constructors for creating new instances, as well as a property named \u003ccode\u003eAllowedLocations\u003c/code\u003e which is a \u003ccode\u003eRepeatedField\u003c/code\u003e of strings that represents the locations allowed.\u003c/p\u003e\n"],["\u003cp\u003eThis class is contained in the Google.Cloud.Batch.V1.dll assembly.\u003c/p\u003e\n"]]],[],null,["# Batch v1 API - Class AllocationPolicy.Types.LocationPolicy (2.13.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.13.0 (latest)](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [2.12.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.12.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [2.11.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.11.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.10.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.9.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.8.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.7.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.6.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.5.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.4.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.3.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.2.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.1.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.0.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/1.3.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/1.2.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/1.1.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/1.0.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy) \n\n public sealed class AllocationPolicy.Types.LocationPolicy : IMessage\u003cAllocationPolicy.Types.LocationPolicy\u003e, IEquatable\u003cAllocationPolicy.Types.LocationPolicy\u003e, IDeepCloneable\u003cAllocationPolicy.Types.LocationPolicy\u003e, IBufferMessage, IMessage\n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e AllocationPolicy.Types.LocationPolicy \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[AllocationPolicy](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy)[Types](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types)[LocationPolicy](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AllocationPolicy](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy)[Types](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types)[LocationPolicy](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[AllocationPolicy](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy)[Types](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types)[LocationPolicy](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types.LocationPolicy), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Batch.V1](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Batch.V1.dll\n\nConstructors\n------------\n\n### LocationPolicy()\n\n public LocationPolicy()\n\n### LocationPolicy(LocationPolicy)\n\n public LocationPolicy(AllocationPolicy.Types.LocationPolicy other)\n\nProperties\n----------\n\n### AllowedLocations\n\n public RepeatedField\u003cstring\u003e AllowedLocations { get; }\n\nA list of allowed location names represented by internal URLs.\n\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.\n\nMixing locations from 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 locations from two distinct regions:\nus-central1 and us-west1. This combination will trigger an error."]]