Class GalleryDataDiskImage

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

public final class GalleryDataDiskImage extends GalleryDiskImage
This is the data disk image.
  • Constructor Details

    • GalleryDataDiskImage

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

    • lun

      public int lun()
      Get the lun property: This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine.
      Returns:
      the lun value.
    • withLun

      public GalleryDataDiskImage withLun(int lun)
      Set the lun property: This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine.
      Parameters:
      lun - the lun value to set.
      Returns:
      the GalleryDataDiskImage object itself.
    • sizeInGB

      public Integer sizeInGB()
      Get the sizeInGB property: This property indicates the size of the VHD to be created.
      Overrides:
      sizeInGB in class GalleryDiskImage
      Returns:
      the sizeInGB value.
    • withHostCaching

      public GalleryDataDiskImage withHostCaching(HostCaching hostCaching)
      Set the hostCaching property: The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'.
      Overrides:
      withHostCaching in class GalleryDiskImage
      Parameters:
      hostCaching - the hostCaching value to set.
      Returns:
      the GalleryDiskImage object itself.
    • withSource

      public GalleryDataDiskImage withSource(GalleryDiskImageSource source)
      Set the source property: The source for the disk image.
      Overrides:
      withSource in class GalleryDiskImage
      Parameters:
      source - the source value to set.
      Returns:
      the GalleryDiskImage object itself.
    • validate

      public void validate()
      Validates the instance.
      Overrides:
      validate in class GalleryDiskImage
      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<GalleryDiskImage>
      Overrides:
      toJson in class GalleryDiskImage
      Throws:
      IOException
    • fromJson

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