From cdfd5bab95e7aee676ea7a2761a91f899da99b2d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 30 Dec 2021 02:50:48 +0000 Subject: [PATCH] CodeGen from PR 17162 in Azure/azure-rest-api-specs [Hub Generated] Review request for Microsoft.AlertsManagement to add version stable/2021-08-08 (#17162) * Adds base for updating Microsoft.AlertsManagement from version preview/2021-08-08-preview to version 2021-08-08 * Updates readme * Updates API version in new specs and examples * 1. added input files to new tag 2. changed alerts management client tag to the new tag Co-authored-by: Liran Englender --- .../Microsoft.AlertsManagement.json | 493 ++++++++++++++++++ schemas/common/autogeneratedResources.json | 3 + 2 files changed, 496 insertions(+) create mode 100644 schemas/2021-08-08/Microsoft.AlertsManagement.json 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 a7ad09a760..896953579e 100644 --- a/schemas/common/autogeneratedResources.json +++ b/schemas/common/autogeneratedResources.json @@ -70,6 +70,9 @@ { "$ref": "https://schema.management.azure.com/schemas/2021-04-01/Microsoft.AlertsManagement.json#/resourceDefinitions/smartDetectorAlertRules" }, + { + "$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" },