diff --git a/schemas/2019-03-01/microsoft.alertsManagement.json b/schemas/2019-03-01/microsoft.alertsManagement.json new file mode 100644 index 0000000000..b886a407c8 --- /dev/null +++ b/schemas/2019-03-01/microsoft.alertsManagement.json @@ -0,0 +1,259 @@ +{ + "id": "https://schema.management.azure.com/schemas/2019-03-01/microsoft.alertsManagement.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "microsoft.alertsManagement", + "description": "microsoft alertsManagement Resource Types", + "resourceDefinitions": { + "smartDetectorAlertRules": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2019-03-01" + ] + }, + "name": { + "type": "string", + "description": "The name of the alert rule." + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/AlertRuleProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The alert rule properties." + }, + "type": { + "type": "string", + "enum": [ + "microsoft.alertsManagement/smartDetectorAlertRules" + ] + } + }, + "required": [ + "apiVersion", + "name", + "properties", + "type" + ], + "description": "microsoft.alertsManagement/smartDetectorAlertRules" + } + }, + "definitions": { + "ActionGroupsInformation": { + "type": "object", + "properties": { + "customEmailSubject": { + "type": "string", + "description": "An optional custom email subject to use in email notifications." + }, + "customWebhookPayload": { + "type": "string", + "description": "An optional custom web-hook payload to use in web-hook notifications." + }, + "groupIds": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The Action Group resource IDs." + } + }, + "required": [ + "groupIds" + ], + "description": "The Action Groups information, used by the alert rule." + }, + "AlertRuleProperties": { + "type": "object", + "properties": { + "actionGroups": { + "oneOf": [ + { + "$ref": "#/definitions/ActionGroupsInformation" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The Action Groups information, used by the alert rule." + }, + "description": { + "type": "string", + "description": "The alert rule description." + }, + "detector": { + "oneOf": [ + { + "$ref": "#/definitions/Detector" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The detector information. By default this is not populated, unless it's specified in expandDetector" + }, + "frequency": { + "type": "string", + "format": "duration", + "description": "The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 5 minutes." + }, + "scope": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The alert rule resources scope." + }, + "severity": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The alert rule severity." + }, + "state": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Enabled", + "Disabled" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The alert rule state." + }, + "throttling": { + "oneOf": [ + { + "$ref": "#/definitions/ThrottlingInformation" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Optional throttling information for the alert rule." + } + }, + "required": [ + "actionGroups", + "detector", + "frequency", + "scope", + "severity", + "state" + ], + "description": "The alert rule properties." + }, + "Detector": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "The Smart Detector description. By default this is not populated, unless it's specified in expandDetector" + }, + "id": { + "type": "string", + "description": "The detector id." + }, + "imagePaths": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The Smart Detector image path. By default this is not populated, unless it's specified in expandDetector" + }, + "name": { + "type": "string", + "description": "The Smart Detector name. By default this is not populated, unless it's specified in expandDetector" + }, + "parameters": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "properties": {} + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The detector's parameters.'" + }, + "supportedResourceTypes": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The Smart Detector supported resource types. By default this is not populated, unless it's specified in expandDetector" + } + }, + "required": [ + "id" + ], + "description": "The detector information. By default this is not populated, unless it's specified in expandDetector" + }, + "ThrottlingInformation": { + "type": "object", + "properties": { + "duration": { + "type": "string", + "format": "duration", + "description": "The required duration (in ISO8601 format) to wait before notifying on the alert rule again. The time granularity must be in minutes and minimum value is 0 minutes" + } + }, + "description": "Optional throttling information for the alert rule." + } + } +} diff --git a/schemas/2019-05-05-preview/Microsoft.AlertsManagement.json b/schemas/2019-05-05-preview/Microsoft.AlertsManagement.json index 8bb3dbd868..a588674814 100644 --- a/schemas/2019-05-05-preview/Microsoft.AlertsManagement.json +++ b/schemas/2019-05-05-preview/Microsoft.AlertsManagement.json @@ -65,9 +65,35 @@ } }, "definitions": { + "ActionGroup": { + "type": "object", + "properties": { + "actionGroupId": { + "type": "string", + "description": "Action group to trigger if action rule matches" + }, + "type": { + "type": "string", + "enum": [ + "ActionGroup" + ] + } + }, + "required": [ + "actionGroupId", + "type" + ], + "description": "Action rule with action group configuration" + }, "ActionRuleProperties": { "type": "object", "oneOf": [ + { + "$ref": "#/definitions/Suppression" + }, + { + "$ref": "#/definitions/ActionGroup" + }, { "$ref": "#/definitions/Diagnostics" } @@ -287,6 +313,107 @@ } }, "description": "Target scope for a given action rule. By default scope will be the subscription. User can also provide list of resource groups or list of resources from the scope subscription as well." + }, + "Suppression": { + "type": "object", + "properties": { + "suppressionConfig": { + "oneOf": [ + { + "$ref": "#/definitions/SuppressionConfig" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Suppression logic for a given action rule" + }, + "type": { + "type": "string", + "enum": [ + "Suppression" + ] + } + }, + "required": [ + "suppressionConfig", + "type" + ], + "description": "Action rule with suppression configuration" + }, + "SuppressionConfig": { + "type": "object", + "properties": { + "recurrenceType": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Always", + "Once", + "Daily", + "Weekly", + "Monthly" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Specifies when the suppression should be applied." + }, + "schedule": { + "oneOf": [ + { + "$ref": "#/definitions/SuppressionSchedule" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Schedule for a given suppression configuration." + } + }, + "required": [ + "recurrenceType" + ], + "description": "Suppression logic for a given action rule" + }, + "SuppressionSchedule": { + "type": "object", + "properties": { + "endDate": { + "type": "string", + "description": "End date for suppression" + }, + "endTime": { + "type": "string", + "description": "End date for suppression" + }, + "recurrenceValues": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "integer" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Specifies the values for recurrence pattern" + }, + "startDate": { + "type": "string", + "description": "Start date for suppression" + }, + "startTime": { + "type": "string", + "description": "Start time for suppression" + } + }, + "description": "Schedule for a given suppression configuration." } } -} \ No newline at end of file +} diff --git a/schemas/2019-06-01/microsoft.alertsManagement.json b/schemas/2019-06-01/microsoft.alertsManagement.json new file mode 100644 index 0000000000..a96059ccf1 --- /dev/null +++ b/schemas/2019-06-01/microsoft.alertsManagement.json @@ -0,0 +1,269 @@ +{ + "id": "https://schema.management.azure.com/schemas/2019-06-01/microsoft.alertsManagement.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "microsoft.alertsManagement", + "description": "microsoft alertsManagement Resource Types", + "resourceDefinitions": { + "smartDetectorAlertRules": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2019-06-01" + ] + }, + "location": { + "type": "string", + "default": "global", + "description": "The resource location." + }, + "name": { + "type": "string", + "description": "The name of the alert rule." + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/AlertRuleProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The alert rule properties." + }, + "tags": { + "type": "object", + "properties": {}, + "description": "The resource tags." + }, + "type": { + "type": "string", + "enum": [ + "microsoft.alertsManagement/smartDetectorAlertRules" + ] + } + }, + "required": [ + "apiVersion", + "name", + "properties", + "type" + ], + "description": "microsoft.alertsManagement/smartDetectorAlertRules" + } + }, + "definitions": { + "ActionGroupsInformation": { + "type": "object", + "properties": { + "customEmailSubject": { + "type": "string", + "description": "An optional custom email subject to use in email notifications." + }, + "customWebhookPayload": { + "type": "string", + "description": "An optional custom web-hook payload to use in web-hook notifications." + }, + "groupIds": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The Action Group resource IDs." + } + }, + "required": [ + "groupIds" + ], + "description": "The Action Groups information, used by the alert rule." + }, + "AlertRuleProperties": { + "type": "object", + "properties": { + "actionGroups": { + "oneOf": [ + { + "$ref": "#/definitions/ActionGroupsInformation" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The Action Groups information, used by the alert rule." + }, + "description": { + "type": "string", + "description": "The alert rule description." + }, + "detector": { + "oneOf": [ + { + "$ref": "#/definitions/Detector" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The detector information. By default this is not populated, unless it's specified in expandDetector" + }, + "frequency": { + "type": "string", + "format": "duration", + "description": "The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 5 minutes." + }, + "scope": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The alert rule resources scope." + }, + "severity": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The alert rule severity." + }, + "state": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Enabled", + "Disabled" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The alert rule state." + }, + "throttling": { + "oneOf": [ + { + "$ref": "#/definitions/ThrottlingInformation" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Optional throttling information for the alert rule." + } + }, + "required": [ + "actionGroups", + "detector", + "frequency", + "scope", + "severity", + "state" + ], + "description": "The alert rule properties." + }, + "Detector": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "The Smart Detector description. By default this is not populated, unless it's specified in expandDetector" + }, + "id": { + "type": "string", + "description": "The detector id." + }, + "imagePaths": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The Smart Detector image path. By default this is not populated, unless it's specified in expandDetector" + }, + "name": { + "type": "string", + "description": "The Smart Detector name. By default this is not populated, unless it's specified in expandDetector" + }, + "parameters": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "properties": {} + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The detector's parameters.'" + }, + "supportedResourceTypes": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The Smart Detector supported resource types. By default this is not populated, unless it's specified in expandDetector" + } + }, + "required": [ + "id" + ], + "description": "The detector information. By default this is not populated, unless it's specified in expandDetector" + }, + "ThrottlingInformation": { + "type": "object", + "properties": { + "duration": { + "type": "string", + "format": "duration", + "description": "The required duration (in ISO8601 format) to wait before notifying on the alert rule again. The time granularity must be in minutes and minimum value is 0 minutes" + } + }, + "description": "Optional throttling information for the alert rule." + } + } +}