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 -
Method Summary
Modifier and TypeMethodDescriptionenabled()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.static ExternalHealthPolicyfromJson(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.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withEnabled(Boolean enabled) 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.withGracePeriod(Duration gracePeriod) 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, waitMethods 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
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
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
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
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
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
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
- Specified by:
toJsonin interfacecom.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.
-