RateLimitRule Class
- java.
lang. Object - com.
azure. resourcemanager. cdn. models. CustomRule - com.
azure. resourcemanager. cdn. models. RateLimitRule
- com.
- com.
public final class RateLimitRule
extends CustomRule
Defines a rate limiting rule that can be included in a waf policy.
Constructor Summary
| Constructor | Description |
|---|---|
| RateLimitRule() |
Creates an instance of Rate |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Rate |
fromJson(JsonReader jsonReader)
Reads an instance of Rate |
| int |
rateLimitDurationInMinutes()
Get the rate |
| int |
rateLimitThreshold()
Get the rate |
|
Json |
toJson(JsonWriter jsonWriter) |
| void |
validate()
Validates the instance. |
|
Rate |
withAction(ActionType action)
Set the action property: Describes what action to be applied when rule matches. |
|
Rate |
withEnabledState(CustomRuleEnabledState enabledState)
Set the enabled |
|
Rate |
withMatchConditions(List<MatchCondition> matchConditions)
Set the match |
|
Rate |
withName(String name)
Set the name property: Defines the name of the custom rule. |
|
Rate |
withPriority(int priority)
Set the priority property: Defines in what order this rule be evaluated in the overall list of custom rules. |
|
Rate |
withRateLimitDurationInMinutes(int rateLimitDurationInMinutes)
Set the rate |
|
Rate |
withRateLimitThreshold(int rateLimitThreshold)
Set the rate |
Methods inherited from CustomRule
Methods inherited from java.lang.Object
Constructor Details
RateLimitRule
public RateLimitRule()
Creates an instance of RateLimitRule class.
Method Details
fromJson
public static RateLimitRule fromJson(JsonReader jsonReader)
Reads an instance of RateLimitRule from the JsonReader.
Parameters:
Returns:
Throws:
rateLimitDurationInMinutes
public int rateLimitDurationInMinutes()
Get the rateLimitDurationInMinutes property: Defines rate limit duration. Default is 1 minute.
Returns:
rateLimitThreshold
public int rateLimitThreshold()
Get the rateLimitThreshold property: Defines rate limit threshold.
Returns:
toJson
public JsonWriter toJson(JsonWriter jsonWriter)
Overrides:
RateLimitRule.toJson(JsonWriter jsonWriter)Parameters:
Throws:
validate
public void validate()
Validates the instance.
Overrides:
RateLimitRule.validate()withAction
public RateLimitRule withAction(ActionType action)
Set the action property: Describes what action to be applied when rule matches.
Overrides:
RateLimitRule.withAction(ActionType action)Parameters:
withEnabledState
public RateLimitRule withEnabledState(CustomRuleEnabledState enabledState)
Set the enabledState property: Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.
Overrides:
RateLimitRule.withEnabledState(CustomRuleEnabledState enabledState)Parameters:
withMatchConditions
public RateLimitRule withMatchConditions(List<MatchCondition> matchConditions)
Set the matchConditions property: List of match conditions.
Overrides:
RateLimitRule.withMatchConditions(List<MatchCondition> matchConditions)Parameters:
withName
public RateLimitRule withName(String name)
Set the name property: Defines the name of the custom rule.
Overrides:
RateLimitRule.withName(String name)Parameters:
withPriority
public RateLimitRule withPriority(int priority)
Set the priority property: Defines in what order this rule be evaluated in the overall list of custom rules.
Overrides:
RateLimitRule.withPriority(int priority)Parameters:
withRateLimitDurationInMinutes
public RateLimitRule withRateLimitDurationInMinutes(int rateLimitDurationInMinutes)
Set the rateLimitDurationInMinutes property: Defines rate limit duration. Default is 1 minute.
Parameters:
Returns:
withRateLimitThreshold
public RateLimitRule withRateLimitThreshold(int rateLimitThreshold)
Set the rateLimitThreshold property: Defines rate limit threshold.
Parameters:
Returns: