# Google Cloud Tpu V2 Client - Class Node (2.3.0)

2.3.0 (latest) 2.2.2 2.1.2 2.0.0 1.4.7 1.3.2 1.2.0 1.1.1 1.0.5 Reference documentation and code samples for the Google Cloud Tpu V2 Client class Node.

A TPU instance.

Generated from protobuf message `google.cloud.tpu.v2.Node`

## Namespace

Google \\ Cloud \\ Tpu \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Output only. Immutable. The name of the TPU. |
| `↳ description` | `string` The user-supplied description of the TPU. Maximum of 512 characters. |
| `↳ accelerator_type` | `string` Optional. The type of hardware accelerators associated with this node. |
| `↳ state` | `int` Output only. The current state for the TPU Node. |
| `↳ health_description` | `string` Output only. If this field is populated, it contains a description of why the TPU Node is unhealthy. |
| `↳ runtime_version` | `string` Required. The runtime version running in the Node. |
| `↳ network_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.NetworkConfig` Network configurations for the TPU node. network_config and network_configs are mutually exclusive, you can only specify one of them. If both are specified, an error will be returned. |
| `↳ network_configs` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.NetworkConfig>` Optional. Repeated network configurations for the TPU node. This field is used to specify multiple networks configs for the TPU node. network_config and network_configs are mutually exclusive, you can only specify one of them. If both are specified, an error will be returned. |
| `↳ cidr_block` | `string` The CIDR block that the TPU node will use when selecting an IP address. This CIDR block must be a /29 block; the Compute Engine networks API forbids a smaller block, and using a larger block would be wasteful (a node can only consume one IP address). Errors will occur if the CIDR block has already been used for a currently existing TPU node, the CIDR block conflicts with any subnetworks in the user's provided network, or the provided network is peered with another network that is using that CIDR block. |
| `↳ service_account` | `https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.ServiceAccount` The Google Cloud Platform Service Account to be used by the TPU node VMs. If None is specified, the default compute service account will be used. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time when the node was created. |
| `↳ scheduling_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.SchedulingConfig` The scheduling options for this node. |
| `↳ network_endpoints` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.NetworkEndpoint>` Output only. The network endpoints where TPU workers can be accessed and sent work. It is recommended that runtime clients of the node reach out to the 0th entry in this map first. |
| `↳ health` | `int` The health status of the TPU node. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Resource labels to represent user-provided metadata. |
| `↳ metadata` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Custom metadata to apply to the TPU Node. Can set startup-script and shutdown-script |
| `↳ tags` | `string[]` Tags to apply to the TPU Node. Tags are used to identify valid sources or targets for network firewalls. |
| `↳ id` | `int|string` Output only. The unique identifier for the TPU Node. |
| `↳ data_disks` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.AttachedDisk>` The additional data disks for the Node. |
| `↳ api_version` | `int` Output only. The API version that created this Node. |
| `↳ symptoms` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.Symptom>` Output only. The Symptoms that have occurred to the TPU Node. |
| `↳ shielded_instance_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.ShieldedInstanceConfig` Shielded Instance options. |
| `↳ accelerator_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.AcceleratorConfig` The AccleratorConfig for the TPU Node. |
| `↳ queued_resource` | `string` Output only. The qualified name of the QueuedResource that requested this Node. |
| `↳ multislice_node` | `bool` Output only. Whether the Node belongs to a Multislice group. |

### getName

Output only. Immutable. The name of the TPU.

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

### setName

Output only. Immutable. The name of the TPU.

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

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

### getDescription

The user-supplied description of the TPU. Maximum of 512 characters.

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

### setDescription

The user-supplied description of the TPU. Maximum of 512 characters.

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

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

### getAcceleratorType

Optional. The type of hardware accelerators associated with this node.

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

### setAcceleratorType

Optional. The type of hardware accelerators associated with this node.

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

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

### getState

Output only. The current state for the TPU Node.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.Node.State). |

### setState

Output only. The current state for the TPU Node.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.Node.State). |

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

### getHealthDescription

Output only. If this field is populated, it contains a description of why
the TPU Node is unhealthy.

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

### setHealthDescription

Output only. If this field is populated, it contains a description of why
the TPU Node is unhealthy.

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

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

### getRuntimeVersion

Required. The runtime version running in the Node.

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

### setRuntimeVersion

Required. The runtime version running in the Node.

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

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

### getNetworkConfig

Network configurations for the TPU node. network_config and network_configs
are mutually exclusive, you can only specify one of them. If both are
specified, an error will be returned.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.NetworkConfig|null` |   |

### hasNetworkConfig

### clearNetworkConfig

### setNetworkConfig

Network configurations for the TPU node. network_config and network_configs
are mutually exclusive, you can only specify one of them. If both are
specified, an error will be returned.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.NetworkConfig` |

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

### getNetworkConfigs

