# Google Cloud Batch V1 Client - Class Volume (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 Volume.

Volume describes a volume and parameters for it to be mounted to a VM.

Generated from protobuf message `google.cloud.batch.v1.Volume`

## Namespace

Google \\ Cloud \\ Batch \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ nfs` | `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.NFS` A Network File System (NFS) volume. For example, a Filestore file share. |
| `↳ gcs` | `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.GCS` A Google Cloud Storage (GCS) volume. |
| `↳ device_name` | `string` Device name of an attached disk volume, which should align with a device_name specified by job.allocation_policy.instances\[0\].policy.disks\[i\].device_name or defined by the given instance template in job.allocation_policy.instances\[0\].instance_template. |
| `↳ mount_path` | `string` The mount path for the volume, e.g. /mnt/disks/share. |
| `↳ mount_options` | `string[]` Mount options vary based on the type of storage volume: \* \* For a Cloud Storage bucket, all the mount options provided by the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) are supported. \* \* For an existing persistent disk, all mount options provided by the [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) except writing are supported. This is due to restrictions of [multi-writer mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). \* \* For any other disk or a Network File System (NFS), all the mount options provided by the `mount` command are supported. |

### getNfs

A Network File System (NFS) volume. For example, a
Filestore file share.

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

### hasNfs

### setNfs

A Network File System (NFS) volume. For example, a
Filestore file share.

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

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

### getGcs

A Google Cloud Storage (GCS) volume.

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

### hasGcs

### setGcs

A Google Cloud Storage (GCS) volume.

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

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

### getDeviceName

Device name of an attached disk volume, which should align with a
device_name specified by
job.allocation_policy.instances\[0\].policy.disks\[i\].device_name or
defined by the given instance template in
job.allocation_policy.instances\[0\].instance_template.

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

### hasDeviceName

### setDeviceName

Device name of an attached disk volume, which should align with a
device_name specified by
job.allocation_policy.instances\[0\].policy.disks\[i\].device_name or
defined by the given instance template in
job.allocation_policy.instances\[0\].instance_template.

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

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

### getMountPath

The mount path for the volume, e.g. /mnt/disks/share.

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

### setMountPath

The mount path for the volume, e.g. /mnt/disks/share.

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

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

### getMountOptions

Mount options vary based on the type of storage volume:

- For a Cloud Storage bucket, all the mount options provided
  by
  the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli)
  are supported.

- For an existing persistent disk, all mount options provided by the
  [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html)
  except writing are supported. This is due to restrictions of
  [multi-writer
  mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms).

- For any other disk or a Network File System (NFS), all the mount options provided by the `mount` command are supported.

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

### setMountOptions

Mount options vary based on the type of storage volume:

- For a Cloud Storage bucket, all the mount options provided
  by
  the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli)
  are supported.

- For an existing persistent disk, all mount options provided by the
  [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html)
  except writing are supported. This is due to restrictions of
  [multi-writer
  mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms).

- For any other disk or a Network File System (NFS), all the mount options provided by the `mount` command are supported.

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

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

### getSource

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