Class AttachedDisk.Builder (1.53.0)

public static final class AttachedDisk.Builder extends GeneratedMessageV3.Builder<AttachedDisk.Builder> implements AttachedDiskOrBuilder

An instance-attached disk resource.

Protobuf type google.cloud.compute.v1.AttachedDisk

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllGuestOsFeatures(Iterable<? extends GuestOsFeature> values)

public AttachedDisk.Builder addAllGuestOsFeatures(Iterable<? extends GuestOsFeature> values)

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameter
Name Description
values Iterable<? extends com.google.cloud.compute.v1.GuestOsFeature>
Returns
Type Description
AttachedDisk.Builder

addAllLicenses(Iterable<String> values)

public AttachedDisk.Builder addAllLicenses(Iterable<String> values)

[Output Only] Any valid publicly visible licenses.

repeated string licenses = 337642578;

Parameter
Name Description
values Iterable<String>

The licenses to add.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

addGuestOsFeatures(GuestOsFeature value)

public AttachedDisk.Builder addGuestOsFeatures(GuestOsFeature value)

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameter
Name Description
value GuestOsFeature
Returns
Type Description
AttachedDisk.Builder

addGuestOsFeatures(GuestOsFeature.Builder builderForValue)

public AttachedDisk.Builder addGuestOsFeatures(GuestOsFeature.Builder builderForValue)

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameter
Name Description
builderForValue GuestOsFeature.Builder
Returns
Type Description
AttachedDisk.Builder

addGuestOsFeatures(int index, GuestOsFeature value)

public AttachedDisk.Builder addGuestOsFeatures(int index, GuestOsFeature value)

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameters
Name Description
index int
value GuestOsFeature
Returns
Type Description
AttachedDisk.Builder

addGuestOsFeatures(int index, GuestOsFeature.Builder builderForValue)

public AttachedDisk.Builder addGuestOsFeatures(int index, GuestOsFeature.Builder builderForValue)

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameters
Name Description
index int
builderForValue GuestOsFeature.Builder
Returns
Type Description
AttachedDisk.Builder

addGuestOsFeaturesBuilder()

public GuestOsFeature.Builder addGuestOsFeaturesBuilder()

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Returns
Type Description
GuestOsFeature.Builder

addGuestOsFeaturesBuilder(int index)

public GuestOsFeature.Builder addGuestOsFeaturesBuilder(int index)

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameter
Name Description
index int
Returns
Type Description
GuestOsFeature.Builder

addLicenses(String value)

public AttachedDisk.Builder addLicenses(String value)

[Output Only] Any valid publicly visible licenses.

repeated string licenses = 337642578;

Parameter
Name Description
value String

The licenses to add.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

addLicensesBytes(ByteString value)

public AttachedDisk.Builder addLicensesBytes(ByteString value)

[Output Only] Any valid publicly visible licenses.

repeated string licenses = 337642578;

Parameter
Name Description
value ByteString

The bytes of the licenses to add.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public AttachedDisk.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AttachedDisk.Builder
Overrides

build()

public AttachedDisk build()
Returns
Type Description
AttachedDisk

buildPartial()

public AttachedDisk buildPartial()
Returns
Type Description
AttachedDisk

clear()

public AttachedDisk.Builder clear()
Returns
Type Description
AttachedDisk.Builder
Overrides

clearArchitecture()

public AttachedDisk.Builder clearArchitecture()

[Output Only] The architecture of the attached disk. Valid values are ARM64 or X86_64. Check the Architecture enum for the list of possible values.

optional string architecture = 302803283;

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

clearAutoDelete()

public AttachedDisk.Builder clearAutoDelete()

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

optional bool auto_delete = 464761403;

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

clearBoot()

public AttachedDisk.Builder clearBoot()

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

optional bool boot = 3029746;

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

clearDeviceName()

public AttachedDisk.Builder clearDeviceName()

Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.

optional string device_name = 67541716;

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

clearDiskEncryptionKey()

