Class ZoneAllocationPolicy

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

public final class ZoneAllocationPolicy extends Object implements com.azure.json.JsonSerializable<ZoneAllocationPolicy>
The configuration parameters for zone allocation of a virtual machine scale set.
  • Constructor Details

    • ZoneAllocationPolicy

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

    • maxZoneCount

      public Integer maxZoneCount()
      Get the maxZoneCount property: The maximum number of availability zones to use if the ZonePlacementPolicy is 'Auto'. If not specified, all availability zones will be used.
      Returns:
      the maxZoneCount value.
    • withMaxZoneCount

      public ZoneAllocationPolicy withMaxZoneCount(Integer maxZoneCount)
      Set the maxZoneCount property: The maximum number of availability zones to use if the ZonePlacementPolicy is 'Auto'. If not specified, all availability zones will be used.
      Parameters:
      maxZoneCount - the maxZoneCount value to set.
      Returns:
      the ZoneAllocationPolicy object itself.
    • maxInstancePercentPerZonePolicy

      public MaxInstancePercentPerZonePolicy maxInstancePercentPerZonePolicy()
      Get the maxInstancePercentPerZonePolicy property: The configuration parameters used to limit the number of virtual machines per availability zone in the virtual machine scale set.
      Returns:
      the maxInstancePercentPerZonePolicy value.
    • withMaxInstancePercentPerZonePolicy

      public ZoneAllocationPolicy withMaxInstancePercentPerZonePolicy(MaxInstancePercentPerZonePolicy maxInstancePercentPerZonePolicy)
      Set the maxInstancePercentPerZonePolicy property: The configuration parameters used to limit the number of virtual machines per availability zone in the virtual machine scale set.
      Parameters:
      maxInstancePercentPerZonePolicy - the maxInstancePercentPerZonePolicy value to set.
      Returns:
      the ZoneAllocationPolicy 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<ZoneAllocationPolicy>
      Throws:
      IOException
    • fromJson

      public static ZoneAllocationPolicy fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of ZoneAllocationPolicy from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of ZoneAllocationPolicy if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the ZoneAllocationPolicy.