diff --git a/schemas/2021-07-22-preview/Microsoft.AlertsManagement.json b/schemas/2021-07-22-preview/Microsoft.AlertsManagement.json new file mode 100644 index 0000000000..fda0fe73a9 --- /dev/null +++ b/schemas/2021-07-22-preview/Microsoft.AlertsManagement.json @@ -0,0 +1,277 @@ +{ + "id": "https://schema.management.azure.com/schemas/2021-07-22-preview/Microsoft.AlertsManagement.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Microsoft.AlertsManagement", + "description": "Microsoft AlertsManagement Resource Types", + "resourceDefinitions": { + "prometheusRuleGroups": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2021-07-22-preview" + ] + }, + "location": { + "type": "string", + "description": "The geo-location where the resource lives" + }, + "name": { + "type": "string", + "description": "The name of the rule group." + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/PrometheusRuleGroupProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "An alert rule." + }, + "tags": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "properties": {} + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Resource tags." + }, + "type": { + "type": "string", + "enum": [ + "Microsoft.AlertsManagement/prometheusRuleGroups" + ] + } + }, + "required": [ + "apiVersion", + "location", + "name", + "properties", + "type" + ], + "description": "Microsoft.AlertsManagement/prometheusRuleGroups" + } + }, + "definitions": { + "PrometheusRule": { + "type": "object", + "properties": { + "actions": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/PrometheusRuleGroupAction" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. Only relevant for alerts." + }, + "alert": { + "type": "string", + "description": "the name of the alert rule." + }, + "annotations": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "properties": {} + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "annotations for rule group. Only relevant for alerts." + }, + "enabled": { + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "the flag that indicates whether the Prometheus rule is enabled." + }, + "expression": { + "type": "string", + "description": "the expression to run for the rule." + }, + "for": { + "type": "string", + "description": "the amount of time alert must be active before firing. Only relevant for alerts." + }, + "labels": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "properties": {} + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "labels for rule group. Only relevant for alerts." + }, + "record": { + "type": "string", + "description": "the name of the recording rule." + }, + "resolveConfiguration": { + "oneOf": [ + { + "$ref": "#/definitions/PrometheusRuleResolveConfiguration" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Specifies the Prometheus alert rule configuration." + }, + "severity": { + "oneOf": [ + { + "type": "integer" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "the severity of the alerts fired by the rule. Only relevant for alerts." + } + }, + "required": [ + "expression" + ] + }, + "PrometheusRuleGroupAction": { + "type": "object", + "properties": { + "actionGroupId": { + "type": "string", + "description": "The resource id of the action group to use." + }, + "actionProperties": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "properties": {} + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The properties of an action group object." + } + }, + "description": "An alert action. Only relevant for alerts." + }, + "PrometheusRuleGroupProperties": { + "type": "object", + "properties": { + "clusterName": { + "type": "string", + "description": "the cluster name of the rule group evaluation." + }, + "description": { + "type": "string", + "description": "the description of the Prometheus rule group that will be included in the alert email." + }, + "enabled": { + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "the flag that indicates whether the Prometheus rule group is enabled." + }, + "interval": { + "type": "string", + "description": "the interval in which to run the Prometheus rule group represented in ISO 8601 duration format. Should be between 1 and 15 minutes" + }, + "rules": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/PrometheusRule" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "defines the rules in the Prometheus rule group." + }, + "scopes": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "the list of resource id's that this rule group is scoped to." + } + }, + "required": [ + "rules", + "scopes" + ], + "description": "An alert rule." + }, + "PrometheusRuleResolveConfiguration": { + "type": "object", + "properties": { + "autoResolved": { + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "the flag that indicates whether or not to auto resolve a fired alert." + }, + "timeToResolve": { + "type": "string", + "description": "the duration a rule must evaluate as healthy before the fired alert is automatically resolved represented in ISO 8601 duration format. Should be between 1 and 15 minutes" + } + }, + "description": "Specifies the Prometheus alert rule configuration." + } + } +} \ No newline at end of file diff --git a/schemas/common/autogeneratedResources.json b/schemas/common/autogeneratedResources.json index 5c0ce50aec..ffcc776fb0 100644 --- a/schemas/common/autogeneratedResources.json +++ b/schemas/common/autogeneratedResources.json @@ -94,6 +94,9 @@ { "$ref": "https://schema.management.azure.com/schemas/2021-04-01/Microsoft.AlertsManagement.json#/resourceDefinitions/smartDetectorAlertRules" }, + { + "$ref": "https://schema.management.azure.com/schemas/2021-07-22-preview/Microsoft.AlertsManagement.json#/resourceDefinitions/prometheusRuleGroups" + }, { "$ref": "https://schema.management.azure.com/schemas/2021-08-08/Microsoft.AlertsManagement.json#/resourceDefinitions/actionRules" },