Class RuleMetricDataSource

java.lang.Object
com.azure.resourcemanager.monitor.models.RuleDataSource
com.azure.resourcemanager.monitor.models.RuleMetricDataSource

public final class RuleMetricDataSource extends RuleDataSource
A rule metric data source. The discriminator value is always RuleMetricDataSource in this case.
  • Constructor Details

    • RuleMetricDataSource

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

    • metricName

      public String metricName()
      Get the metricName property: the name of the metric that defines what the rule monitors.
      Returns:
      the metricName value.
    • withMetricName

      public RuleMetricDataSource withMetricName(String metricName)
      Set the metricName property: the name of the metric that defines what the rule monitors.
      Parameters:
      metricName - the metricName value to set.
      Returns:
      the RuleMetricDataSource object itself.
    • withResourceUri

      public RuleMetricDataSource withResourceUri(String resourceUri)
      Set the resourceUri property: the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.
      Overrides:
      withResourceUri in class RuleDataSource
      Parameters:
      resourceUri - the resourceUri value to set.
      Returns:
      the RuleDataSource object itself.
    • withLegacyResourceId

      public RuleMetricDataSource withLegacyResourceId(String legacyResourceId)
      Set the legacyResourceId property: the legacy resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.
      Overrides:
      withLegacyResourceId in class RuleDataSource
      Parameters:
      legacyResourceId - the legacyResourceId value to set.
      Returns:
      the RuleDataSource object itself.
    • withResourceLocation

      public RuleMetricDataSource withResourceLocation(String resourceLocation)
      Set the resourceLocation property: the location of the resource.
      Overrides:
      withResourceLocation in class RuleDataSource
      Parameters:
      resourceLocation - the resourceLocation value to set.
      Returns:
      the RuleDataSource object itself.
    • withMetricNamespace

      public RuleMetricDataSource withMetricNamespace(String metricNamespace)
      Set the metricNamespace property: the namespace of the metric.
      Overrides:
      withMetricNamespace in class RuleDataSource
      Parameters:
      metricNamespace - the metricNamespace value to set.
      Returns:
      the RuleDataSource object itself.
    • validate

      public void validate()
      Validates the instance.
      Overrides:
      validate in class RuleDataSource
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.