ScheduledQueryRuleResourcePatch Class

  • java.lang.Object
    • com.azure.resourcemanager.monitor.models.ScheduledQueryRuleResourcePatch

Implements

public final class ScheduledQueryRuleResourcePatch
implements JsonSerializable<ScheduledQueryRuleResourcePatch>

The scheduled query rule resource for patch operations.

Constructor Summary

Constructor Description
ScheduledQueryRuleResourcePatch()

Creates an instance of ScheduledQueryRuleResourcePatch class.

Method Summary

Modifier and Type Method and Description
Actions actions()

Get the actions property: Actions to invoke when the alert fires.

Boolean autoMitigate()

Get the autoMitigate property: The flag that indicates whether the alert should be automatically resolved or not.

Boolean checkWorkspaceAlertsStorageConfigured()

Get the checkWorkspaceAlertsStorageConfigured property: The flag which indicates whether this scheduled query rule should be stored in the customer's storage.

String createdWithApiVersion()

Get the createdWithApiVersion property: The api-version used when creating this alert rule.

ScheduledQueryRuleCriteria criteria()

Get the criteria property: The rule criteria that defines the conditions of the scheduled query rule.

String description()

Get the description property: The description of the scheduled query rule.

String displayName()

Get the displayName property: The display name of the alert rule.

Boolean enabled()

Get the enabled property: The flag which indicates whether this scheduled query rule is enabled.

Duration evaluationFrequency()

Get the evaluationFrequency property: How often the scheduled query rule is evaluated represented in ISO 8601 duration format.

static ScheduledQueryRuleResourcePatch fromJson(JsonReader jsonReader)

Reads an instance of ScheduledQueryRuleResourcePatch from the JsonReader.

Boolean isLegacyLogAnalyticsRule()

Get the isLegacyLogAnalyticsRule property: True if alert rule is legacy Log Analytic rule.

Boolean isWorkspaceAlertsStorageConfigured()

Get the isWorkspaceAlertsStorageConfigured property: The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage.

Duration muteActionsDuration()

Get the muteActionsDuration property: Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired.

Duration overrideQueryTimeRange()

Get the overrideQueryTimeRange property: If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods).

List<String> scopes()

Get the scopes property: The list of resource id's that this scheduled query rule is scoped to.

AlertSeverity severity()

Get the severity property: Severity of the alert.

Boolean skipQueryValidation()

Get the skipQueryValidation property: The flag which indicates whether the provided query should be validated or not.

Map<String,String> tags()

Get the tags property: Resource tags.

List<String> targetResourceTypes()

Get the targetResourceTypes property: List of resource type of the target resource(s) on which the alert is created/updated.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

Duration windowSize()

Get the windowSize property: The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size).

ScheduledQueryRuleResourcePatch withActions(Actions actions)

Set the actions property: Actions to invoke when the alert fires.

ScheduledQueryRuleResourcePatch withAutoMitigate(Boolean autoMitigate)

Set the autoMitigate property: The flag that indicates whether the alert should be automatically resolved or not.

ScheduledQueryRuleResourcePatch withCheckWorkspaceAlertsStorageConfigured(Boolean checkWorkspaceAlertsStorageConfigured)

Set the checkWorkspaceAlertsStorageConfigured property: The flag which indicates whether this scheduled query rule should be stored in the customer's storage.

ScheduledQueryRuleResourcePatch withCriteria(ScheduledQueryRuleCriteria criteria)

Set the criteria property: The rule criteria that defines the conditions of the scheduled query rule.

ScheduledQueryRuleResourcePatch withDescription(String description)

Set the description property: The description of the scheduled query rule.

ScheduledQueryRuleResourcePatch withDisplayName(String displayName)

Set the displayName property: The display name of the alert rule.

ScheduledQueryRuleResourcePatch withEnabled(Boolean enabled)

Set the enabled property: The flag which indicates whether this scheduled query rule is enabled.

ScheduledQueryRuleResourcePatch withEvaluationFrequency(Duration evaluationFrequency)

Set the evaluationFrequency property: How often the scheduled query rule is evaluated represented in ISO 8601 duration format.

ScheduledQueryRuleResourcePatch withMuteActionsDuration(Duration muteActionsDuration)

Set the muteActionsDuration property: Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired.

ScheduledQueryRuleResourcePatch withOverrideQueryTimeRange(Duration overrideQueryTimeRange)

Set the overrideQueryTimeRange property: If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods).

ScheduledQueryRuleResourcePatch withScopes(List<String> scopes)

Set the scopes property: The list of resource id's that this scheduled query rule is scoped to.

