Class AttachedDisk.Builder (1.88.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. Note: Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. You cannot create VMs that have disks with customer-supplied keys using the bulk insert method.

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