Skip to main content

internal_ranges

Creates, updates, deletes, gets or lists an internal_ranges resource.

Overview

Nameinternal_ranges
TypeResource
Idgoogle.networkconnectivity.internal_ranges

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. The name of an internal range. Format: projects/{project}/locations/{location}/internalRanges/{internal_range} See: https://google.aip.dev/122#fields-representing-resource-names
allocationOptionsobjectOptional. Range auto-allocation options, may be set only when auto-allocation is selected by not setting ip_cidr_range (and setting prefix_length). (id: AllocationOptions)
createTimestring (google-datetime)Time when the internal range was created.
descriptionstringOptional. A description of this resource.
excludeCidrRangesarrayOptional. ExcludeCidrRanges flag. Specifies a set of CIDR blocks that allows exclusion of particular CIDR ranges from the auto-allocation process, without having to reserve these blocks
immutablebooleanOptional. Immutable ranges cannot have their fields modified, except for labels and description.
ipCidrRangestringOptional. The IP range that this internal range defines. NOTE: IPv6 ranges are limited to usage=EXTERNAL_TO_VPC and peering=FOR_SELF. NOTE: For IPv6 Ranges this field is compulsory, i.e. the address range must be specified explicitly.
labelsobjectUser-defined labels.
migrationobjectOptional. Must be present if usage is set to FOR_MIGRATION. (id: Migration)
networkstringImmutable. The URL or resource ID of the network in which to reserve the internal range. The network cannot be deleted if there are any reserved internal ranges referring to it. Legacy networks are not supported. For example: https://www.googleapis.com/compute/v1/projects/{project}/locations/global/networks/{network} projects/{project}/locations/global/networks/{network} {network}
overlapsarrayOptional. Types of resources that are allowed to overlap with the current internal range.
peeringstringOptional. The type of peering set for this internal range.
prefixLengthinteger (int32)Optional. An alternate to ip_cidr_range. Can be set when trying to create an IPv4 reservation that automatically finds a free range of the given size. If both ip_cidr_range and prefix_length are set, there is an error if the range sizes do not match. Can also be used during updates to change the range size. NOTE: For IPv6 this field only works if ip_cidr_range is set as well, and both fields must match. In other words, with IPv6 this field only works as a redundant parameter.
targetCidrRangearrayOptional. Can be set to narrow down or pick a different address space while searching for a free range. If not set, defaults to the ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"] address space (for auto-mode networks, the "10.0.0.0/9" range is used instead of "10.0.0.0/8"). This can be used to target the search in other rfc-1918 address spaces like "172.16.0.0/12" and "192.168.0.0/16" or non-rfc-1918 address spaces used in the VPC.
updateTimestring (google-datetime)Time when the internal range was updated.
usagestringOptional. The type of usage set for this InternalRange.
usersarrayOutput only. The list of resources that refer to this internal range. Resources that use the internal range for their range allocation are referred to as users of the range. Other resources mark themselves as users while doing so by creating a reference to this internal range. Having a user, based on this reference, prevents deletion of the internal range referred to. Can be empty.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, internalRangesIdGets details of a single internal range.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists internal ranges in a given project and location.
createinsertprojectsId, locationsIdinternalRangeId, requestIdCreates a new internal range in a given project and location.
patchupdateprojectsId, locationsId, internalRangesIdupdateMask, requestIdUpdates the parameters of a single internal range.
deletedeleteprojectsId, locationsId, internalRangesIdrequestIdDeletes a single internal range.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
internalRangesIdstring
locationsIdstring
projectsIdstring
filterstring
internalRangeIdstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details of a single internal range.

SELECT
name,
allocationOptions,
createTime,
description,
excludeCidrRanges,
immutable,
ipCidrRange,
labels,
migration,
network,
overlaps,
peering,
prefixLength,
targetCidrRange,
updateTime,
usage,
users
FROM google.networkconnectivity.internal_ranges
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND internalRangesId = '{{ internalRangesId }}' -- required;

INSERT examples

Creates a new internal range in a given project and location.

INSERT INTO google.networkconnectivity.internal_ranges (
data__name,
data__createTime,
data__updateTime,
data__labels,
data__description,
data__ipCidrRange,
data__network,
data__usage,
data__peering,
data__prefixLength,
data__targetCidrRange,
data__overlaps,
data__migration,
data__immutable,
data__allocationOptions,
data__excludeCidrRanges,
projectsId,
locationsId,
internalRangeId,
requestId
)
SELECT
'{{ name }}',
'{{ createTime }}',
'{{ updateTime }}',
'{{ labels }}',
'{{ description }}',
'{{ ipCidrRange }}',
'{{ network }}',
'{{ usage }}',
'{{ peering }}',
{{ prefixLength }},
'{{ targetCidrRange }}',
'{{ overlaps }}',
'{{ migration }}',
{{ immutable }},
'{{ allocationOptions }}',
'{{ excludeCidrRanges }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ internalRangeId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the parameters of a single internal range.

UPDATE google.networkconnectivity.internal_ranges
SET
data__name = '{{ name }}',
data__createTime = '{{ createTime }}',
data__updateTime = '{{ updateTime }}',
data__labels = '{{ labels }}',
data__description = '{{ description }}',
data__ipCidrRange = '{{ ipCidrRange }}',
data__network = '{{ network }}',
data__usage = '{{ usage }}',
data__peering = '{{ peering }}',
data__prefixLength = {{ prefixLength }},
data__targetCidrRange = '{{ targetCidrRange }}',
data__overlaps = '{{ overlaps }}',
data__migration = '{{ migration }}',
data__immutable = {{ immutable }},
data__allocationOptions = '{{ allocationOptions }}',
data__excludeCidrRanges = '{{ excludeCidrRanges }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND internalRangesId = '{{ internalRangesId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single internal range.

DELETE FROM google.networkconnectivity.internal_ranges
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND internalRangesId = '{{ internalRangesId }}' --required
AND requestId = '{{ requestId }}';