Class UpgradePolicy

java.lang.Object
com.azure.compute.batch.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 Details

    • UpgradePolicy

      public UpgradePolicy(UpgradeMode mode)
      Creates an instance of UpgradePolicy class.
      Parameters:
      mode - the mode value to set.
  • Method Details

    • getMode

      public UpgradeMode getMode()
      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.<br /><br /> **Rolling** - Scale set performs updates in batches with an optional pause time in between.
      Returns:
      the mode value.
    • getAutomaticOsUpgradePolicy

      public AutomaticOsUpgradePolicy getAutomaticOsUpgradePolicy()
      Get the automaticOsUpgradePolicy property: Configuration parameters used for performing automatic OS Upgrade. The configuration parameters used for performing automatic OS upgrade.
      Returns:
      the automaticOsUpgradePolicy value.
    • setAutomaticOsUpgradePolicy

      public UpgradePolicy setAutomaticOsUpgradePolicy(AutomaticOsUpgradePolicy automaticOsUpgradePolicy)
      Set the automaticOsUpgradePolicy property: Configuration parameters used for performing automatic OS Upgrade. The configuration parameters used for performing automatic OS upgrade.
      Parameters:
      automaticOsUpgradePolicy - the automaticOsUpgradePolicy value to set.
      Returns:
      the UpgradePolicy object itself.
    • getRollingUpgradePolicy

      public RollingUpgradePolicy getRollingUpgradePolicy()
      Get the rollingUpgradePolicy property: The configuration parameters used while performing a rolling upgrade.
      Returns:
      the rollingUpgradePolicy value.
    • setRollingUpgradePolicy

      public UpgradePolicy setRollingUpgradePolicy(RollingUpgradePolicy rollingUpgradePolicy)
      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.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<UpgradePolicy>
      Throws:
      IOException
    • fromJson

      public static UpgradePolicy fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      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:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the UpgradePolicy.