Skip to main content

custom_ranges

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

Overview

Namecustom_ranges
TypeResource
Idgoogle.cloudnumberregistry.custom_ranges

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringRequired. Identifier. The resource name of the CustomRange, in the format projects/{project}/locations/{location}/customRanges/{custom_range}.
attributesarrayOptional. The attributes of the CustomRange.
descriptionstringOptional. The description of the CustomRange.
ipv4CidrRangestringOptional. The IPv4 CIDR range of the CustomRange.
ipv6CidrRangestringOptional. The IPv6 CIDR range of the CustomRange.
labelsobjectOptional. User-defined labels.
parentRangestringOptional. The resource name of the parent CustomRange, in the format projects/{project}/locations/{location}/customRanges/{custom_range}. If specified, the parent CustomRange must be in the same RegistryBook. This field is mutually exclusive with the realm field, as the Realm is inherited from the parent CustomRange.
realmstringOptional. The resource name of the Realm associated with the CustomRange, in the format projects/{project}/locations/{location}/realms/{realm}. The Realm must be in the same project as the CustomRange. This field must not be set if the parent_range field is set, as the Realm will be inherited from the parent CustomRange.
registryBookstringOutput only. The RegistryBook of the CustomRange. This field is inherited from the Realm or parent CustomRange depending on which one is specified.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, customRangesIdGets details of a single CustomRange.
listselectprojectsId, locationsIdpageSize, pageToken, orderBy, filterLists CustomRanges in a given project and location.
createinsertprojectsId, locationsIdcustomRangeId, requestIdCreates a new CustomRange in a given project and location.
patchupdateprojectsId, locationsId, customRangesIdupdateMask, requestIdUpdates the parameters of a single CustomRange.
deletedeleteprojectsId, locationsId, customRangesIdrequestId, forceDeletes a single CustomRange.
find_free_ip_rangesexecprojectsId, locationsId, customRangesIdcidrPrefixLength, requestId, rangeCountFinds free IP ranges in a single CustomRange.
show_utilizationexecprojectsId, locationsId, customRangesIdGets the details of a single CustomRange and its utilization.

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
customRangesIdstring
locationsIdstring
projectsIdstring
cidrPrefixLengthinteger (int32)
customRangeIdstring
filterstring
forceboolean
orderBystring
pageSizeinteger (int32)
pageTokenstring
rangeCountinteger (int32)
requestIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details of a single CustomRange.

SELECT
name,
attributes,
description,
ipv4CidrRange,
ipv6CidrRange,
labels,
parentRange,
realm,
registryBook
FROM google.cloudnumberregistry.custom_ranges
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND customRangesId = '{{ customRangesId }}' -- required
;

INSERT examples

Creates a new CustomRange in a given project and location.

INSERT INTO google.cloudnumberregistry.custom_ranges (
data__description,
data__labels,
data__name,
data__ipv4CidrRange,
data__ipv6CidrRange,
data__parentRange,
data__realm,
data__attributes,
projectsId,
locationsId,
customRangeId,
requestId
)
SELECT
'{{ description }}',
'{{ labels }}',
'{{ name }}',
'{{ ipv4CidrRange }}',
'{{ ipv6CidrRange }}',
'{{ parentRange }}',
'{{ realm }}',
'{{ attributes }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ customRangeId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the parameters of a single CustomRange.

UPDATE google.cloudnumberregistry.custom_ranges
SET
data__description = '{{ description }}',
data__labels = '{{ labels }}',
data__name = '{{ name }}',
data__ipv4CidrRange = '{{ ipv4CidrRange }}',
data__ipv6CidrRange = '{{ ipv6CidrRange }}',
data__parentRange = '{{ parentRange }}',
data__realm = '{{ realm }}',
data__attributes = '{{ attributes }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND customRangesId = '{{ customRangesId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single CustomRange.

DELETE FROM google.cloudnumberregistry.custom_ranges
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND customRangesId = '{{ customRangesId }}' --required
AND requestId = '{{ requestId }}'
AND force = '{{ force }}'
;

Lifecycle Methods

Finds free IP ranges in a single CustomRange.

EXEC google.cloudnumberregistry.custom_ranges.find_free_ip_ranges
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@customRangesId='{{ customRangesId }}' --required,
@cidrPrefixLength='{{ cidrPrefixLength }}',
@requestId='{{ requestId }}',
@rangeCount='{{ rangeCount }}'
;