ScheduledQueryRuleResourcePatch withSeverity(AlertSeverity severity)

Set the severity property: Severity of the alert.

ScheduledQueryRuleResourcePatch withSkipQueryValidation(Boolean skipQueryValidation)

Set the skipQueryValidation property: The flag which indicates whether the provided query should be validated or not.

ScheduledQueryRuleResourcePatch withTags(Map<String,String> tags)

Set the tags property: Resource tags.

ScheduledQueryRuleResourcePatch withTargetResourceTypes(List<String> targetResourceTypes)

Set the targetResourceTypes property: List of resource type of the target resource(s) on which the alert is created/updated.

ScheduledQueryRuleResourcePatch withWindowSize(Duration windowSize)

Set the windowSize property: The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size).

Methods inherited from java.lang.Object

Constructor Details

ScheduledQueryRuleResourcePatch

public ScheduledQueryRuleResourcePatch()

Creates an instance of ScheduledQueryRuleResourcePatch class.

Method Details

actions

public Actions actions()

Get the actions property: Actions to invoke when the alert fires.

Returns:

the actions value.

autoMitigate

public Boolean autoMitigate()

Get the autoMitigate property: The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert.

Returns:

the autoMitigate value.

checkWorkspaceAlertsStorageConfigured

public Boolean checkWorkspaceAlertsStorageConfigured()

Get the checkWorkspaceAlertsStorageConfigured property: The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert.

Returns:

the checkWorkspaceAlertsStorageConfigured value.

createdWithApiVersion

public String createdWithApiVersion()

Get the createdWithApiVersion property: The api-version used when creating this alert rule.

Returns:

the createdWithApiVersion value.

criteria

public ScheduledQueryRuleCriteria criteria()

Get the criteria property: The rule criteria that defines the conditions of the scheduled query rule.

Returns:

the criteria value.

description

public String description()

Get the description property: The description of the scheduled query rule.

Returns:

the description value.

displayName

public String displayName()

Get the displayName property: The display name of the alert rule.

Returns:

the displayName value.

enabled

public Boolean enabled()

Get the enabled property: The flag which indicates whether this scheduled query rule is enabled. Value should be true or false.

Returns:

the enabled value.

evaluationFrequency

public Duration evaluationFrequency()

Get the evaluationFrequency property: How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert.

Returns:

the evaluationFrequency value.

fromJson

public static ScheduledQueryRuleResourcePatch fromJson(JsonReader jsonReader)

Reads an instance of ScheduledQueryRuleResourcePatch from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

Throws:

IOException

- If an error occurs while reading the ScheduledQueryRuleResourcePatch.

isLegacyLogAnalyticsRule

public Boolean isLegacyLogAnalyticsRule()

Get the isLegacyLogAnalyticsRule property: True if alert rule is legacy Log Analytic rule.

Returns:

the isLegacyLogAnalyticsRule value.

isWorkspaceAlertsStorageConfigured

public Boolean isWorkspaceAlertsStorageConfigured()

Get the isWorkspaceAlertsStorageConfigured property: The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false.

Returns:

the isWorkspaceAlertsStorageConfigured value.

muteActionsDuration

public Duration muteActionsDuration()

Get the muteActionsDuration property: Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules of the kind LogAlert.

Returns:

the muteActionsDuration value.

overrideQueryTimeRange

public Duration overrideQueryTimeRange()

Get the overrideQueryTimeRange property: If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert.

Returns:

the overrideQueryTimeRange value.

scopes

public List<String> scopes()

Get the scopes property: The list of resource id's that this scheduled query rule is scoped to.

Returns:

the scopes value.

severity

public AlertSeverity severity()

Get the severity property: Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert.

Returns:

the severity value.

skipQueryValidation

public Boolean skipQueryValidation()

Get the skipQueryValidation property: The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert.

Returns:

the skipQueryValidation value.

tags

public Map<String,String> tags()

Get the tags property: Resource tags.

Returns:

the tags value.

targetResourceTypes

public List<String> targetResourceTypes()

Get the targetResourceTypes property: List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert.

Returns:

the targetResourceTypes value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

windowSize

public Duration windowSize()

Get the windowSize property: The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert.

Returns:

the windowSize value.

withActions

public ScheduledQueryRuleResourcePatch withActions(Actions actions)

Set the actions property: Actions to invoke when the alert fires.

Parameters:

actions - the actions value to set.

Returns:

the ScheduledQueryRuleResourcePatch object itself.

withAutoMitigate

public ScheduledQueryRuleResourcePatch withAutoMitigate(Boolean autoMitigate)

