Class AutomaticRepairsPolicy
- java.lang.Object
-
- com.azure.resourcemanager.compute.models.AutomaticRepairsPolicy
-
public final class AutomaticRepairsPolicy extends Object
Specifies the configuration parameters for automatic repairs on the virtual machine scale set.
-
-
Constructor Summary
Constructors Constructor Description AutomaticRepairsPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Booleanenabled()Get the enabled property: Specifies whether automatic repairs should be enabled on the virtual machine scale set.StringgracePeriod()Get the gracePeriod property: The amount of time for which automatic repairs are suspended due to a state change on VM.RepairActionrepairAction()Get the repairAction property: Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale set.voidvalidate()Validates the instance.AutomaticRepairsPolicywithEnabled(Boolean enabled)Set the enabled property: Specifies whether automatic repairs should be enabled on the virtual machine scale set.AutomaticRepairsPolicywithGracePeriod(String gracePeriod)Set the gracePeriod property: The amount of time for which automatic repairs are suspended due to a state change on VM.AutomaticRepairsPolicywithRepairAction(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.
-
-
-
Method Detail
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
validate
public void validate()
Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
-