Skip to content

Commit 90a294f

Browse files
meydandyashmuelmeday89
authored
[Hub Generated] Review request for Microsoft.AlertsManagement to add version preview/2023-01-01-preview (#22248)
* Adds base for updating Microsoft.AlertsManagement from version stable/2021-08-08 to version 2023-01-01-preview * Updates readme * Updates API version in new specs and examples * Add alertRuleRecommendations swagger file * Fix json * revert * revert * Fix json * Fix validations * Fixes * remove client thing * validation fixes * prettier fixes * Fix title * Delete error response definition * Fix version * Fix readme * separate methods * Fix pageble * Fix subscription level examples * Fix pageble * Fix readme * Fix readme file * Another try * Return list of recommendations * PR fixes * Add resource standard properties * Fix misplles * PR comments * Fix propreties definition name * flatten the properties --------- Co-authored-by: yashmuel <63585146+yashmuel@users.noreply.github.com> Co-authored-by: Meydan Dayan <meday@microsoft.com>
1 parent 78ec1b9 commit 90a294f

File tree

6 files changed

+1397
-0
lines changed

6 files changed

+1397
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,329 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"version": "2023-01-01-preview",
5+
"title": "Azure Alerts Management Service Resource Provider",
6+
"description": "Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor."
7+
},
8+
"host": "management.azure.com",
9+
"schemes": [
10+
"https"
11+
],
12+
"consumes": [
13+
"application/json"
14+
],
15+
"produces": [
16+
"application/json"
17+
],
18+
"security": [
19+
{
20+
"azure_auth": [
21+
"user_impersonation"
22+
]
23+
}
24+
],
25+
"securityDefinitions": {
26+
"azure_auth": {
27+
"type": "oauth2",
28+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
29+
"flow": "implicit",
30+
"description": "Azure Active Directory OAuth2 Flow",
31+
"scopes": {
32+
"user_impersonation": "impersonate your user account"
33+
}
34+
}
35+
},
36+
"paths": {
37+
"/{resourceUri}/providers/Microsoft.AlertsManagement/alertRuleRecommendations": {
38+
"get": {
39+
"tags": [
40+
"alertRuleRecommendations"
41+
],
42+
"description": "Retrieve alert rule recommendations for a resource.",
43+
"operationId": "AlertRuleRecommendations_ListByResource",
44+
"parameters": [
45+
{
46+
"$ref": "#/parameters/ResourceUriParameter"
47+
},
48+
{
49+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter"
50+
}
51+
],
52+
"responses": {
53+
"200": {
54+
"description": "Successful request for a list of alert rule recommendations",
55+
"schema": {
56+
"$ref": "#/definitions/AlertRuleRecommendationsListResponse"
57+
}
58+
},
59+
"default": {
60+
"description": "Error response describing why the operation failed.",
61+
"schema": {
62+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
63+
}
64+
}
65+
},
66+
"x-ms-pageable": {
67+
"nextLinkName": "nextLink"
68+
},
69+
"x-ms-examples": {
70+
"List alert rule recommendations for virtual machines at resource level": {
71+
"$ref": "./examples/AlertRuleRecommendations_GetByResource_VM.json"
72+
},
73+
"List alert rule recommendations for Monitoring accounts at resource level": {
74+
"$ref": "./examples/AlertRuleRecommendations_GetByResource_MAC.json"
75+
}
76+
}
77+
}
78+
},
79+
"/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alertRuleRecommendations": {
80+
"get": {
81+
"tags": [
82+
"alertRuleRecommendations"
83+
],
84+
"description": "Retrieve alert rule recommendations for a target type.",
85+
"operationId": "AlertRuleRecommendations_ListByTargetType",
86+
"parameters": [
87+
{
88+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter"
89+
},
90+
{
91+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter"
92+
},
93+
{
94+
"$ref": "#/parameters/TargetTypeParameter"
95+
}
96+
],
97+
"responses": {
98+
"200": {
99+
"description": "Successful request for a list of alert rule recommendations",
100+
"schema": {
101+
"$ref": "#/definitions/AlertRuleRecommendationsListResponse"
102+
}
103+
},
104+
"default": {
105+
"description": "Error response describing why the operation failed.",
106+
"schema": {
107+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
108+
}
109+
}
110+
},
111+
"x-ms-pageable": {
112+
"nextLinkName": "nextLink"
113+
},
114+
"x-ms-examples": {
115+
"List alert rule recommendations for virtual machines at subscription level": {
116+
"$ref": "./examples/AlertRuleRecommendations_GetBySubscription_VM.json"
117+
},
118+
"List alert rule recommendations for Monitoring accounts at subscription level": {
119+
"$ref": "./examples/AlertRuleRecommendations_GetBySubscription_MAC.json"
120+
}
121+
}
122+
}
123+
}
124+
},
125+
"parameters": {
126+
"ResourceUriParameter": {
127+
"name": "resourceUri",
128+
"in": "path",
129+
"required": true,
130+
"type": "string",
131+
"description": "The identifier of the resource.",
132+
"x-ms-parameter-location": "method",
133+
"x-ms-skip-url-encoding": true
134+
},
135+
"TargetTypeParameter": {
136+
"name": "targetType",
137+
"in": "query",
138+
"required": true,
139+
"type": "string",
140+
"description": "The recommendations target type.",
141+
"x-ms-parameter-location": "client"
142+
}
143+
},
144+
"definitions": {
145+
"AlertRuleRecommendationsListResponse": {
146+
"type": "object",
147+
"description": "List of alert rule recommendations.",
148+
"required": [
149+
"value"
150+
],
151+
"properties": {
152+
"value": {
153+
"type": "array",
154+
"items": {
155+
"$ref": "#/definitions/AlertRuleRecommendationResource"
156+
},
157+
"description": "the values for the alert rule recommendations."
158+
},
159+
"nextLink": {
160+
"description": "URL to fetch the next set of recommendations.",
161+
"type": "string"
162+
}
163+
}
164+
},
165+
"AlertRuleRecommendationResource": {
166+
"type": "object",
167+
"description": "A single alert rule recommendation resource.",
168+
"allOf": [
169+
{
170+
"$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource"
171+
}
172+
],
173+
"required": [
174+
"properties"
175+
],
176+
"properties": {
177+
"properties": {
178+
"$ref": "#/definitions/AlertRuleRecommendationProperties",
179+
"x-ms-client-flatten": true,
180+
"description": "recommendation properties."
181+
}
182+
}
183+
},
184+
"AlertRuleRecommendationProperties": {
185+
"description": "Describes the format of Alert Rule Recommendations response.",
186+
"type": "object",
187+
"required": [
188+
"alertRuleType",
189+
"displayInformation",
190+
"ruleArmTemplate"
191+
],
192+
"properties": {
193+
"alertRuleType": {
194+
"type": "string",
195+
"description": "The recommendation alert rule type."
196+
},
197+
"displayInformation": {
198+
"$ref": "#/definitions/DisplayInformationItem"
199+
},
200+
"ruleArmTemplate": {
201+
"$ref": "#/definitions/ruleArmTemplate"
202+
}
203+
}
204+
},
205+
"DisplayInformationItem": {
206+
"description": "Provides the display information for an alert rule recommendation recommendations.",
207+
"type": "object",
208+
"properties": {
209+
"ruleInfo": {
210+
"type": "string",
211+
"description": "The alert rule information."
212+
},
213+
"infoBallonMessage": {
214+
"type": "string",
215+
"description": "The information to display inside an information balloon."
216+
},
217+
"infoBallonLink": {
218+
"type": "string",
219+
"description": "The documentation link to display inside an information balloon."
220+
},
221+
"metricAlertsDisplayInformation": {
222+
"$ref": "#/definitions/MetricAlertsDisplayInformation"
223+
}
224+
}
225+
},
226+
"MetricAlertsDisplayUnit": {
227+
"type": "string",
228+
"description": "The unit to display for a metric alert rule.",
229+
"enum": [
230+
"None",
231+
"Percentage",
232+
"Bytes",
233+
"Kilobytes",
234+
"Megabytes",
235+
"Gigabytes",
236+
"Terabytes",
237+
"Petabytes",
238+
"BytesPerDay",
239+
"BytesPerHour",
240+
"BytesPerMinute",
241+
"BytesPerSecond",
242+
"KilobytesPerSecond",
243+
"MegabytesPerSecond",
244+
"GigabytesPerSecond",
245+
"TerabytesPerSecond",
246+
"PetabytesPerSecond",
247+
"Count",
248+
"Thousand",
249+
"Million",
250+
"Billion",
251+
"Trillion",
252+
"MicroSeconds",
253+
"MilliSeconds",
254+
"Seconds",
255+
"Minutes",
256+
"Hours",
257+
"Days",
258+
"CountPerDay",
259+
"CountPerHour",
260+
"CountPerMinute",
261+
"CountPerSecond",
262+
"ThousandPerSecond",
263+
"MillionPerSecond",
264+
"BillionPerSecond",
265+
"TrillionPerSecond"
266+
],
267+
"x-ms-enum": {
268+
"name": "MetricAlertsDisplayUnit",
269+
"modelAsString": true
270+
}
271+
},
272+
"MetricAlertsDisplayInformation": {
273+
"description": "Provides display information specific for Metric Alerts rule.",
274+
"type": "object",
275+
"required": [
276+
"metricDisplayName",
277+
"displayUnits"
278+
],
279+
"properties": {
280+
"metricDisplayName": {
281+
"type": "string",
282+
"description": "The metric display name to use in the UI for the metric alert rule."
283+
},
284+
"displayUnits": {
285+
"$ref": "#/definitions/MetricAlertsDisplayUnit",
286+
"description": "The display units to use in the UI for the metric alert rule."
287+
}
288+
}
289+
},
290+
"ruleArmTemplate": {
291+
"description": "A complete ARM template to deploy the alert rules.",
292+
"type": "object",
293+
"required": [
294+
"$schema",
295+
"contentVersion",
296+
"variables",
297+
"parameters",
298+
"resources"
299+
],
300+
"properties": {
301+
"$schema": {
302+
"type": "string",
303+
"description": "JSON schema reference"
304+
},
305+
"contentVersion": {
306+
"type": "string",
307+
"pattern": "(^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$)",
308+
"description": "A 4 number format for the version number of this template file. For example, 1.0.0.0"
309+
},
310+
"variables": {
311+
"type": "object",
312+
"description": "Variable definitions"
313+
},
314+
"parameters": {
315+
"type": "object",
316+
"description": "Input parameter definitions"
317+
},
318+
"resources": {
319+
"type": "array",
320+
"description": "Alert rule resource definitions",
321+
"items": {
322+
"type": "object"
323+
},
324+
"x-ms-identifiers": []
325+
}
326+
}
327+
}
328+
}
329+
}

0 commit comments

Comments
 (0)