Optional. Repeated network configurations for the TPU node. This field is
used to specify multiple networks configs for the TPU node. network_config
and network_configs are mutually exclusive, you can only specify one of
them. If both are specified, an error will be returned.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.NetworkConfig>` |   |

### setNetworkConfigs

Optional. Repeated network configurations for the TPU node. This field is
used to specify multiple networks configs for the TPU node. network_config
and network_configs are mutually exclusive, you can only specify one of
them. If both are specified, an error will be returned.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.NetworkConfig>` |

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

### getCidrBlock

The CIDR block that the TPU node will use when selecting an IP address.

This CIDR block must be a /29 block; the Compute Engine networks API
forbids a smaller block, and using a larger block would be wasteful (a
node can only consume one IP address). Errors will occur if the CIDR block
has already been used for a currently existing TPU node, the CIDR block
conflicts with any subnetworks in the user's provided network, or the
provided network is peered with another network that is using that CIDR
block.

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

### setCidrBlock

The CIDR block that the TPU node will use when selecting an IP address.

This CIDR block must be a /29 block; the Compute Engine networks API
forbids a smaller block, and using a larger block would be wasteful (a
node can only consume one IP address). Errors will occur if the CIDR block
has already been used for a currently existing TPU node, the CIDR block
conflicts with any subnetworks in the user's provided network, or the
provided network is peered with another network that is using that CIDR
block.

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

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

### getServiceAccount

The Google Cloud Platform Service Account to be used by the TPU node VMs.

If None is specified, the default compute service account will be used.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.ServiceAccount|null` |   |

### hasServiceAccount

### clearServiceAccount

### setServiceAccount

The Google Cloud Platform Service Account to be used by the TPU node VMs.

If None is specified, the default compute service account will be used.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.ServiceAccount` |

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

### getCreateTime

Output only. The time when the node was created.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The time when the node was created.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getSchedulingConfig

The scheduling options for this node.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.SchedulingConfig|null` |   |

### hasSchedulingConfig

### clearSchedulingConfig

### setSchedulingConfig

The scheduling options for this node.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.SchedulingConfig` |

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

### getNetworkEndpoints

Output only. The network endpoints where TPU workers can be accessed and
sent work. It is recommended that runtime clients of the node reach out
to the 0th entry in this map first.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.NetworkEndpoint>` |   |

### setNetworkEndpoints

Output only. The network endpoints where TPU workers can be accessed and
sent work. It is recommended that runtime clients of the node reach out
to the 0th entry in this map first.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.NetworkEndpoint>` |

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

### getHealth

The health status of the TPU node.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Health](https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.Node.Health). |

### setHealth

The health status of the TPU node.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Health](https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.Node.Health). |

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

### getLabels

Resource labels to represent user-provided metadata.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabels

Resource labels to represent user-provided metadata.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getMetadata

Custom metadata to apply to the TPU Node.

Can set startup-script and shutdown-script

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setMetadata

Custom metadata to apply to the TPU Node.

Can set startup-script and shutdown-script

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getTags

Tags to apply to the TPU Node. Tags are used to identify valid sources or
targets for network firewalls.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setTags

Tags to apply to the TPU Node. Tags are used to identify valid sources or
targets for network firewalls.

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

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

### getId

Output only. The unique identifier for the TPU Node.

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

### setId

Output only. The unique identifier for the TPU Node.

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

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

### getDataDisks

The additional data disks for the Node.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.AttachedDisk>` |   |

### setDataDisks

The additional data disks for the Node.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.AttachedDisk>` |

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

### getApiVersion

Output only. The API version that created this Node.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ApiVersion](https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.Node.ApiVersion). |

### setApiVersion

Output only. The API version that created this Node.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [ApiVersion](https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.Node.ApiVersion). |

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

### getSymptoms

Output only. The Symptoms that have occurred to the TPU Node.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.Symptom>` |   |

### setSymptoms

Output only. The Symptoms that have occurred to the TPU Node.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.Symptom>` |

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

### getShieldedInstanceConfig

Shielded Instance options.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.ShieldedInstanceConfig|null` |   |

### hasShieldedInstanceConfig

### clearShieldedInstanceConfig

### setShieldedInstanceConfig

Shielded Instance options.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.ShieldedInstanceConfig` |

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

### getAcceleratorConfig

The AccleratorConfig for the TPU Node.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.AcceleratorConfig|null` |   |

### hasAcceleratorConfig

### clearAcceleratorConfig

### setAcceleratorConfig

The AccleratorConfig for the TPU Node.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-tpu/latest/V2.AcceleratorConfig` |

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

### getQueuedResource

Output only. The qualified name of the QueuedResource that requested this
Node.

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

### setQueuedResource

Output only. The qualified name of the QueuedResource that requested this
Node.

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

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

### getMultisliceNode

Output only. Whether the Node belongs to a Multislice group.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setMultisliceNode

Output only. Whether the Node belongs to a Multislice group.

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

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