AlertRuleProperties Class

  • java.lang.Object
    • com.azure.resourcemanager.monitor.fluent.models.AlertRuleProperties

Implements

public final class AlertRuleProperties
implements JsonSerializable<AlertRuleProperties>

An Azure Activity Log Alert rule.

Constructor Summary

Constructor Description
AlertRuleProperties()

Creates an instance of AlertRuleProperties class.

Method Summary

Modifier and Type Method and Description
ActionList actions()

Get the actions property: The actions that will activate when the condition is met.

ActivityLogAlertAllOfCondition condition()

Get the condition property: The condition that will cause this alert to activate.

String description()

Get the description property: A description of this Activity Log Alert rule.

Boolean enabled()

Get the enabled property: Indicates whether this Activity Log Alert rule is enabled.

static AlertRuleProperties fromJson(JsonReader jsonReader)

Reads an instance of AlertRuleProperties from the JsonReader.

List<String> scopes()

Get the scopes property: A list of resource IDs that will be used as prefixes.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

AlertRuleProperties withActions(ActionList actions)

Set the actions property: The actions that will activate when the condition is met.

AlertRuleProperties withCondition(ActivityLogAlertAllOfCondition condition)

Set the condition property: The condition that will cause this alert to activate.

AlertRuleProperties withDescription(String description)

Set the description property: A description of this Activity Log Alert rule.

AlertRuleProperties withEnabled(Boolean enabled)

Set the enabled property: Indicates whether this Activity Log Alert rule is enabled.

AlertRuleProperties withScopes(List<String> scopes)

Set the scopes property: A list of resource IDs that will be used as prefixes.

Methods inherited from java.lang.Object

Constructor Details

AlertRuleProperties

public AlertRuleProperties()

Creates an instance of AlertRuleProperties class.

Method Details

actions

public ActionList actions()

Get the actions property: The actions that will activate when the condition is met.

Returns:

the actions value.

condition

public ActivityLogAlertAllOfCondition condition()

Get the condition property: The condition that will cause this alert to activate.

Returns:

the condition value.

description

public String description()

Get the description property: A description of this Activity Log Alert rule.

Returns:

the description value.

enabled

public Boolean enabled()

Get the enabled property: Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.

Returns:

the enabled value.

fromJson

public static AlertRuleProperties fromJson(JsonReader jsonReader)

Reads an instance of AlertRuleProperties from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of AlertRuleProperties if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

scopes

public List scopes()

Get the scopes property: A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item.

Returns:

the scopes value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withActions

public AlertRuleProperties withActions(ActionList actions)

Set the actions property: The actions that will activate when the condition is met.

Parameters:

actions - the actions value to set.

Returns:

the AlertRuleProperties object itself.

withCondition

public AlertRuleProperties withCondition(ActivityLogAlertAllOfCondition condition)

Set the condition property: The condition that will cause this alert to activate.

Parameters:

condition - the condition value to set.

Returns:

the AlertRuleProperties object itself.

withDescription

public AlertRuleProperties withDescription(String description)

Set the description property: A description of this Activity Log Alert rule.

Parameters:

description - the description value to set.

Returns:

the AlertRuleProperties object itself.

withEnabled

public AlertRuleProperties withEnabled(Boolean enabled)

Set the enabled property: Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.

Parameters:

enabled - the enabled value to set.

Returns:

the AlertRuleProperties object itself.

withScopes

public AlertRuleProperties withScopes(List scopes)

Set the scopes property: A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item.

Parameters:

scopes - the scopes value to set.

Returns:

the AlertRuleProperties object itself.

Applies to

Azure SDK for Java

Latest