ImageDataDisk Class

public final class ImageDataDisk
extends ImageDisk

Describes a data disk.

Constructor Summary

Constructor Description
ImageDataDisk()

Creates an instance of ImageDataDisk class.

Method Summary

Modifier and Type Method and Description
static ImageDataDisk fromJson(JsonReader jsonReader)

Reads an instance of ImageDataDisk from the JsonReader.

int lun()

Get the lun property: Specifies the logical unit number of the data disk.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

ImageDataDisk withBlobUri(String blobUri)

Set the blobUri property: The Virtual Hard Disk.

ImageDataDisk withCaching(CachingTypes caching)

Set the caching property: Specifies the caching requirements.

ImageDataDisk withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet)

Set the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the managed image disk.

ImageDataDisk withDiskSizeGB(Integer diskSizeGB)

Set the diskSizeGB property: Specifies the size of empty data disks in gigabytes.

ImageDataDisk withLun(int lun)

Set the lun property: Specifies the logical unit number of the data disk.

ImageDataDisk withManagedDisk(SubResource managedDisk)

Set the managedDisk property: The managedDisk.

ImageDataDisk withSnapshot(SubResource snapshot)

Set the snapshot property: The snapshot.

ImageDataDisk withStorageAccountType(StorageAccountTypes storageAccountType)

Set the storageAccountType property: Specifies the storage account type for the managed disk.

Methods inherited from ImageDisk

Methods inherited from java.lang.Object

Constructor Details

ImageDataDisk

public ImageDataDisk()

Creates an instance of ImageDataDisk class.

Method Details

fromJson

public static ImageDataDisk fromJson(JsonReader jsonReader)

Reads an instance of ImageDataDisk from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ImageDataDisk if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

lun

public int lun()

Get the lun property: Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.

Returns:

the lun value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

ImageDataDisk.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

Overrides:

ImageDataDisk.validate()

withBlobUri

public ImageDataDisk withBlobUri(String blobUri)

Set the blobUri property: The Virtual Hard Disk.

Overrides:

ImageDataDisk.withBlobUri(String blobUri)

Parameters:

blobUri

withCaching

public ImageDataDisk withCaching(CachingTypes caching)

Set the caching property: Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage.**.

Overrides:

ImageDataDisk.withCaching(CachingTypes caching)

Parameters:

caching

withDiskEncryptionSet

public ImageDataDisk withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet)

Set the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the managed image disk.

Overrides:

ImageDataDisk.withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet)

Parameters:

diskEncryptionSet

withDiskSizeGB

public ImageDataDisk withDiskSizeGB(Integer diskSizeGB)

Set the diskSizeGB property: Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. This value cannot be larger than 1023 GB.

Overrides:

ImageDataDisk.withDiskSizeGB(Integer diskSizeGB)

Parameters:

diskSizeGB

withLun

public ImageDataDisk withLun(int lun)

Set the lun property: Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.

Parameters:

lun - the lun value to set.

Returns:

the ImageDataDisk object itself.

withManagedDisk

public ImageDataDisk withManagedDisk(SubResource managedDisk)

Set the managedDisk property: The managedDisk.

Overrides:

ImageDataDisk.withManagedDisk(SubResource managedDisk)

Parameters:

managedDisk

withSnapshot

public ImageDataDisk withSnapshot(SubResource snapshot)

Set the snapshot property: The snapshot.

Overrides:

ImageDataDisk.withSnapshot(SubResource snapshot)

Parameters:

snapshot

withStorageAccountType

public ImageDataDisk withStorageAccountType(StorageAccountTypes storageAccountType)

Set the storageAccountType property: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk.

Overrides:

ImageDataDisk.withStorageAccountType(StorageAccountTypes storageAccountType)

Parameters:

storageAccountType

Applies to