# Google Cloud Network Management V1 Client - Class Endpoint (2.9.2)

2.9.2 (latest) 2.9.1 2.8.0 2.7.0 2.6.1 2.5.0 2.4.2 2.3.2 2.2.1 2.1.1 2.0.1 1.7.3 1.5.0 1.4.2 1.3.0 1.2.0 1.1.1 1.0.5 Reference documentation and code samples for the Google Cloud Network Management V1 Client class Endpoint.

Source or destination of the Connectivity Test.

Generated from protobuf message `google.cloud.networkmanagement.v1.Endpoint`

## Namespace

Google \\ Cloud \\ NetworkManagement \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ ip_address` | `string` The IP address of the endpoint, which can be an external or internal IP. |
| `↳ port` | `int` The IP protocol port of the endpoint. Only applicable when protocol is TCP or UDP. |
| `↳ instance` | `string` A Compute Engine instance URI. |
| `↳ forwarding_rule` | `string` A forwarding rule and its corresponding IP address represent the frontend configuration of a Google Cloud load balancer. Forwarding rules are also used for protocol forwarding, Private Service Connect and other network services to provide forwarding information in the control plane. Applicable only to destination endpoint. Format: `projects/{project}/global/forwardingRules/{id}` or `projects/{project}/regions/{region}/forwardingRules/{id}` |
| `↳ forwarding_rule_target` | `int` Output only. Specifies the type of the target of the forwarding rule. |
| `↳ load_balancer_id` | `string` Output only. ID of the load balancer the forwarding rule points to. Empty for forwarding rules not related to load balancers. |
| `↳ load_balancer_type` | `int` Output only. Type of the load balancer the forwarding rule points to. |
| `↳ gke_master_cluster` | `string` A cluster URI for [Google Kubernetes Engine cluster control plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture). |
| `↳ fqdn` | `string` DNS endpoint of [Google Kubernetes Engine cluster control plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture). Requires gke_master_cluster to be set, can't be used simultaneoulsly with ip_address or network. Applicable only to destination endpoint. |
| `↳ cloud_sql_instance` | `string` A [Cloud SQL](https://cloud.google.com/sql) instance URI. |
| `↳ redis_instance` | `string` A [Redis Instance](https://cloud.google.com/memorystore/docs/redis) URI. Applicable only to destination endpoint. |
| `↳ redis_cluster` | `string` A [Redis Cluster](https://cloud.google.com/memorystore/docs/cluster) URI. Applicable only to destination endpoint. |
| `↳ gke_pod` | `string` A [GKE Pod](https://cloud.google.com/kubernetes-engine/docs/concepts/pod) URI. |
| `↳ cloud_function` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-management/latest/V1.Endpoint.CloudFunctionEndpoint` A [Cloud Function](https://cloud.google.com/functions). Applicable only to source endpoint. |
| `↳ app_engine_version` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-management/latest/V1.Endpoint.AppEngineVersionEndpoint` An [App Engine](https://cloud.google.com/appengine) [service version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions). Applicable only to source endpoint. |
| `↳ cloud_run_revision` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-management/latest/V1.Endpoint.CloudRunRevisionEndpoint` A [Cloud Run](https://cloud.google.com/run) [revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get) Applicable only to source endpoint. |
| `↳ network` | `string` A VPC network URI. For source endpoints, used according to the `network_type`. For destination endpoints, used only when the source is an external IP address endpoint, and the destination is an internal IP address endpoint. |
| `↳ network_type` | `int` For source endpoints, type of the network where the endpoint is located. Not relevant for destination endpoints. |
| `↳ project_id` | `string` For source endpoints, endpoint project ID. Used according to the `network_type`. Not relevant for destination endpoints. |

### getIpAddress

The IP address of the endpoint, which can be an external or internal IP.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setIpAddress

The IP address of the endpoint, which can be an external or internal IP.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPort

The IP protocol port of the endpoint.

Only applicable when protocol is TCP or UDP.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setPort

The IP protocol port of the endpoint.

Only applicable when protocol is TCP or UDP.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getInstance

A Compute Engine instance URI.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setInstance

A Compute Engine instance URI.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getForwardingRule

A forwarding rule and its corresponding IP address represent the frontend
configuration of a Google Cloud load balancer. Forwarding rules are also
used for protocol forwarding, Private Service Connect and other network
services to provide forwarding information in the control plane. Applicable
only to destination endpoint. Format:
`projects/{project}/global/forwardingRules/{id}` or
`projects/{project}/regions/{region}/forwardingRules/{id}`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setForwardingRule

A forwarding rule and its corresponding IP address represent the frontend
configuration of a Google Cloud load balancer. Forwarding rules are also
used for protocol forwarding, Private Service Connect and other network
services to provide forwarding information in the control plane. Applicable
only to destination endpoint. Format:
`projects/{project}/global/forwardingRules/{id}` or
`projects/{project}/regions/{region}/forwardingRules/{id}`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getForwardingRuleTarget

Output only. Specifies the type of the target of the forwarding rule.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### hasForwardingRuleTarget

### clearForwardingRuleTarget

### setForwardingRuleTarget

Output only. Specifies the type of the target of the forwarding rule.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLoadBalancerId

Output only. ID of the load balancer the forwarding rule points to. Empty
for forwarding rules not related to load balancers.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasLoadBalancerId

### clearLoadBalancerId

### setLoadBalancerId

Output only. ID of the load balancer the forwarding rule points to. Empty
for forwarding rules not related to load balancers.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLoadBalancerType

Output only. Type of the load balancer the forwarding rule points to.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### hasLoadBalancerType

### clearLoadBalancerType

### setLoadBalancerType

Output only. Type of the load balancer the forwarding rule points to.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getGkeMasterCluster

A cluster URI for [Google Kubernetes Engine cluster control
plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setGkeMasterCluster

A cluster URI for [Google Kubernetes Engine cluster control
plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getFqdn

DNS endpoint of [Google Kubernetes Engine cluster control
plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).

Requires gke_master_cluster to be set, can't be used simultaneoulsly with
ip_address or network. Applicable only to destination endpoint.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setFqdn

DNS endpoint of [Google Kubernetes Engine cluster control
plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).

Requires gke_master_cluster to be set, can't be used simultaneoulsly with
ip_address or network. Applicable only to destination endpoint.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCloudSqlInstance

A [Cloud SQL](https://cloud.google.com/sql) instance URI.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setCloudSqlInstance

A [Cloud SQL](https://cloud.google.com/sql) instance URI.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRedisInstance

A [Redis Instance](https://cloud.google.com/memorystore/docs/redis) URI.

Applicable only to destination endpoint.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setRedisInstance

A [Redis Instance](https://cloud.google.com/memorystore/docs/redis) URI.

Applicable only to destination endpoint.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRedisCluster

A [Redis Cluster](https://cloud.google.com/memorystore/docs/cluster) URI.

Applicable only to destination endpoint.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setRedisCluster

A [Redis Cluster](https://cloud.google.com/memorystore/docs/cluster) URI.

Applicable only to destination endpoint.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getGkePod

A [GKE Pod](https://cloud.google.com/kubernetes-engine/docs/concepts/pod)
URI.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setGkePod

A [GKE Pod](https://cloud.google.com/kubernetes-engine/docs/concepts/pod)
URI.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCloudFunction

A [Cloud Function](https://cloud.google.com/functions). Applicable only to
source endpoint.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-network-management/latest/V1.Endpoint.CloudFunctionEndpoint|null` |   |

### hasCloudFunction

### clearCloudFunction

### setCloudFunction

A [Cloud Function](https://cloud.google.com/functions). Applicable only to
source endpoint.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-management/latest/V1.Endpoint.CloudFunctionEndpoint` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAppEngineVersion

An [App Engine](https://cloud.google.com/appengine) [service
version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions).

Applicable only to source endpoint.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-network-management/latest/V1.Endpoint.AppEngineVersionEndpoint|null` |   |

### hasAppEngineVersion

### clearAppEngineVersion

### setAppEngineVersion

An [App Engine](https://cloud.google.com/appengine) [service
version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions).

Applicable only to source endpoint.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-management/latest/V1.Endpoint.AppEngineVersionEndpoint` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCloudRunRevision

A [Cloud Run](https://cloud.google.com/run)
[revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get)
Applicable only to source endpoint.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-network-management/latest/V1.Endpoint.CloudRunRevisionEndpoint|null` |   |

### hasCloudRunRevision

### clearCloudRunRevision

### setCloudRunRevision

A [Cloud Run](https://cloud.google.com/run)
[revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get)
Applicable only to source endpoint.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-management/latest/V1.Endpoint.CloudRunRevisionEndpoint` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getNetwork

A VPC network URI. For source endpoints, used according to the
`network_type`. For destination endpoints, used only when the source is an
external IP address endpoint, and the destination is an internal IP address
endpoint.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setNetwork

A VPC network URI. For source endpoints, used according to the
`network_type`. For destination endpoints, used only when the source is an
external IP address endpoint, and the destination is an internal IP address
endpoint.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getNetworkType

For source endpoints, type of the network where the endpoint is located.

Not relevant for destination endpoints.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [NetworkType](https://docs.cloud.google.com/php/docs/reference/cloud-network-management/latest/V1.Endpoint.NetworkType). |

### setNetworkType

For source endpoints, type of the network where the endpoint is located.

Not relevant for destination endpoints.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [NetworkType](https://docs.cloud.google.com/php/docs/reference/cloud-network-management/latest/V1.Endpoint.NetworkType). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getProjectId

For source endpoints, endpoint project ID. Used according to the
`network_type`. Not relevant for destination endpoints.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setProjectId

For source endpoints, endpoint project ID. Used according to the
`network_type`. Not relevant for destination endpoints.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |