Class ExternalHealthPolicy

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

public final class ExternalHealthPolicy extends Object implements com.azure.json.JsonSerializable<ExternalHealthPolicy>
Specifies the external health policy for the virtual machine scale set.
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    Get the enabled property: If true, external health is enabled for this scale set.
    Get the expiryDuration property: Defines how long the health status set by External Health API will last on the VM.
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of ExternalHealthPolicy from the JsonReader.
    Get the gracePeriod property: Grace period for newly created VMs or when the External Health policy is first applied on VMSS.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    Set the enabled property: If true, external health is enabled for this scale set.
    withExpiryDuration(Duration expiryDuration)
    Set the expiryDuration property: Defines how long the health status set by External Health API will last on the VM.
    Set the gracePeriod property: Grace period for newly created VMs or when the External Health policy is first applied on VMSS.

    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

    • ExternalHealthPolicy

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

    • enabled

      public Boolean enabled()
      Get the enabled property: If true, external health is enabled for this scale set. Cannot be set to true on instances where another health monitoring source is active (ApplicationHealth extension or SLB). Defaults to false.
      Returns:
      the enabled value.
    • withEnabled

      public ExternalHealthPolicy withEnabled(Boolean enabled)
      Set the enabled property: If true, external health is enabled for this scale set. Cannot be set to true on instances where another health monitoring source is active (ApplicationHealth extension or SLB). Defaults to false.
      Parameters:
      enabled - the enabled value to set.
      Returns:
      the ExternalHealthPolicy object itself.
    • expiryDuration

      public Duration expiryDuration()
      Get the expiryDuration property: Defines how long the health status set by External Health API will last on the VM. If a signal is not received/updated within this time, the VM Health will be marked as "unknown". Uses the ISO 8601 format. Minimum: 5 minutes (PT5M), Maximum: 3 hours (PT3H).
      Returns:
      the expiryDuration value.
    • withExpiryDuration

      public ExternalHealthPolicy withExpiryDuration(Duration expiryDuration)
      Set the expiryDuration property: Defines how long the health status set by External Health API will last on the VM. If a signal is not received/updated within this time, the VM Health will be marked as "unknown". Uses the ISO 8601 format. Minimum: 5 minutes (PT5M), Maximum: 3 hours (PT3H).
      Parameters:
      expiryDuration - the expiryDuration value to set.
      Returns:
      the ExternalHealthPolicy object itself.
    • gracePeriod

      public Duration gracePeriod()
      Get the gracePeriod property: Grace period for newly created VMs or when the External Health policy is first applied on VMSS. Uses the ISO 8601 format. Minimum: 5 minutes (PT5M), Maximum: 4 hours (PT4H).
      Returns:
      the gracePeriod value.
    • withGracePeriod

      public ExternalHealthPolicy withGracePeriod(Duration gracePeriod)
      Set the gracePeriod property: Grace period for newly created VMs or when the External Health policy is first applied on VMSS. Uses the ISO 8601 format. Minimum: 5 minutes (PT5M), Maximum: 4 hours (PT4H).
      Parameters:
      gracePeriod - the gracePeriod value to set.
      Returns:
      the ExternalHealthPolicy 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<ExternalHealthPolicy>
      Throws:
      IOException
    • fromJson

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