Class DataDisksToAttach

java.lang.Object
com.azure.resourcemanager.compute.models.DataDisksToAttach
All Implemented Interfaces:
com.azure.json.JsonSerializable<DataDisksToAttach>

public final class DataDisksToAttach extends Object implements com.azure.json.JsonSerializable<DataDisksToAttach>
Describes the data disk to be attached.
  • Constructor Details

    • DataDisksToAttach

      public DataDisksToAttach()
      Creates an instance of DataDisksToAttach class.
  • Method Details

    • diskId

      public String diskId()
      Get the diskId property: ID of the managed data disk.
      Returns:
      the diskId value.
    • withDiskId

      public DataDisksToAttach withDiskId(String diskId)
      Set the diskId property: ID of the managed data disk.
      Parameters:
      diskId - the diskId value to set.
      Returns:
      the DataDisksToAttach object itself.
    • lun

      public Integer lun()
      Get the lun property: 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. If not specified, lun would be auto assigned.
      Returns:
      the lun value.
    • withLun

      public DataDisksToAttach withLun(Integer lun)
      Set the lun property: 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. If not specified, lun would be auto assigned.
      Parameters:
      lun - the lun value to set.
      Returns:
      the DataDisksToAttach object itself.
    • 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:
      the caching value.
    • withCaching

      public DataDisksToAttach 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:
      caching - the caching value to set.
      Returns:
      the DataDisksToAttach object itself.
    • 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:
      the deleteOption value.
    • withDeleteOption

      public DataDisksToAttach 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:
      deleteOption - the deleteOption value to set.
      Returns:
      the DataDisksToAttach object itself.
    • diskEncryptionSet

      public DiskEncryptionSetParameters diskEncryptionSet()
      Get the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the managed disk.
      Returns:
      the diskEncryptionSet value.
    • withDiskEncryptionSet

      public DataDisksToAttach withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet)
      Set the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the managed disk.
      Parameters:
      diskEncryptionSet - the diskEncryptionSet value to set.
      Returns:
      the DataDisksToAttach object itself.
    • writeAcceleratorEnabled

      public Boolean writeAcceleratorEnabled()
      Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the disk.
      Returns:
      the writeAcceleratorEnabled value.
    • withWriteAcceleratorEnabled

      public DataDisksToAttach withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled)
      Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the disk.
      Parameters:
      writeAcceleratorEnabled - the writeAcceleratorEnabled value to set.
      Returns:
      the DataDisksToAttach object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<DataDisksToAttach>
      Throws:
      IOException
    • fromJson

      public static DataDisksToAttach fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of DataDisksToAttach from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of DataDisksToAttach 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 DataDisksToAttach.