ExternalHealthPolicy Class

  • java.lang.Object
    • com.azure.resourcemanager.compute.models.ExternalHealthPolicy

Implements

public final class ExternalHealthPolicy
implements JsonSerializable<ExternalHealthPolicy>

Specifies the external health policy for the virtual machine scale set.

Constructor Summary

Constructor Description
ExternalHealthPolicy()

Creates an instance of ExternalHealthPolicy class.

Method Summary

Modifier and Type Method and Description
Boolean enabled()

Get the enabled property: If true, external health is enabled for this scale set.

Duration expiryDuration()

Get the expiryDuration property: Defines how long the health status set by External Health API will last on the VM.

static ExternalHealthPolicy fromJson(JsonReader jsonReader)

Reads an instance of ExternalHealthPolicy from the JsonReader.

Duration gracePeriod()

Get the gracePeriod property: Grace period for newly created VMs or when the External Health policy is first applied on VMSS.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

ExternalHealthPolicy withEnabled(Boolean enabled)

Set the enabled property: If true, external health is enabled for this scale set.

ExternalHealthPolicy withExpiryDuration(Duration expiryDuration)

Set the expiryDuration property: Defines how long the health status set by External Health API will last on the VM.

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.

Methods inherited from java.lang.Object

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.

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.

fromJson

public static ExternalHealthPolicy fromJson(JsonReader jsonReader)

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.

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.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

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.

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.

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.

Applies to