# Google Cloud Batch V1 Client - Class AttachedDisk (1.4.1)

1.4.1 (latest) 1.4.0 1.3.1 1.2.2 1.1.7 1.0.3 0.17.0 0.16.10 0.15.0 0.14.0 0.13.1 0.12.1 0.11.3 0.10.0 0.9.0 0.8.0 0.7.0 0.6.0 0.5.2 0.4.0 0.3.0 0.2.2 Reference documentation and code samples for the Google Cloud Batch V1 Client class AttachedDisk.

A new or an existing persistent disk (PD) or a local ssd attached to a VM
instance.

Generated from protobuf message `google.cloud.batch.v1.AllocationPolicy.AttachedDisk`

## Namespace

Google \\ Cloud \\ Batch \\ V1 \\ AllocationPolicy

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ new_disk` | `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.AllocationPolicy.Disk` |
| `↳ existing_disk` | `string` Name of an existing PD. |
| `↳ device_name` | `string` Device name that the guest operating system will see. It is used by Runnable.volumes field to mount disks. So please specify the device_name if you want Batch to help mount the disk, and it should match the device_name field in volumes. |

### getNewDisk

Generated from protobuf field `.google.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.AllocationPolicy.Disk|null` |   |

### hasNewDisk

### setNewDisk

Generated from protobuf field `.google.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.AllocationPolicy.Disk` |

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

### getExistingDisk

Name of an existing PD.

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

### hasExistingDisk

### setExistingDisk

Name of an existing PD.

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

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

### getDeviceName

Device name that the guest operating system will see.

It is used by Runnable.volumes field to mount disks. So please specify
the device_name if you want Batch to help mount the disk, and it should
match the device_name field in volumes.

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

### setDeviceName

Device name that the guest operating system will see.

It is used by Runnable.volumes field to mount disks. So please specify
the device_name if you want Batch to help mount the disk, and it should
match the device_name field in volumes.

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

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

### getAttached

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