Class ScheduledQueryRuleResourceInner

java.lang.Object
com.azure.core.management.ProxyResource
com.azure.core.management.Resource
com.azure.resourcemanager.monitor.fluent.models.ScheduledQueryRuleResourceInner
All Implemented Interfaces:
com.azure.json.JsonSerializable<com.azure.core.management.ProxyResource>

public final class ScheduledQueryRuleResourceInner extends com.azure.core.management.Resource
The scheduled query rule resource.
  • Constructor Details

    • ScheduledQueryRuleResourceInner

      public ScheduledQueryRuleResourceInner()
      Creates an instance of ScheduledQueryRuleResourceInner class.
  • Method Details

    • kind

      public Kind kind()
      Get the kind property: Indicates the type of scheduled query rule. The default is LogAlert.
      Returns:
      the kind value.
    • withKind

      public ScheduledQueryRuleResourceInner withKind(Kind kind)
      Set the kind property: Indicates the type of scheduled query rule. The default is LogAlert.
      Parameters:
      kind - the kind value to set.
      Returns:
      the ScheduledQueryRuleResourceInner object itself.
    • etag

      public String etag()
      Get the etag property: The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
      Returns:
      the etag value.
    • systemData

      public com.azure.core.management.SystemData systemData()
      Get the systemData property: SystemData of ScheduledQueryRule.
      Returns:
      the systemData value.
    • id

      public String id()
      Get the id property: Fully qualified resource Id for the resource.
      Overrides:
      id in class com.azure.core.management.ProxyResource
      Returns:
      the id value.
    • name

      public String name()
      Get the name property: The name of the resource.
      Overrides:
      name in class com.azure.core.management.ProxyResource
      Returns:
      the name value.
    • type

      public String type()
      Get the type property: The type of the resource.
      Overrides:
      type in class com.azure.core.management.ProxyResource
      Returns:
      the type value.
    • withLocation

      public ScheduledQueryRuleResourceInner withLocation(String location)
      Overrides:
      withLocation in class com.azure.core.management.Resource
    • withTags

      Overrides:
      withTags in class com.azure.core.management.Resource
    • createdWithApiVersion

      public String createdWithApiVersion()
      Get the createdWithApiVersion property: The api-version used when creating this alert rule.
      Returns:
      the createdWithApiVersion value.
    • isLegacyLogAnalyticsRule

      public Boolean isLegacyLogAnalyticsRule()
      Get the isLegacyLogAnalyticsRule property: True if alert rule is legacy Log Analytic rule.
      Returns:
      the isLegacyLogAnalyticsRule value.
    • description

      public String description()
      Get the description property: The description of the scheduled query rule.
      Returns:
      the description value.
    • withDescription

      public ScheduledQueryRuleResourceInner withDescription(String description)
      Set the description property: The description of the scheduled query rule.
      Parameters:
      description - the description value to set.
      Returns:
      the ScheduledQueryRuleResourceInner object itself.
    • displayName

      public String displayName()
      Get the displayName property: The display name of the alert rule.
      Returns:
      the displayName value.
    • withDisplayName

      public ScheduledQueryRuleResourceInner withDisplayName(String displayName)
      Set the displayName property: The display name of the alert rule.
      Parameters:
      displayName - the displayName value to set.
      Returns:
      the ScheduledQueryRuleResourceInner object itself.
    • 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.
    • withSeverity

      public ScheduledQueryRuleResourceInner 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 ScheduledQueryRuleResourceInner object itself.
    • 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.
    • withEnabled

      public ScheduledQueryRuleResourceInner 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 ScheduledQueryRuleResourceInner object itself.
    • 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.
    • withScopes

      public ScheduledQueryRuleResourceInner 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 ScheduledQueryRuleResourceInner object itself.
    • 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.
    • withEvaluationFrequency

      public ScheduledQueryRuleResourceInner 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 ScheduledQueryRuleResourceInner object itself.
    • 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.
    • withWindowSize

      public ScheduledQueryRuleResourceInner 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 ScheduledQueryRuleResourceInner object itself.
    • 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.
    • withOverrideQueryTimeRange

      public ScheduledQueryRuleResourceInner 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 ScheduledQueryRuleResourceInner object itself.
    • 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.
    • withTargetResourceTypes

      public ScheduledQueryRuleResourceInner 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 ScheduledQueryRuleResourceInner object itself.
    • criteria

      public ScheduledQueryRuleCriteria 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 ScheduledQueryRuleResourceInner object itself.
    • 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.
    • withMuteActionsDuration

      public ScheduledQueryRuleResourceInner 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 ScheduledQueryRuleResourceInner object itself.
    • actions

      public Actions actions()
      Get the actions property: Actions to invoke when the alert fires.
      Returns:
      the actions value.
    • withActions

      public ScheduledQueryRuleResourceInner withActions(Actions actions)
      Set the actions property: Actions to invoke when the alert fires.
      Parameters:
      actions - the actions value to set.
      Returns:
      the ScheduledQueryRuleResourceInner object itself.
    • 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.
    • 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.
    • withCheckWorkspaceAlertsStorageConfigured

      public ScheduledQueryRuleResourceInner 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 ScheduledQueryRuleResourceInner object itself.
    • 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.
    • withSkipQueryValidation

      public ScheduledQueryRuleResourceInner 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 ScheduledQueryRuleResourceInner object itself.
    • 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.
    • withAutoMitigate

      public ScheduledQueryRuleResourceInner 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 ScheduledQueryRuleResourceInner object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<com.azure.core.management.ProxyResource>
      Overrides:
      toJson in class com.azure.core.management.Resource
      Throws:
      IOException
    • fromJson

      public static ScheduledQueryRuleResourceInner fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of ScheduledQueryRuleResourceInner from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of ScheduledQueryRuleResourceInner if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the ScheduledQueryRuleResourceInner.