Class ScaleAction
java.lang.Object
com.azure.resourcemanager.monitor.models.ScaleAction
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ScaleAction>
public final class ScaleAction
extends Object
implements com.azure.json.JsonSerializable<ScaleAction>
The parameters for the scaling action.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncooldown()
Get the cooldown property: the amount of time to wait since the last scaling action before this action occurs.Get the direction property: the scale direction.static ScaleAction
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of ScaleAction from the JsonReader.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) type()
Get the type property: the type of action that should occur when the scale rule fires.void
validate()
Validates the instance.value()
Get the value property: the number of instances that are involved in the scaling action.withCooldown
(Duration cooldown) Set the cooldown property: the amount of time to wait since the last scaling action before this action occurs.withDirection
(ScaleDirection direction) Set the direction property: the scale direction.Set the type property: the type of action that should occur when the scale rule fires.Set the value property: the number of instances that are involved in the scaling action.Methods inherited from class java.lang.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
-
ScaleAction
public ScaleAction()Creates an instance of ScaleAction class.
-
-
Method Details
-
direction
Get the direction property: the scale direction. Whether the scaling action increases or decreases the number of instances.- Returns:
- the direction value.
-
withDirection
Set the direction property: the scale direction. Whether the scaling action increases or decreases the number of instances.- Parameters:
direction
- the direction value to set.- Returns:
- the ScaleAction object itself.
-
type
Get the type property: the type of action that should occur when the scale rule fires.- Returns:
- the type value.
-
withType
Set the type property: the type of action that should occur when the scale rule fires.- Parameters:
type
- the type value to set.- Returns:
- the ScaleAction object itself.
-
value
Get the value property: the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1.- Returns:
- the value value.
-
withValue
Set the value property: the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1.- Parameters:
value
- the value value to set.- Returns:
- the ScaleAction object itself.
-
cooldown
Get the cooldown property: the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week and 1 minute in ISO 8601 format.- Returns:
- the cooldown value.
-
withCooldown
Set the cooldown property: the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week and 1 minute in ISO 8601 format.- Parameters:
cooldown
- the cooldown value to set.- Returns:
- the ScaleAction object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException
- thrown if the instance is not valid.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<ScaleAction>
- Throws:
IOException
-
fromJson
Reads an instance of ScaleAction from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of ScaleAction if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException
- If the deserialized JSON object was missing any required properties.IOException
- If an error occurs while reading the ScaleAction.
-