internal_ranges
Creates, updates, deletes, gets or lists an internal_ranges
resource.
Overview
Name | internal_ranges |
Type | Resource |
Id | google.networkconnectivity.internal_ranges |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. The name of an internal range. Format: projects/{project}/locations/{location}/internalRanges/{internal_range} See: https://google.aip.dev/122#fields-representing-resource-names |
allocationOptions | object | Optional. 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) |
createTime | string (google-datetime) | Time when the internal range was created. |
description | string | Optional. A description of this resource. |
excludeCidrRanges | array | Optional. 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 |
immutable | boolean | Optional. Immutable ranges cannot have their fields modified, except for labels and description. |
ipCidrRange | string | Optional. 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. |
labels | object | User-defined labels. |
migration | object | Optional. Must be present if usage is set to FOR_MIGRATION. (id: Migration) |
network | string | Immutable. 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} |
overlaps | array | Optional. Types of resources that are allowed to overlap with the current internal range. |
peering | string | Optional. The type of peering set for this internal range. |
prefixLength | integer (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. |
targetCidrRange | array | Optional. 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. |
updateTime | string (google-datetime) | Time when the internal range was updated. |
usage | string | Optional. The type of usage set for this InternalRange. |
users | array | Output 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. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. The name of an internal range. Format: projects/{project}/locations/{location}/internalRanges/{internal_range} See: https://google.aip.dev/122#fields-representing-resource-names |
allocationOptions | object | Optional. 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) |
createTime | string (google-datetime) | Time when the internal range was created. |
description | string | Optional. A description of this resource. |
excludeCidrRanges | array | Optional. 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 |
immutable | boolean | Optional. Immutable ranges cannot have their fields modified, except for labels and description. |
ipCidrRange | string | Optional. 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. |
labels | object | User-defined labels. |
migration | object | Optional. Must be present if usage is set to FOR_MIGRATION. (id: Migration) |
network | string | Immutable. 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} |
overlaps | array | Optional. Types of resources that are allowed to overlap with the current internal range. |
peering | string | Optional. The type of peering set for this internal range. |
prefixLength | integer (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. |
targetCidrRange | array | Optional. 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. |
updateTime | string (google-datetime) | Time when the internal range was updated. |
usage | string | Optional. The type of usage set for this InternalRange. |
users | array | Output 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:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , internalRangesId | Gets details of a single internal range. | |
list | select | projectsId , locationsId | pageSize , pageToken , filter , orderBy | Lists internal ranges in a given project and location. |
create | insert | projectsId , locationsId | internalRangeId , requestId | Creates a new internal range in a given project and location. |
patch | update | projectsId , locationsId , internalRangesId | updateMask , requestId | Updates the parameters of a single internal range. |
delete | delete | projectsId , locationsId , internalRangesId | requestId | Deletes 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.
Name | Datatype | Description |
---|---|---|
internalRangesId | string | |
locationsId | string | |
projectsId | string | |
filter | string | |
internalRangeId | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
requestId | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
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;
Lists internal ranges in a given project and location.
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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}';
INSERT
examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: internal_ranges
props:
- name: projectsId
value: string
description: Required parameter for the internal_ranges resource.
- name: locationsId
value: string
description: Required parameter for the internal_ranges resource.
- name: name
value: string
description: >
Identifier. The name of an internal range. Format: projects/{project}/locations/{location}/internalRanges/{internal_range} See: https://google.aip.dev/122#fields-representing-resource-names
- name: createTime
value: string
description: >
Time when the internal range was created.
- name: updateTime
value: string
description: >
Time when the internal range was updated.
- name: labels
value: object
description: >
User-defined labels.
- name: description
value: string
description: >
Optional. A description of this resource.
- name: ipCidrRange
value: string
description: >
Optional. 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.
- name: network
value: string
description: >
Immutable. 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}
- name: usage
value: string
description: >
Optional. The type of usage set for this InternalRange.
valid_values: ['USAGE_UNSPECIFIED', 'FOR_VPC', 'EXTERNAL_TO_VPC', 'FOR_MIGRATION']
- name: peering
value: string
description: >
Optional. The type of peering set for this internal range.
valid_values: ['PEERING_UNSPECIFIED', 'FOR_SELF', 'FOR_PEER', 'NOT_SHARED']
- name: prefixLength
value: integer
description: >
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.
- name: targetCidrRange
value: array
description: >
Optional. 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.
- name: overlaps
value: array
description: >
Optional. Types of resources that are allowed to overlap with the current internal range.
- name: migration
value: object
description: >
Optional. Must be present if usage is set to FOR_MIGRATION.
- name: immutable
value: boolean
description: >
Optional. Immutable ranges cannot have their fields modified, except for labels and description.
- name: allocationOptions
value: object
description: >
Optional. Range auto-allocation options, may be set only when auto-allocation is selected by not setting ip_cidr_range (and setting prefix_length).
- name: excludeCidrRanges
value: array
description: >
Optional. 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
- name: internalRangeId
value: string
- name: requestId
value: string
UPDATE
examples
- patch
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
- delete
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 }}';