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's
project.
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 network
endpoint, you can remove the network endpoint or
delete the VM.
When you delete a VM, Google Cloud deletes all network endpoints that are
associated with the VM.
After the network endpoint is deleted,
add a network endpoint to the port mapping NEG that contains
the 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 to
recreate the NEG.
Console
In the Google Cloud console, go to the Network Endpoint Groups page.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[],[],null,["# Update port mapping services\n============================\n\nThis page describes how service producers can update\nPrivate Service Connect port mapping services.\n\nAdd a network endpoint\n----------------------\n\nYou can add network endpoints to a port mapping network endpoint group (NEG) without\nneeding to recreate the NEG.\n\nFor information about adding a network endpoint, see\n[Add networking endpoints to a port mapping NEG](/vpc/docs/create-port-mapping-service#add-endpoints).\n\nList network endpoints\n----------------------\n\nYou can list the network endpoints that are associated with a port mapping NEG. \n\n### Console\n\n1. In the Google Cloud console, go to the **Network Endpoint Groups** page.\n\n [Go to Network Endpoint Groups](https://console.cloud.google.com/compute/networkendpointgroups/list)\n2. Click the name of your port mapping NEG.\n\n### gcloud\n\nUse the [`network-endpoint-groups list-network-endpoints` command](/sdk/gcloud/reference/compute/network-endpoint-groups/list). \n\n```\ngcloud compute network-endpoint-groups list-network-endpoints NEG \\\n --region=REGION\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eNEG\u003c/var\u003e: the name of the port mapping NEG.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region of the port mapping NEG.\n\n### API\n\nSend a `POST` request to the\n[`regionNetworkEndpointGroups.listNetworkEndpoints` method](/compute/docs/reference/rest/v1/regionNetworkEndpointGroups/listNetworkEndpoints). \n\n```\nPOST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/networkEndpointGroups/NEG/listNetworkEndpoints\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the port mapping NEG's project.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region of the port mapping NEG.\n- \u003cvar translate=\"no\"\u003eNEG\u003c/var\u003e: the name of the port mapping NEG.\n\nUpdate a network endpoint\n-------------------------\n\nIf you need to update the port mapping or VM that is associated with a network\nendpoint, you can remove the network endpoint or\n[delete the VM](/compute/docs/instances/deleting-instance#delete_an_instance).\nWhen you delete a VM, Google Cloud deletes all network endpoints that are\nassociated with the VM.\n\nAfter the network endpoint is deleted,\nadd a network endpoint to the port mapping NEG that contains\nthe updated port mapping or VM.\n\nRemove a network endpoint from a port mapping NEG\n-------------------------------------------------\n\nYou can remove network endpoints from a port mapping NEG without needing to\nrecreate the NEG. \n\n### Console\n\n1. In the Google Cloud console, go to the **Network Endpoint Groups** page.\n\n [Go to Network Endpoint Groups](https://console.cloud.google.com/compute/networkendpointgroups/list)\n2. Click the name of the port mapping NEG that you want to update.\n\n3. Select the network endpoint that you want to remove.\n\n4. Click **Remove endpoint**.\n\n### gcloud\n\nUse the [`network-endpoint-groups update` command](/sdk/gcloud/reference/compute/network-endpoint-groups/update). \n\n```\ngcloud compute network-endpoint-groups update NEG \\\n --region=REGION \\\n --remove-endpoint=instance=https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eNEG\u003c/var\u003e: the name of the port mapping NEG.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region of the port mapping NEG.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the port mapping NEG's project.\n- \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone of the VM that is associated with the network endpoint to remove.\n- \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e: the name of the instance that is associated with the network endpoint to remove.\n\n### API\n\nSend a `POST` request to the\n[`regionNetworkEndpointGroups.detachNetworkEndpoints` method](/compute/docs/reference/rest/v1/regionNetworkEndpointGroups/detachNetworkEndpoints). \n\n```\nPOST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/networkEndpointGroups/NEG/detachNetworkEndpoints\n{\n \"networkEndpoints\": [\n {\n \"instance\": \"projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME\"\n }\n ]\n}\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the port mapping NEG's project.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region of the port mapping NEG.\n- \u003cvar translate=\"no\"\u003eNEG\u003c/var\u003e: the name of the port mapping NEG.\n- \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone of the VM that is associated with the network endpoint to remove.\n- \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e: the name of the instance that is associated with the network endpoint to remove."]]