Update port mapping services

This page describes how service producers can updatePrivate Service Connect port mapping services.

Add a network endpoint

You can add network endpoints to a port mapping network endpoint group (NEG) withoutneeding to recreate the NEG.

For information about adding a network endpoint, seeAdd networking endpoints to a port mapping NEG.

List network endpoints

You can list the network endpoints that are associated with a port mapping NEG.

Console

  1. In the Google Cloud console, go to theNetwork Endpoint Groups page.

    Go to Network Endpoint Groups

  2. Click the name of your port mapping NEG.

gcloud

Use thenetwork-endpoint-groups list-network-endpoints command.

gcloud compute network-endpoint-groups list-network-endpointsNEG \    --region=REGION

Replace the following:

  • NEG: the name of the port mapping NEG.
  • REGION: the region of the port mapping NEG.

API

Send aPOST request to theregionNetworkEndpointGroups.listNetworkEndpoints method.

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/networkEndpointGroups/NEG/listNetworkEndpoints

Replace the following:

  • PROJECT_ID: the ID of the port mapping NEG'sproject.
  • REGION: the region of the port mapping NEG.
  • NEG: the name of the port mapping NEG.

Update a network endpoint

If you need to update the port mapping or VM that is associated with a networkendpoint, you can remove the network endpoint ordelete the VM.When you delete a VM, Google Cloud deletes all network endpoints that areassociated with the VM.

After the network endpoint is deleted,add a network endpoint to the port mapping NEG that containsthe updated port mapping or VM.

Remove a network endpoint from a port mapping NEG

You can remove network endpoints from a port mapping NEG without needing torecreate the NEG.

Console

  1. In the Google Cloud console, go to theNetwork Endpoint Groups page.

    Go to Network Endpoint Groups

  2. Click the name of the port mapping NEG that you want to update.

  3. Select the network endpoint that you want to remove.

  4. ClickRemove endpoint.

gcloud

Use thenetwork-endpoint-groups update command.

gcloud compute network-endpoint-groups updateNEG \    --region=REGION \    --remove-endpoint=instance=https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME

Replace the following:

  • NEG: the name of the port mapping NEG.
  • REGION: the region of the port mapping NEG.
  • PROJECT_ID: the ID of the port mapping NEG'sproject.
  • ZONE: the zone of the VM that is associatedwith the network endpoint to remove.
  • INSTANCE_NAME: the name of the instance that isassociated with the network endpoint to remove.

API

Send aPOST request to theregionNetworkEndpointGroups.detachNetworkEndpoints method.

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/networkEndpointGroups/NEG/detachNetworkEndpoints{  "networkEndpoints": [    {      "instance": "projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME"    }  ]}

Replace the following:

  • PROJECT_ID: the ID of the port mapping NEG'sproject.
  • REGION: the region of the port mapping NEG.
  • NEG: the name of the port mapping NEG.
  • ZONE: the zone of the VM that is associatedwith the network endpoint to remove.
  • INSTANCE_NAME: the name of the instance that isassociated with the network endpoint to remove.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-18 UTC.