Set the autoMitigate property: The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert.

Parameters:

autoMitigate - the autoMitigate value to set.

Returns:

the ScheduledQueryRuleResourcePatch object itself.

withCheckWorkspaceAlertsStorageConfigured

public ScheduledQueryRuleResourcePatch withCheckWorkspaceAlertsStorageConfigured(Boolean checkWorkspaceAlertsStorageConfigured)

Set the checkWorkspaceAlertsStorageConfigured property: The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert.

Parameters:

checkWorkspaceAlertsStorageConfigured - the checkWorkspaceAlertsStorageConfigured value to set.

Returns:

the ScheduledQueryRuleResourcePatch object itself.

withCriteria

public ScheduledQueryRuleResourcePatch withCriteria(ScheduledQueryRuleCriteria criteria)

Set the criteria property: The rule criteria that defines the conditions of the scheduled query rule.

Parameters:

criteria - the criteria value to set.

Returns:

the ScheduledQueryRuleResourcePatch object itself.

withDescription

public ScheduledQueryRuleResourcePatch withDescription(String description)

Set the description property: The description of the scheduled query rule.

Parameters:

description - the description value to set.

Returns:

the ScheduledQueryRuleResourcePatch object itself.

withDisplayName

public ScheduledQueryRuleResourcePatch withDisplayName(String displayName)

Set the displayName property: The display name of the alert rule.

Parameters:

displayName - the displayName value to set.

Returns:

the ScheduledQueryRuleResourcePatch object itself.

withEnabled

public ScheduledQueryRuleResourcePatch withEnabled(Boolean enabled)

Set the enabled property: The flag which indicates whether this scheduled query rule is enabled. Value should be true or false.

Parameters:

enabled - the enabled value to set.

Returns:

the ScheduledQueryRuleResourcePatch object itself.

withEvaluationFrequency

public ScheduledQueryRuleResourcePatch withEvaluationFrequency(Duration evaluationFrequency)

Set the evaluationFrequency property: How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert.

Parameters:

evaluationFrequency - the evaluationFrequency value to set.

Returns:

the ScheduledQueryRuleResourcePatch object itself.

withMuteActionsDuration

public ScheduledQueryRuleResourcePatch withMuteActionsDuration(Duration muteActionsDuration)

Set the muteActionsDuration property: Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules of the kind LogAlert.

Parameters:

muteActionsDuration - the muteActionsDuration value to set.

Returns:

the ScheduledQueryRuleResourcePatch object itself.

withOverrideQueryTimeRange

public ScheduledQueryRuleResourcePatch withOverrideQueryTimeRange(Duration overrideQueryTimeRange)

Set the overrideQueryTimeRange property: If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert.

Parameters:

overrideQueryTimeRange - the overrideQueryTimeRange value to set.

Returns:

the ScheduledQueryRuleResourcePatch object itself.

withScopes

public ScheduledQueryRuleResourcePatch withScopes(List<String> scopes)

Set the scopes property: The list of resource id's that this scheduled query rule is scoped to.

Parameters:

scopes - the scopes value to set.

Returns:

the ScheduledQueryRuleResourcePatch object itself.

withSeverity

public ScheduledQueryRuleResourcePatch withSeverity(AlertSeverity severity)

Set the severity property: Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert.

Parameters:

severity - the severity value to set.

Returns:

the ScheduledQueryRuleResourcePatch object itself.

withSkipQueryValidation

public ScheduledQueryRuleResourcePatch withSkipQueryValidation(Boolean skipQueryValidation)

Set the skipQueryValidation property: The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert.

Parameters:

skipQueryValidation - the skipQueryValidation value to set.

Returns:

the ScheduledQueryRuleResourcePatch object itself.

withTags

public ScheduledQueryRuleResourcePatch withTags(Map<String,String> tags)

Set the tags property: Resource tags.

Parameters:

tags - the tags value to set.

Returns:

the ScheduledQueryRuleResourcePatch object itself.

withTargetResourceTypes

public ScheduledQueryRuleResourcePatch withTargetResourceTypes(List<String> targetResourceTypes)

Set the targetResourceTypes property: List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert.

Parameters:

targetResourceTypes - the targetResourceTypes value to set.

Returns:

the ScheduledQueryRuleResourcePatch object itself.

withWindowSize

public ScheduledQueryRuleResourcePatch withWindowSize(Duration windowSize)

Set the windowSize property: The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert.

Parameters:

windowSize - the windowSize value to set.

Returns:

the ScheduledQueryRuleResourcePatch object itself.

Applies to