{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-compute-engine/json-schema/google-cloud-compute-engine-network-endpoint-group-schema.json",
  "title": "NetworkEndpointGroup",
  "description": "Represents a collection of network endpoints.\n\nA network endpoint group (NEG) defines how a set of endpoints should be\nreached, whether they are reachable, and where they are located.\nFor more information about using NEGs for different use cases, seeNetwork endpoint groups overview.\n\nNote: Use the following APIs to manage network endpoint groups:\n   \n   - \n   To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity\n   NEGs): zonal\n   API\n   - \n   To manage NEGs with regional scope (such as regional internet NEGs,\n   serverless NEGs, Private Service Connect NEGs): regional\n   API\n   - \n   To manage NEGs with global scope (such as global internet NEGs):global\n   API",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-compute-engine-global-network-endpoint-groups-api-openapi.yml#/components/schemas/NetworkEndpointGroup",
  "type": "object",
  "properties": {
    "description": {
      "description": "An optional description of this resource. Provide this property when you\ncreate the resource.",
      "type": "string"
    },
    "region": {
      "type": "string",
      "readOnly": true,
      "description": "Output only. [Output Only] The URL of theregion\nwhere the network endpoint group is located."
    },
    "name": {
      "type": "string",
      "description": "Name of the resource; provided by the client when the resource is created.\nThe name must be 1-63 characters long, and comply withRFC1035.\nSpecifically, the name must be 1-63 characters long and match the regular\nexpression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first\ncharacter must be a lowercase letter, and all following characters must be\na dash, lowercase letter, or digit, except the last character, which cannot\nbe a dash."
    },
    "selfLink": {
      "readOnly": true,
      "description": "Output only. [Output Only] Server-defined URL for the resource.",
      "type": "string"
    },
    "zone": {
      "type": "string",
      "description": "Output only. [Output Only] The URL of thezone\nwhere the network endpoint group is located.",
      "readOnly": true
    },
    "cloudFunction": {
      "$ref": "#/$defs/NetworkEndpointGroupCloudFunction",
      "description": "Optional. Only valid when networkEndpointType isSERVERLESS. Only one of cloudRun,appEngine or cloudFunction may be set."
    },
    "pscData": {
      "$ref": "#/$defs/NetworkEndpointGroupPscData",
      "description": "Optional. Only valid when networkEndpointType isPRIVATE_SERVICE_CONNECT."
    },
    "size": {
      "type": "integer",
      "readOnly": true,
      "format": "int32",
      "description": "Output only. [Output only] Number of network endpoints in the network endpoint group."
    },
    "networkEndpointType": {
      "enum": [
        "GCE_VM_IP",
        "GCE_VM_IP_DEDICATED_BACKEND",
        "GCE_VM_IP_PORT",
        "GCE_VM_IP_PORTMAP",
        "INTERNET_FQDN_PORT",
        "INTERNET_IP_PORT",
        "NON_GCP_PRIVATE_IP_PORT",
        "PRIVATE_SERVICE_CONNECT",
        "SERVERLESS"
      ],
      "description": "Type 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.",
      "type": "string"
    },
    "creationTimestamp": {
      "type": "string",
      "description": "Output only. [Output Only] Creation timestamp inRFC3339\ntext format.",
      "readOnly": true
    },
    "subnetwork": {
      "type": "string",
      "description": "Optional URL of the subnetwork to which all network endpoints in the NEG\nbelong."
    },
    "pscTargetService": {
      "description": "The target service url used to set up private service connection to\na Google API or a PSC Producer Service Attachment.\nAn example value is: asia-northeast3-cloudkms.googleapis.com.\n\nOptional. Only valid when networkEndpointType isPRIVATE_SERVICE_CONNECT.",
      "type": "string"
    },
    "cloudRun": {
      "$ref": "#/$defs/NetworkEndpointGroupCloudRun",
      "description": "Optional. Only valid when networkEndpointType isSERVERLESS. Only one of cloudRun,appEngine or cloudFunction may be set."
    },
    "network": {
      "type": "string",
      "description": "The URL of the network to which all network endpoints in the NEG belong.\nFor networkEndpointType GCE_VM_IP_PORT,GCE_VM_IP_PORTMAP or NON_GCP_PRIVATE_IP_PORT,\nif this field is not specified, a default network will be used.\nThis field cannot be set for NEGs with networkEndpointType set toSERVERLESS or PRIVATE_SERVICE_CONNECT and for\nglobal NEGs.\nFor all other network endpoint types, this field is required."
    },
    "id": {
      "description": "Output only. [Output Only] The unique identifier for the resource. This identifier is\ndefined by the server.",
      "type": "string",
      "readOnly": true,
      "format": "uint64"
    },
    "annotations": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object",
      "description": "Optional. Metadata defined as annotations on the network endpoint group."
    },
    "appEngine": {
      "$ref": "#/$defs/NetworkEndpointGroupAppEngine",
      "description": "Optional. Only valid when networkEndpointType isSERVERLESS. Only one of cloudRun,appEngine or cloudFunction may be set."
    },
    "defaultPort": {
      "type": "integer",
      "format": "int32",
      "description": "The default port used if the port number is not specified in the network\nendpoint.\n\nOptional. If the network endpoint type is either GCE_VM_IP,SERVERLESS or PRIVATE_SERVICE_CONNECT, this\nfield must not be specified."
    },
    "kind": {
      "description": "Output only. [Output Only] Type of the resource. Alwayscompute#networkEndpointGroup for network endpoint group.",
      "type": "string",
      "default": "compute#networkEndpointGroup",
      "readOnly": true
    }
  },
  "$defs": {
    "NetworkEndpointGroupAppEngine": {
      "type": "object",
      "description": "Configuration for an App Engine network endpoint group (NEG).\nThe service is optional, may be provided explicitly or in the\nURL mask. The version is optional and can only be provided\nexplicitly or in the URL mask when service is present.\n\nNote: App Engine service must be in the same project and located in the\nsame region as the Serverless NEG.",
      "properties": {
        "service": {
          "type": "string",
          "description": "Optional serving service.\n\nThe service name is case-sensitive and must be 1-63\ncharacters long.\n\nExample value: default, my-service."
        },
        "version": {
          "description": "Optional serving version.\n\nThe version name is case-sensitive and must be 1-100\ncharacters long.\n\nExample value: v1, v2.",
          "type": "string"
        },
        "urlMask": {
          "description": "An URL\nmask is one of the main components of the Cloud Function.\n\nA template to parse service and version fields\nfrom a request URL. URL mask allows for routing to multiple App Engine\nservices without having to create multiple Network Endpoint Groups and\nbackend services.\n\nFor example, the request URLsfoo1-dot-appname.appspot.com/v1 andfoo1-dot-appname.appspot.com/v2 can be backed by the same\nServerless NEG with URL mask<service>-dot-appname.appspot.com/<version>.\nThe URL mask will parse them to { service = \"foo1\", version = \"v1\"\n} and { service = \"foo1\", version = \"v2\" }\nrespectively.",
          "type": "string"
        }
      }
    },
    "NetworkEndpointGroupCloudFunction": {
      "properties": {
        "urlMask": {
          "type": "string",
          "description": "An URL\nmask is one of the main components of the Cloud Function.\n\nA template to parse function field from a request URL. URL\nmask allows for routing to multiple Cloud Functions without having to\ncreate multiple Network Endpoint Groups and backend services.\n\nFor example, request URLs mydomain.com/function1 andmydomain.com/function2 can be backed by the same\nServerless NEG with URL mask /<function>. The URL\nmask will parse them to { function = \"function1\" } and{ function = \"function2\" } respectively."
        },
        "function": {
          "description": "A user-defined name of the Cloud Function.\n\nThe function name is case-sensitive and must be 1-63\ncharacters long.\n\nExample value: func1.",
          "type": "string"
        }
      },
      "type": "object",
      "description": "Configuration for a Cloud Function network endpoint group (NEG).\nThe function must be provided explicitly or in the URL mask.\n\nNote: Cloud Function must be in the same project and located in the same\nregion as the Serverless NEG."
    },
    "NetworkEndpointGroupCloudRun": {
      "description": "Configuration for a Cloud Run network endpoint group (NEG).\nThe service must be provided explicitly or in the URL mask.\nThe tag is optional, may be provided explicitly or in the URL\nmask.\n\nNote: Cloud Run service must be in the same project and located in the same\nregion as the Serverless NEG.",
      "properties": {
        "tag": {
          "type": "string",
          "description": "Optional Cloud Run tag represents the \"named-revision\" to provide additional\nfine-grained traffic routing information.\n\nThe tag must be 1-63 characters long, and comply withRFC1035.\n\nExample value: \"revision-0010\"."
        },
        "service": {
          "type": "string",
          "description": "Cloud Run service is the main resource of Cloud Run.\n\nThe service must be 1-63 characters long, and comply withRFC1035.\n\nExample value: \"run-service\"."
        },
        "urlMask": {
          "description": "An URL\nmask is one of the main components of the Cloud Function.\n\nA template to parse <service> and<tag> fields from a request URL. URL mask allows for\nrouting to multiple Run services without having to create multiple\nnetwork endpoint groups and backend services.\n\nFor example, request URLs foo1.domain.com/bar1 andfoo1.domain.com/bar2 can be backed by the same Serverless\nNetwork Endpoint Group (NEG) with URL mask<tag>.domain.com/<service>. The URL mask will\nparse them to { service=\"bar1\", tag=\"foo1\" } and {\nservice=\"bar2\", tag=\"foo2\" } respectively.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "NetworkEndpointGroupPscData": {
      "properties": {
        "producerPort": {
          "description": "The psc producer port is used to connect PSC NEG with specific port on\nthe PSC Producer side; should only be used for the\nPRIVATE_SERVICE_CONNECT NEG type",
          "format": "int32",
          "type": "integer"
        },
        "consumerPscAddress": {
          "type": "string",
          "readOnly": true,
          "description": "Output only. [Output Only] Address allocated from given subnetwork for PSC. This IP\naddress acts as a VIP for a PSC NEG, allowing it to act as an endpoint in\nL7 PSC-XLB."
        },
        "pscConnectionStatus": {
          "readOnly": true,
          "enum": [
            "ACCEPTED",
            "CLOSED",
            "NEEDS_ATTENTION",
            "PENDING",
            "REJECTED",
            "STATUS_UNSPECIFIED"
          ],
          "description": "Output only. [Output Only] The connection status of the PSC Forwarding Rule.",
          "type": "string"
        },
        "pscConnectionId": {
          "type": "string",
          "format": "uint64",
          "readOnly": true,
          "description": "Output only. [Output Only] The PSC connection id of the PSC Network Endpoint Group\nConsumer."
        }
      },
      "type": "object",
      "description": "All data that is specifically relevant to only network endpoint groups of\ntype PRIVATE_SERVICE_CONNECT."
    }
  }
}