Skip to content

Commit 655c53e

Browse files
JoyerJinCopilotVeryEarly
authored
[PS] Migrate ScheduledQueryRule in Monitor module to autorest v4 (Azure#28195)
Co-authored-by: Copilot <[email protected]> Co-authored-by: Yabo Hu <[email protected]>
1 parent ad9cd69 commit 655c53e

27 files changed

+590
-323
lines changed

src/Monitor/Monitor.sln

Lines changed: 98 additions & 69 deletions
Large diffs are not rendered by default.

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/15/2025
6+
# Generated on: 8/7/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

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: Az.ScheduledQueryRule.psm1-help.xml
33
Module Name: Az.Monitor
4-
online version: https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzScheduledQueryRuleConditionObject
4+
online version: https://learn.microsoft.com/powershell/module/Az.Monitor/new-azscheduledqueryruleconditionobject
55
schema: 2.0.0
66
---
77

@@ -15,8 +15,8 @@ Create an in-memory object for Condition.
1515
```
1616
New-AzScheduledQueryRuleConditionObject [-Dimension <IDimension[]>]
1717
[-FailingPeriodMinFailingPeriodsToAlert <Int64>] [-FailingPeriodNumberOfEvaluationPeriod <Int64>]
18-
[-MetricMeasureColumn <String>] [-MetricName <String>] [-Operator <ConditionOperator>] [-Query <String>]
19-
[-ResourceIdColumn <String>] [-Threshold <Double>] [-TimeAggregation <TimeAggregation>]
18+
[-MetricMeasureColumn <String>] [-MetricName <String>] [-Operator <String>] [-Query <String>]
19+
[-ResourceIdColumn <String>] [-Threshold <Double>] [-TimeAggregation <String>]
2020
[<CommonParameters>]
2121
```
2222

@@ -37,10 +37,9 @@ Create condition object
3737

3838
### -Dimension
3939
List of Dimensions conditions.
40-
To construct, see NOTES section for DIMENSION properties and create a hash table.
4140

4241
```yaml
43-
Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimension[]
42+
Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimension[]
4443
Parameter Sets: (All)
4544
Aliases:
4645

@@ -122,7 +121,7 @@ The criteria operator.
122121
Relevant and required only for rules of the kind LogAlert.
123122
124123
```yaml
125-
Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator
124+
Type: System.String
126125
Parameter Sets: (All)
127126
Aliases:
128127

@@ -186,7 +185,7 @@ Aggregation type.
186185
Relevant and required only for rules of the kind LogAlert.
187186
188187
```yaml
189-
Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation
188+
Type: System.String
190189
Parameter Sets: (All)
191190
Aliases:
192191

@@ -204,7 +203,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
204203
205204
## OUTPUTS
206205
207-
### Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Condition
206+
### Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Condition
208207
209208
## NOTES
210209

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: Az.ScheduledQueryRule.psm1-help.xml
33
Module Name: Az.Monitor
4-
online version: https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzScheduledQueryRuleDimensionObject
4+
online version: https://learn.microsoft.com/powershell/module/Az.Monitor/new-azscheduledqueryruledimensionobject
55
schema: 2.0.0
66
---
77

@@ -13,7 +13,7 @@ Create an in-memory object for Dimension.
1313
## SYNTAX
1414

1515
```
16-
New-AzScheduledQueryRuleDimensionObject -Name <String> -Operator <DimensionOperator> -Value <String[]>
16+
New-AzScheduledQueryRuleDimensionObject -Name <String> -Operator <String> -Value <String[]>
1717
[<CommonParameters>]
1818
```
1919

@@ -50,7 +50,7 @@ Accept wildcard characters: False
5050
Operator for dimension values.
5151
5252
```yaml
53-
Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator
53+
Type: System.String
5454
Parameter Sets: (All)
5555
Aliases:
5656

@@ -83,7 +83,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
8383
8484
## OUTPUTS
8585
86-
### Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Dimension
86+
### Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Dimension
8787
8888
## NOTES
8989

0 commit comments

Comments
 (0)