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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ZoneAllocationPolicyfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ZoneAllocationPolicy from the JsonReader.Get the maxInstancePercentPerZonePolicy property: The configuration parameters used to limit the number of virtual machines per availability zone in the virtual machine scale set.Get the maxZoneCount property: The maximum number of availability zones to use if the ZonePlacementPolicy is 'Auto'.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.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.withMaxZoneCount(Integer maxZoneCount) Set the maxZoneCount property: The maximum number of availability zones to use if the ZonePlacementPolicy is 'Auto'.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
-
ZoneAllocationPolicy
public ZoneAllocationPolicy()Creates an instance of ZoneAllocationPolicy class.
-
-
Method Details
-
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
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
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
- Specified by:
toJsonin interfacecom.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.
-