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..331a0f5d85 --- /dev/null +++ b/schemas/2021-07-22-preview/Microsoft.AlertsManagement.json @@ -0,0 +1,248 @@ +{ + "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." + }, + "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." + } + } + }, + "PrometheusRuleGroupAction": { + "type": "object", + "properties": { + "actionGroupId": { + "type": "string", + "description": "the 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": { + "description": { + "type": "string", + "description": "the description of the Prometheus rule group that will be included in the alert email." + }, + "interval": { + "type": "string", + "description": "the interval in which to run the Prometheus rule group represented in ISO 8601 duration format." + }, + "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." + } + }, + "description": "Specifies the Prometheus alert rule configuration." + } + } +} \ No newline at end of file diff --git a/schemas/2021-08-08-preview/Microsoft.AlertsManagement.json b/schemas/2021-08-08-preview/Microsoft.AlertsManagement.json index 4a0cd0794b..d5b439946c 100644 --- a/schemas/2021-08-08-preview/Microsoft.AlertsManagement.json +++ b/schemas/2021-08-08-preview/Microsoft.AlertsManagement.json @@ -19,18 +19,18 @@ }, "name": { "type": "string", - "description": "The name of the action rule that needs to be created/updated" + "description": "The name of the alert processing rule that needs to be created/updated." }, "properties": { "oneOf": [ { - "$ref": "#/definitions/ActionRuleProperties" + "$ref": "#/definitions/AlertProcessingRuleProperties" }, { "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" } ], - "description": "Action rule properties defining scopes, conditions and scheduling logic for action rule" + "description": "Alert processing rule properties defining scopes, conditions and scheduling logic for alert processing rule." }, "systemData": { "oneOf": [ @@ -87,9 +87,39 @@ } ], "properties": {}, - "description": "Action to be applied" + "description": "Action to be applied." }, - "ActionRuleProperties": { + "AddActionGroups": { + "type": "object", + "properties": { + "actionGroupIds": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "List of action group Ids to add to alert processing rule." + }, + "actionType": { + "type": "string", + "enum": [ + "AddActionGroups" + ] + } + }, + "required": [ + "actionGroupIds", + "actionType" + ], + "description": "Add action groups to alert processing rule." + }, + "AlertProcessingRuleProperties": { "type": "object", "properties": { "actions": { @@ -104,7 +134,7 @@ "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" } ], - "description": "Actions to be applied" + "description": "Actions to be applied." }, "conditions": { "oneOf": [ @@ -118,11 +148,11 @@ "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" } ], - "description": "Conditions in alert instance to be matched for a given action rule. Default value is all. Multiple values could be provided with comma separation." + "description": "Conditions in alert instance to be matched for a given alert processing rule. Default value is all. Multiple values could be provided with comma separation." }, "description": { "type": "string", - "description": "Description of action rule" + "description": "Description of alert processing rule." }, "enabled": { "oneOf": [ @@ -134,7 +164,7 @@ "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" } ], - "description": "Indicates if the given action rule is enabled or disabled" + "description": "Indicates if the given alert processing rule is enabled or disabled." }, "schedule": { "oneOf": [ @@ -145,7 +175,7 @@ "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" } ], - "description": "Scheduling configuration for a given action rule" + "description": "Scheduling configuration for a given alert processing rule." }, "scopes": { "oneOf": [ @@ -159,44 +189,14 @@ "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" } ], - "description": "List of ARM IDs which will be the target of the given action rule." + "description": "List of ARM IDs which will be the target of the given alert processing rule." } }, "required": [ "actions", "scopes" ], - "description": "Action rule properties defining scopes, conditions and scheduling logic for action rule" - }, - "AddActionGroups": { - "type": "object", - "properties": { - "actionGroupIds": { - "oneOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" - } - ], - "description": "List of action group Ids to add to action rule" - }, - "actionType": { - "type": "string", - "enum": [ - "AddActionGroups" - ] - } - }, - "required": [ - "actionGroupIds", - "actionType" - ], - "description": "Add action groups to action rule" + "description": "Alert processing rule properties defining scopes, conditions and scheduling logic for alert processing rule." }, "Condition": { "type": "object", @@ -257,7 +257,7 @@ "description": "List of values to match for a given condition." } }, - "description": "Condition to trigger an action rule" + "description": "Condition to trigger an alert processing rule." }, "DailyRecurrence": { "type": "object", @@ -272,7 +272,7 @@ "required": [ "recurrenceType" ], - "description": "Daily recurrence object" + "description": "Daily recurrence object." }, "MonthlyRecurrence": { "type": "object", @@ -289,7 +289,7 @@ "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" } ], - "description": "Specifies the values for monthly recurrence pattern" + "description": "Specifies the values for monthly recurrence pattern." }, "recurrenceType": { "type": "string", @@ -302,7 +302,7 @@ "daysOfMonth", "recurrenceType" ], - "description": "Monthly recurrence object" + "description": "Monthly recurrence object." }, "Recurrence": { "type": "object", @@ -320,14 +320,14 @@ "properties": { "endTime": { "type": "string", - "description": "End time for recurrence" + "description": "End time for recurrence." }, "startTime": { "type": "string", - "description": "Start time for recurrence" + "description": "Start time for recurrence." } }, - "description": "Recurrence object" + "description": "Recurrence object." }, "RemoveAllActionGroups": { "type": "object", @@ -342,7 +342,7 @@ "required": [ "actionType" ], - "description": "Indicates if all action groups should be removed" + "description": "Indicates if all action groups should be removed." }, "Schedule": { "type": "object", @@ -383,14 +383,14 @@ "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" } ], - "description": "List of recurrences" + "description": "List of recurrences." }, "timeZone": { "type": "string", - "description": "Scheduling time zone" + "description": "Scheduling time zone." } }, - "description": "Scheduling configuration for a given action rule" + "description": "Scheduling configuration for a given alert processing rule." }, "SystemData": { "type": "object", @@ -474,7 +474,7 @@ "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" } ], - "description": "Specifies the values for weekly recurrence pattern" + "description": "Specifies the values for weekly recurrence pattern." }, "recurrenceType": { "type": "string", @@ -487,7 +487,7 @@ "daysOfWeek", "recurrenceType" ], - "description": "Weekly recurrence object" + "description": "Weekly recurrence object." } } } \ No newline at end of file diff --git a/schemas/2021-08-08/Microsoft.AlertsManagement.json b/schemas/2021-08-08/Microsoft.AlertsManagement.json new file mode 100644 index 0000000000..a7a27a51b9 --- /dev/null +++ b/schemas/2021-08-08/Microsoft.AlertsManagement.json @@ -0,0 +1,493 @@ +{ + "id": "https://schema.management.azure.com/schemas/2021-08-08/Microsoft.AlertsManagement.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Microsoft.AlertsManagement", + "description": "Microsoft AlertsManagement Resource Types", + "resourceDefinitions": { + "actionRules": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2021-08-08" + ] + }, + "location": { + "type": "string", + "description": "Resource location" + }, + "name": { + "type": "string", + "description": "The name of the alert processing rule that needs to be created/updated." + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/AlertProcessingRuleProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Alert processing rule properties defining scopes, conditions and scheduling logic for alert processing rule." + }, + "systemData": { + "oneOf": [ + { + "$ref": "#/definitions/SystemData" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Metadata pertaining to creation and last modification of the resource." + }, + "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/actionRules" + ] + } + }, + "required": [ + "apiVersion", + "location", + "name", + "properties", + "type" + ], + "description": "Microsoft.AlertsManagement/actionRules" + } + }, + "definitions": { + "Action": { + "type": "object", + "oneOf": [ + { + "$ref": "#/definitions/AddActionGroups" + }, + { + "$ref": "#/definitions/RemoveAllActionGroups" + } + ], + "properties": {}, + "description": "Action to be applied." + }, + "AddActionGroups": { + "type": "object", + "properties": { + "actionGroupIds": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "List of action group Ids to add to alert processing rule." + }, + "actionType": { + "type": "string", + "enum": [ + "AddActionGroups" + ] + } + }, + "required": [ + "actionGroupIds", + "actionType" + ], + "description": "Add action groups to alert processing rule." + }, + "AlertProcessingRuleProperties": { + "type": "object", + "properties": { + "actions": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Actions to be applied." + }, + "conditions": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/Condition" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Conditions in alert instance to be matched for a given alert processing rule. Default value is all. Multiple values could be provided with comma separation." + }, + "description": { + "type": "string", + "description": "Description of alert processing rule." + }, + "enabled": { + "oneOf": [ + { + "type": "boolean", + "default": true + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Indicates if the given alert processing rule is enabled or disabled." + }, + "schedule": { + "oneOf": [ + { + "$ref": "#/definitions/Schedule" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Scheduling configuration for a given alert processing rule." + }, + "scopes": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "List of ARM IDs which will be the target of the given alert processing rule." + } + }, + "required": [ + "actions", + "scopes" + ], + "description": "Alert processing rule properties defining scopes, conditions and scheduling logic for alert processing rule." + }, + "Condition": { + "type": "object", + "properties": { + "field": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Severity", + "MonitorService", + "MonitorCondition", + "SignalType", + "TargetResourceType", + "TargetResource", + "TargetResourceGroup", + "AlertRuleId", + "AlertRuleName", + "Description", + "AlertContext" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Field for a given condition." + }, + "operator": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Equals", + "NotEquals", + "Contains", + "DoesNotContain" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Operator for a given condition." + }, + "values": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "List of values to match for a given condition." + } + }, + "description": "Condition to trigger an alert processing rule." + }, + "DailyRecurrence": { + "type": "object", + "properties": { + "recurrenceType": { + "type": "string", + "enum": [ + "Daily" + ] + } + }, + "required": [ + "recurrenceType" + ], + "description": "Daily recurrence object." + }, + "MonthlyRecurrence": { + "type": "object", + "properties": { + "daysOfMonth": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "integer" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Specifies the values for monthly recurrence pattern." + }, + "recurrenceType": { + "type": "string", + "enum": [ + "Monthly" + ] + } + }, + "required": [ + "daysOfMonth", + "recurrenceType" + ], + "description": "Monthly recurrence object." + }, + "Recurrence": { + "type": "object", + "oneOf": [ + { + "$ref": "#/definitions/DailyRecurrence" + }, + { + "$ref": "#/definitions/WeeklyRecurrence" + }, + { + "$ref": "#/definitions/MonthlyRecurrence" + } + ], + "properties": { + "endTime": { + "type": "string", + "description": "End time for recurrence." + }, + "startTime": { + "type": "string", + "description": "Start time for recurrence." + } + }, + "description": "Recurrence object." + }, + "RemoveAllActionGroups": { + "type": "object", + "properties": { + "actionType": { + "type": "string", + "enum": [ + "RemoveAllActionGroups" + ] + } + }, + "required": [ + "actionType" + ], + "description": "Indicates if all action groups should be removed." + }, + "Schedule": { + "type": "object", + "properties": { + "effectiveFrom": { + "oneOf": [ + { + "type": "string", + "pattern": "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Scheduling effective from time. Date-Time in ISO-8601 format without timezone suffix." + }, + "effectiveUntil": { + "oneOf": [ + { + "type": "string", + "pattern": "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Scheduling effective until time. Date-Time in ISO-8601 format without timezone suffix." + }, + "recurrences": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/Recurrence" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "List of recurrences." + }, + "timeZone": { + "type": "string", + "description": "Scheduling time zone." + } + }, + "description": "Scheduling configuration for a given alert processing rule." + }, + "SystemData": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of resource creation (UTC)." + }, + "createdBy": { + "type": "string", + "description": "The identity that created the resource." + }, + "createdByType": { + "oneOf": [ + { + "type": "string", + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The type of identity that created the resource." + }, + "lastModifiedAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of resource last modification (UTC)" + }, + "lastModifiedBy": { + "type": "string", + "description": "The identity that last modified the resource." + }, + "lastModifiedByType": { + "oneOf": [ + { + "type": "string", + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The type of identity that last modified the resource." + } + }, + "description": "Metadata pertaining to creation and last modification of the resource." + }, + "WeeklyRecurrence": { + "type": "object", + "properties": { + "daysOfWeek": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string", + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ] + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Specifies the values for weekly recurrence pattern." + }, + "recurrenceType": { + "type": "string", + "enum": [ + "Weekly" + ] + } + }, + "required": [ + "daysOfWeek", + "recurrenceType" + ], + "description": "Weekly recurrence object." + } + } +} \ No newline at end of file diff --git a/schemas/common/autogeneratedResources.json b/schemas/common/autogeneratedResources.json index cbbdcfd256..a7133d7129 100644 --- a/schemas/common/autogeneratedResources.json +++ b/schemas/common/autogeneratedResources.json @@ -70,6 +70,12 @@ { "$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" + }, { "$ref": "https://schema.management.azure.com/schemas/2021-08-08-preview/Microsoft.AlertsManagement.json#/resourceDefinitions/actionRules" },