Skip to main content

internal_ranges

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

Overview

Nameinternal_ranges
TypeResource
Idgoogle.networkconnectivity.internal_ranges

Fields

NameDatatypeDescription
namestringImmutable. The name of an internal range. Format: projects/{project}/locations/{location}/internalRanges/{internal_range} See: https://google.aip.dev/122#fields-representing-resource-names
descriptionstringA description of this resource.
createTimestringTime when the internal range was created.
ipCidrRangestringThe IP range that this internal range defines.
labelsobjectUser-defined labels.
networkstringThe 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.
peeringstringThe type of peering set for this internal range.
prefixLengthintegerAn alternate to ip_cidr_range. Can be set when trying to create a 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.
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" address space. This can be used to 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.
updateTimestringTime when the internal range was updated.
usagestringThe 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

NameAccessible byRequired ParamsDescription
getSELECTinternalRangesId, locationsId, projectsIdGets details of a single internal range.
listSELECTlocationsId, projectsIdLists internal ranges in a given project and location.
createINSERTlocationsId, projectsIdCreates a new internal range in a given project and location.
deleteDELETEinternalRangesId, locationsId, projectsIdDeletes a single internal range.
patchUPDATEinternalRangesId, locationsId, projectsIdUpdates the parameters of a single internal range.

SELECT examples

Lists internal ranges in a given project and location.

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

INSERT example

Use the following StackQL query and manifest file to create a new internal_ranges resource.

/*+ create */
INSERT INTO google.networkconnectivity.internal_ranges (
locationsId,
projectsId,
name,
labels,
description,
ipCidrRange,
network,
usage,
peering,
prefixLength,
targetCidrRange,
overlaps
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ labels }}',
'{{ description }}',
'{{ ipCidrRange }}',
'{{ network }}',
'{{ usage }}',
'{{ peering }}',
'{{ prefixLength }}',
'{{ targetCidrRange }}',
'{{ overlaps }}'
;

UPDATE example

Updates a internal_ranges resource.

/*+ update */
UPDATE google.networkconnectivity.internal_ranges
SET
name = '{{ name }}',
labels = '{{ labels }}',
description = '{{ description }}',
ipCidrRange = '{{ ipCidrRange }}',
network = '{{ network }}',
usage = '{{ usage }}',
peering = '{{ peering }}',
prefixLength = '{{ prefixLength }}',
targetCidrRange = '{{ targetCidrRange }}',
overlaps = '{{ overlaps }}'
WHERE
internalRangesId = '{{ internalRangesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified internal_ranges resource.

/*+ delete */
DELETE FROM google.networkconnectivity.internal_ranges
WHERE internalRangesId = '{{ internalRangesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';