# Google Cloud Tpu V2 Client - Class AttachedDisk (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 AttachedDisk.

A node-attached disk resource.

Next ID: 8;

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

## Namespace

Google \\ Cloud \\ Tpu \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ source_disk` | `string` Specifies the full path to an existing disk. For example: "projects/my-project/zones/us-central1-c/disks/my-disk". |
| `↳ mode` | `int` The mode in which to attach this disk. If not specified, the default is READ_WRITE mode. Only applicable to data_disks. |

### getSourceDisk

Specifies the full path to an existing disk.

For example: "projects/my-project/zones/us-central1-c/disks/my-disk".

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

### setSourceDisk

Specifies the full path to an existing disk.

For example: "projects/my-project/zones/us-central1-c/disks/my-disk".

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

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

### getMode

The mode in which to attach this disk.

If not specified, the default is READ_WRITE mode.
Only applicable to data_disks.

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

### setMode

The mode in which to attach this disk.

If not specified, the default is READ_WRITE mode.
Only applicable to data_disks.

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

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