Class ImageDataDisk
java.lang.Object
com.azure.resourcemanager.compute.models.ImageDisk
com.azure.resourcemanager.compute.models.ImageDataDisk
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ImageDisk>
Describes a data disk.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ImageDataDiskfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ImageDataDisk from the JsonReader.intlun()Get the lun property: Specifies the logical unit number of the data disk.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withBlobUri(String blobUri) Set the blobUri property: The Virtual Hard Disk.withCaching(CachingTypes caching) Set the caching property: Specifies the caching requirements.withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet) Set the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the managed image disk.withDiskSizeGB(Integer diskSizeGB) Set the diskSizeGB property: Specifies the size of empty data disks in gigabytes.withLun(int lun) Set the lun property: Specifies the logical unit number of the data disk.withManagedDisk(com.azure.core.management.SubResource managedDisk) Set the managedDisk property: The managedDisk.withSnapshot(com.azure.core.management.SubResource snapshot) Set the snapshot property: The snapshot.withStorageAccountType(StorageAccountTypes storageAccountType) Set the storageAccountType property: Specifies the storage account type for the managed disk.Methods inherited from class ImageDisk
blobUri, caching, diskEncryptionSet, diskSizeGB, managedDisk, snapshot, storageAccountTypeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
ImageDataDisk
public ImageDataDisk()Creates an instance of ImageDataDisk class.
-
-
Method Details
-
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.
-
withLun
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.
-
withSnapshot
Set the snapshot property: The snapshot.- Overrides:
withSnapshotin classImageDisk- Parameters:
snapshot- the snapshot value to set.- Returns:
- the ImageDisk object itself.
-
withManagedDisk
Set the managedDisk property: The managedDisk.- Overrides:
withManagedDiskin classImageDisk- Parameters:
managedDisk- the managedDisk value to set.- Returns:
- the ImageDisk object itself.
-
withBlobUri
Set the blobUri property: The Virtual Hard Disk.- Overrides:
withBlobUriin classImageDisk- Parameters:
blobUri- the blobUri value to set.- Returns:
- the ImageDisk object itself.
-
withCaching
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:
withCachingin classImageDisk- Parameters:
caching- the caching value to set.- Returns:
- the ImageDisk object itself.
-
withDiskSizeGB
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:
withDiskSizeGBin classImageDisk- Parameters:
diskSizeGB- the diskSizeGB value to set.- Returns:
- the ImageDisk object itself.
-
withStorageAccountType
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:
withStorageAccountTypein classImageDisk- Parameters:
storageAccountType- the storageAccountType value to set.- Returns:
- the ImageDisk object itself.
-
withDiskEncryptionSet
Set the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the managed image disk.- Overrides:
withDiskEncryptionSetin classImageDisk- Parameters:
diskEncryptionSet- the diskEncryptionSet value to set.- Returns:
- the ImageDisk object itself.
-
validate
public void validate()Validates the instance.- Overrides:
validatein classImageDisk- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<ImageDisk>- Overrides:
toJsonin classImageDisk- Throws:
IOException
-
fromJson
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:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the ImageDataDisk.
-