{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure/json-schema/microsoft-azure-anomaly-alerting-configuration-patch-schema.json",
  "title": "AnomalyAlertingConfigurationPatch",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-anomalyalerting-api-openapi.yml#/components/schemas/AnomalyAlertingConfigurationPatch",
  "type": "object",
  "properties": {
    "name": {
      "description": "Anomaly alerting configuration name",
      "type": "string"
    },
    "description": {
      "description": "anomaly alerting configuration description",
      "default": "",
      "type": "string"
    },
    "crossMetricsOperator": {
      "description": "cross metrics operator",
      "enum": [
        "AND",
        "OR",
        "XOR"
      ],
      "type": "string",
      "x-ms-enum": {
        "name": "AnomalyAlertingConfigurationLogicType",
        "modelAsString": true
      }
    },
    "splitAlertByDimensions": {
      "description": "dimensions used to split alert",
      "uniqueItems": true,
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "hookIds": {
      "description": "hook unique ids",
      "uniqueItems": true,
      "type": "array",
      "items": {
        "format": "uuid",
        "type": "string"
      }
    },
    "metricAlertingConfigurations": {
      "description": "Anomaly alerting configurations",
      "uniqueItems": true,
      "type": "array",
      "items": {
        "$ref": "#/$defs/MetricAlertingConfiguration"
      }
    }
  },
  "$defs": {
    "AlertSnoozeCondition": {
      "required": [
        "autoSnooze",
        "onlyForSuccessive",
        "snoozeScope"
      ],
      "type": "object",
      "properties": {
        "autoSnooze": {
          "format": "int32",
          "description": "snooze point count, value range : [0, +∞)",
          "type": "integer"
        },
        "snoozeScope": {
          "description": "snooze scope",
          "enum": [
            "Metric",
            "Series"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "SnoozeScope",
            "modelAsString": true
          }
        },
        "onlyForSuccessive": {
          "description": "only snooze for successive anomalies",
          "type": "boolean"
        }
      }
    },
    "DimensionGroupIdentity": {
      "required": [
        "dimension"
      ],
      "type": "object",
      "properties": {
        "dimension": {
          "description": "dimension specified for series group",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "MetricAlertingConfiguration": {
      "required": [
        "anomalyDetectionConfigurationId",
        "anomalyScopeType"
      ],
      "type": "object",
      "properties": {
        "anomalyDetectionConfigurationId": {
          "format": "uuid",
          "description": "Anomaly detection configuration unique id",
          "type": "string"
        },
        "anomalyScopeType": {
          "description": "Anomaly scope",
          "enum": [
            "All",
            "Dimension",
            "TopN"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "AnomalyScope",
            "modelAsString": true
          }
        },
        "negationOperation": {
          "description": "Negation operation",
          "default": false,
          "type": "boolean"
        },
        "dimensionAnomalyScope": {
          "$ref": "#/$defs/DimensionGroupIdentity"
        },
        "topNAnomalyScope": {
          "$ref": "#/$defs/TopNGroupScope"
        },
        "severityFilter": {
          "$ref": "#/$defs/SeverityCondition"
        },
        "snoozeFilter": {
          "$ref": "#/$defs/AlertSnoozeCondition"
        },
        "valueFilter": {
          "$ref": "#/$defs/ValueCondition"
        }
      }
    },
    "SeverityCondition": {
      "required": [
        "maxAlertSeverity",
        "minAlertSeverity"
      ],
      "type": "object",
      "properties": {
        "minAlertSeverity": {
          "description": "min alert severity",
          "enum": [
            "Low",
            "Medium",
            "High"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "Severity",
            "modelAsString": true
          }
        },
        "maxAlertSeverity": {
          "description": "max alert severity",
          "enum": [
            "Low",
            "Medium",
            "High"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "Severity",
            "modelAsString": true
          }
        }
      }
    },
    "TopNGroupScope": {
      "required": [
        "minTopCount",
        "period",
        "top"
      ],
      "type": "object",
      "properties": {
        "top": {
          "format": "int32",
          "description": "top N, value range : [1, +∞)",
          "type": "integer"
        },
        "period": {
          "format": "int32",
          "description": "point count used to look back, value range : [1, +∞)",
          "type": "integer"
        },
        "minTopCount": {
          "format": "int32",
          "description": "min count should be in top N, value range : [1, +∞)\n\nshould be less than or equal to period",
          "type": "integer"
        }
      }
    },
    "ValueCondition": {
      "required": [
        "direction"
      ],
      "type": "object",
      "properties": {
        "lower": {
          "format": "double",
          "description": "lower bound\n\nshould be specified when direction is Both or Down",
          "type": "number"
        },
        "upper": {
          "format": "double",
          "description": "upper bound\n\nshould be specified when direction is Both or Up",
          "type": "number"
        },
        "direction": {
          "description": "value filter direction",
          "enum": [
            "Both",
            "Down",
            "Up"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "Direction",
            "modelAsString": true
          }
        },
        "type": {
          "description": "data used to implement value filter",
          "default": "Value",
          "enum": [
            "Value",
            "Mean"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "ValueType",
            "modelAsString": true
          }
        },
        "metricId": {
          "format": "uuid",
          "description": "the other metric unique id used for value filter",
          "type": "string"
        },
        "triggerForMissing": {
          "description": "trigger alert when the corresponding point is missing in the other metric\n\nshould be specified only when using other metric to filter",
          "type": "boolean"
        }
      }
    }
  }
}