Class AutomaticOSUpgradePolicy
java.lang.Object
com.azure.resourcemanager.compute.models.AutomaticOSUpgradePolicy
- All Implemented Interfaces:
com.azure.json.JsonSerializable<AutomaticOSUpgradePolicy>
public final class AutomaticOSUpgradePolicy
extends Object
implements com.azure.json.JsonSerializable<AutomaticOSUpgradePolicy>
The configuration parameters used for performing automatic OS upgrade.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of AutomaticOSUpgradePolicy class. -
Method Summary
Modifier and TypeMethodDescriptionGet the disableAutomaticRollback property: Whether OS image rollback feature should be disabled.Get the enableAutomaticOSUpgrade property: Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available.static AutomaticOSUpgradePolicyfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of AutomaticOSUpgradePolicy from the JsonReader.Get the osRollingUpgradeDeferral property: Indicates whether Auto OS Upgrade should undergo deferral.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Get the useRollingUpgradePolicy property: Indicates whether rolling upgrade policy should be used during Auto OS Upgrade.voidvalidate()Validates the instance.withDisableAutomaticRollback(Boolean disableAutomaticRollback) Set the disableAutomaticRollback property: Whether OS image rollback feature should be disabled.withEnableAutomaticOSUpgrade(Boolean enableAutomaticOSUpgrade) Set the enableAutomaticOSUpgrade property: Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available.withOsRollingUpgradeDeferral(Boolean osRollingUpgradeDeferral) Set the osRollingUpgradeDeferral property: Indicates whether Auto OS Upgrade should undergo deferral.withUseRollingUpgradePolicy(Boolean useRollingUpgradePolicy) Set the useRollingUpgradePolicy property: Indicates whether rolling upgrade policy should be used during Auto OS Upgrade.Methods inherited from class java.lang.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
-
AutomaticOSUpgradePolicy
public AutomaticOSUpgradePolicy()Creates an instance of AutomaticOSUpgradePolicy class.
-
-
Method Details
-
enableAutomaticOSUpgrade
Get the enableAutomaticOSUpgrade property: Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. Default value is false. If this is set to true for Windows based scale sets, [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) is automatically set to false and cannot be set to true.- Returns:
- the enableAutomaticOSUpgrade value.
-
withEnableAutomaticOSUpgrade
Set the enableAutomaticOSUpgrade property: Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. Default value is false. If this is set to true for Windows based scale sets, [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) is automatically set to false and cannot be set to true.- Parameters:
enableAutomaticOSUpgrade- the enableAutomaticOSUpgrade value to set.- Returns:
- the AutomaticOSUpgradePolicy object itself.
-
disableAutomaticRollback
Get the disableAutomaticRollback property: Whether OS image rollback feature should be disabled. Default value is false.- Returns:
- the disableAutomaticRollback value.
-
withDisableAutomaticRollback
Set the disableAutomaticRollback property: Whether OS image rollback feature should be disabled. Default value is false.- Parameters:
disableAutomaticRollback- the disableAutomaticRollback value to set.- Returns:
- the AutomaticOSUpgradePolicy object itself.
-
useRollingUpgradePolicy
Get the useRollingUpgradePolicy property: Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Default value is false. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS.- Returns:
- the useRollingUpgradePolicy value.
-
withUseRollingUpgradePolicy
Set the useRollingUpgradePolicy property: Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Default value is false. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS.- Parameters:
useRollingUpgradePolicy- the useRollingUpgradePolicy value to set.- Returns:
- the AutomaticOSUpgradePolicy object itself.
-
osRollingUpgradeDeferral
Get the osRollingUpgradeDeferral property: Indicates whether Auto OS Upgrade should undergo deferral. Deferred OS upgrades will send advanced notifications on a per-VM basis that an OS upgrade from rolling upgrades is incoming, via the IMDS tag 'Platform.PendingOSUpgrade'. The upgrade then defers until the upgrade is approved via an ApproveRollingUpgrade call.- Returns:
- the osRollingUpgradeDeferral value.
-
withOsRollingUpgradeDeferral
Set the osRollingUpgradeDeferral property: Indicates whether Auto OS Upgrade should undergo deferral. Deferred OS upgrades will send advanced notifications on a per-VM basis that an OS upgrade from rolling upgrades is incoming, via the IMDS tag 'Platform.PendingOSUpgrade'. The upgrade then defers until the upgrade is approved via an ApproveRollingUpgrade call.- Parameters:
osRollingUpgradeDeferral- the osRollingUpgradeDeferral value to set.- Returns:
- the AutomaticOSUpgradePolicy 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<AutomaticOSUpgradePolicy>- Throws:
IOException
-
fromJson
public static AutomaticOSUpgradePolicy fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of AutomaticOSUpgradePolicy from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of AutomaticOSUpgradePolicy 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 AutomaticOSUpgradePolicy.
-