DataDisk Class
- java.
lang. Object - com.
azure. resourcemanager. compute. models. DataDisk
- com.
Implements
public final class DataDisk
implements JsonSerializable<DataDisk>
Describes a data disk.
Constructor Summary
Constructor | Description |
---|---|
DataDisk() |
Creates an instance of Data |
Method Summary
Modifier and Type | Method and Description |
---|---|
Caching |
caching()
Get the caching property: Specifies the caching requirements. |
Disk |
createOption()
Get the create |
Disk |
deleteOption()
Get the delete |
Disk |
detachOption()
Get the detach |
Long |
diskIopsReadWrite()
Get the disk |
Long |
diskMBpsReadWrite()
Get the disk |
Integer |
diskSizeGB()
Get the disk |
static
Data |
fromJson(JsonReader jsonReader)
Reads an instance of Data |
Virtual |
image()
Get the image property: The source user image virtual hard disk. |
int |
lun()
Get the lun property: Specifies the logical unit number of the data disk. |
Managed |
managedDisk()
Get the managed |
String |
name()
Get the name property: The disk name. |
Api |
sourceResource()
Get the source |
Boolean |
toBeDetached()
Get the to |
Json |
toJson(JsonWriter jsonWriter) |
void |
validate()
Validates the instance. |
Virtual |
vhd()
Get the vhd property: The virtual hard disk. |
Data |
withCaching(CachingTypes caching)
Set the caching property: Specifies the caching requirements. |
Data |
withCreateOption(DiskCreateOptionTypes createOption)
Set the create |
Data |
withDeleteOption(DiskDeleteOptionTypes deleteOption)
Set the delete |
Data |
withDetachOption(DiskDetachOptionTypes detachOption)
Set the detach |
Data |
withDiskSizeGB(Integer diskSizeGB)
Set the disk |
Data |
withImage(VirtualHardDisk image)
Set the image property: The source user image virtual hard disk. |
Data |
withLun(int lun)
Set the lun property: Specifies the logical unit number of the data disk. |
Data |
withManagedDisk(ManagedDiskParameters managedDisk)
Set the managed |
Data |
withName(String name)
Set the name property: The disk name. |
Data |
withSourceResource(ApiEntityReference sourceResource)
Set the source |
Data |
withToBeDetached(Boolean toBeDetached)
Set the to |
Data |
withVhd(VirtualHardDisk vhd)
Set the vhd property: The virtual hard disk. |
Data |
withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled)
Set the write |
Boolean |
writeAcceleratorEnabled()
Get the write |
Methods inherited from java.lang.Object
Constructor Details
DataDisk
public DataDisk()
Creates an instance of DataDisk class.
Method Details
caching
public CachingTypes 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:
createOption
public DiskCreateOptionTypes 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:
deleteOption
public DiskDeleteOptionTypes 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:
detachOption
public DiskDetachOptionTypes 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:
diskIopsReadWrite
public Long diskIopsReadWrite()
Get the diskIopsReadWrite property: Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set.
Returns:
diskMBpsReadWrite
public Long diskMBpsReadWrite()
Get the diskMBpsReadWrite property: Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set.
Returns:
diskSizeGB
public Integer 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:
fromJson
public static DataDisk fromJson(JsonReader jsonReader)
Reads an instance of DataDisk from the JsonReader.
Parameters:
Returns:
Throws:
image
public VirtualHardDisk 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:
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:
managedDisk
public ManagedDiskParameters managedDisk()
Get the managedDisk property: The managed disk parameters.
Returns:
name
public String name()
Get the name property: The disk name.
Returns:
sourceResource
public ApiEntityReference 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:
toBeDetached
public Boolean toBeDetached()
Get the toBeDetached property: Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset.
Returns:
toJson
validate
public void validate()
Validates the instance.
vhd
public VirtualHardDisk vhd()
Get the vhd property: The virtual hard disk.
Returns:
withCaching
public DataDisk withCaching(CachingTypes caching)
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:
Returns:
withCreateOption
public DataDisk withCreateOption(DiskCreateOptionTypes createOption)
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:
Returns:
withDeleteOption
public DataDisk withDeleteOption(DiskDeleteOptionTypes deleteOption)
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:
Returns:
withDetachOption
public DataDisk 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. 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:
Returns:
withDiskSizeGB
public DataDisk withDiskSizeGB(Integer diskSizeGB)
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:
Returns:
withImage
public DataDisk withImage(VirtualHardDisk image)
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:
Returns:
withLun
public DataDisk 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:
Returns:
withManagedDisk
public DataDisk withManagedDisk(ManagedDiskParameters managedDisk)
Set the managedDisk property: The managed disk parameters.
Parameters:
Returns:
withName
public DataDisk withName(String name)
Set the name property: The disk name.
Parameters:
Returns:
withSourceResource
public DataDisk withSourceResource(ApiEntityReference sourceResource)
Set the sourceResource property: The source resource identifier. It can be a snapshot, or disk restore point from which to create a disk.
Parameters:
Returns:
withToBeDetached
public DataDisk withToBeDetached(Boolean toBeDetached)
Set the toBeDetached property: Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset.
Parameters:
Returns:
withVhd
public DataDisk withVhd(VirtualHardDisk vhd)
Set the vhd property: The virtual hard disk.
Parameters:
Returns:
withWriteAcceleratorEnabled
public DataDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled)
Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the disk.
Parameters:
Returns:
writeAcceleratorEnabled
public Boolean writeAcceleratorEnabled()
Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the disk.
Returns:
Applies to
Azure SDK for Java