diff --git a/schemas/2023-05-01-preview/Microsoft.AlertsManagement.json b/schemas/2023-05-01-preview/Microsoft.AlertsManagement.json new file mode 100644 index 0000000000..0f5e5e068b --- /dev/null +++ b/schemas/2023-05-01-preview/Microsoft.AlertsManagement.json @@ -0,0 +1,568 @@ +{ + "id": "https://schema.management.azure.com/schemas/2023-05-01-preview/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": [ + "2023-05-01-preview" + ] + }, + "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" + }, + { + "$ref": "#/definitions/CorrelateAlerts" + } + ], + "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." + }, + "CorrelateAlerts": { + "type": "object", + "properties": { + "actionType": { + "type": "string", + "enum": [ + "CorrelateAlerts" + ] + }, + "correlateBy": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/CorrelateBy" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The list of conditions for the alerts correlations." + }, + "correlationInterval": { + "type": "string", + "description": "The required duration (in ISO8601 format) for the alerts correlation." + }, + "notificationsForCorrelatedAlerts": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotifyAlways", + "SuppressAlways" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Indicates how to handle child alerts notifications." + }, + "priority": { + "oneOf": [ + { + "type": "integer" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The priority of this correlation." + } + }, + "required": [ + "actionType", + "correlateBy", + "correlationInterval", + "priority" + ], + "description": "Add logic for alerts correlation." + }, + "CorrelateBy": { + "type": "object", + "properties": { + "field": { + "type": "string", + "description": "The JPath of the property that the alerts should be correlated by." + } + }, + "description": "The logic for the correlation." + }, + "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 68852fb6c1..21507a6a69 100644 --- a/schemas/common/autogeneratedResources.json +++ b/schemas/common/autogeneratedResources.json @@ -139,6 +139,9 @@ { "$ref": "https://schema.management.azure.com/schemas/2023-03-01/Microsoft.AlertsManagement.json#/resourceDefinitions/prometheusRuleGroups" }, + { + "$ref": "https://schema.management.azure.com/schemas/2023-05-01-preview/Microsoft.AlertsManagement.json#/resourceDefinitions/actionRules" + }, { "$ref": "https://schema.management.azure.com/schemas/2016-05-16/Microsoft.AnalysisServices.json#/resourceDefinitions/servers" },