-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Expand file tree
/
Copy pathAlertRule.tsp
More file actions
93 lines (83 loc) · 2.41 KB
/
Copy pathAlertRule.tsp
File metadata and controls
93 lines (83 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./VirtualResource.tsp";
using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;
using TypeSpec.Versioning;
namespace Microsoft.SecurityInsights;
/**
* Alert rule.
*/
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@discriminator("kind")
model AlertRule
is Azure.ResourceManager.Legacy.DiscriminatedProxyResource<AlertRuleKind> {
...ResourceNameParameter<
Resource = AlertRule,
KeyName = "ruleId",
SegmentName = "alertRules",
NamePattern = ""
>;
/**
* Etag of the azure resource
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
etag?: string;
}
@armResourceOperations(#{ omitTags: true })
interface AlertRules {
/**
* Gets the alert rule.
*/
@tag("Alert Rules")
get is Extension.Read<OperationalInsights, AlertRule, Error = CloudError>;
/**
* Creates or updates the alert rule.
*/
@tag("Alert Rules")
createOrUpdate is Extension.CreateOrReplaceSync<
OperationalInsights,
AlertRule,
Error = CloudError
>;
/**
* Delete the alert rule.
*/
@tag("Alert Rules")
delete is Extension.DeleteSync<
OperationalInsights,
AlertRule,
Error = CloudError
>;
/**
* Gets all alert rules.
*/
@tag("Alert Rules")
list is Extension.ListByTarget<
OperationalInsights,
AlertRule,
Response = ArmResponse<AlertRulesList>,
Error = CloudError
>;
/**
* triggers analytics rule run
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@operationId("alertRule_TriggerRuleRun")
@tag("trigger analytics rule run")
@added(Versions.v2025_10_01_preview)
triggerRuleRun is Extension.ActionAsyncBase<
OperationalInsights,
AlertRule,
Request = AnalyticsRuleRunTrigger,
Response = ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = AlertRule>>,
Error = ErrorResponse
>;
}
@@doc(AlertRule.name, "Alert rule ID");
@@doc(AlertRules.createOrUpdate::parameters.resource, "The alert rule");