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
    Constructor
    Description
    Creates an instance of UpgradePolicy class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the automaticOSUpgradePolicy property: Configuration parameters used for performing automatic OS Upgrade.
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of UpgradePolicy from the JsonReader.
    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.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    Set the automaticOSUpgradePolicy property: Configuration parameters used for performing automatic OS Upgrade.
    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.
    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, wait

    Methods 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

      public UpgradeMode 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

      public UpgradePolicy 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. 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

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

      public UpgradePolicy withRollingUpgradePolicy(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.
    • automaticOSUpgradePolicy

      public AutomaticOSUpgradePolicy 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

      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:
      IOException - If an error occurs while reading the UpgradePolicy.