Class AttachedDisk.Builder (1.37.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
TypeDescription
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
NameDescription
valuesIterable<? extends com.google.cloud.compute.v1.GuestOsFeature>
Returns
TypeDescription
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
NameDescription
valuesIterable<String>

The licenses to add.

Returns
TypeDescription
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
NameDescription
valueGuestOsFeature
Returns
TypeDescription
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
NameDescription
builderForValueGuestOsFeature.Builder
Returns
TypeDescription
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
NameDescription
indexint
valueGuestOsFeature
Returns
TypeDescription
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
NameDescription
indexint
builderForValueGuestOsFeature.Builder
Returns
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
GuestOsFeature.Builder

addLicenses(String value)

public AttachedDisk.Builder addLicenses(String value)

[Output Only] Any valid publicly visible licenses.

repeated string licenses = 337642578;

Parameter
NameDescription
valueString

The licenses to add.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes of the licenses to add.

Returns
TypeDescription
AttachedDisk.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public AttachedDisk.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
AttachedDisk.Builder
Overrides

build()

public AttachedDisk build()
Returns
TypeDescription
AttachedDisk

buildPartial()

public AttachedDisk buildPartial()
Returns
TypeDescription
AttachedDisk

clear()

public AttachedDisk.Builder clear()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
AttachedDisk.Builder

clearDiskSizeGb()

public AttachedDisk.Builder clearDiskSizeGb()

The size of the disk in GB.

optional int64 disk_size_gb = 316263735;

Returns
TypeDescription
AttachedDisk.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public AttachedDisk.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
AttachedDisk.Builder

This builder for chaining.

clearLicenses()

public AttachedDisk.Builder clearLicenses()

[Output Only] Any valid publicly visible licenses.

repeated string licenses = 337642578;

Returns
TypeDescription
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
TypeDescription
AttachedDisk.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public AttachedDisk.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
AttachedDisk.Builder

This builder for chaining.

clone()

public AttachedDisk.Builder clone()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

The boot.

getDefaultInstanceForType()

public AttachedDisk getDefaultInstanceForType()
Returns
TypeDescription
AttachedDisk

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
CustomerEncryptionKeyOrBuilder

getDiskSizeGb()

public long getDiskSizeGb()

The size of the disk in GB.

optional int64 disk_size_gb = 316263735;

Returns
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
String

The kind.

getKindBytes()

public ByteString getKindBytes()

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

optional string kind = 3292052;

Returns
TypeDescription
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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
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
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
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
TypeDescription
int

The count of licenses.

getLicensesList()

public ProtocolStringList getLicensesList()

[Output Only] Any valid publicly visible licenses.

repeated string licenses = 337642578;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the type field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
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
NameDescription
valueCustomerEncryptionKey
Returns
TypeDescription
AttachedDisk.Builder

mergeFrom(AttachedDisk other)

public AttachedDisk.Builder mergeFrom(AttachedDisk other)
Parameter
NameDescription
otherAttachedDisk
Returns
TypeDescription
AttachedDisk.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public AttachedDisk.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AttachedDisk.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public AttachedDisk.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
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
NameDescription
valueAttachedDiskInitializeParams
Returns
TypeDescription
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
NameDescription
valueInitialStateConfig
Returns
TypeDescription
AttachedDisk.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final AttachedDisk.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
valueString

The architecture to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for architecture to set.

Returns
TypeDescription
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
NameDescription
valueboolean

The autoDelete to set.

Returns
TypeDescription
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
NameDescription
valueboolean

The boot to set.

Returns
TypeDescription
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
NameDescription
valueString

The deviceName to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for deviceName to set.

Returns
TypeDescription
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
NameDescription
valueCustomerEncryptionKey
Returns
TypeDescription
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
NameDescription
builderForValueCustomerEncryptionKey.Builder
Returns
TypeDescription
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
NameDescription
valuelong

The diskSizeGb to set.

Returns
TypeDescription
AttachedDisk.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public AttachedDisk.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueboolean

The forceAttach to set.

Returns
TypeDescription
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
NameDescription
indexint
valueGuestOsFeature
Returns
TypeDescription
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
NameDescription
indexint
builderForValueGuestOsFeature.Builder
Returns
TypeDescription
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
NameDescription
valueint

The index to set.

Returns
TypeDescription
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
NameDescription
valueAttachedDiskInitializeParams
Returns
TypeDescription
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
NameDescription
builderForValueAttachedDiskInitializeParams.Builder
Returns
TypeDescription
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
NameDescription
valueString

The interface to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for interface to set.

Returns
TypeDescription
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
NameDescription
valueString

The kind to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for kind to set.

Returns
TypeDescription
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
NameDescription
indexint

The index to set the value at.

valueString

The licenses to set.

Returns
TypeDescription
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
NameDescription
valueString

The mode to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for mode to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The savedState to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for savedState to set.

Returns
TypeDescription
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
NameDescription
valueInitialStateConfig
Returns
TypeDescription
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
NameDescription
builderForValueInitialStateConfig.Builder
Returns
TypeDescription
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
NameDescription
valueString

The source to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for source to set.

Returns
TypeDescription
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
NameDescription
valueString

The type to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for type to set.

Returns
TypeDescription
AttachedDisk.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final AttachedDisk.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
AttachedDisk.Builder
Overrides