다음을 통해 공유


AutomaticRepairsPolicy Class

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

Implements

public final class AutomaticRepairsPolicy
implements JsonSerializable<AutomaticRepairsPolicy>

Specifies the configuration parameters for automatic repairs on the virtual machine scale set.

Constructor Summary

Constructor Description
AutomaticRepairsPolicy()

Creates an instance of AutomaticRepairsPolicy class.

Method Summary

Modifier and Type Method and Description
Boolean enabled()

Get the enabled property: Specifies whether automatic repairs should be enabled on the virtual machine scale set.

static AutomaticRepairsPolicy fromJson(JsonReader jsonReader)

Reads an instance of AutomaticRepairsPolicy from the JsonReader.

String gracePeriod()

Get the gracePeriod property: The amount of time for which automatic repairs are suspended due to a state change on VM.

RepairAction repairAction()

Get the repairAction property: Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale set.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

AutomaticRepairsPolicy withEnabled(Boolean enabled)

Set the enabled property: Specifies whether automatic repairs should be enabled on the virtual machine scale set.

AutomaticRepairsPolicy withGracePeriod(String gracePeriod)

Set the gracePeriod property: The amount of time for which automatic repairs are suspended due to a state change on VM.

AutomaticRepairsPolicy withRepairAction(RepairAction repairAction)

Set the repairAction property: Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale set.

Methods inherited from java.lang.Object

Constructor Details

AutomaticRepairsPolicy

public AutomaticRepairsPolicy()

Creates an instance of AutomaticRepairsPolicy class.

Method Details

enabled

public Boolean enabled()

Get the enabled property: Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false.

Returns:

the enabled value.

fromJson

public static AutomaticRepairsPolicy fromJson(JsonReader jsonReader)

Reads an instance of AutomaticRepairsPolicy from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of AutomaticRepairsPolicy 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 AutomaticRepairsPolicy.

gracePeriod

public String gracePeriod()

Get the gracePeriod property: The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 10 minutes (PT10M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M).

Returns:

the gracePeriod value.

repairAction

public RepairAction repairAction()

Get the repairAction property: Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale set. Default value is replace.

Returns:

the repairAction value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withEnabled

public AutomaticRepairsPolicy withEnabled(Boolean enabled)

Set the enabled property: Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false.

Parameters:

enabled - the enabled value to set.

Returns:

the AutomaticRepairsPolicy object itself.

withGracePeriod

public AutomaticRepairsPolicy withGracePeriod(String gracePeriod)

Set the gracePeriod property: The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 10 minutes (PT10M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M).

Parameters:

gracePeriod - the gracePeriod value to set.

Returns:

the AutomaticRepairsPolicy object itself.

withRepairAction

public AutomaticRepairsPolicy withRepairAction(RepairAction repairAction)

Set the repairAction property: Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale set. Default value is replace.

Parameters:

repairAction - the repairAction value to set.

Returns:

the AutomaticRepairsPolicy object itself.

Applies to