Reference documentation and code samples for the Google Cloud Network Connectivity V1 Client class AllocationStrategy.
Enumeration of range auto-allocation strategies
Protobuf type google.cloud.networkconnectivity.v1.InternalRange.AllocationStrategy
Namespace
Google \ Cloud \ NetworkConnectivity \ V1 \ InternalRange
Methods
static::name
Parameter
Name
Description
value
mixed
static::value
Parameter
Name
Description
name
mixed
Constants
ALLOCATION_STRATEGY_UNSPECIFIED
Value: 0
Unspecified is the only valid option when the range is specified
explicitly by ip_cidr_range field. Otherwise unspefified means using the
default strategy.
Generated from protobuf enum ALLOCATION_STRATEGY_UNSPECIFIED = 0;
RANDOM
Value: 1
Random strategy, the legacy algorithm, used for backwards compatibility.
This allocation strategy remains efficient in the case of concurrent
allocation requests in the same peered network space and doesn't require
providing the level of concurrency in an explicit parameter, but it is
prone to fragmenting available address space.
Generated from protobuf enum RANDOM = 1;
FIRST_AVAILABLE
Value: 2
Pick the first available address range. This strategy is deterministic
and the result is easy to predict.
Generated from protobuf enum FIRST_AVAILABLE = 2;
RANDOM_FIRST_N_AVAILABLE
Value: 3
Pick an arbitrary range out of the first N available ones. The N will be
set in the first_available_ranges_lookup_size field. This strategy should
be used when concurrent allocation requests are made in the same space of
peered networks while the fragmentation of the addrress space is reduced.
Generated from protobuf enum RANDOM_FIRST_N_AVAILABLE = 3;
FIRST_SMALLEST_FITTING
Value: 4
Pick the smallest but fitting available range. This deterministic
strategy minimizes fragmentation of the address space.
Generated from protobuf enum FIRST_SMALLEST_FITTING = 4;
[[["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-09-04 UTC."],[],[],null,["# Google Cloud Network Connectivity V1 Client - Class AllocationStrategy (2.3.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.0 (latest)](/php/docs/reference/cloud-network-connectivity/latest/V1.InternalRange.AllocationStrategy)\n- [2.2.2](/php/docs/reference/cloud-network-connectivity/2.2.2/V1.InternalRange.AllocationStrategy)\n- [2.1.2](/php/docs/reference/cloud-network-connectivity/2.1.2/V1.InternalRange.AllocationStrategy)\n- [2.0.2](/php/docs/reference/cloud-network-connectivity/2.0.2/V1.InternalRange.AllocationStrategy)\n- [1.5.5](/php/docs/reference/cloud-network-connectivity/1.5.5/V1.InternalRange.AllocationStrategy)\n- [1.4.2](/php/docs/reference/cloud-network-connectivity/1.4.2/V1.InternalRange.AllocationStrategy)\n- [1.3.0](/php/docs/reference/cloud-network-connectivity/1.3.0/V1.InternalRange.AllocationStrategy)\n- [1.2.0](/php/docs/reference/cloud-network-connectivity/1.2.0/V1.InternalRange.AllocationStrategy)\n- [1.1.1](/php/docs/reference/cloud-network-connectivity/1.1.1/V1.InternalRange.AllocationStrategy)\n- [1.0.5](/php/docs/reference/cloud-network-connectivity/1.0.5/V1.InternalRange.AllocationStrategy) \nReference documentation and code samples for the Google Cloud Network Connectivity V1 Client class AllocationStrategy.\n\nEnumeration of range auto-allocation strategies\n\nProtobuf type `google.cloud.networkconnectivity.v1.InternalRange.AllocationStrategy`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ NetworkConnectivity \\\\ V1 \\\\ InternalRange\n\nMethods\n-------\n\n### static::name\n\n### static::value\n\nConstants\n---------\n\n### ALLOCATION_STRATEGY_UNSPECIFIED\n\n Value: 0\n\nUnspecified is the only valid option when the range is specified\nexplicitly by ip_cidr_range field. Otherwise unspefified means using the\ndefault strategy.\n\nGenerated from protobuf enum `ALLOCATION_STRATEGY_UNSPECIFIED = 0;`\n\n### RANDOM\n\n Value: 1\n\nRandom strategy, the legacy algorithm, used for backwards compatibility.\n\nThis allocation strategy remains efficient in the case of concurrent\nallocation requests in the same peered network space and doesn't require\nproviding the level of concurrency in an explicit parameter, but it is\nprone to fragmenting available address space.\n\nGenerated from protobuf enum `RANDOM = 1;`\n\n### FIRST_AVAILABLE\n\n Value: 2\n\nPick the first available address range. This strategy is deterministic\nand the result is easy to predict.\n\nGenerated from protobuf enum `FIRST_AVAILABLE = 2;`\n\n### RANDOM_FIRST_N_AVAILABLE\n\n Value: 3\n\nPick an arbitrary range out of the first N available ones. The N will be\nset in the first_available_ranges_lookup_size field. This strategy should\nbe used when concurrent allocation requests are made in the same space of\npeered networks while the fragmentation of the addrress space is reduced.\n\nGenerated from protobuf enum `RANDOM_FIRST_N_AVAILABLE = 3;`\n\n### FIRST_SMALLEST_FITTING\n\n Value: 4\n\nPick the smallest but fitting available range. This deterministic\nstrategy minimizes fragmentation of the address space.\n\nGenerated from protobuf enum `FIRST_SMALLEST_FITTING = 4;`"]]