Share via


AutomaticOsUpgradePolicy Class

  • java.lang.Object
    • com.azure.compute.batch.models.AutomaticOsUpgradePolicy

Implements

public final class AutomaticOsUpgradePolicy
implements JsonSerializable<AutomaticOsUpgradePolicy>

The configuration parameters used for performing automatic OS upgrade.

Constructor Summary

Constructor Description
AutomaticOsUpgradePolicy()

Creates an instance of AutomaticOsUpgradePolicy class.

Method Summary

Modifier and Type Method and Description
static AutomaticOsUpgradePolicy fromJson(JsonReader jsonReader)

Reads an instance of AutomaticOsUpgradePolicy from the JsonReader.

Boolean isDisableAutomaticRollback()

Get the disableAutomaticRollback property: Whether OS image rollback feature should be disabled.

Boolean isEnableAutomaticOsUpgrade()

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.

Boolean isOsRollingUpgradeDeferral()

Get the osRollingUpgradeDeferral property: Defer OS upgrades on the TVMs if they are running tasks.

Boolean isUseRollingUpgradePolicy()

Get the useRollingUpgradePolicy property: Indicates whether rolling upgrade policy should be used during Auto OS Upgrade.

AutomaticOsUpgradePolicy setDisableAutomaticRollback(Boolean disableAutomaticRollback)

Set the disableAutomaticRollback property: Whether OS image rollback feature should be disabled.

AutomaticOsUpgradePolicy setEnableAutomaticOsUpgrade(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.

AutomaticOsUpgradePolicy setOsRollingUpgradeDeferral(Boolean osRollingUpgradeDeferral)

Set the osRollingUpgradeDeferral property: Defer OS upgrades on the TVMs if they are running tasks.

AutomaticOsUpgradePolicy setUseRollingUpgradePolicy(Boolean useRollingUpgradePolicy)

Set the useRollingUpgradePolicy property: Indicates whether rolling upgrade policy should be used during Auto OS Upgrade.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

AutomaticOsUpgradePolicy

public AutomaticOsUpgradePolicy()

Creates an instance of AutomaticOsUpgradePolicy class.

Method Details

fromJson

public static AutomaticOsUpgradePolicy fromJson(JsonReader jsonReader)

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.

isDisableAutomaticRollback

public Boolean isDisableAutomaticRollback()

Get the disableAutomaticRollback property: Whether OS image rollback feature should be disabled.

Returns:

the disableAutomaticRollback value.

isEnableAutomaticOsUpgrade

public Boolean isEnableAutomaticOsUpgrade()

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.

If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/rest/api/batchservice/pool/add?tabs=HTTP\#windowsconfiguration) cannot be set to true.

Returns:

the enableAutomaticOsUpgrade value.

isOsRollingUpgradeDeferral

public Boolean isOsRollingUpgradeDeferral()

Get the osRollingUpgradeDeferral property: Defer OS upgrades on the TVMs if they are running tasks.

Returns:

the osRollingUpgradeDeferral value.

isUseRollingUpgradePolicy

public Boolean isUseRollingUpgradePolicy()

Get the useRollingUpgradePolicy property: Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS.

Returns:

the useRollingUpgradePolicy value.

setDisableAutomaticRollback

public AutomaticOsUpgradePolicy setDisableAutomaticRollback(Boolean disableAutomaticRollback)

Set the disableAutomaticRollback property: Whether OS image rollback feature should be disabled.

Parameters:

disableAutomaticRollback - the disableAutomaticRollback value to set.

Returns:

the AutomaticOsUpgradePolicy object itself.

setEnableAutomaticOsUpgrade

public AutomaticOsUpgradePolicy setEnableAutomaticOsUpgrade(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.

If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/rest/api/batchservice/pool/add?tabs=HTTP\#windowsconfiguration) cannot be set to true.

Parameters:

enableAutomaticOsUpgrade - the enableAutomaticOsUpgrade value to set.

Returns:

the AutomaticOsUpgradePolicy object itself.

setOsRollingUpgradeDeferral

public AutomaticOsUpgradePolicy setOsRollingUpgradeDeferral(Boolean osRollingUpgradeDeferral)

Set the osRollingUpgradeDeferral property: Defer OS upgrades on the TVMs if they are running tasks.

Parameters:

osRollingUpgradeDeferral - the osRollingUpgradeDeferral value to set.

Returns:

the AutomaticOsUpgradePolicy object itself.

setUseRollingUpgradePolicy

public AutomaticOsUpgradePolicy setUseRollingUpgradePolicy(Boolean useRollingUpgradePolicy)

Set the useRollingUpgradePolicy property: Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. 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.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to