Class UpgradePolicy
java.lang.Object
com.azure.resourcemanager.compute.models.UpgradePolicy
- All Implemented Interfaces:
com.azure.json.JsonSerializable<UpgradePolicy>
public final class UpgradePolicy
extends Object
implements com.azure.json.JsonSerializable<UpgradePolicy>
Describes an upgrade policy - automatic, manual, or rolling.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the automaticOSUpgradePolicy property: Configuration parameters used for performing automatic OS Upgrade.static UpgradePolicyfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of UpgradePolicy from the JsonReader.mode()Get the mode property: Specifies the mode of an upgrade to virtual machines in the scale set.<br /><br /> Possible values are:<br /><br /> **Manual** - You control the application of updates to virtual machines in the scale set.Get the rollingUpgradePolicy property: The configuration parameters used while performing a rolling upgrade.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withAutomaticOSUpgradePolicy(AutomaticOSUpgradePolicy automaticOSUpgradePolicy) Set the automaticOSUpgradePolicy property: Configuration parameters used for performing automatic OS Upgrade.withMode(UpgradeMode mode) Set the mode property: Specifies the mode of an upgrade to virtual machines in the scale set.<br /><br /> Possible values are:<br /><br /> **Manual** - You control the application of updates to virtual machines in the scale set.withRollingUpgradePolicy(RollingUpgradePolicy rollingUpgradePolicy) Set the rollingUpgradePolicy property: The configuration parameters used while performing a rolling upgrade.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
-
UpgradePolicy
public UpgradePolicy()Creates an instance of UpgradePolicy class.
-
-
Method Details
-
mode
Get the mode property: Specifies the mode of an upgrade to virtual machines in the scale set.<br /><br /> Possible values are:<br /><br /> **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.<br /><br /> **Automatic** - All virtual machines in the scale set are automatically updated at the same time.- Returns:
- the mode value.
-
withMode
Set the mode property: Specifies the mode of an upgrade to virtual machines in the scale set.<br /><br /> Possible values are:<br /><br /> **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.<br /><br /> **Automatic** - All virtual machines in the scale set are automatically updated at the same time.- Parameters:
mode- the mode value to set.- Returns:
- the UpgradePolicy object itself.
-
rollingUpgradePolicy
Get the rollingUpgradePolicy property: The configuration parameters used while performing a rolling upgrade.- Returns:
- the rollingUpgradePolicy value.
-
withRollingUpgradePolicy
Set the rollingUpgradePolicy property: The configuration parameters used while performing a rolling upgrade.- Parameters:
rollingUpgradePolicy- the rollingUpgradePolicy value to set.- Returns:
- the UpgradePolicy object itself.
-
automaticOSUpgradePolicy
Get the automaticOSUpgradePolicy property: Configuration parameters used for performing automatic OS Upgrade.- Returns:
- the automaticOSUpgradePolicy value.
-
withAutomaticOSUpgradePolicy
public UpgradePolicy withAutomaticOSUpgradePolicy(AutomaticOSUpgradePolicy automaticOSUpgradePolicy) Set the automaticOSUpgradePolicy property: Configuration parameters used for performing automatic OS Upgrade.- Parameters:
automaticOSUpgradePolicy- the automaticOSUpgradePolicy value to set.- Returns:
- the UpgradePolicy 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<UpgradePolicy>- Throws:
IOException
-
fromJson
Reads an instance of UpgradePolicy from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of UpgradePolicy 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 UpgradePolicy.
-