Class DataDisk
java.lang.Object
com.azure.resourcemanager.compute.models.DataDisk
- All Implemented Interfaces:
com.azure.json.JsonSerializable<DataDisk>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncaching()Get the caching property: Specifies the caching requirements.Get the createOption property: Specifies how the virtual machine disk should be created.Get the deleteOption property: Specifies whether data disk should be deleted or detached upon VM deletion.Get the detachOption property: Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine.Get the diskIopsReadWrite property: Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS.Get the diskMBpsReadWrite property: Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS.Get the diskSizeGB property: Specifies the size of an empty data disk in gigabytes.static DataDiskfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of DataDisk from the JsonReader.image()Get the image property: The source user image virtual hard disk.intlun()Get the lun property: Specifies the logical unit number of the data disk.Get the managedDisk property: The managed disk parameters.name()Get the name property: The disk name.Get the sourceResource property: The source resource identifier.Get the toBeDetached property: Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.vhd()Get the vhd property: The virtual hard disk.withCaching(CachingTypes caching) Set the caching property: Specifies the caching requirements.withCreateOption(DiskCreateOptionTypes createOption) Set the createOption property: Specifies how the virtual machine disk should be created.withDeleteOption(DiskDeleteOptionTypes deleteOption) Set the deleteOption property: Specifies whether data disk should be deleted or detached upon VM deletion.withDetachOption(DiskDetachOptionTypes detachOption) Set the detachOption property: Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine.withDiskIopsReadWrite(Long diskIopsReadWrite) Set the diskIopsReadWrite property: Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS.withDiskMBpsReadWrite(Long diskMBpsReadWrite) Set the diskMBpsReadWrite property: Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS.withDiskSizeGB(Integer diskSizeGB) Set the diskSizeGB property: Specifies the size of an empty data disk in gigabytes.withImage(VirtualHardDisk image) Set the image property: The source user image virtual hard disk.withLun(int lun) Set the lun property: Specifies the logical unit number of the data disk.withManagedDisk(ManagedDiskParameters managedDisk) Set the managedDisk property: The managed disk parameters.Set the name property: The disk name.withSourceResource(ApiEntityReference sourceResource) Set the sourceResource property: The source resource identifier.withToBeDetached(Boolean toBeDetached) Set the toBeDetached property: Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset.withVhd(VirtualHardDisk vhd) Set the vhd property: The virtual hard disk.withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the disk.Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the disk.Methods 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
-
DataDisk
public DataDisk()Creates an instance of DataDisk 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 DataDisk object itself.
-
name
-
withName
-
vhd
-
withVhd
Set the vhd property: The virtual hard disk.- Parameters:
vhd- the vhd value to set.- Returns:
- the DataDisk object itself.
-
image
Get the image property: The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.- Returns:
- the image value.
-
withImage
Set the image property: The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.- Parameters:
image- the image value to set.- Returns:
- the DataDisk object itself.
-
caching
Get the caching property: Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None for Standard storage. ReadOnly for Premium storage.**.- Returns:
- the caching value.
-
withCaching
Set the caching property: Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None for Standard storage. ReadOnly for Premium storage.**.- Parameters:
caching- the caching value to set.- Returns:
- the DataDisk object itself.
-
writeAcceleratorEnabled
Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the disk.- Returns:
- the writeAcceleratorEnabled value.
-
withWriteAcceleratorEnabled
Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the disk.- Parameters:
writeAcceleratorEnabled- the writeAcceleratorEnabled value to set.- Returns:
- the DataDisk object itself.
-
createOption
Get the createOption property: Specifies how the virtual machine disk should be created. Possible values are **Attach:** This value is used when you are using a specialized disk to create the virtual machine. **FromImage:** This value is used when you are using an image to create the virtual machine data disk. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described. **Empty:** This value is used when creating an empty data disk. **Copy:** This value is used to create a data disk from a snapshot or another disk. **Restore:** This value is used to create a data disk from a disk restore point.- Returns:
- the createOption value.
-
withCreateOption
Set the createOption property: Specifies how the virtual machine disk should be created. Possible values are **Attach:** This value is used when you are using a specialized disk to create the virtual machine. **FromImage:** This value is used when you are using an image to create the virtual machine data disk. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described. **Empty:** This value is used when creating an empty data disk. **Copy:** This value is used to create a data disk from a snapshot or another disk. **Restore:** This value is used to create a data disk from a disk restore point.- Parameters:
createOption- the createOption value to set.- Returns:
- the DataDisk object itself.
-
diskSizeGB
Get the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023.- Returns:
- the diskSizeGB value.
-
withDiskSizeGB
Set the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023.- Parameters:
diskSizeGB- the diskSizeGB value to set.- Returns:
- the DataDisk object itself.
-
managedDisk
Get the managedDisk property: The managed disk parameters.- Returns:
- the managedDisk value.
-
withManagedDisk
Set the managedDisk property: The managed disk parameters.- Parameters:
managedDisk- the managedDisk value to set.- Returns:
- the DataDisk object itself.
-
sourceResource
Get the sourceResource property: The source resource identifier. It can be a snapshot, or disk restore point from which to create a disk.- Returns:
- the sourceResource value.
-
withSourceResource
Set the sourceResource property: The source resource identifier. It can be a snapshot, or disk restore point from which to create a disk.- Parameters:
sourceResource- the sourceResource value to set.- Returns:
- the DataDisk object itself.
-
toBeDetached
Get the toBeDetached property: Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset.- Returns:
- the toBeDetached value.
-
withToBeDetached
-
diskIopsReadWrite
Get the diskIopsReadWrite property: Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS.- Returns:
- the diskIopsReadWrite value.
-
withDiskIopsReadWrite
-
diskMBpsReadWrite
Get the diskMBpsReadWrite property: Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS.- Returns:
- the diskMBpsReadWrite value.
-
withDiskMBpsReadWrite
Set the diskMBpsReadWrite property: Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS.- Parameters:
diskMBpsReadWrite- the diskMBpsReadWrite value to set.- Returns:
- the DataDisk object itself.
-
detachOption
Get the detachOption property: Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview**. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.- Returns:
- the detachOption value.
-
withDetachOption
Set the detachOption property: Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview**. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.- Parameters:
detachOption- the detachOption value to set.- Returns:
- the DataDisk object itself.
-
deleteOption
Get the deleteOption property: Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**.- Returns:
- the deleteOption value.
-
withDeleteOption
Set the deleteOption property: Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**.- Parameters:
deleteOption- the deleteOption value to set.- Returns:
- the DataDisk object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<DataDisk>- Throws:
IOException
-
fromJson
Reads an instance of DataDisk from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of DataDisk 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 DataDisk.
-