Class SpotRestorePolicy

java.lang.Object
com.azure.resourcemanager.compute.models.SpotRestorePolicy
All Implemented Interfaces:
com.azure.json.JsonSerializable<SpotRestorePolicy>

public final class SpotRestorePolicy extends Object implements com.azure.json.JsonSerializable<SpotRestorePolicy>
Specifies the Spot-Try-Restore properties for the virtual machine scale set. With this property customer can enable or disable automatic restore of the evicted Spot VMSS VM instances opportunistically based on capacity availability and pricing constraint.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of SpotRestorePolicy class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the enabled property: Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored opportunistically based on capacity availability and pricing constraints.
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of SpotRestorePolicy from the JsonReader.
    Get the restoreTimeout property: Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    Set the enabled property: Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored opportunistically based on capacity availability and pricing constraints.
    withRestoreTimeout(String restoreTimeout)
    Set the restoreTimeout property: Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances.

    Methods inherited from class java.lang.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

    • SpotRestorePolicy

      public SpotRestorePolicy()
      Creates an instance of SpotRestorePolicy class.
  • Method Details

    • enabled

      public Boolean enabled()
      Get the enabled property: Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored opportunistically based on capacity availability and pricing constraints.
      Returns:
      the enabled value.
    • withEnabled

      public SpotRestorePolicy withEnabled(Boolean enabled)
      Set the enabled property: Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored opportunistically based on capacity availability and pricing constraints.
      Parameters:
      enabled - the enabled value to set.
      Returns:
      the SpotRestorePolicy object itself.
    • restoreTimeout

      public String restoreTimeout()
      Get the restoreTimeout property: Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances.
      Returns:
      the restoreTimeout value.
    • withRestoreTimeout

      public SpotRestorePolicy withRestoreTimeout(String restoreTimeout)
      Set the restoreTimeout property: Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances.
      Parameters:
      restoreTimeout - the restoreTimeout value to set.
      Returns:
      the SpotRestorePolicy 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<SpotRestorePolicy>
      Throws:
      IOException
    • fromJson

      public static SpotRestorePolicy fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of SpotRestorePolicy from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of SpotRestorePolicy 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 SpotRestorePolicy.