Class RuleDataSource

java.lang.Object
com.azure.resourcemanager.monitor.models.RuleDataSource
All Implemented Interfaces:
com.azure.json.JsonSerializable<RuleDataSource>
Direct Known Subclasses:
RuleManagementEventDataSource, RuleMetricDataSource

public class RuleDataSource extends Object implements com.azure.json.JsonSerializable<RuleDataSource>
The resource from which the rule collects its data.
  • Constructor Details

    • RuleDataSource

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

    • odataType

      public String odataType()
      Get the odataType property: specifies the type of data source. There are two types of rule data sources: RuleMetricDataSource and RuleManagementEventDataSource.
      Returns:
      the odataType value.
    • resourceUri

      public String resourceUri()
      Get the resourceUri property: the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.
      Returns:
      the resourceUri value.
    • withResourceUri

      public RuleDataSource 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.
      Parameters:
      resourceUri - the resourceUri value to set.
      Returns:
      the RuleDataSource object itself.
    • legacyResourceId

      public String legacyResourceId()
      Get the legacyResourceId property: the legacy resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.
      Returns:
      the legacyResourceId value.
    • withLegacyResourceId

      public RuleDataSource 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.
      Parameters:
      legacyResourceId - the legacyResourceId value to set.
      Returns:
      the RuleDataSource object itself.
    • resourceLocation

      public String resourceLocation()
      Get the resourceLocation property: the location of the resource.
      Returns:
      the resourceLocation value.
    • withResourceLocation

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

      public String metricNamespace()
      Get the metricNamespace property: the namespace of the metric.
      Returns:
      the metricNamespace value.
    • withMetricNamespace

      public RuleDataSource withMetricNamespace(String metricNamespace)
      Set the metricNamespace property: the namespace of the metric.
      Parameters:
      metricNamespace - the metricNamespace value to set.
      Returns:
      the RuleDataSource 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<RuleDataSource>
      Throws:
      IOException
    • fromJson

      public static RuleDataSource fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of RuleDataSource from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of RuleDataSource 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 RuleDataSource.