Skip to content

Commit 3a47efa

Browse files
SDKAutoMoshe Malka
andcommitted
CodeGen from PR 22284 in Azure/azure-rest-api-specs
[Hub Generated] Review request for Microsoft.AlertsManagement to add version stable/2023-03-01 (#22284) * Adds base for updating Microsoft.AlertsManagement from version preview/2021-07-22-preview to version 2023-03-01 * Updates readme * Updates API version in new specs and examples * adding PrometheusRuleGroups stable api-version * rename example titles * improve descriptions * improve examples * fix lintdiff errors * add pattern to rule name * fix pattern * remove validations * add recomandations * change actions * change to last acions property version * run prettier * fix PR review comments --------- Co-authored-by: Moshe Malka <momalka@microsoft.com>
1 parent 5ed6daf commit 3a47efa

File tree

2 files changed

+292
-0
lines changed

2 files changed

+292
-0
lines changed
Lines changed: 289 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
1+
{
2+
"id": "https://schema.management.azure.com/schemas/2023-03-01/Microsoft.AlertsManagement.json#",
3+
"$schema": "http://json-schema.org/draft-04/schema#",
4+
"title": "Microsoft.AlertsManagement",
5+
"description": "Microsoft AlertsManagement Resource Types",
6+
"resourceDefinitions": {
7+
"prometheusRuleGroups": {
8+
"type": "object",
9+
"properties": {
10+
"apiVersion": {
11+
"type": "string",
12+
"enum": [
13+
"2023-03-01"
14+
]
15+
},
16+
"location": {
17+
"type": "string",
18+
"description": "The geo-location where the resource lives"
19+
},
20+
"name": {
21+
"oneOf": [
22+
{
23+
"type": "string",
24+
"pattern": "^[^:@/#{}%&+*<>?]+$"
25+
},
26+
{
27+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
28+
}
29+
],
30+
"description": "The name of the rule group."
31+
},
32+
"properties": {
33+
"oneOf": [
34+
{
35+
"$ref": "#/definitions/PrometheusRuleGroupProperties"
36+
},
37+
{
38+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
39+
}
40+
],
41+
"description": "An Azure Prometheus rule group."
42+
},
43+
"tags": {
44+
"oneOf": [
45+
{
46+
"type": "object",
47+
"additionalProperties": {
48+
"type": "string"
49+
},
50+
"properties": {}
51+
},
52+
{
53+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
54+
}
55+
],
56+
"description": "Resource tags."
57+
},
58+
"type": {
59+
"type": "string",
60+
"enum": [
61+
"Microsoft.AlertsManagement/prometheusRuleGroups"
62+
]
63+
}
64+
},
65+
"required": [
66+
"apiVersion",
67+
"location",
68+
"name",
69+
"properties",
70+
"type"
71+
],
72+
"description": "Microsoft.AlertsManagement/prometheusRuleGroups"
73+
}
74+
},
75+
"definitions": {
76+
"PrometheusRule": {
77+
"type": "object",
78+
"properties": {
79+
"actions": {
80+
"oneOf": [
81+
{
82+
"type": "array",
83+
"items": {
84+
"$ref": "#/definitions/PrometheusRuleGroupAction"
85+
}
86+
},
87+
{
88+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
89+
}
90+
],
91+
"description": "The array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. Only relevant for alerts."
92+
},
93+
"alert": {
94+
"type": "string",
95+
"description": "Alert rule name."
96+
},
97+
"annotations": {
98+
"oneOf": [
99+
{
100+
"type": "object",
101+
"additionalProperties": {
102+
"type": "string"
103+
},
104+
"properties": {}
105+
},
106+
{
107+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
108+
}
109+
],
110+
"description": "The annotations clause specifies a set of informational labels that can be used to store longer additional information such as alert descriptions or runbook links. The annotation values can be templated."
111+
},
112+
"enabled": {
113+
"oneOf": [
114+
{
115+
"type": "boolean"
116+
},
117+
{
118+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
119+
}
120+
],
121+
"description": "Enable/disable rule."
122+
},
123+
"expression": {
124+
"type": "string",
125+
"description": "The PromQL expression to evaluate. https://prometheus.io/docs/prometheus/latest/querying/basics/. Evaluated periodically as given by 'interval', and the result recorded as a new set of time series with the metric name as given by 'record'."
126+
},
127+
"for": {
128+
"type": "string",
129+
"format": "duration",
130+
"description": "The amount of time alert must be active before firing."
131+
},
132+
"labels": {
133+
"oneOf": [
134+
{
135+
"type": "object",
136+
"additionalProperties": {
137+
"type": "string"
138+
},
139+
"properties": {}
140+
},
141+
{
142+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
143+
}
144+
],
145+
"description": "Labels to add or overwrite before storing the result."
146+
},
147+
"record": {
148+
"type": "string",
149+
"description": "Recorded metrics name."
150+
},
151+
"resolveConfiguration": {
152+
"oneOf": [
153+
{
154+
"$ref": "#/definitions/PrometheusRuleResolveConfiguration"
155+
},
156+
{
157+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
158+
}
159+
],
160+
"description": "Specifies the Prometheus alert rule configuration."
161+
},
162+
"severity": {
163+
"oneOf": [
164+
{
165+
"type": "integer"
166+
},
167+
{
168+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
169+
}
170+
],
171+
"description": "The severity of the alerts fired by the rule. Must be between 0 and 4."
172+
}
173+
},
174+
"required": [
175+
"expression"
176+
],
177+
"description": "An Azure Prometheus alerting or recording rule."
178+
},
179+
"PrometheusRuleGroupAction": {
180+
"type": "object",
181+
"properties": {
182+
"actionGroupId": {
183+
"type": "string",
184+
"description": "The resource id of the action group to use."
185+
},
186+
"actionProperties": {
187+
"oneOf": [
188+
{
189+
"type": "object",
190+
"additionalProperties": {
191+
"type": "string"
192+
},
193+
"properties": {}
194+
},
195+
{
196+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
197+
}
198+
],
199+
"description": "The properties of an action group object."
200+
}
201+
},
202+
"description": "An alert action. Only relevant for alerts."
203+
},
204+
"PrometheusRuleGroupProperties": {
205+
"type": "object",
206+
"properties": {
207+
"clusterName": {
208+
"type": "string",
209+
"description": "Apply rule to data from a specific cluster."
210+
},
211+
"description": {
212+
"type": "string",
213+
"description": "Rule group description."
214+
},
215+
"enabled": {
216+
"oneOf": [
217+
{
218+
"type": "boolean"
219+
},
220+
{
221+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
222+
}
223+
],
224+
"description": "Enable/disable rule group."
225+
},
226+
"interval": {
227+
"type": "string",
228+
"format": "duration",
229+
"description": "The interval in which to run the Prometheus rule group represented in ISO 8601 duration format. Should be between 1 and 15 minutes"
230+
},
231+
"rules": {
232+
"oneOf": [
233+
{
234+
"type": "array",
235+
"items": {
236+
"$ref": "#/definitions/PrometheusRule"
237+
}
238+
},
239+
{
240+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
241+
}
242+
],
243+
"description": "Defines the rules in the Prometheus rule group."
244+
},
245+
"scopes": {
246+
"oneOf": [
247+
{
248+
"type": "array",
249+
"items": {
250+
"type": "string"
251+
}
252+
},
253+
{
254+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
255+
}
256+
],
257+
"description": "Target Azure Monitor workspaces resource ids. This api-version is currently limited to creating with one scope. This may change in future."
258+
}
259+
},
260+
"required": [
261+
"rules",
262+
"scopes"
263+
],
264+
"description": "An Azure Prometheus rule group."
265+
},
266+
"PrometheusRuleResolveConfiguration": {
267+
"type": "object",
268+
"properties": {
269+
"autoResolved": {
270+
"oneOf": [
271+
{
272+
"type": "boolean"
273+
},
274+
{
275+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
276+
}
277+
],
278+
"description": "Enable alert auto-resolution."
279+
},
280+
"timeToResolve": {
281+
"type": "string",
282+
"format": "duration",
283+
"description": "Alert auto-resolution timeout."
284+
}
285+
},
286+
"description": "Specifies the Prometheus alert rule configuration."
287+
}
288+
}
289+
}

schemas/common/autogeneratedResources.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@
106106
{
107107
"$ref": "https://schema.management.azure.com/schemas/2021-08-08-preview/Microsoft.AlertsManagement.json#/resourceDefinitions/actionRules"
108108
},
109+
{
110+
"$ref": "https://schema.management.azure.com/schemas/2023-03-01/Microsoft.AlertsManagement.json#/resourceDefinitions/prometheusRuleGroups"
111+
},
109112
{
110113
"$ref": "https://schema.management.azure.com/schemas/2016-05-16/Microsoft.AnalysisServices.json#/resourceDefinitions/servers"
111114
},

0 commit comments

Comments
 (0)