From e89ddd33586bdb74ded1701f9532305bdeb606f0 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 4 May 2023 09:04:00 +0000 Subject: [PATCH] CodeGen from PR 22993 in Azure/azure-rest-api-specs [Hub Generated] Review request for Microsoft.Insights to add version preview/2023-03-15-preview (#22993) * Adds base for updating Microsoft.Insights from version preview/2022-08-01-preview to version 2023-03-15-preview * Updates readme * Updates API version in new specs and examples * New api version - 2023-03-15-preview * Fix Readme * remove duplications from autorest readme --------- Co-authored-by: meydand Co-authored-by: Meydan Dayan --- .../Microsoft.Insights.json | 550 ++++++++++++++++++ schemas/common/autogeneratedResources.json | 3 + 2 files changed, 553 insertions(+) create mode 100644 schemas/2023-03-15-preview/Microsoft.Insights.json diff --git a/schemas/2023-03-15-preview/Microsoft.Insights.json b/schemas/2023-03-15-preview/Microsoft.Insights.json new file mode 100644 index 0000000000..4c5f988beb --- /dev/null +++ b/schemas/2023-03-15-preview/Microsoft.Insights.json @@ -0,0 +1,550 @@ +{ + "id": "https://schema.management.azure.com/schemas/2023-03-15-preview/Microsoft.Insights.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Microsoft.Insights", + "description": "Microsoft Insights Resource Types", + "resourceDefinitions": { + "scheduledQueryRules": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2023-03-15-preview" + ] + }, + "identity": { + "oneOf": [ + { + "$ref": "#/definitions/Identity" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Identity for the resource." + }, + "kind": { + "oneOf": [ + { + "type": "string", + "enum": [ + "LogAlert", + "LogToMetric" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Indicates the type of scheduled query rule. The default is LogAlert." + }, + "location": { + "type": "string", + "description": "The geo-location where the resource lives" + }, + "name": { + "type": "string", + "description": "The name of the rule." + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/ScheduledQueryRuleProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "scheduled query rule Definition" + }, + "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.Insights/scheduledQueryRules" + ] + } + }, + "required": [ + "apiVersion", + "location", + "name", + "properties", + "type" + ], + "description": "Microsoft.Insights/scheduledQueryRules" + } + }, + "definitions": { + "Actions": { + "type": "object", + "properties": { + "actionGroups": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Action Group resource Ids to invoke when the alert fires." + }, + "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 properties." + }, + "customProperties": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "properties": {} + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The properties of an alert payload." + } + }, + "description": "Actions to invoke when the alert fires." + }, + "Condition": { + "type": "object", + "properties": { + "dimensions": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/Dimension" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "List of Dimensions conditions" + }, + "failingPeriods": { + "oneOf": [ + { + "$ref": "#/definitions/ConditionFailingPeriods" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert." + }, + "metricMeasureColumn": { + "type": "string", + "description": "The column containing the metric measure number. Relevant only for rules of the kind LogAlert." + }, + "metricName": { + "type": "string", + "description": "The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric." + }, + "operator": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Equals", + "GreaterThan", + "GreaterThanOrEqual", + "LessThan", + "LessThanOrEqual" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The criteria operator. Relevant and required only for rules of the kind LogAlert." + }, + "query": { + "type": "string", + "description": "Log query alert" + }, + "resourceIdColumn": { + "type": "string", + "description": "The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert." + }, + "threshold": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert." + }, + "timeAggregation": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Count", + "Average", + "Minimum", + "Maximum", + "Total" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Aggregation type. Relevant and required only for rules of the kind LogAlert." + } + }, + "description": "A condition of the scheduled query rule." + }, + "ConditionFailingPeriods": { + "type": "object", + "properties": { + "minFailingPeriodsToAlert": { + "oneOf": [ + { + "type": "integer", + "default": "1" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1" + }, + "numberOfEvaluationPeriods": { + "oneOf": [ + { + "type": "integer", + "default": "1" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1" + } + }, + "description": "The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert." + }, + "Dimension": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the dimension" + }, + "operator": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Include", + "Exclude" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Operator for dimension values." + }, + "values": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "List of dimension values" + } + }, + "required": [ + "name", + "operator", + "values" + ], + "description": "Dimension splitting and filtering definition" + }, + "Identity": { + "type": "object", + "properties": { + "type": { + "oneOf": [ + { + "type": "string", + "enum": [ + "SystemAssigned", + "UserAssigned", + "None" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Type of managed service identity." + }, + "userAssignedIdentities": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/UserIdentityProperties" + }, + "properties": {} + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'." + } + }, + "required": [ + "type" + ], + "description": "Identity for the resource." + }, + "RuleResolveConfiguration": { + "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", + "format": "duration", + "description": "The duration a rule must evaluate as healthy before the fired alert is automatically resolved represented in ISO 8601 duration format." + } + }, + "description": "TBD. Relevant only for rules of the kind LogAlert." + }, + "ScheduledQueryRuleCriteria": { + "type": "object", + "properties": { + "allOf": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/Condition" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "A list of conditions to evaluate against the specified scopes" + } + }, + "description": "The rule criteria that defines the conditions of the scheduled query rule." + }, + "ScheduledQueryRuleProperties": { + "type": "object", + "properties": { + "actions": { + "oneOf": [ + { + "$ref": "#/definitions/Actions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Actions to invoke when the alert fires." + }, + "autoMitigate": { + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert." + }, + "checkWorkspaceAlertsStorageConfigured": { + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert." + }, + "criteria": { + "oneOf": [ + { + "$ref": "#/definitions/ScheduledQueryRuleCriteria" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The rule criteria that defines the conditions of the scheduled query rule." + }, + "description": { + "type": "string", + "description": "The description of the scheduled query rule." + }, + "displayName": { + "type": "string", + "description": "The display name of the alert rule" + }, + "enabled": { + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The flag which indicates whether this scheduled query rule is enabled. Value should be true or false" + }, + "evaluationFrequency": { + "type": "string", + "format": "duration", + "description": "How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert." + }, + "muteActionsDuration": { + "type": "string", + "format": "duration", + "description": "Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules of the kind LogAlert." + }, + "overrideQueryTimeRange": { + "type": "string", + "format": "duration", + "description": "If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert." + }, + "ruleResolveConfiguration": { + "oneOf": [ + { + "$ref": "#/definitions/RuleResolveConfiguration" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "TBD. Relevant only for rules of the kind LogAlert." + }, + "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 scheduled query rule is scoped to." + }, + "severity": { + "oneOf": [ + { + "type": "integer" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert." + }, + "skipQueryValidation": { + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert." + }, + "targetResourceTypes": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert" + }, + "windowSize": { + "type": "string", + "format": "duration", + "description": "The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert." + } + }, + "description": "scheduled query rule Definition" + }, + "UserIdentityProperties": { + "type": "object", + "properties": {}, + "description": "User assigned identity properties." + } + } +} \ No newline at end of file diff --git a/schemas/common/autogeneratedResources.json b/schemas/common/autogeneratedResources.json index 826118bb71..3d656cec66 100644 --- a/schemas/common/autogeneratedResources.json +++ b/schemas/common/autogeneratedResources.json @@ -14704,6 +14704,9 @@ { "$ref": "https://schema.management.azure.com/schemas/2023-01-01-preview/Microsoft.Insights.json#/resourceDefinitions/activityLogAlerts" }, + { + "$ref": "https://schema.management.azure.com/schemas/2023-03-15-preview/Microsoft.Insights.json#/resourceDefinitions/scheduledQueryRules" + }, { "$ref": "https://schema.management.azure.com/schemas/2018-09-01/Microsoft.IotCentral.json#/resourceDefinitions/iotApps" },