Class ScheduledQueryRuleResourcePatch
java.lang.Object
com.azure.resourcemanager.monitor.models.ScheduledQueryRuleResourcePatch
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ScheduledQueryRuleResourcePatch>
public final class ScheduledQueryRuleResourcePatch
extends Object
implements com.azure.json.JsonSerializable<ScheduledQueryRuleResourcePatch>
The scheduled query rule resource for patch operations.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of ScheduledQueryRuleResourcePatch class. -
Method Summary
Modifier and TypeMethodDescriptionactions()
Get the actions property: Actions to invoke when the alert fires.Get the autoMitigate property: The flag that indicates whether the alert should be automatically resolved or not.Get the checkWorkspaceAlertsStorageConfigured property: The flag which indicates whether this scheduled query rule should be stored in the customer's storage.Get the createdWithApiVersion property: The api-version used when creating this alert rule.criteria()
Get the criteria property: The rule criteria that defines the conditions of the scheduled query rule.Get the description property: The description of the scheduled query rule.Get the displayName property: The display name of the alert rule.enabled()
Get the enabled property: The flag which indicates whether this scheduled query rule is enabled.Get the evaluationFrequency property: How often the scheduled query rule is evaluated represented in ISO 8601 duration format.fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of ScheduledQueryRuleResourcePatch from the JsonReader.Get the isLegacyLogAnalyticsRule property: True if alert rule is legacy Log Analytic rule.Get the isWorkspaceAlertsStorageConfigured property: The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage.Get the muteActionsDuration property: Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired.Get the overrideQueryTimeRange property: If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods).scopes()
Get the scopes property: The list of resource id's that this scheduled query rule is scoped to.severity()
Get the severity property: Severity of the alert.Get the skipQueryValidation property: The flag which indicates whether the provided query should be validated or not.tags()
Get the tags property: Resource tags.Get the targetResourceTypes property: List of resource type of the target resource(s) on which the alert is created/updated.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) void
validate()
Validates the instance.Get the windowSize property: The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size).withActions
(Actions actions) Set the actions property: Actions to invoke when the alert fires.withAutoMitigate
(Boolean autoMitigate) Set the autoMitigate property: The flag that indicates whether the alert should be automatically resolved or not.withCheckWorkspaceAlertsStorageConfigured
(Boolean checkWorkspaceAlertsStorageConfigured) Set the checkWorkspaceAlertsStorageConfigured property: The flag which indicates whether this scheduled query rule should be stored in the customer's storage.withCriteria
(ScheduledQueryRuleCriteria criteria) Set the criteria property: The rule criteria that defines the conditions of the scheduled query rule.withDescription
(String description) Set the description property: The description of the scheduled query rule.withDisplayName
(String displayName) Set the displayName property: The display name of the alert rule.withEnabled
(Boolean enabled) Set the enabled property: The flag which indicates whether this scheduled query rule is enabled.withEvaluationFrequency
(Duration evaluationFrequency) Set the evaluationFrequency property: How often the scheduled query rule is evaluated represented in ISO 8601 duration format.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.withOverrideQueryTimeRange
(Duration overrideQueryTimeRange) Set the overrideQueryTimeRange property: If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods).withScopes
(List<String> scopes) Set the scopes property: The list of resource id's that this scheduled query rule is scoped to.withSeverity
(AlertSeverity severity) Set the severity property: Severity of the alert.withSkipQueryValidation
(Boolean skipQueryValidation) Set the skipQueryValidation property: The flag which indicates whether the provided query should be validated or not.Set the tags property: Resource tags.withTargetResourceTypes
(List<String> targetResourceTypes) Set the targetResourceTypes property: List of resource type of the target resource(s) on which the alert is created/updated.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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
ScheduledQueryRuleResourcePatch
public ScheduledQueryRuleResourcePatch()Creates an instance of ScheduledQueryRuleResourcePatch class.
-
-
Method Details
-
tags
Get the tags property: Resource tags.- Returns:
- the tags value.
-
withTags
Set the tags property: Resource tags.- Parameters:
tags
- the tags value to set.- Returns:
- the ScheduledQueryRuleResourcePatch object itself.
-
createdWithApiVersion
Get the createdWithApiVersion property: The api-version used when creating this alert rule.- Returns:
- the createdWithApiVersion value.
-
isLegacyLogAnalyticsRule
Get the isLegacyLogAnalyticsRule property: True if alert rule is legacy Log Analytic rule.- Returns:
- the isLegacyLogAnalyticsRule value.
-
description
Get the description property: The description of the scheduled query rule.- Returns:
- the description value.
-
withDescription
Set the description property: The description of the scheduled query rule.- Parameters:
description
- the description value to set.- Returns:
- the ScheduledQueryRuleResourcePatch object itself.
-
displayName
Get the displayName property: The display name of the alert rule.- Returns:
- the displayName value.
-
withDisplayName
Set the displayName property: The display name of the alert rule.- Parameters:
displayName
- the displayName value to set.- Returns:
- the ScheduledQueryRuleResourcePatch object itself.
-
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.
-
withSeverity
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.
-
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.
-
withEnabled
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.
-
scopes
Get the scopes property: The list of resource id's that this scheduled query rule is scoped to.- Returns:
- the scopes value.
-
withScopes
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.
-
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.
-
withEvaluationFrequency
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.
-
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.
-
withWindowSize
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.
-
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.
-
withOverrideQueryTimeRange
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.
-
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.
-
withTargetResourceTypes
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.
-
criteria
Get the criteria property: The rule criteria that defines the conditions of the scheduled query rule.- Returns:
- the criteria value.
-
withCriteria
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.
-
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.
-
withMuteActionsDuration
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.
-
actions
Get the actions property: Actions to invoke when the alert fires.- Returns:
- the actions value.
-
withActions
Set the actions property: Actions to invoke when the alert fires.- Parameters:
actions
- the actions value to set.- Returns:
- the ScheduledQueryRuleResourcePatch object itself.
-
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.
-
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.
-
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.
-
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.
-
withSkipQueryValidation
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.
-
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.
-
withAutoMitigate
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.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException
- thrown if the instance is not valid.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<ScheduledQueryRuleResourcePatch>
- Throws:
IOException
-
fromJson
public static ScheduledQueryRuleResourcePatch fromJson(com.azure.json.JsonReader jsonReader) throws IOException 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.
-