Class V2HPAScalingRules
java.lang.Object
io.kubernetes.client.openapi.models.V2HPAScalingRules
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
date="2024-04-23T13:45:09.091597Z[Etc/UTC]")
public class V2HPAScalingRules
extends Object
HPAScalingRules configures the scaling behavior for one direction. These Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPoliciesItem
(V2HPAScalingPolicy policiesItem) boolean
static V2HPAScalingRules
Create an instance of V2HPAScalingRules given an JSON stringpolicies is a list of potential scaling polices which can be used during scaling.selectPolicy is used to specify which policy should be used.stabilizationWindowSeconds is the number of seconds for which past recommendations should be considered while scaling up or scaling down.int
hashCode()
policies
(List<V2HPAScalingPolicy> policies) selectPolicy
(String selectPolicy) void
setPolicies
(List<V2HPAScalingPolicy> policies) void
setSelectPolicy
(String selectPolicy) void
setStabilizationWindowSeconds
(Integer stabilizationWindowSeconds) stabilizationWindowSeconds
(Integer stabilizationWindowSeconds) toJson()
Convert an instance of V2HPAScalingRules to an JSON stringtoString()
static void
validateJsonObject
(com.google.gson.JsonObject jsonObj) Validates the JSON Object and throws an exception if issues found
-
Field Details
-
SERIALIZED_NAME_POLICIES
- See Also:
-
SERIALIZED_NAME_SELECT_POLICY
- See Also:
-
SERIALIZED_NAME_STABILIZATION_WINDOW_SECONDS
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
V2HPAScalingRules
public V2HPAScalingRules()
-
-
Method Details
-
policies
-
addPoliciesItem
-
getPolicies
policies is a list of potential scaling polices which can be used during scaling. At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid- Returns:
- policies
-
setPolicies
-
selectPolicy
-
getSelectPolicy
selectPolicy is used to specify which policy should be used. If not set, the default value Max is used.- Returns:
- selectPolicy
-
setSelectPolicy
-
stabilizationWindowSeconds
-
getStabilizationWindowSeconds
stabilizationWindowSeconds is the number of seconds for which past recommendations should be considered while scaling up or scaling down. StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long).- Returns:
- stabilizationWindowSeconds
-
setStabilizationWindowSeconds
-
equals
-
hashCode
public int hashCode() -
toString
-
validateJsonObject
Validates the JSON Object and throws an exception if issues found- Parameters:
jsonObj
- JSON Object- Throws:
IOException
- if the JSON Object is invalid with respect to V2HPAScalingRules
-
fromJson
Create an instance of V2HPAScalingRules given an JSON string- Parameters:
jsonString
- JSON string- Returns:
- An instance of V2HPAScalingRules
- Throws:
IOException
- if the JSON string is invalid with respect to V2HPAScalingRules
-
toJson
Convert an instance of V2HPAScalingRules to an JSON string- Returns:
- JSON string
-