Skip to content

Commit 43918fc

Browse files
committed
migrate ScheduledQueryRule to autorest v4
1 parent 8e67334 commit 43918fc

28 files changed

+615
-255
lines changed

src/Monitor/Monitor.sln

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.MonitorWorkspace", "..\.
4747
EndProject
4848
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.PipelineGroup", "..\..\generated\Monitor\PipelineGroup.Autorest\Az.PipelineGroup.csproj", "{BBB1BE4E-4595-4589-AB2B-14BCFF7EB65C}"
4949
EndProject
50-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.ScheduledQueryRule", "..\..\generated\Monitor\ScheduledQueryRule.Autorest\Az.ScheduledQueryRule.csproj", "{7CDB5277-30F0-4C26-97D9-DD08A11AA3B2}"
51-
EndProject
5250
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.ApplicationInsights", "..\..\generated\ApplicationInsights\ApplicationInsights.Autorest\Az.ApplicationInsights.csproj", "{988AD78A-B61E-4D34-968B-05A014140ACF}"
5351
EndProject
5452
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataCollectionRule.Autorest", "DataCollectionRule.Autorest", "{35E5CBAF-5596-AC3C-3DBD-816FC74B54D0}"
@@ -59,6 +57,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Metricdata.Autorest", "Metr
5957
EndProject
6058
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Metricdata", "..\..\generated\Monitor\Metricdata.Autorest\Az.Metricdata.csproj", "{0A51A656-9092-4C82-83B5-524516C8FED7}"
6159
EndProject
60+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ScheduledQueryRule.Autorest", "ScheduledQueryRule.Autorest", "{DFE9A16E-4879-AFA3-BD8B-DBC73F42D0CA}"
61+
EndProject
62+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.ScheduledQueryRule", "..\..\generated\Monitor\ScheduledQueryRule.Autorest\Az.ScheduledQueryRule.csproj", "{FB60BFF1-D07C-4FC7-9AD0-F349FFEEAD37}"
63+
EndProject
6264
Global
6365
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6466
Debug|Any CPU = Debug|Any CPU
@@ -297,18 +299,6 @@ Global
297299
{BBB1BE4E-4595-4589-AB2B-14BCFF7EB65C}.Release|x64.Build.0 = Release|Any CPU
298300
{BBB1BE4E-4595-4589-AB2B-14BCFF7EB65C}.Release|x86.ActiveCfg = Release|Any CPU
299301
{BBB1BE4E-4595-4589-AB2B-14BCFF7EB65C}.Release|x86.Build.0 = Release|Any CPU
300-
{7CDB5277-30F0-4C26-97D9-DD08A11AA3B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
301-
{7CDB5277-30F0-4C26-97D9-DD08A11AA3B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
302-
{7CDB5277-30F0-4C26-97D9-DD08A11AA3B2}.Debug|x64.ActiveCfg = Debug|Any CPU
303-
{7CDB5277-30F0-4C26-97D9-DD08A11AA3B2}.Debug|x64.Build.0 = Debug|Any CPU
304-
{7CDB5277-30F0-4C26-97D9-DD08A11AA3B2}.Debug|x86.ActiveCfg = Debug|Any CPU
305-
{7CDB5277-30F0-4C26-97D9-DD08A11AA3B2}.Debug|x86.Build.0 = Debug|Any CPU
306-
{7CDB5277-30F0-4C26-97D9-DD08A11AA3B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
307-
{7CDB5277-30F0-4C26-97D9-DD08A11AA3B2}.Release|Any CPU.Build.0 = Release|Any CPU
308-
{7CDB5277-30F0-4C26-97D9-DD08A11AA3B2}.Release|x64.ActiveCfg = Release|Any CPU
309-
{7CDB5277-30F0-4C26-97D9-DD08A11AA3B2}.Release|x64.Build.0 = Release|Any CPU
310-
{7CDB5277-30F0-4C26-97D9-DD08A11AA3B2}.Release|x86.ActiveCfg = Release|Any CPU
311-
{7CDB5277-30F0-4C26-97D9-DD08A11AA3B2}.Release|x86.Build.0 = Release|Any CPU
312302
{988AD78A-B61E-4D34-968B-05A014140ACF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
313303
{988AD78A-B61E-4D34-968B-05A014140ACF}.Debug|Any CPU.Build.0 = Debug|Any CPU
314304
{988AD78A-B61E-4D34-968B-05A014140ACF}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -345,6 +335,18 @@ Global
345335
{0A51A656-9092-4C82-83B5-524516C8FED7}.Release|x64.Build.0 = Release|Any CPU
346336
{0A51A656-9092-4C82-83B5-524516C8FED7}.Release|x86.ActiveCfg = Release|Any CPU
347337
{0A51A656-9092-4C82-83B5-524516C8FED7}.Release|x86.Build.0 = Release|Any CPU
338+
{FB60BFF1-D07C-4FC7-9AD0-F349FFEEAD37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
339+
{FB60BFF1-D07C-4FC7-9AD0-F349FFEEAD37}.Debug|Any CPU.Build.0 = Debug|Any CPU
340+
{FB60BFF1-D07C-4FC7-9AD0-F349FFEEAD37}.Debug|x64.ActiveCfg = Debug|Any CPU
341+
{FB60BFF1-D07C-4FC7-9AD0-F349FFEEAD37}.Debug|x64.Build.0 = Debug|Any CPU
342+
{FB60BFF1-D07C-4FC7-9AD0-F349FFEEAD37}.Debug|x86.ActiveCfg = Debug|Any CPU
343+
{FB60BFF1-D07C-4FC7-9AD0-F349FFEEAD37}.Debug|x86.Build.0 = Debug|Any CPU
344+
{FB60BFF1-D07C-4FC7-9AD0-F349FFEEAD37}.Release|Any CPU.ActiveCfg = Release|Any CPU
345+
{FB60BFF1-D07C-4FC7-9AD0-F349FFEEAD37}.Release|Any CPU.Build.0 = Release|Any CPU
346+
{FB60BFF1-D07C-4FC7-9AD0-F349FFEEAD37}.Release|x64.ActiveCfg = Release|Any CPU
347+
{FB60BFF1-D07C-4FC7-9AD0-F349FFEEAD37}.Release|x64.Build.0 = Release|Any CPU
348+
{FB60BFF1-D07C-4FC7-9AD0-F349FFEEAD37}.Release|x86.ActiveCfg = Release|Any CPU
349+
{FB60BFF1-D07C-4FC7-9AD0-F349FFEEAD37}.Release|x86.Build.0 = Release|Any CPU
348350
EndGlobalSection
349351
GlobalSection(SolutionProperties) = preSolution
350352
HideSolutionNode = FALSE
@@ -365,5 +367,6 @@ Global
365367
{0636EEB2-FE81-4424-8CFC-CCEB25360A40} = {3F76A15C-B128-4A31-A887-05E303CF8D7F}
366368
{138B61C0-9D0E-44A1-9EA1-E8142303ECA5} = {35E5CBAF-5596-AC3C-3DBD-816FC74B54D0}
367369
{0A51A656-9092-4C82-83B5-524516C8FED7} = {97973F8C-3EE1-368A-3B71-C62280C2DC8C}
370+
{FB60BFF1-D07C-4FC7-9AD0-F349FFEEAD37} = {DFE9A16E-4879-AFA3-BD8B-DBC73F42D0CA}
368371
EndGlobalSection
369372
EndGlobal

src/Monitor/Monitor/Az.Monitor.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 7/2/2025
6+
# Generated on: 7/16/2025
77
#
88

99
@{

src/Monitor/Monitor/help/Az.Monitor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ Create an in-memory object for PlatformTelemetryDataSource.
253253
Create an in-memory object for PrometheusForwarderDataSource.
254254

255255
### [New-AzScheduledQueryRule](New-AzScheduledQueryRule.md)
256-
Creates or updates a scheduled query rule.
256+
Create a scheduled query rule.
257257

258258
### [New-AzScheduledQueryRuleConditionObject](New-AzScheduledQueryRuleConditionObject.md)
259259
Create an in-memory object for Condition.

src/Monitor/Monitor/help/Get-AzScheduledQueryRule.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ Accept wildcard characters: False
8282
8383
### -InputObject
8484
Identity Parameter
85-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
8685
8786
```yaml
8887
Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleIdentity
@@ -151,7 +150,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
151150
152151
## OUTPUTS
153152
154-
### Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource
153+
### Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource
155154
156155
## NOTES
157156

src/Monitor/Monitor/help/New-AzScheduledQueryRule.md

Lines changed: 70 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,37 @@ schema: 2.0.0
88
# New-AzScheduledQueryRule
99

1010
## SYNOPSIS
11-
Creates or updates a scheduled query rule.
11+
Create a scheduled query rule.
1212

1313
## SYNTAX
1414

15+
### CreateExpanded (Default)
1516
```
1617
New-AzScheduledQueryRule -Name <String> -ResourceGroupName <String> [-SubscriptionId <String>]
1718
-Location <String> [-ActionCustomProperty <Hashtable>] [-ActionGroupResourceId <String[]>] [-AutoMitigate]
1819
[-CheckWorkspaceAlertsStorageConfigured] [-CriterionAllOf <ICondition[]>] [-Description <String>]
19-
[-DisplayName <String>] [-Enabled] [-EvaluationFrequency <TimeSpan>] [-Kind <Kind>]
20+
[-DisplayName <String>] [-Enabled] [-EvaluationFrequency <TimeSpan>] [-Kind <String>]
2021
[-MuteActionsDuration <TimeSpan>] [-OverrideQueryTimeRange <TimeSpan>] [-Scope <String[]>] [-Severity <Int64>]
2122
[-SkipQueryValidation] [-Tag <Hashtable>] [-TargetResourceType <String[]>] [-WindowSize <TimeSpan>]
2223
[-DefaultProfile <PSObject>] [-WhatIf] [-Confirm] [<CommonParameters>]
2324
```
2425

26+
### CreateViaJsonFilePath
27+
```
28+
New-AzScheduledQueryRule -Name <String> -ResourceGroupName <String> [-SubscriptionId <String>]
29+
-JsonFilePath <String> [-DefaultProfile <PSObject>] [-WhatIf] [-Confirm]
30+
[<CommonParameters>]
31+
```
32+
33+
### CreateViaJsonString
34+
```
35+
New-AzScheduledQueryRule -Name <String> -ResourceGroupName <String> [-SubscriptionId <String>]
36+
-JsonString <String> [-DefaultProfile <PSObject>] [-WhatIf] [-Confirm]
37+
[<CommonParameters>]
38+
```
39+
2540
## DESCRIPTION
26-
Creates or updates a scheduled query rule.
41+
Create a scheduled query rule.
2742

2843
## EXAMPLES
2944

@@ -44,7 +59,7 @@ The properties of an alert payload.
4459

4560
```yaml
4661
Type: System.Collections.Hashtable
47-
Parameter Sets: (All)
62+
Parameter Sets: CreateExpanded
4863
Aliases:
4964

5065
Required: False
@@ -59,7 +74,7 @@ Action Group resource Ids to invoke when the alert fires.
5974
6075
```yaml
6176
Type: System.String[]
62-
Parameter Sets: (All)
77+
Parameter Sets: CreateExpanded
6378
Aliases:
6479

6580
Required: False
@@ -76,7 +91,7 @@ Relevant only for rules of the kind LogAlert.
7691
7792
```yaml
7893
Type: System.Management.Automation.SwitchParameter
79-
Parameter Sets: (All)
94+
Parameter Sets: CreateExpanded
8095
Aliases:
8196

8297
Required: False
@@ -93,7 +108,7 @@ Relevant only for rules of the kind LogAlert.
93108
94109
```yaml
95110
Type: System.Management.Automation.SwitchParameter
96-
Parameter Sets: (All)
111+
Parameter Sets: CreateExpanded
97112
Aliases:
98113

99114
Required: False
@@ -105,11 +120,10 @@ Accept wildcard characters: False
105120
106121
### -CriterionAllOf
107122
A list of conditions to evaluate against the specified scopes
108-
To construct, see NOTES section for CRITERIONALLOF properties and create a hash table.
109123
110124
```yaml
111-
Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[]
112-
Parameter Sets: (All)
125+
Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition[]
126+
Parameter Sets: CreateExpanded
113127
Aliases:
114128

115129
Required: False
@@ -140,7 +154,7 @@ The description of the scheduled query rule.
140154
141155
```yaml
142156
Type: System.String
143-
Parameter Sets: (All)
157+
Parameter Sets: CreateExpanded
144158
Aliases:
145159

146160
Required: False
@@ -155,7 +169,7 @@ The display name of the alert rule
155169
156170
```yaml
157171
Type: System.String
158-
Parameter Sets: (All)
172+
Parameter Sets: CreateExpanded
159173
Aliases:
160174

161175
Required: False
@@ -171,7 +185,7 @@ Value should be true or false
171185
172186
```yaml
173187
Type: System.Management.Automation.SwitchParameter
174-
Parameter Sets: (All)
188+
Parameter Sets: CreateExpanded
175189
Aliases:
176190

177191
Required: False
@@ -187,7 +201,7 @@ Relevant and required only for rules of the kind LogAlert.
187201
188202
```yaml
189203
Type: System.TimeSpan
190-
Parameter Sets: (All)
204+
Parameter Sets: CreateExpanded
191205
Aliases:
192206

193207
Required: False
@@ -197,13 +211,43 @@ Accept pipeline input: False
197211
Accept wildcard characters: False
198212
```
199213
214+
### -JsonFilePath
215+
Path of Json file supplied to the Create operation
216+
217+
```yaml
218+
Type: System.String
219+
Parameter Sets: CreateViaJsonFilePath
220+
Aliases:
221+
222+
Required: True
223+
Position: Named
224+
Default value: None
225+
Accept pipeline input: False
226+
Accept wildcard characters: False
227+
```
228+
229+
### -JsonString
230+
Json string supplied to the Create operation
231+
232+
```yaml
233+
Type: System.String
234+
Parameter Sets: CreateViaJsonString
235+
Aliases:
236+
237+
Required: True
238+
Position: Named
239+
Default value: None
240+
Accept pipeline input: False
241+
Accept wildcard characters: False
242+
```
243+
200244
### -Kind
201245
Indicates the type of scheduled query rule.
202246
The default is LogAlert.
203247
204248
```yaml
205-
Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind
206-
Parameter Sets: (All)
249+
Type: System.String
250+
Parameter Sets: CreateExpanded
207251
Aliases:
208252

209253
Required: False
@@ -218,7 +262,7 @@ The geo-location where the resource lives
218262
219263
```yaml
220264
Type: System.String
221-
Parameter Sets: (All)
265+
Parameter Sets: CreateExpanded
222266
Aliases:
223267

224268
Required: True
@@ -234,7 +278,7 @@ Relevant only for rules of the kind LogAlert.
234278
235279
```yaml
236280
Type: System.TimeSpan
237-
Parameter Sets: (All)
281+
Parameter Sets: CreateExpanded
238282
Aliases:
239283

240284
Required: False
@@ -265,7 +309,7 @@ Relevant only for rules of the kind LogAlert.
265309
266310
```yaml
267311
Type: System.TimeSpan
268-
Parameter Sets: (All)
312+
Parameter Sets: CreateExpanded
269313
Aliases:
270314

271315
Required: False
@@ -296,7 +340,7 @@ The list of resource id's that this scheduled query rule is scoped to.
296340
297341
```yaml
298342
Type: System.String[]
299-
Parameter Sets: (All)
343+
Parameter Sets: CreateExpanded
300344
Aliases:
301345

302346
Required: False
@@ -314,7 +358,7 @@ Relevant and required only for rules of the kind LogAlert.
314358
315359
```yaml
316360
Type: System.Int64
317-
Parameter Sets: (All)
361+
Parameter Sets: CreateExpanded
318362
Aliases:
319363

320364
Required: False
@@ -331,7 +375,7 @@ Relevant only for rules of the kind LogAlert.
331375
332376
```yaml
333377
Type: System.Management.Automation.SwitchParameter
334-
Parameter Sets: (All)
378+
Parameter Sets: CreateExpanded
335379
Aliases:
336380

337381
Required: False
@@ -361,7 +405,7 @@ Resource tags.
361405
362406
```yaml
363407
Type: System.Collections.Hashtable
364-
Parameter Sets: (All)
408+
Parameter Sets: CreateExpanded
365409
Aliases:
366410

367411
Required: False
@@ -378,7 +422,7 @@ Relevant only for rules of the kind LogAlert
378422
379423
```yaml
380424
Type: System.String[]
381-
Parameter Sets: (All)
425+
Parameter Sets: CreateExpanded
382426
Aliases:
383427

384428
Required: False
@@ -394,7 +438,7 @@ Relevant and required only for rules of the kind LogAlert.
394438
395439
```yaml
396440
Type: System.TimeSpan
397-
Parameter Sets: (All)
441+
Parameter Sets: CreateExpanded
398442
Aliases:
399443

400444
Required: False
@@ -442,7 +486,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
442486
443487
## OUTPUTS
444488
445-
### Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource
489+
### Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource
446490
447491
## NOTES
448492

0 commit comments

Comments
 (0)