# Compute V1 Client - Class SavedAttachedDisk (2.10.0)

2.10.0 (latest) 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.0.0 1.36.0 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 1.24.0 1.23.0 1.22.1 1.21.0 1.20.0 1.19.0 1.18.1 1.17.0 1.16.2 1.14.0 1.13.0 1.12.1 1.11.1 1.10.1 1.9.1 1.8.3 1.7.1 1.6.1 1.5.0 Reference documentation and code samples for the Compute V1 Client class SavedAttachedDisk.

DEPRECATED: Please use compute#savedDisk instead.

An instance-attached disk resource.

Generated from protobuf message `google.cloud.compute.v1.SavedAttachedDisk`

## Namespace

Google \\ Cloud \\ Compute \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ auto_delete` | `bool` Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). |
| `↳ boot` | `bool` Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem. |
| `↳ device_name` | `string` Specifies the name of the disk attached to the source instance. |
| `↳ disk_encryption_key` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.CustomerEncryptionKey` The encryption key for the disk. |
| `↳ disk_size_gb` | `int|string` The size of the disk in base-2 GB. |
| `↳ disk_type` | `string` Output only. \[Output Only\] URL of the disk type resource. For example:projects/project/zones/zone/diskTypes/pd-standard or pd-ssd |
| `↳ guest_os_features` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.GuestOsFeature>` A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. |
| `↳ index` | `int` Output only. Specifies zero-based index of the disk that is attached to the source instance. |
| `↳ interface` | `string` Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. Check the Interface enum for the list of possible values. |
| `↳ kind` | `string` Output only. \[Output Only\] Type of the resource. Alwayscompute#attachedDisk for attached disks. |
| `↳ licenses` | `string[]` Output only. \[Output Only\] Any valid publicly visible licenses. |
| `↳ mode` | `string` The mode in which this disk is attached to the source instance, eitherREAD_WRITE or READ_ONLY. Check the Mode enum for the list of possible values. |
| `↳ source` | `string` Specifies a URL of the disk attached to the source instance. |
| `↳ storage_bytes` | `int|string` Output only. \[Output Only\] A size of the storage used by the disk's snapshot by this machine image. |
| `↳ storage_bytes_status` | `string` Output only. \[Output Only\] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. Check the StorageBytesStatus enum for the list of possible values. |
| `↳ type` | `string` Specifies the type of the attached disk, either SCRATCH orPERSISTENT. Check the Type enum for the list of possible values. |

### getAutoDelete

Specifies whether the disk will be auto-deleted when the instance is
deleted (but not when the disk is detached from the instance).

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

### hasAutoDelete

### clearAutoDelete

### setAutoDelete

Specifies whether the disk will be auto-deleted when the instance is
deleted (but not when the disk is detached from the instance).

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

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

### getBoot

Indicates that this is a boot disk. The virtual machine will use the first
partition of the disk for its root filesystem.

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

### hasBoot

### clearBoot

### setBoot

Indicates that this is a boot disk. The virtual machine will use the first
partition of the disk for its root filesystem.

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

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

### getDeviceName

Specifies the name of the disk attached to the source instance.

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

### hasDeviceName

### clearDeviceName

### setDeviceName

Specifies the name of the disk attached to the source instance.

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

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

### getDiskEncryptionKey

The encryption key for the disk.

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

### hasDiskEncryptionKey

### clearDiskEncryptionKey

### setDiskEncryptionKey

The encryption key for the disk.

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

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

### getDiskSizeGb

The size of the disk in base-2 GB.

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

### hasDiskSizeGb

### clearDiskSizeGb

### setDiskSizeGb

The size of the disk in base-2 GB.

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

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

### getDiskType

Output only. \[Output Only\] URL of the disk type resource. For example:projects/project/zones/zone/diskTypes/pd-standard or
pd-ssd

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

### hasDiskType

### clearDiskType

### setDiskType

Output only. \[Output Only\] URL of the disk type resource. For example:projects/project/zones/zone/diskTypes/pd-standard or
pd-ssd

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

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

### getGuestOsFeatures

A list of features to enable on the guest operating system. Applicable only
for bootable images. Read
Enabling guest operating system features to see a list of available
options.

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

### setGuestOsFeatures

A list of features to enable on the guest operating system. Applicable only
for bootable images. Read
Enabling guest operating system features to see a list of available
options.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.GuestOsFeature>` |

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

### getIndex

Output only. Specifies zero-based index of the disk that is attached to the source
instance.

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

### hasIndex

### clearIndex

### setIndex

Output only. Specifies zero-based index of the disk that is attached to the source
instance.

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

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

### getInterface

Specifies the disk interface to use for attaching this disk, which is
either SCSI or NVME.

Check the Interface enum for the list of possible values.

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

### hasInterface

### clearInterface

### setInterface

Specifies the disk interface to use for attaching this disk, which is
either SCSI or NVME.

Check the Interface enum for the list of possible values.

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

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

### getKind

Output only. \[Output Only\] Type of the resource. Alwayscompute#attachedDisk for attached disks.

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

### hasKind

### clearKind

### setKind

Output only. \[Output Only\] Type of the resource. Alwayscompute#attachedDisk for attached disks.

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

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

### getLicenses

Output only. \[Output Only\] Any valid publicly visible licenses.

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

### setLicenses

Output only. \[Output Only\] Any valid publicly visible licenses.

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

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

### getMode

The mode in which this disk is attached to the source instance, eitherREAD_WRITE or READ_ONLY.

Check the Mode enum for the list of possible values.

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

### hasMode

### clearMode

### setMode

The mode in which this disk is attached to the source instance, eitherREAD_WRITE or READ_ONLY.

Check the Mode enum for the list of possible values.

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

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

### getSource

Specifies a URL of the disk attached to the source instance.

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

### hasSource

### clearSource

### setSource

Specifies a URL of the disk attached to the source instance.

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

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

### getStorageBytes

Output only. \[Output Only\] A size of the storage used by the disk's snapshot by this
machine image.

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

### hasStorageBytes

### clearStorageBytes

### setStorageBytes

Output only. \[Output Only\] A size of the storage used by the disk's snapshot by this
machine image.

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

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

### getStorageBytesStatus

Output only. \[Output Only\] An indicator whether storageBytes is in a
stable state or it is being adjusted as a result of shared storage
reallocation. This status can either be UPDATING, meaning
the size of the snapshot is being updated, or UP_TO_DATE,
meaning the size of the snapshot is up-to-date.

Check the StorageBytesStatus enum for the list of possible values.

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

### hasStorageBytesStatus

### clearStorageBytesStatus

### setStorageBytesStatus

Output only. \[Output Only\] An indicator whether storageBytes is in a
stable state or it is being adjusted as a result of shared storage
reallocation. This status can either be UPDATING, meaning
the size of the snapshot is being updated, or UP_TO_DATE,
meaning the size of the snapshot is up-to-date.

Check the StorageBytesStatus enum for the list of possible values.

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

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

### getType

Specifies the type of the attached disk, either SCRATCH orPERSISTENT.

Check the Type enum for the list of possible values.

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

### hasType

### clearType

### setType

Specifies the type of the attached disk, either SCRATCH orPERSISTENT.

Check the Type enum for the list of possible values.

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

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