public AttachedDisk.Builder clearDiskEncryptionKey()

Encrypts or decrypts a disk using a customer-supplied encryption key. If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.

optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677;

Returns
Type Description
AttachedDisk.Builder

clearDiskSizeGb()

public AttachedDisk.Builder clearDiskSizeGb()

The size of the disk in GB.

optional int64 disk_size_gb = 316263735;

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public AttachedDisk.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
AttachedDisk.Builder
Overrides

clearForceAttach()

public AttachedDisk.Builder clearForceAttach()

[Input Only] Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error.

optional bool force_attach = 142758425;

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

clearGuestOsFeatures()

public AttachedDisk.Builder clearGuestOsFeatures()

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Returns
Type Description
AttachedDisk.Builder

clearIndex()

public AttachedDisk.Builder clearIndex()

[Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number.

optional int32 index = 100346066;

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

clearInitializeParams()

public AttachedDisk.Builder clearInitializeParams()

[Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. This property is mutually exclusive with the source property; you can only define one or the other, but not both.

optional .google.cloud.compute.v1.AttachedDiskInitializeParams initialize_params = 17697045;

Returns
Type Description
AttachedDisk.Builder

clearInterface()

public AttachedDisk.Builder clearInterface()

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. For most machine types, the default is SCSI. Local SSDs can use either NVME or SCSI. In certain configurations, persistent disks can use NVMe. For more information, see About persistent disks. Check the Interface enum for the list of possible values.

optional string interface = 502623545;

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

clearKind()

public AttachedDisk.Builder clearKind()

[Output Only] Type of the resource. Always compute#attachedDisk for attached disks.

optional string kind = 3292052;

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

clearLicenses()

public AttachedDisk.Builder clearLicenses()

[Output Only] Any valid publicly visible licenses.

repeated string licenses = 337642578;

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

clearMode()

public AttachedDisk.Builder clearMode()

The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. Check the Mode enum for the list of possible values.

optional string mode = 3357091;

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public AttachedDisk.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
AttachedDisk.Builder
Overrides

clearSavedState()

public AttachedDisk.Builder clearSavedState()

For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this field is set to PRESERVED if the LocalSSD data has been saved to a persistent location by customer request. (see the discard_local_ssd option on Stop/Suspend). Read-only in the api. Check the SavedState enum for the list of possible values.

optional string saved_state = 411587801;

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

clearShieldedInstanceInitialState()

public AttachedDisk.Builder clearShieldedInstanceInitialState()

[Output Only] shielded vm initial state stored on disk

optional .google.cloud.compute.v1.InitialStateConfig shielded_instance_initial_state = 192356867;

Returns
Type Description
AttachedDisk.Builder

clearSource()

public AttachedDisk.Builder clearSource()

Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. Note that for InstanceTemplate, specify the disk name for zonal disk, and the URL for regional disk.

optional string source = 177235995;

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

clearType()

public AttachedDisk.Builder clearType()

Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. Check the Type enum for the list of possible values.

optional string type = 3575610;

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

clone()

public AttachedDisk.Builder clone()
Returns
Type Description
AttachedDisk.Builder
Overrides

getArchitecture()

public String getArchitecture()

[Output Only] The architecture of the attached disk. Valid values are ARM64 or X86_64. Check the Architecture enum for the list of possible values.

optional string architecture = 302803283;

Returns
Type Description
String

The architecture.

getArchitectureBytes()

public ByteString getArchitectureBytes()

[Output Only] The architecture of the attached disk. Valid values are ARM64 or X86_64. Check the Architecture enum for the list of possible values.

optional string architecture = 302803283;

Returns
Type Description
ByteString

The bytes for architecture.

getAutoDelete()

public boolean getAutoDelete()

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

optional bool auto_delete = 464761403;

Returns
Type Description
boolean

The autoDelete.

getBoot()

public boolean getBoot()

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

optional bool boot = 3029746;

Returns
Type Description
boolean

The boot.

getDefaultInstanceForType()

public AttachedDisk getDefaultInstanceForType()
Returns
Type Description
AttachedDisk

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDeviceName()

public String getDeviceName()

Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.

optional string device_name = 67541716;

Returns
Type Description
String

The deviceName.

getDeviceNameBytes()

public ByteString getDeviceNameBytes()

Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.

optional string device_name = 67541716;

Returns
Type Description
ByteString

The bytes for deviceName.

getDiskEncryptionKey()

public CustomerEncryptionKey getDiskEncryptionKey()

Encrypts or decrypts a disk using a customer-supplied encryption key. If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.

optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677;

Returns
Type Description
CustomerEncryptionKey

The diskEncryptionKey.

getDiskEncryptionKeyBuilder()

public CustomerEncryptionKey.Builder getDiskEncryptionKeyBuilder()

Encrypts or decrypts a disk using a customer-supplied encryption key. If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.

optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677;

Returns
Type Description
CustomerEncryptionKey.Builder

getDiskEncryptionKeyOrBuilder()

public CustomerEncryptionKeyOrBuilder getDiskEncryptionKeyOrBuilder()

Encrypts or decrypts a disk using a customer-supplied encryption key. If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.

optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677;

Returns
Type Description
CustomerEncryptionKeyOrBuilder

getDiskSizeGb()

public long getDiskSizeGb()

The size of the disk in GB.

optional int64 disk_size_gb = 316263735;

Returns
Type Description
long

The diskSizeGb.

getForceAttach()

public boolean getForceAttach()

[Input Only] Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error.

optional bool force_attach = 142758425;

Returns
Type Description
boolean

The forceAttach.

getGuestOsFeatures(int index)

public GuestOsFeature getGuestOsFeatures(int index)

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameter
Name Description
index int
Returns
Type Description
GuestOsFeature

getGuestOsFeaturesBuilder(int index)

public GuestOsFeature.Builder getGuestOsFeaturesBuilder(int index)

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameter
Name Description
index int
Returns
Type Description
GuestOsFeature.Builder

getGuestOsFeaturesBuilderList()

public List<GuestOsFeature.Builder> getGuestOsFeaturesBuilderList()

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Returns
Type Description
List<Builder>

getGuestOsFeaturesCount()

public int getGuestOsFeaturesCount()

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Returns
Type Description
int

getGuestOsFeaturesList()

public List<GuestOsFeature> getGuestOsFeaturesList()

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Returns
Type Description
List<GuestOsFeature>

getGuestOsFeaturesOrBuilder(int index)

public GuestOsFeatureOrBuilder getGuestOsFeaturesOrBuilder(int index)

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameter
Name Description
index int
Returns
Type Description
GuestOsFeatureOrBuilder

getGuestOsFeaturesOrBuilderList()

public List<? extends GuestOsFeatureOrBuilder> getGuestOsFeaturesOrBuilderList()

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Returns
Type Description
List<? extends com.google.cloud.compute.v1.GuestOsFeatureOrBuilder>

getIndex()

public int getIndex()

[Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number.

optional int32 index = 100346066;

Returns
Type Description
int

The index.

getInitializeParams()

public AttachedDiskInitializeParams getInitializeParams()

[Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. This property is mutually exclusive with the source property; you can only define one or the other, but not both.

optional .google.cloud.compute.v1.AttachedDiskInitializeParams initialize_params = 17697045;

Returns
Type Description
AttachedDiskInitializeParams

The initializeParams.

getInitializeParamsBuilder()

public AttachedDiskInitializeParams.Builder getInitializeParamsBuilder()

[Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. This property is mutually exclusive with the source property; you can only define one or the other, but not both.

optional .google.cloud.compute.v1.AttachedDiskInitializeParams initialize_params = 17697045;

Returns
Type Description
AttachedDiskInitializeParams.Builder

getInitializeParamsOrBuilder()

public AttachedDiskInitializeParamsOrBuilder getInitializeParamsOrBuilder()

[Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. This property is mutually exclusive with the source property; you can only define one or the other, but not both.

optional .google.cloud.compute.v1.AttachedDiskInitializeParams initialize_params = 17697045;

Returns
Type Description
AttachedDiskInitializeParamsOrBuilder

getInterface()

public String getInterface()

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. For most machine types, the default is SCSI. Local SSDs can use either NVME or SCSI. In certain configurations, persistent disks can use NVMe. For more information, see About persistent disks. Check the Interface enum for the list of possible values.

optional string interface = 502623545;

Returns
Type Description
String

The interface.

getInterfaceBytes()

public ByteString getInterfaceBytes()

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. For most machine types, the default is SCSI. Local SSDs can use either NVME or SCSI. In certain configurations, persistent disks can use NVMe. For more information, see About persistent disks. Check the Interface enum for the list of possible values.

optional string interface = 502623545;

Returns
Type Description
ByteString

The bytes for interface.

getKind()

public String getKind()

[Output Only] Type of the resource. Always compute#attachedDisk for attached disks.

optional string kind = 3292052;

Returns
Type Description
String

The kind.

getKindBytes()

public ByteString getKindBytes()

[Output Only] Type of the resource. Always compute#attachedDisk for attached disks.

optional string kind = 3292052;

Returns
Type Description
ByteString

The bytes for kind.

getLicenses(int index)

public String getLicenses(int index)

[Output Only] Any valid publicly visible licenses.

repeated string licenses = 337642578;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The licenses at the given index.

getLicensesBytes(int index)

public ByteString getLicensesBytes(int index)

[Output Only] Any valid publicly visible licenses.

repeated string licenses = 337642578;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the licenses at the given index.

getLicensesCount()

public int getLicensesCount()

[Output Only] Any valid publicly visible licenses.

repeated string licenses = 337642578;

Returns
Type Description
int

The count of licenses.

getLicensesList()

public ProtocolStringList getLicensesList()

[Output Only] Any valid publicly visible licenses.

repeated string licenses = 337642578;

Returns
Type Description
ProtocolStringList

A list containing the licenses.

getMode()

public String getMode()

The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. Check the Mode enum for the list of possible values.

optional string mode = 3357091;

Returns
Type Description
String

The mode.

getModeBytes()

public ByteString getModeBytes()

The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. Check the Mode enum for the list of possible values.

optional string mode = 3357091;

Returns
Type Description
ByteString

The bytes for mode.

getSavedState()

public String getSavedState()

For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this field is set to PRESERVED if the LocalSSD data has been saved to a persistent location by customer request. (see the discard_local_ssd option on Stop/Suspend). Read-only in the api. Check the SavedState enum for the list of possible values.

optional string saved_state = 411587801;

Returns
Type Description
String

The savedState.

getSavedStateBytes()

public ByteString getSavedStateBytes()

For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this field is set to PRESERVED if the LocalSSD data has been saved to a persistent location by customer request. (see the discard_local_ssd option on Stop/Suspend). Read-only in the api. Check the SavedState enum for the list of possible values.

optional string saved_state = 411587801;

Returns
Type Description
ByteString

The bytes for savedState.

getShieldedInstanceInitialState()

public InitialStateConfig getShieldedInstanceInitialState()

[Output Only] shielded vm initial state stored on disk

optional .google.cloud.compute.v1.InitialStateConfig shielded_instance_initial_state = 192356867;

Returns
Type Description
InitialStateConfig

The shieldedInstanceInitialState.

getShieldedInstanceInitialStateBuilder()

public InitialStateConfig.Builder getShieldedInstanceInitialStateBuilder()

[Output Only] shielded vm initial state stored on disk

optional .google.cloud.compute.v1.InitialStateConfig shielded_instance_initial_state = 192356867;

Returns
Type Description
InitialStateConfig.Builder

getShieldedInstanceInitialStateOrBuilder()

public InitialStateConfigOrBuilder getShieldedInstanceInitialStateOrBuilder()

[Output Only] shielded vm initial state stored on disk

optional .google.cloud.compute.v1.InitialStateConfig shielded_instance_initial_state = 192356867;

Returns
Type Description
InitialStateConfigOrBuilder

getSource()

public String getSource()

Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. Note that for InstanceTemplate, specify the disk name for zonal disk, and the URL for regional disk.

optional string source = 177235995;

Returns
Type Description
String

The source.

getSourceBytes()

public ByteString getSourceBytes()

Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. Note that for InstanceTemplate, specify the disk name for zonal disk, and the URL for regional disk.

optional string source = 177235995;

Returns
Type Description
ByteString

The bytes for source.

getType()

public String getType()

Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. Check the Type enum for the list of possible values.

optional string type = 3575610;

Returns
Type Description
String

The type.

getTypeBytes()

public ByteString getTypeBytes()

Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. Check the Type enum for the list of possible values.

optional string type = 3575610;

Returns
Type Description
ByteString

The bytes for type.

hasArchitecture()

public boolean hasArchitecture()

[Output Only] The architecture of the attached disk. Valid values are ARM64 or X86_64. Check the Architecture enum for the list of possible values.

optional string architecture = 302803283;

Returns
Type Description
boolean

Whether the architecture field is set.

hasAutoDelete()

public boolean hasAutoDelete()

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

optional bool auto_delete = 464761403;

Returns
Type Description
boolean

Whether the autoDelete field is set.

hasBoot()

public boolean hasBoot()

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

optional bool boot = 3029746;

Returns
Type Description
boolean

Whether the boot field is set.

hasDeviceName()

public boolean hasDeviceName()

Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.

optional string device_name = 67541716;

Returns
Type Description
boolean

Whether the deviceName field is set.

hasDiskEncryptionKey()

public boolean hasDiskEncryptionKey()

Encrypts or decrypts a disk using a customer-supplied encryption key. If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.

optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677;

Returns
Type Description
boolean

Whether the diskEncryptionKey field is set.

hasDiskSizeGb()

public boolean hasDiskSizeGb()

The size of the disk in GB.

optional int64 disk_size_gb = 316263735;

Returns
Type Description
boolean

Whether the diskSizeGb field is set.

hasForceAttach()

public boolean hasForceAttach()

[Input Only] Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error.

optional bool force_attach = 142758425;

Returns
Type Description
boolean

Whether the forceAttach field is set.

hasIndex()

public boolean hasIndex()

[Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number.

optional int32 index = 100346066;

Returns
Type Description
boolean

Whether the index field is set.

hasInitializeParams()

public boolean hasInitializeParams()

[Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. This property is mutually exclusive with the source property; you can only define one or the other, but not both.

optional .google.cloud.compute.v1.AttachedDiskInitializeParams initialize_params = 17697045;

Returns
Type Description
boolean

Whether the initializeParams field is set.

hasInterface()

public boolean hasInterface()

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. For most machine types, the default is SCSI. Local SSDs can use either NVME or SCSI. In certain configurations, persistent disks can use NVMe. For more information, see About persistent disks. Check the Interface enum for the list of possible values.

optional string interface = 502623545;

Returns
Type Description
boolean

Whether the interface field is set.

hasKind()

public boolean hasKind()

[Output Only] Type of the resource. Always compute#attachedDisk for attached disks.

optional string kind = 3292052;

Returns
Type Description
boolean

Whether the kind field is set.

hasMode()

public boolean hasMode()

The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. Check the Mode enum for the list of possible values.

optional string mode = 3357091;

Returns
Type Description
boolean

Whether the mode field is set.

hasSavedState()

public boolean hasSavedState()

For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this field is set to PRESERVED if the LocalSSD data has been saved to a persistent location by customer request. (see the discard_local_ssd option on Stop/Suspend). Read-only in the api. Check the SavedState enum for the list of possible values.

optional string saved_state = 411587801;

Returns
Type Description
boolean

Whether the savedState field is set.

hasShieldedInstanceInitialState()

public boolean hasShieldedInstanceInitialState()

[Output Only] shielded vm initial state stored on disk

optional .google.cloud.compute.v1.InitialStateConfig shielded_instance_initial_state = 192356867;

Returns
Type Description
boolean

Whether the shieldedInstanceInitialState field is set.

hasSource()

public boolean hasSource()

Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. Note that for InstanceTemplate, specify the disk name for zonal disk, and the URL for regional disk.

optional string source = 177235995;

Returns
Type Description
boolean

Whether the source field is set.

hasType()

public boolean hasType()

Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. Check the Type enum for the list of possible values.

optional string type = 3575610;

Returns
Type Description
boolean

Whether the type field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeDiskEncryptionKey(CustomerEncryptionKey value)

public AttachedDisk.Builder mergeDiskEncryptionKey(CustomerEncryptionKey value)

Encrypts or decrypts a disk using a customer-supplied encryption key. If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.

optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677;

Parameter
Name Description
value CustomerEncryptionKey
Returns
Type Description
AttachedDisk.Builder

mergeFrom(AttachedDisk other)

public AttachedDisk.Builder mergeFrom(AttachedDisk other)
Parameter
Name Description
other AttachedDisk
Returns
Type Description
AttachedDisk.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public AttachedDisk.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AttachedDisk.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public AttachedDisk.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
AttachedDisk.Builder
Overrides

mergeInitializeParams(AttachedDiskInitializeParams value)

public AttachedDisk.Builder mergeInitializeParams(AttachedDiskInitializeParams value)

[Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. This property is mutually exclusive with the source property; you can only define one or the other, but not both.

optional .google.cloud.compute.v1.AttachedDiskInitializeParams initialize_params = 17697045;

Parameter
Name Description
value AttachedDiskInitializeParams
Returns
Type Description
AttachedDisk.Builder

mergeShieldedInstanceInitialState(InitialStateConfig value)

public AttachedDisk.Builder mergeShieldedInstanceInitialState(InitialStateConfig value)

[Output Only] shielded vm initial state stored on disk

optional .google.cloud.compute.v1.InitialStateConfig shielded_instance_initial_state = 192356867;

Parameter
Name Description
value InitialStateConfig
Returns
Type Description
AttachedDisk.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final AttachedDisk.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AttachedDisk.Builder
Overrides

removeGuestOsFeatures(int index)

public AttachedDisk.Builder removeGuestOsFeatures(int index)

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameter
Name Description
index int
Returns
Type Description
AttachedDisk.Builder

setArchitecture(String value)

public AttachedDisk.Builder setArchitecture(String value)

[Output Only] The architecture of the attached disk. Valid values are ARM64 or X86_64. Check the Architecture enum for the list of possible values.

optional string architecture = 302803283;

Parameter
Name Description
value String

The architecture to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setArchitectureBytes(ByteString value)

public AttachedDisk.Builder setArchitectureBytes(ByteString value)

[Output Only] The architecture of the attached disk. Valid values are ARM64 or X86_64. Check the Architecture enum for the list of possible values.

optional string architecture = 302803283;

Parameter
Name Description
value ByteString

The bytes for architecture to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setAutoDelete(boolean value)

public AttachedDisk.Builder setAutoDelete(boolean value)

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

optional bool auto_delete = 464761403;

Parameter
Name Description
value boolean

The autoDelete to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setBoot(boolean value)

public AttachedDisk.Builder setBoot(boolean value)

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

optional bool boot = 3029746;

Parameter
Name Description
value boolean

The boot to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setDeviceName(String value)

public AttachedDisk.Builder setDeviceName(String value)

Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.

optional string device_name = 67541716;

Parameter
Name Description
value String

The deviceName to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setDeviceNameBytes(ByteString value)

public AttachedDisk.Builder setDeviceNameBytes(ByteString value)

Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.

optional string device_name = 67541716;

Parameter
Name Description
value ByteString

The bytes for deviceName to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setDiskEncryptionKey(CustomerEncryptionKey value)

public AttachedDisk.Builder setDiskEncryptionKey(CustomerEncryptionKey value)

Encrypts or decrypts a disk using a customer-supplied encryption key. If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.

optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677;

Parameter
Name Description
value CustomerEncryptionKey
Returns
Type Description
AttachedDisk.Builder

setDiskEncryptionKey(CustomerEncryptionKey.Builder builderForValue)

public AttachedDisk.Builder setDiskEncryptionKey(CustomerEncryptionKey.Builder builderForValue)

Encrypts or decrypts a disk using a customer-supplied encryption key. If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.

optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677;

Parameter
Name Description
builderForValue CustomerEncryptionKey.Builder
Returns
Type Description
AttachedDisk.Builder

setDiskSizeGb(long value)

public AttachedDisk.Builder setDiskSizeGb(long value)

The size of the disk in GB.

optional int64 disk_size_gb = 316263735;

Parameter
Name Description
value long

The diskSizeGb to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public AttachedDisk.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AttachedDisk.Builder
Overrides

setForceAttach(boolean value)

public AttachedDisk.Builder setForceAttach(boolean value)

[Input Only] Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error.

optional bool force_attach = 142758425;

Parameter
Name Description
value boolean

The forceAttach to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setGuestOsFeatures(int index, GuestOsFeature value)

public AttachedDisk.Builder setGuestOsFeatures(int index, GuestOsFeature value)

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameters
Name Description
index int
value GuestOsFeature
Returns
Type Description
AttachedDisk.Builder

setGuestOsFeatures(int index, GuestOsFeature.Builder builderForValue)

public AttachedDisk.Builder setGuestOsFeatures(int index, GuestOsFeature.Builder builderForValue)

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.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameters
Name Description
index int
builderForValue GuestOsFeature.Builder
Returns
Type Description
AttachedDisk.Builder

setIndex(int value)

public AttachedDisk.Builder setIndex(int value)

[Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number.

optional int32 index = 100346066;

Parameter
Name Description
value int

The index to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setInitializeParams(AttachedDiskInitializeParams value)

public AttachedDisk.Builder setInitializeParams(AttachedDiskInitializeParams value)

[Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. This property is mutually exclusive with the source property; you can only define one or the other, but not both.

optional .google.cloud.compute.v1.AttachedDiskInitializeParams initialize_params = 17697045;

Parameter
Name Description
value AttachedDiskInitializeParams
Returns
Type Description
AttachedDisk.Builder

setInitializeParams(AttachedDiskInitializeParams.Builder builderForValue)

public AttachedDisk.Builder setInitializeParams(AttachedDiskInitializeParams.Builder builderForValue)

[Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. This property is mutually exclusive with the source property; you can only define one or the other, but not both.

optional .google.cloud.compute.v1.AttachedDiskInitializeParams initialize_params = 17697045;

Parameter
Name Description
builderForValue AttachedDiskInitializeParams.Builder
Returns
Type Description
AttachedDisk.Builder

setInterface(String value)

public AttachedDisk.Builder setInterface(String value)

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. For most machine types, the default is SCSI. Local SSDs can use either NVME or SCSI. In certain configurations, persistent disks can use NVMe. For more information, see About persistent disks. Check the Interface enum for the list of possible values.

optional string interface = 502623545;

Parameter
Name Description
value String

The interface to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setInterfaceBytes(ByteString value)

public AttachedDisk.Builder setInterfaceBytes(ByteString value)

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. For most machine types, the default is SCSI. Local SSDs can use either NVME or SCSI. In certain configurations, persistent disks can use NVMe. For more information, see About persistent disks. Check the Interface enum for the list of possible values.

optional string interface = 502623545;

Parameter
Name Description
value ByteString

The bytes for interface to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setKind(String value)

public AttachedDisk.Builder setKind(String value)

[Output Only] Type of the resource. Always compute#attachedDisk for attached disks.

optional string kind = 3292052;

Parameter
Name Description
value String

The kind to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setKindBytes(ByteString value)

public AttachedDisk.Builder setKindBytes(ByteString value)

[Output Only] Type of the resource. Always compute#attachedDisk for attached disks.

optional string kind = 3292052;

Parameter
Name Description
value ByteString

The bytes for kind to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setLicenses(int index, String value)

public AttachedDisk.Builder setLicenses(int index, String value)

[Output Only] Any valid publicly visible licenses.

repeated string licenses = 337642578;

Parameters
Name Description
index int

The index to set the value at.

value String

The licenses to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setMode(String value)

public AttachedDisk.Builder setMode(String value)

The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. Check the Mode enum for the list of possible values.

optional string mode = 3357091;

Parameter
Name Description
value String

The mode to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setModeBytes(ByteString value)

public AttachedDisk.Builder setModeBytes(ByteString value)

The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. Check the Mode enum for the list of possible values.

optional string mode = 3357091;

Parameter
Name Description
value ByteString

The bytes for mode to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public AttachedDisk.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
AttachedDisk.Builder
Overrides

setSavedState(String value)

public AttachedDisk.Builder setSavedState(String value)

For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this field is set to PRESERVED if the LocalSSD data has been saved to a persistent location by customer request. (see the discard_local_ssd option on Stop/Suspend). Read-only in the api. Check the SavedState enum for the list of possible values.

optional string saved_state = 411587801;

Parameter
Name Description
value String

The savedState to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setSavedStateBytes(ByteString value)

public AttachedDisk.Builder setSavedStateBytes(ByteString value)

For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this field is set to PRESERVED if the LocalSSD data has been saved to a persistent location by customer request. (see the discard_local_ssd option on Stop/Suspend). Read-only in the api. Check the SavedState enum for the list of possible values.

optional string saved_state = 411587801;

Parameter
Name Description
value ByteString

The bytes for savedState to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setShieldedInstanceInitialState(InitialStateConfig value)

public AttachedDisk.Builder setShieldedInstanceInitialState(InitialStateConfig value)

[Output Only] shielded vm initial state stored on disk

optional .google.cloud.compute.v1.InitialStateConfig shielded_instance_initial_state = 192356867;

Parameter
Name Description
value InitialStateConfig
Returns
Type Description
AttachedDisk.Builder

setShieldedInstanceInitialState(InitialStateConfig.Builder builderForValue)

public AttachedDisk.Builder setShieldedInstanceInitialState(InitialStateConfig.Builder builderForValue)

[Output Only] shielded vm initial state stored on disk

optional .google.cloud.compute.v1.InitialStateConfig shielded_instance_initial_state = 192356867;

Parameter
Name Description
builderForValue InitialStateConfig.Builder
Returns
Type Description
AttachedDisk.Builder

setSource(String value)

public AttachedDisk.Builder setSource(String value)

Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. Note that for InstanceTemplate, specify the disk name for zonal disk, and the URL for regional disk.

optional string source = 177235995;

Parameter
Name Description
value String

The source to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setSourceBytes(ByteString value)

public AttachedDisk.Builder setSourceBytes(ByteString value)

Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. Note that for InstanceTemplate, specify the disk name for zonal disk, and the URL for regional disk.

optional string source = 177235995;

Parameter
Name Description
value ByteString

The bytes for source to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setType(String value)

public AttachedDisk.Builder setType(String value)

Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. Check the Type enum for the list of possible values.

optional string type = 3575610;

Parameter
Name Description
value String

The type to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setTypeBytes(ByteString value)

public AttachedDisk.Builder setTypeBytes(ByteString value)

Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. Check the Type enum for the list of possible values.

optional string type = 3575610;

Parameter
Name Description
value ByteString

The bytes for type to set.

Returns
Type Description
AttachedDisk.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final AttachedDisk.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AttachedDisk.Builder
Overrides