Skip to main content

network_endpoint_groups

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

Overview

Namenetwork_endpoint_groups
TypeResource
Idgoogle.compute.network_endpoint_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (uint64)Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server.
namestringName of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply withRFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
annotationsobjectOptional. Metadata defined as annotations on the network endpoint group.
appEngineobjectOptional. Only valid when networkEndpointType isSERVERLESS. Only one of cloudRun,appEngine or cloudFunction may be set. (id: NetworkEndpointGroupAppEngine)
cloudFunctionobjectOptional. Only valid when networkEndpointType isSERVERLESS. Only one of cloudRun,appEngine or cloudFunction may be set. (id: NetworkEndpointGroupCloudFunction)
cloudRunobjectOptional. Only valid when networkEndpointType isSERVERLESS. Only one of cloudRun,appEngine or cloudFunction may be set. (id: NetworkEndpointGroupCloudRun)
creationTimestampstringOutput only. [Output Only] Creation timestamp inRFC3339 text format.
defaultPortinteger (int32)The default port used if the port number is not specified in the network endpoint. Optional. If the network endpoint type is either GCE_VM_IP,SERVERLESS or PRIVATE_SERVICE_CONNECT, this field must not be specified.
descriptionstringAn optional description of this resource. Provide this property when you create the resource.
kindstringOutput only. [Output Only] Type of the resource. Alwayscompute#networkEndpointGroup for network endpoint group. (default: compute#networkEndpointGroup)
networkstringThe URL of the network to which all network endpoints in the NEG belong. For networkEndpointType GCE_VM_IP_PORT,GCE_VM_IP_PORTMAP or NON_GCP_PRIVATE_IP_PORT, if this field is not specified, a default network will be used. This field cannot be set for NEGs with networkEndpointType set toSERVERLESS or PRIVATE_SERVICE_CONNECT and for global NEGs. For all other network endpoint types, this field is required.
networkEndpointTypestringType of network endpoints in this network endpoint group. Can be one ofGCE_VM_IP, GCE_VM_IP_PORT,NON_GCP_PRIVATE_IP_PORT, INTERNET_FQDN_PORT,INTERNET_IP_PORT, SERVERLESS,PRIVATE_SERVICE_CONNECT, GCE_VM_IP_PORTMAP. (GCE_VM_IP, GCE_VM_IP_PORT, GCE_VM_IP_PORTMAP, INTERNET_FQDN_PORT, INTERNET_IP_PORT, NON_GCP_PRIVATE_IP_PORT, PRIVATE_SERVICE_CONNECT, SERVERLESS)
pscDataobjectOptional. Only valid when networkEndpointType isPRIVATE_SERVICE_CONNECT. (id: NetworkEndpointGroupPscData)
pscTargetServicestringThe target service url used to set up private service connection to a Google API or a PSC Producer Service Attachment. An example value is: asia-northeast3-cloudkms.googleapis.com. Optional. Only valid when networkEndpointType isPRIVATE_SERVICE_CONNECT.
regionstringOutput only. [Output Only] The URL of theregion where the network endpoint group is located.
selfLinkstringOutput only. [Output Only] Server-defined URL for the resource.
sizeinteger (int32)Output only. [Output only] Number of network endpoints in the network endpoint group.
subnetworkstringOptional URL of the subnetwork to which all network endpoints in the NEG belong.
zonestringOutput only. [Output Only] The URL of thezone where the network endpoint group is located.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject, zone, networkEndpointGroupReturns the specified network endpoint group.
listselectproject, zoneorderBy, filter, maxResults, pageToken, returnPartialSuccessRetrieves the list of network endpoint groups that are located in the
specified project and zone.
aggregated_listselectprojectmaxResults, pageToken, filter, serviceProjectNumber, includeAllScopes, orderBy, returnPartialSuccessRetrieves the list of network endpoint groups and sorts them by zone.

To prevent failure, Google recommends that you set the
returnPartialSuccess parameter to true.
insertinsertproject, zonerequestIdCreates a network endpoint group in the specified project using the
parameters that are included in the request.

Note: Use the following APIs to manage network endpoint groups:

-
To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
NEGs): zonal
API
-
To manage NEGs with regional scope (such as regional internet NEGs,
serverless NEGs, Private Service Connect NEGs): regional
API
-
To manage NEGs with global scope (such as global internet NEGs):global
API
deletedeleteproject, zone, networkEndpointGrouprequestIdDeletes the specified network endpoint group. The network endpoints in the
NEG and the VM instances they belong to are not terminated when the NEG is
deleted. Note that the NEG cannot be deleted if there are backend services
referencing it.
attach_network_endpointsexecproject, zone, networkEndpointGrouprequestIdAttach a list of network endpoints to the specified network endpoint group.
detach_network_endpointsexecproject, zone, networkEndpointGrouprequestIdDetach a list of network endpoints from the specified network endpoint
group.

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
networkEndpointGroupstring
projectstring
zonestring
filterstring
includeAllScopesboolean
maxResultsinteger (uint32)
orderBystring
pageTokenstring
requestIdstring
returnPartialSuccessboolean
serviceProjectNumberstring (int64)

SELECT examples

Returns the specified network endpoint group.

SELECT
id,
name,
annotations,
appEngine,
cloudFunction,
cloudRun,
creationTimestamp,
defaultPort,
description,
kind,
network,
networkEndpointType,
pscData,
pscTargetService,
region,
selfLink,
size,
subnetwork,
zone
FROM google.compute.network_endpoint_groups
WHERE project = '{{ project }}' -- required
AND zone = '{{ zone }}' -- required
AND networkEndpointGroup = '{{ networkEndpointGroup }}' -- required
;

INSERT examples

Creates a network endpoint group in the specified project using the
parameters that are included in the request.

Note: Use the following APIs to manage network endpoint groups:

-
To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
NEGs): zonal
API
-
To manage NEGs with regional scope (such as regional internet NEGs,
serverless NEGs, Private Service Connect NEGs): regional
API
-
To manage NEGs with global scope (such as global internet NEGs):global
API

INSERT INTO google.compute.network_endpoint_groups (
data__cloudFunction,
data__description,
data__name,
data__defaultPort,
data__network,
data__annotations,
data__appEngine,
data__pscData,
data__networkEndpointType,
data__subnetwork,
data__cloudRun,
data__pscTargetService,
project,
zone,
requestId
)
SELECT
'{{ cloudFunction }}',
'{{ description }}',
'{{ name }}',
{{ defaultPort }},
'{{ network }}',
'{{ annotations }}',
'{{ appEngine }}',
'{{ pscData }}',
'{{ networkEndpointType }}',
'{{ subnetwork }}',
'{{ cloudRun }}',
'{{ pscTargetService }}',
'{{ project }}',
'{{ zone }}',
'{{ requestId }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone
;

DELETE examples

Deletes the specified network endpoint group. The network endpoints in the
NEG and the VM instances they belong to are not terminated when the NEG is
deleted. Note that the NEG cannot be deleted if there are backend services
referencing it.

DELETE FROM google.compute.network_endpoint_groups
WHERE project = '{{ project }}' --required
AND zone = '{{ zone }}' --required
AND networkEndpointGroup = '{{ networkEndpointGroup }}' --required
AND requestId = '{{ requestId }}'
;

Lifecycle Methods

Attach a list of network endpoints to the specified network endpoint group.

EXEC google.compute.network_endpoint_groups.attach_network_endpoints
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@networkEndpointGroup='{{ networkEndpointGroup }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"networkEndpoints": "{{ networkEndpoints }}"
}'
;