PrometheusRule Class
- java.
lang. Object - com.
azure. resourcemanager. alertsmanagement. models. PrometheusRule
- com.
Implements
public final class PrometheusRule
implements JsonSerializable<PrometheusRule>
The PrometheusRule model.
Constructor Summary
| Constructor | Description |
|---|---|
| PrometheusRule() |
Creates an instance of Prometheus |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
List<Prometheus |
actions()
Get the actions property: The array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. |
| String |
alert()
Get the alert property: the name of the alert rule. |
| Map<String,String> |
annotations()
Get the annotations property: annotations for rule group. |
| Boolean |
enabled()
Get the enabled property: the flag that indicates whether the Prometheus rule is enabled. |
| String |
expression()
Get the expression property: the expression to run for the rule. |
| String |
forProperty()
Get the for |
|
static
Prometheus |
fromJson(JsonReader jsonReader)
Reads an instance of Prometheus |
| Map<String,String> |
labels()
Get the labels property: labels for rule group. |
| String |
record()
Get the record property: the name of the recording rule. |
|
Prometheus |
resolveConfiguration()
Get the resolve |
| Integer |
severity()
Get the severity property: the severity of the alerts fired by the rule. |
|
Json |
toJson(JsonWriter jsonWriter) |
| void |
validate()
Validates the instance. |
|
Prometheus |
withActions(List<PrometheusRuleGroupAction> actions)
Set the actions property: The array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. |
|
Prometheus |
withAlert(String alert)
Set the alert property: the name of the alert rule. |
|
Prometheus |
withAnnotations(Map<String,String> annotations)
Set the annotations property: annotations for rule group. |
|
Prometheus |
withEnabled(Boolean enabled)
Set the enabled property: the flag that indicates whether the Prometheus rule is enabled. |
|
Prometheus |
withExpression(String expression)
Set the expression property: the expression to run for the rule. |
|
Prometheus |
withForProperty(String forProperty)
Set the for |
|
Prometheus |
withLabels(Map<String,String> labels)
Set the labels property: labels for rule group. |
|
Prometheus |
withRecord(String record)
Set the record property: the name of the recording rule. |
|
Prometheus |
withResolveConfiguration(PrometheusRuleResolveConfiguration resolveConfiguration)
Set the resolve |
|
Prometheus |
withSeverity(Integer severity)
Set the severity property: the severity of the alerts fired by the rule. |
Methods inherited from java.lang.Object
Constructor Details
PrometheusRule
public PrometheusRule()
Creates an instance of PrometheusRule class.
Method Details
actions
public List<PrometheusRuleGroupAction> actions()
Get the actions property: The array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. Only relevant for alerts.
Returns:
alert
public String alert()
Get the alert property: the name of the alert rule.
Returns:
annotations
public Map<String,String> annotations()
Get the annotations property: annotations for rule group. Only relevant for alerts.
Returns:
enabled
public Boolean enabled()
Get the enabled property: the flag that indicates whether the Prometheus rule is enabled.
Returns:
expression
public String expression()
Get the expression property: the expression to run for the rule.
Returns:
forProperty
public String forProperty()
Get the forProperty property: the amount of time alert must be active before firing. Only relevant for alerts.
Returns:
fromJson
public static PrometheusRule fromJson(JsonReader jsonReader)
Reads an instance of PrometheusRule from the JsonReader.
Parameters:
Returns:
Throws:
labels
public Map<String,String> labels()
Get the labels property: labels for rule group. Only relevant for alerts.
Returns:
record
public String record()
Get the record property: the name of the recording rule.
Returns:
resolveConfiguration
public PrometheusRuleResolveConfiguration resolveConfiguration()
Get the resolveConfiguration property: defines the configuration for resolving fired alerts. Only relevant for alerts.
Returns:
severity
public Integer severity()
Get the severity property: the severity of the alerts fired by the rule. Only relevant for alerts.
Returns:
toJson
validate
public void validate()
Validates the instance.
withActions
public PrometheusRule withActions(List<PrometheusRuleGroupAction> actions)
Set the actions property: The array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. Only relevant for alerts.
Parameters:
Returns:
withAlert
public PrometheusRule withAlert(String alert)
Set the alert property: the name of the alert rule.
Parameters:
Returns:
withAnnotations
public PrometheusRule withAnnotations(Map<String,String> annotations)
Set the annotations property: annotations for rule group. Only relevant for alerts.
Parameters:
Returns:
withEnabled
public PrometheusRule withEnabled(Boolean enabled)
Set the enabled property: the flag that indicates whether the Prometheus rule is enabled.
Parameters:
Returns:
withExpression
public PrometheusRule withExpression(String expression)
Set the expression property: the expression to run for the rule.
Parameters:
Returns:
withForProperty
public PrometheusRule withForProperty(String forProperty)
Set the forProperty property: the amount of time alert must be active before firing. Only relevant for alerts.
Parameters:
Returns:
withLabels
public PrometheusRule withLabels(Map<String,String> labels)
Set the labels property: labels for rule group. Only relevant for alerts.
Parameters:
Returns:
withRecord
public PrometheusRule withRecord(String record)
Set the record property: the name of the recording rule.
Parameters:
Returns:
withResolveConfiguration
public PrometheusRule withResolveConfiguration(PrometheusRuleResolveConfiguration resolveConfiguration)
Set the resolveConfiguration property: defines the configuration for resolving fired alerts. Only relevant for alerts.
Parameters:
Returns:
withSeverity
public PrometheusRule withSeverity(Integer severity)
Set the severity property: the severity of the alerts fired by the rule. Only relevant for alerts.
Parameters:
Returns: