diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/back-compatible.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/back-compatible.tsp new file mode 100644 index 000000000000..d5420e498cef --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/back-compatible.tsp @@ -0,0 +1,7 @@ +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; +using Microsoft.AlertsManagement; + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@Legacy.flattenProperty(LogAlertRuleResource.properties); diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/examples/2025-07-01-preview/previewDynamicThresholdLogSearchAlertRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/examples/2025-07-01-preview/previewDynamicThresholdLogSearchAlertRule.json new file mode 100644 index 000000000000..af21535efcbf --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/examples/2025-07-01-preview/previewDynamicThresholdLogSearchAlertRule.json @@ -0,0 +1,107 @@ +{ + "parameters": { + "api-version": "2025-07-01-preview", + "parameters": { + "location": "eastus", + "properties": { + "scheduledQueryRuleProperties": { + "location": "eastus", + "properties": { + "description": "Performance rule", + "criteria": { + "allOf": [ + { + "alertSensitivity": "Medium", + "criterionType": "DynamicThresholdCriterion", + "dimensions": [ + { + "name": "AlertName", + "operator": "Include", + "values": [ + "alert" + ] + } + ], + "operator": "GreaterThan", + "query": "Alert", + "timeAggregation": "Count" + } + ] + }, + "enabled": true, + "evaluationFrequency": "PT1H", + "scopes": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/myWorkspace" + ], + "severity": 4, + "windowSize": "PT1H" + } + }, + "timespan": "PT24H" + } + }, + "resourceId": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/myWorkspace" + }, + "responses": { + "200": { + "body": { + "rulePreviewResults": [ + { + "dimensionCombination": [ + { + "name": "AlertName", + "value": "Alert1" + } + ], + "evaluations": [ + { + "alertState": "Fired", + "evaluatedPeriods": [ + { + "highThreshold": 80, + "lowThreshold": 20, + "metricValue": 85, + "thresholdMet": true, + "timestamp": "2025-02-15T09:00:00Z" + }, + { + "highThreshold": 80, + "lowThreshold": 20, + "metricValue": 75, + "thresholdMet": false, + "timestamp": "2025-02-15T08:00:00Z" + } + ], + "evaluationTime": "2025-02-15T10:00:00Z", + "thresholdMet": true + }, + { + "alertState": "Resolved", + "evaluatedPeriods": [ + { + "highThreshold": 80, + "lowThreshold": 20, + "metricValue": 65, + "thresholdMet": false, + "timestamp": "2025-02-15T10:00:00Z" + }, + { + "highThreshold": 80, + "lowThreshold": 20, + "metricValue": 85, + "thresholdMet": true, + "timestamp": "2025-02-15T09:00:00Z" + } + ], + "evaluationTime": "2025-02-15T11:00:00Z", + "thresholdMet": false + } + ] + } + ] + } + } + }, + "operationId": "PreviewAlertRule", + "title": "Run preview of a dynamic threshold log search alert rule" +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/main.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/main.tsp new file mode 100644 index 000000000000..e0549dff35de --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/main.tsp @@ -0,0 +1,44 @@ +/** + * PLEASE DO NOT REMOVE - USED FOR CONVERTER METRICS + * Generated by package: @autorest/openapi-to-typespec + * Parameters used: + * isFullCompatible: true + * guessResourceKey: false + * Version: 0.11.12 + * Date: 2025-12-08T01:30:48.361Z + */ +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "./models.tsp"; +import "./back-compatible.tsp"; +import "./routes.tsp"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager.Foundations; +using Azure.Core; +using Azure.ResourceManager; +using TypeSpec.Versioning; +/** + * The Preview Alert Rule API provides the ability to retrieve the results of a simulated historical execution of an alert rule + */ +#suppress "@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@armProviderNamespace +@service(#{ + title: "Preview Alert Rule API in Alerts Management Service Resource Provider", +}) +@versioned(Versions) +@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v3) +namespace Microsoft.AlertsManagement; + +/** + * The available API versions. + */ +enum Versions { + /** + * The 2025-07-01-preview API version. + */ + v2025_07_01_preview: "2025-07-01-preview", +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/models.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/models.tsp new file mode 100644 index 000000000000..e0159946c945 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/models.tsp @@ -0,0 +1,517 @@ +import "@typespec/rest"; +import "@typespec/http"; +import "@azure-tools/typespec-azure-resource-manager"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager; +using Azure.ResourceManager.Foundations; + +namespace Microsoft.AlertsManagement; + +/** + * Indicates the type of scheduled query rule. The default is LogAlert. + */ +union Kind { + string, + + /** + * LogAlert + */ + LogAlert: "LogAlert", + + /** + * EventLogAlert + */ + EventLogAlert: "EventLogAlert", + + /** + * LogToMetric + */ + LogToMetric: "LogToMetric", +} + +/** + * 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. + */ +union AlertSeverity { + int64, + + /** + * 0 + */ + `0`: 0, + + /** + * 1 + */ + `1`: 1, + + /** + * 2 + */ + `2`: 2, + + /** + * 3 + */ + `3`: 3, + + /** + * 4 + */ + `4`: 4, +} + +/** + * Specifies the type of threshold criteria + */ +union CriterionType { + string, + + /** + * StaticThresholdCriterion + */ + StaticThresholdCriterion: "StaticThresholdCriterion", + + /** + * DynamicThresholdCriterion + */ + DynamicThresholdCriterion: "DynamicThresholdCriterion", +} + +/** + * Aggregation type. Relevant and required only for rules of the kind LogAlert. + */ +union TimeAggregation { + string, + + /** + * Count + */ + Count: "Count", + + /** + * Average + */ + Average: "Average", + + /** + * Minimum + */ + Minimum: "Minimum", + + /** + * Maximum + */ + Maximum: "Maximum", + + /** + * Total + */ + Total: "Total", +} + +/** + * Operator for dimension values + */ +union DimensionOperator { + string, + + /** + * Include + */ + Include: "Include", + + /** + * Exclude + */ + Exclude: "Exclude", +} + +/** + * The criteria operator. Relevant and required only for rules of the kind LogAlert. + */ +union ConditionOperator { + string, + + /** + * Equals + */ + Equals: "Equals", + + /** + * GreaterThan + */ + GreaterThan: "GreaterThan", + + /** + * GreaterThanOrEqual + */ + GreaterThanOrEqual: "GreaterThanOrEqual", + + /** + * LessThan + */ + LessThan: "LessThan", + + /** + * LessThanOrEqual + */ + LessThanOrEqual: "LessThanOrEqual", + + /** + * GreaterOrLessThan + */ + GreaterOrLessThan: "GreaterOrLessThan", +} + +/** + * The state of the alert after the evaluation. + */ +union AlertState { + string, + + /** + * NoAlert + */ + NoAlert: "NoAlert", + + /** + * Fired + */ + Fired: "Fired", + + /** + * Firing + */ + Firing: "Firing", + + /** + * Resolving + */ + Resolving: "Resolving", + + /** + * Resolved + */ + Resolved: "Resolved", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model PreviewAlertRuleRequest { + /** + * The location of the rule resource. + */ + location: string; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties: PreviewAlertRuleRequestProperties; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model PreviewAlertRuleRequestProperties { + /** + * Specifies the timespan of the preview in ISO 8601 duration format. + */ + timespan: duration; + + /** + * The properties of the alert rule to preview. + */ + scheduledQueryRuleProperties?: LogAlertRuleResource; +} + +/** + * The scheduled query rule resource. + */ +model LogAlertRuleResource { + /** + * Resource tags. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update) + tags?: Record; + + /** + * The geo-location where the resource lives + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + location: string; + + /** + * Indicates the type of scheduled query rule. The default is LogAlert. + */ + kind?: Kind; + + /** + * The rule properties of the resource. + */ + properties: LogAlertRuleProperties; +} + +/** + * scheduled query rule Definition + */ +model LogAlertRuleProperties { + /** + * The description of the scheduled query rule. + */ + description?: string; + + /** + * The display name of the alert rule + */ + displayName?: string; + + /** + * 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. + */ + severity?: AlertSeverity; + + /** + * The flag which indicates whether this scheduled query rule is enabled. Value should be true or false + */ + enabled?: boolean; + + /** + * The list of resource id's that this scheduled query rule is scoped to. + */ + scopes?: string[]; + + /** + * How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert. + */ + evaluationFrequency?: duration; + + /** + * 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. + */ + windowSize?: duration; + + /** + * If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert. + */ + overrideQueryTimeRange?: duration; + + /** + * 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 + */ + targetResourceTypes?: string[]; + + /** + * The rule criteria that defines the conditions of the scheduled query rule. + */ + criteria?: LogAlertRuleCriteria; +} + +/** + * The rule criteria that defines the conditions of the scheduled query rule. + */ +model LogAlertRuleCriteria { + /** + * A list of conditions to evaluate against the specified scopes + */ + @identifiers(#[]) + allOf?: LogAlertRuleCondition[]; +} + +/** + * A condition of the scheduled query rule. + */ +model LogAlertRuleCondition { + /** + * Specifies the type of threshold criteria + */ + criterionType?: CriterionType; + + /** + * KQL log query alert + */ + query?: string; + + /** + * Aggregation type. Relevant and required only for rules of the kind LogAlert. + */ + timeAggregation?: TimeAggregation; + + /** + * The column containing the metric measure number. Relevant only for rules of the kind LogAlert. + */ + metricMeasureColumn?: string; + + /** + * 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. + */ + resourceIdColumn?: string; + + /** + * List of Dimensions conditions + */ + @identifiers(#[]) + dimensions?: LogAlertRuleDimension[]; + + /** + * The criteria operator. Relevant and required only for rules of the kind LogAlert. + */ + operator?: ConditionOperator; + + /** + * the criteria threshold value that activates the alert. Relevant and required only for static threshold rules of the kind LogAlert. + */ + threshold?: float64; + + /** + * The extent of deviation required to trigger an alert. Allowed values are 'Low', 'Medium' and 'High'. This will affect how tight the threshold is to the metric series pattern. Relevant and required only for dynamic threshold rules of the kind LogAlert. + */ + alertSensitivity?: string; + + /** + * Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format). Relevant only for dynamic threshold rules of the kind LogAlert. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + ignoreDataBefore?: utcDateTime; + + /** + * 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. + */ + failingPeriods?: LogAlertRuleConditionFailingPeriods; + + /** + * The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric. + */ + metricName?: string; +} + +/** + * Dimension splitting and filtering definition + */ +model LogAlertRuleDimension { + /** + * Name of the dimension + */ + name: string; + + /** + * Operator for dimension values + */ + operator: DimensionOperator; + + /** + * List of dimension values + */ + values: string[]; +} + +/** + * 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. + */ +model LogAlertRuleConditionFailingPeriods { + /** + * 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 + */ + numberOfEvaluationPeriods?: int64 = 1; + + /** + * The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1 + */ + minFailingPeriodsToAlert?: int64 = 1; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model PreviewAlertRuleResponse { + /** + * An array of rule preview results. + */ + @identifiers(#[]) + rulePreviewResults?: RulePreviewResult[]; +} + +/** + * A rule preview result containing a dimension combination and an array of evaluations. + */ +model RulePreviewResult { + /** + * The list of dimensions for the evaluation. + */ + dimensionCombination?: DimensionNameAndValue[]; + + /** + * An array of evaluations. + */ + @identifiers(#[]) + evaluations?: Evaluation[]; +} + +/** + * Dimension name and value + */ +model DimensionNameAndValue { + /** + * Name of the dimension + */ + name: string; + + /** + * Value of the dimension + */ + value: string; +} + +/** + * An evaluation of the alert rule. + */ +model Evaluation { + /** + * The time when the evaluation was performed. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + evaluationTime?: utcDateTime; + + /** + * The state of the alert after the evaluation. + */ + alertState?: AlertState; + + /** + * An array of evaluated periods. + */ + @identifiers(#[]) + evaluatedPeriods?: EvaluatedPeriod[]; + + /** + * Indicates whether the threshold was met for this evaluation. + */ + thresholdMet?: boolean; +} + +/** + * Details of the evaluated period. + */ +model EvaluatedPeriod { + /** + * The timestamp of the evaluated period. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + timestamp?: utcDateTime; + + /** + * The high threshold value for the evaluation period. + */ + highThreshold?: float64; + + /** + * The low threshold value for the evaluation period. + */ + lowThreshold?: float64; + + /** + * The metric value for the evaluation period. + */ + metricValue?: float64; + + /** + * Indicates whether the threshold was met during the evaluation period. + */ + thresholdMet?: boolean; +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/preview/2025-07-01-preview/PreviewAlertRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/preview/2025-07-01-preview/PreviewAlertRule.json index 778bae256603..140d249269da 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/preview/2025-07-01-preview/PreviewAlertRule.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/preview/2025-07-01-preview/PreviewAlertRule.json @@ -1,45 +1,58 @@ { "swagger": "2.0", "info": { - "version": "2025-07-01-preview", "title": "Preview Alert Rule API in Alerts Management Service Resource Provider", - "description": "The Preview Alert Rule API provides the ability to retrieve the results of a simulated historical execution of an alert rule" + "version": "2025-07-01-preview", + "description": "The Preview Alert Rule API provides the ability to retrieve the results of a simulated historical execution of an alert rule", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] }, - "host": "management.azure.com", "schemes": [ "https" ], - "consumes": [ + "host": "management.azure.com", + "produces": [ "application/json" ], - "produces": [ + "consumes": [ "application/json" ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], "securityDefinitions": { "azure_auth": { "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "description": "Azure Active Directory OAuth2 Flow.", "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "user_impersonation": "impersonate your user account" } } }, + "tags": [], "paths": { - "/{resourceId}/providers/Microsoft.AlertsManagement/previewAlertRule": { + "/{resourceId}/providers/microsoft.AlertsManagement/previewAlertRule": { "post": { - "tags": [ - "PreviewAlertRule" - ], - "description": "Retrieves the results of a simulated historical execution of an alert rule", "operationId": "PreviewAlertRule", + "description": "Retrieves the results of a simulated historical execution of an alert rule", "parameters": [ { - "$ref": "#/parameters/ResourceIdParameter" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "name": "resourceId", + "in": "path", + "required": true, + "type": "string" }, { "name": "parameters", @@ -47,19 +60,18 @@ "required": true, "schema": { "$ref": "#/definitions/PreviewAlertRuleRequest" - }, - "description": "The alert rule to preview." + } } ], "responses": { "200": { - "description": "OK", + "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/PreviewAlertRuleResponse" } }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } @@ -74,155 +86,297 @@ } }, "definitions": { - "LogAlertRuleProperties": { + "AlertSeverity": { + "type": "number", + "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.", + "enum": [ + 0, + 1, + 2, + 3, + 4 + ], + "x-ms-enum": { + "name": "AlertSeverity", + "modelAsString": true, + "values": [ + { + "name": "0", + "value": 0, + "description": "0" + }, + { + "name": "1", + "value": 1, + "description": "1" + }, + { + "name": "2", + "value": 2, + "description": "2" + }, + { + "name": "3", + "value": 3, + "description": "3" + }, + { + "name": "4", + "value": 4, + "description": "4" + } + ] + } + }, + "AlertState": { + "type": "string", + "description": "The state of the alert after the evaluation.", + "enum": [ + "NoAlert", + "Fired", + "Firing", + "Resolving", + "Resolved" + ], + "x-ms-enum": { + "name": "AlertState", + "modelAsString": true, + "values": [ + { + "name": "NoAlert", + "value": "NoAlert", + "description": "NoAlert" + }, + { + "name": "Fired", + "value": "Fired", + "description": "Fired" + }, + { + "name": "Firing", + "value": "Firing", + "description": "Firing" + }, + { + "name": "Resolving", + "value": "Resolving", + "description": "Resolving" + }, + { + "name": "Resolved", + "value": "Resolved", + "description": "Resolved" + } + ] + } + }, + "ConditionOperator": { + "type": "string", + "description": "The criteria operator. Relevant and required only for rules of the kind LogAlert.", + "enum": [ + "Equals", + "GreaterThan", + "GreaterThanOrEqual", + "LessThan", + "LessThanOrEqual", + "GreaterOrLessThan" + ], + "x-ms-enum": { + "name": "ConditionOperator", + "modelAsString": true, + "values": [ + { + "name": "Equals", + "value": "Equals", + "description": "Equals" + }, + { + "name": "GreaterThan", + "value": "GreaterThan", + "description": "GreaterThan" + }, + { + "name": "GreaterThanOrEqual", + "value": "GreaterThanOrEqual", + "description": "GreaterThanOrEqual" + }, + { + "name": "LessThan", + "value": "LessThan", + "description": "LessThan" + }, + { + "name": "LessThanOrEqual", + "value": "LessThanOrEqual", + "description": "LessThanOrEqual" + }, + { + "name": "GreaterOrLessThan", + "value": "GreaterOrLessThan", + "description": "GreaterOrLessThan" + } + ] + } + }, + "CriterionType": { + "type": "string", + "description": "Specifies the type of threshold criteria", + "enum": [ + "StaticThresholdCriterion", + "DynamicThresholdCriterion" + ], + "x-ms-enum": { + "name": "CriterionType", + "modelAsString": true, + "values": [ + { + "name": "StaticThresholdCriterion", + "value": "StaticThresholdCriterion", + "description": "StaticThresholdCriterion" + }, + { + "name": "DynamicThresholdCriterion", + "value": "DynamicThresholdCriterion", + "description": "DynamicThresholdCriterion" + } + ] + } + }, + "DimensionNameAndValue": { "type": "object", + "description": "Dimension name and value", "properties": { - "description": { + "name": { "type": "string", - "description": "The description of the scheduled query rule." + "description": "Name of the dimension" }, - "displayName": { + "value": { "type": "string", - "description": "The display name of the alert rule" - }, - "severity": { - "type": "integer", - "format": "int64", - "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.", - "enum": [ - 0, - 1, - 2, - 3, - 4 - ], - "x-ms-enum": { - "name": "AlertSeverity", - "modelAsString": true - } - }, - "enabled": { - "type": "boolean", - "description": "The flag which indicates whether this scheduled query rule is enabled. Value should be true or false" - }, - "scopes": { - "type": "array", - "items": { - "type": "string" + "description": "Value of the dimension" + } + }, + "required": [ + "name", + "value" + ] + }, + "DimensionOperator": { + "type": "string", + "description": "Operator for dimension values", + "enum": [ + "Include", + "Exclude" + ], + "x-ms-enum": { + "name": "DimensionOperator", + "modelAsString": true, + "values": [ + { + "name": "Include", + "value": "Include", + "description": "Include" }, - "description": "The list of resource id's that this scheduled query rule is scoped to." - }, - "evaluationFrequency": { + { + "name": "Exclude", + "value": "Exclude", + "description": "Exclude" + } + ] + } + }, + "EvaluatedPeriod": { + "type": "object", + "description": "Details of the evaluated period.", + "properties": { + "timestamp": { "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." + "format": "date-time", + "description": "The timestamp of the evaluated period." }, - "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." + "highThreshold": { + "type": "number", + "format": "double", + "description": "The high threshold value for the evaluation period." }, - "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." + "lowThreshold": { + "type": "number", + "format": "double", + "description": "The low threshold value for the evaluation period." }, - "targetResourceTypes": { - "type": "array", - "items": { - "type": "string" - }, - "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" + "metricValue": { + "type": "number", + "format": "double", + "description": "The metric value for the evaluation period." }, - "criteria": { - "$ref": "#/definitions/LogAlertRuleCriteria", - "description": "The rule criteria that defines the conditions of the scheduled query rule." + "thresholdMet": { + "type": "boolean", + "description": "Indicates whether the threshold was met during the evaluation period." } - }, - "description": "scheduled query rule Definition" + } }, - "LogAlertRuleResource": { + "Evaluation": { "type": "object", - "required": [ - "properties", - "location" - ], + "description": "An evaluation of the alert rule.", "properties": { - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-ms-mutability": [ - "read", - "create", - "update" - ], - "description": "Resource tags." - }, - "location": { + "evaluationTime": { "type": "string", - "x-ms-mutability": [ - "read", - "create" - ], - "description": "The geo-location where the resource lives" + "format": "date-time", + "description": "The time when the evaluation was performed." }, - "kind": { - "type": "string", - "description": "Indicates the type of scheduled query rule. The default is LogAlert.", - "enum": [ - "LogAlert", - "EventLogAlert", - "LogToMetric" - ], - "x-ms-enum": { - "name": "Kind", - "modelAsString": true - } + "alertState": { + "$ref": "#/definitions/AlertState", + "description": "The state of the alert after the evaluation." }, - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/LogAlertRuleProperties", - "description": "The rule properties of the resource.", - "required": [ - "enabled", - "criteria", - "scopes" - ] - } - }, - "description": "The scheduled query rule resource.", - "x-ms-azure-resource": true - }, - "LogAlertRuleCriteria": { - "type": "object", - "description": "The rule criteria that defines the conditions of the scheduled query rule.", - "properties": { - "allOf": { + "evaluatedPeriods": { "type": "array", - "description": "A list of conditions to evaluate against the specified scopes", + "description": "An array of evaluated periods.", "items": { - "$ref": "#/definitions/LogAlertRuleCondition" + "$ref": "#/definitions/EvaluatedPeriod" }, "x-ms-identifiers": [] + }, + "thresholdMet": { + "type": "boolean", + "description": "Indicates whether the threshold was met for this evaluation." } } }, + "Kind": { + "type": "string", + "description": "Indicates the type of scheduled query rule. The default is LogAlert.", + "enum": [ + "LogAlert", + "EventLogAlert", + "LogToMetric" + ], + "x-ms-enum": { + "name": "Kind", + "modelAsString": true, + "values": [ + { + "name": "LogAlert", + "value": "LogAlert", + "description": "LogAlert" + }, + { + "name": "EventLogAlert", + "value": "EventLogAlert", + "description": "EventLogAlert" + }, + { + "name": "LogToMetric", + "value": "LogToMetric", + "description": "LogToMetric" + } + ] + } + }, "LogAlertRuleCondition": { "type": "object", "description": "A condition of the scheduled query rule.", "properties": { "criterionType": { - "type": "string", - "enum": [ - "StaticThresholdCriterion", - "DynamicThresholdCriterion" - ], - "x-ms-enum": { - "name": "criterionType", - "modelAsString": true - }, + "$ref": "#/definitions/CriterionType", "description": "Specifies the type of threshold criteria" }, "query": { @@ -230,19 +384,8 @@ "description": "KQL log query alert" }, "timeAggregation": { - "type": "string", - "description": "Aggregation type. Relevant and required only for rules of the kind LogAlert.", - "enum": [ - "Count", - "Average", - "Minimum", - "Maximum", - "Total" - ], - "x-ms-enum": { - "name": "timeAggregation", - "modelAsString": true - } + "$ref": "#/definitions/TimeAggregation", + "description": "Aggregation type. Relevant and required only for rules of the kind LogAlert." }, "metricMeasureColumn": { "type": "string", @@ -254,26 +397,14 @@ }, "dimensions": { "type": "array", + "description": "List of Dimensions conditions", "items": { "$ref": "#/definitions/LogAlertRuleDimension" }, - "description": "List of Dimensions conditions", "x-ms-identifiers": [] }, "operator": { - "type": "string", - "enum": [ - "Equals", - "GreaterThan", - "GreaterThanOrEqual", - "LessThan", - "LessThanOrEqual", - "GreaterOrLessThan" - ], - "x-ms-enum": { - "name": "conditionOperator", - "modelAsString": true - }, + "$ref": "#/definitions/ConditionOperator", "description": "The criteria operator. Relevant and required only for rules of the kind LogAlert." }, "threshold": { @@ -291,22 +422,8 @@ "description": "Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format). Relevant only for dynamic threshold rules of the kind LogAlert." }, "failingPeriods": { - "type": "object", - "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.", - "properties": { - "numberOfEvaluationPeriods": { - "type": "integer", - "format": "int64", - "default": 1, - "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" - }, - "minFailingPeriodsToAlert": { - "type": "integer", - "format": "int64", - "default": 1, - "description": "The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1" - } - } + "$ref": "#/definitions/LogAlertRuleConditionFailingPeriods", + "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." }, "metricName": { "type": "string", @@ -314,6 +431,38 @@ } } }, + "LogAlertRuleConditionFailingPeriods": { + "type": "object", + "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.", + "properties": { + "numberOfEvaluationPeriods": { + "type": "integer", + "format": "int64", + "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", + "default": 1 + }, + "minFailingPeriodsToAlert": { + "type": "integer", + "format": "int64", + "description": "The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1", + "default": 1 + } + } + }, + "LogAlertRuleCriteria": { + "type": "object", + "description": "The rule criteria that defines the conditions of the scheduled query rule.", + "properties": { + "allOf": { + "type": "array", + "description": "A list of conditions to evaluate against the specified scopes", + "items": { + "$ref": "#/definitions/LogAlertRuleCondition" + }, + "x-ms-identifiers": [] + } + } + }, "LogAlertRuleDimension": { "type": "object", "description": "Dimension splitting and filtering definition", @@ -323,23 +472,15 @@ "description": "Name of the dimension" }, "operator": { - "type": "string", - "description": "Operator for dimension values", - "enum": [ - "Include", - "Exclude" - ], - "x-ms-enum": { - "name": "dimensionOperator", - "modelAsString": true - } + "$ref": "#/definitions/DimensionOperator", + "description": "Operator for dimension values" }, "values": { "type": "array", + "description": "List of dimension values", "items": { "type": "string" - }, - "description": "List of dimension values" + } } }, "required": [ @@ -348,121 +489,98 @@ "values" ] }, - "PreviewAlertRuleResponse": { - "type": "object", - "properties": { - "rulePreviewResults": { - "type": "array", - "items": { - "$ref": "#/definitions/RulePreviewResult" - }, - "description": "An array of rule preview results." - } - } - }, - "RulePreviewResult": { - "type": "object", - "properties": { - "dimensionCombination": { - "type": "array", - "items": { - "$ref": "#/definitions/DimensionNameAndValue" - }, - "description": "The list of dimensions for the evaluation." - }, - "evaluations": { - "type": "array", - "items": { - "$ref": "#/definitions/Evaluation" - }, - "description": "An array of evaluations." - } - }, - "description": "A rule preview result containing a dimension combination and an array of evaluations." - }, - "Evaluation": { + "LogAlertRuleProperties": { "type": "object", + "description": "scheduled query rule Definition", "properties": { - "evaluationTime": { + "description": { "type": "string", - "format": "date-time", - "description": "The time when the evaluation was performed." + "description": "The description of the scheduled query rule." }, - "alertState": { + "displayName": { "type": "string", - "enum": [ - "NoAlert", - "Fired", - "Firing", - "Resolving", - "Resolved" - ], - "x-ms-enum": { - "name": "AlertState", - "modelAsString": true - }, - "description": "The state of the alert after the evaluation." + "description": "The display name of the alert rule" }, - "evaluatedPeriods": { + "severity": { + "$ref": "#/definitions/AlertSeverity", + "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." + }, + "enabled": { + "type": "boolean", + "description": "The flag which indicates whether this scheduled query rule is enabled. Value should be true or false" + }, + "scopes": { "type": "array", + "description": "The list of resource id's that this scheduled query rule is scoped to.", "items": { - "$ref": "#/definitions/EvaluatedPeriod" - }, - "description": "An array of evaluated periods." + "type": "string" + } }, - "thresholdMet": { - "type": "boolean", - "description": "Indicates whether the threshold was met for this evaluation." - } - }, - "description": "An evaluation of the alert rule." - }, - "EvaluatedPeriod": { - "type": "object", - "properties": { - "timestamp": { + "evaluationFrequency": { "type": "string", - "format": "date-time", - "description": "The timestamp of the evaluated period." + "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." }, - "highThreshold": { - "type": "number", - "format": "double", - "description": "The high threshold value for the evaluation period." + "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." }, - "lowThreshold": { - "type": "number", - "format": "double", - "description": "The low threshold value for the evaluation period." + "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." }, - "metricValue": { - "type": "number", - "format": "double", - "description": "The metric value for the evaluation period." + "targetResourceTypes": { + "type": "array", + "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", + "items": { + "type": "string" + } }, - "thresholdMet": { - "type": "boolean", - "description": "Indicates whether the threshold was met during the evaluation period." + "criteria": { + "$ref": "#/definitions/LogAlertRuleCriteria", + "description": "The rule criteria that defines the conditions of the scheduled query rule." } - }, - "description": "Details of the evaluated period." + } }, - "DimensionNameAndValue": { + "LogAlertRuleResource": { "type": "object", - "description": "Dimension name and value", + "description": "The scheduled query rule resource.", "properties": { - "name": { - "type": "string", - "description": "Name of the dimension" + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "read", + "update", + "create" + ] }, - "value": { + "location": { "type": "string", - "description": "Value of the dimension" + "description": "The geo-location where the resource lives", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "kind": { + "$ref": "#/definitions/Kind", + "description": "Indicates the type of scheduled query rule. The default is LogAlert." + }, + "properties": { + "$ref": "#/definitions/LogAlertRuleProperties", + "description": "The rule properties of the resource.", + "x-ms-client-flatten": true } }, "required": [ - "name", - "value" + "location", + "properties" ] }, "PreviewAlertRuleRequest": { @@ -473,38 +591,107 @@ "description": "The location of the rule resource." }, "properties": { - "type": "object", - "properties": { - "timespan": { - "type": "string", - "format": "duration", - "description": "Specifies the timespan of the preview in ISO 8601 duration format." - }, - "scheduledQueryRuleProperties": { - "$ref": "#/definitions/LogAlertRuleResource", - "description": "The properties of the alert rule to preview." - } - }, - "required": [ - "timespan" - ] + "$ref": "#/definitions/PreviewAlertRuleRequestProperties" } }, "required": [ "location", "properties" ] - } - }, - "parameters": { - "ResourceIdParameter": { - "name": "resourceId", - "in": "path", - "required": true, + }, + "PreviewAlertRuleRequestProperties": { + "type": "object", + "properties": { + "timespan": { + "type": "string", + "format": "duration", + "description": "Specifies the timespan of the preview in ISO 8601 duration format." + }, + "scheduledQueryRuleProperties": { + "$ref": "#/definitions/LogAlertRuleResource", + "description": "The properties of the alert rule to preview." + } + }, + "required": [ + "timespan" + ] + }, + "PreviewAlertRuleResponse": { + "type": "object", + "properties": { + "rulePreviewResults": { + "type": "array", + "description": "An array of rule preview results.", + "items": { + "$ref": "#/definitions/RulePreviewResult" + }, + "x-ms-identifiers": [] + } + } + }, + "RulePreviewResult": { + "type": "object", + "description": "A rule preview result containing a dimension combination and an array of evaluations.", + "properties": { + "dimensionCombination": { + "type": "array", + "description": "The list of dimensions for the evaluation.", + "items": { + "$ref": "#/definitions/DimensionNameAndValue" + } + }, + "evaluations": { + "type": "array", + "description": "An array of evaluations.", + "items": { + "$ref": "#/definitions/Evaluation" + }, + "x-ms-identifiers": [] + } + } + }, + "TimeAggregation": { "type": "string", - "description": "The identifier of the resource.", - "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": true + "description": "Aggregation type. Relevant and required only for rules of the kind LogAlert.", + "enum": [ + "Count", + "Average", + "Minimum", + "Maximum", + "Total" + ], + "x-ms-enum": { + "name": "TimeAggregation", + "modelAsString": true, + "values": [ + { + "name": "Count", + "value": "Count", + "description": "Count" + }, + { + "name": "Average", + "value": "Average", + "description": "Average" + }, + { + "name": "Minimum", + "value": "Minimum", + "description": "Minimum" + }, + { + "name": "Maximum", + "value": "Maximum", + "description": "Maximum" + }, + { + "name": "Total", + "value": "Total", + "description": "Total" + } + ] + } } - } + }, + "parameters": {} } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/preview/2025-07-01-preview/examples/previewDynamicThresholdLogSearchAlertRule.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/preview/2025-07-01-preview/examples/previewDynamicThresholdLogSearchAlertRule.json index 3232b31cb728..af21535efcbf 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/preview/2025-07-01-preview/examples/previewDynamicThresholdLogSearchAlertRule.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/preview/2025-07-01-preview/examples/previewDynamicThresholdLogSearchAlertRule.json @@ -1,28 +1,18 @@ { "parameters": { - "resourceId": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/myWorkspace", "api-version": "2025-07-01-preview", "parameters": { "location": "eastus", "properties": { - "timespan": "PT24H", "scheduledQueryRuleProperties": { "location": "eastus", "properties": { "description": "Performance rule", - "severity": 4, - "enabled": true, - "evaluationFrequency": "PT1H", - "scopes": [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/myWorkspace" - ], - "windowSize": "PT1H", "criteria": { "allOf": [ { + "alertSensitivity": "Medium", "criterionType": "DynamicThresholdCriterion", - "query": "Alert", - "timeAggregation": "Count", "dimensions": [ { "name": "AlertName", @@ -33,14 +23,24 @@ } ], "operator": "GreaterThan", - "alertSensitivity": "Medium" + "query": "Alert", + "timeAggregation": "Count" } ] - } + }, + "enabled": true, + "evaluationFrequency": "PT1H", + "scopes": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/myWorkspace" + ], + "severity": 4, + "windowSize": "PT1H" } - } + }, + "timespan": "PT24H" } - } + }, + "resourceId": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/myWorkspace" }, "responses": { "200": { @@ -55,51 +55,53 @@ ], "evaluations": [ { - "evaluationTime": "2025-02-15T10:00:00Z", "alertState": "Fired", - "thresholdMet": true, "evaluatedPeriods": [ { - "timestamp": "2025-02-15T09:00:00Z", - "highThreshold": 80.0, - "lowThreshold": 20.0, - "metricValue": 85.0, - "thresholdMet": true + "highThreshold": 80, + "lowThreshold": 20, + "metricValue": 85, + "thresholdMet": true, + "timestamp": "2025-02-15T09:00:00Z" }, { - "timestamp": "2025-02-15T08:00:00Z", - "highThreshold": 80.0, - "lowThreshold": 20.0, - "metricValue": 75.0, - "thresholdMet": false + "highThreshold": 80, + "lowThreshold": 20, + "metricValue": 75, + "thresholdMet": false, + "timestamp": "2025-02-15T08:00:00Z" } - ] + ], + "evaluationTime": "2025-02-15T10:00:00Z", + "thresholdMet": true }, { - "evaluationTime": "2025-02-15T11:00:00Z", "alertState": "Resolved", - "thresholdMet": false, "evaluatedPeriods": [ { - "timestamp": "2025-02-15T10:00:00Z", - "highThreshold": 80.0, - "lowThreshold": 20.0, - "metricValue": 65.0, - "thresholdMet": false + "highThreshold": 80, + "lowThreshold": 20, + "metricValue": 65, + "thresholdMet": false, + "timestamp": "2025-02-15T10:00:00Z" }, { - "timestamp": "2025-02-15T09:00:00Z", - "highThreshold": 80.0, - "lowThreshold": 20.0, - "metricValue": 85.0, - "thresholdMet": true + "highThreshold": 80, + "lowThreshold": 20, + "metricValue": 85, + "thresholdMet": true, + "timestamp": "2025-02-15T09:00:00Z" } - ] + ], + "evaluationTime": "2025-02-15T11:00:00Z", + "thresholdMet": false } ] } ] } } - } + }, + "operationId": "PreviewAlertRule", + "title": "Run preview of a dynamic threshold log search alert rule" } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/routes.tsp b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/routes.tsp new file mode 100644 index 000000000000..813c95751af4 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/routes.tsp @@ -0,0 +1,27 @@ +// FIXME: Operations in this file are not detected as a resource operation, please confirm the conversion result manually + +import "@azure-tools/typespec-azure-core"; +import "@typespec/rest"; +import "./models.tsp"; +import "@azure-tools/typespec-azure-resource-manager"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager; + +namespace Microsoft.AlertsManagement; + +/** + * Retrieves the results of a simulated historical execution of an alert rule + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@route("/{resourceId}/providers/microsoft.AlertsManagement/previewAlertRule") +@post +op previewAlertRule( + ...ApiVersionParameter, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @path resourceId: string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @body parameters: PreviewAlertRuleRequest, +): PreviewAlertRuleResponse | ErrorResponse; diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/suppressions.yaml b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/suppressions.yaml index 85ca2e83b301..5541693ff1be 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/suppressions.yaml +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/suppressions.yaml @@ -1,6 +1,3 @@ - tool: TypeSpecRequirement path: ./preview/2025-05-01-preview/*.json - reason: Brownfield service not ready to migrate -- tool: TypeSpecRequirement - path: ./preview/2025-07-01-preview/*.json - reason: Brownfield service not ready to migrate + reason: Brownfield service not ready to migrate \ No newline at end of file diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/tspconfig.yaml b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/tspconfig.yaml new file mode 100644 index 000000000000..011520909929 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/PreviewAlertRule/tspconfig.yaml @@ -0,0 +1,49 @@ +parameters: + "service-dir": + default: "sdk/previewalertrule" +emit: + - "@azure-tools/typespec-autorest" +options: + "@azure-tools/typespec-autorest": + omit-unreachable-types: true + emitter-output-dir: "{project-root}" + azure-resource-provider-folder: "resource-manager" + output-file: "{version-status}/{version}/PreviewAlertRule.json" + arm-types-dir: "{project-root}/../../../../common-types/resource-management" + emit-lro-options: "all" + examples-dir: "{project-root}/examples" + "@azure-tools/typespec-python": + package-dir: "azure-mgmt-previewalertrule" + emitter-output-dir: "{output-dir}/{service-dir}/azure-mgmt-previewalertrule" + namespace: "azure.mgmt.previewalertrule" + generate-test: true + generate-sample: true + flavor: "azure" + "@azure-tools/typespec-java": + package-dir: "azure-resourcemanager-previewalertrule" + emitter-output-dir: "{output-dir}/{service-dir}/azure-resourcemanager-previewalertrule" + namespace: "com.azure.resourcemanager.previewalertrule" + service-name: "PreviewAlertRule" # human-readable service name, whitespace allowed + flavor: azure + "@azure-tools/typespec-ts": + service-dir: sdk/previewalertrule + package-dir: "arm-previewalertrule" + emitter-output-dir: "{output-dir}/{service-dir}/arm-previewalertrule" + is-modular-library: true + flavor: "azure" + experimental-extensible-enums: true + package-details: + name: "@azure/arm-previewalertrule" + "@azure-tools/typespec-go": + service-dir: "sdk/resourcemanager/previewalertrule" + emitter-output-dir: "{output-dir}/{service-dir}/armpreviewalertrule" + module: "github.com/Azure/azure-sdk-for-go/{service-dir}/armpreviewalertrule" + fix-const-stuttering: true + flavor: "azure" + generate-samples: true + generate-fakes: true + head-as-boolean: true + inject-spans: true +linter: + extends: + - "@azure-tools/typespec-azure-rulesets/resource-manager"