Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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);
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
@@ -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",
}
Loading
Loading