Skip to content

Commit cf72c7d

Browse files
Migrate AlertsManagement from generation to main (#21634)
* Move AlertsManagement to main * revise code * Update ChangeLog.md --------- Co-authored-by: Nanxiang Liu <[email protected]> Co-authored-by: NanxiangLiu <[email protected]>
1 parent a41ab6e commit cf72c7d

File tree

305 files changed

+45214
-261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+45214
-261
lines changed

src/AlertsManagement/AlertsManagement.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Microsoft Visual Studio Solution File, Format Version 12.00
1+
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio Version 17
33
VisualStudioVersion = 17.3.32901.215
44
MinimumVisualStudioVersion = 10.0.40219.1
@@ -22,6 +22,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestFx", "..\..\tools\TestF
2222
EndProject
2323
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AlertsManagement.Sdk", "AlertsManagement.Sdk\AlertsManagement.Sdk.csproj", "{03DE8A68-76C9-4FD8-A611-117617FF280B}"
2424
EndProject
25+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.PrometheusRuleGroups", "PrometheusRuleGroups.Autorest\Az.PrometheusRuleGroups.csproj", "{DEDB2891-A311-4637-8627-F0D2FD344C5A}"
26+
EndProject
2527
Global
2628
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2729
Debug|Any CPU = Debug|Any CPU
@@ -64,6 +66,10 @@ Global
6466
{03DE8A68-76C9-4FD8-A611-117617FF280B}.Debug|Any CPU.Build.0 = Debug|Any CPU
6567
{03DE8A68-76C9-4FD8-A611-117617FF280B}.Release|Any CPU.ActiveCfg = Release|Any CPU
6668
{03DE8A68-76C9-4FD8-A611-117617FF280B}.Release|Any CPU.Build.0 = Release|Any CPU
69+
{DEDB2891-A311-4637-8627-F0D2FD344C5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
70+
{DEDB2891-A311-4637-8627-F0D2FD344C5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
71+
{DEDB2891-A311-4637-8627-F0D2FD344C5A}.Release|Any CPU.ActiveCfg = Release|Any CPU
72+
{DEDB2891-A311-4637-8627-F0D2FD344C5A}.Release|Any CPU.Build.0 = Release|Any CPU
6773
EndGlobalSection
6874
GlobalSection(SolutionProperties) = preSolution
6975
HideSolutionNode = FALSE

src/AlertsManagement/AlertsManagement/Az.AlertsManagement.psd1

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 10/28/2022
6+
# Generated on: 4/24/2023
77
#
88

99
@{
@@ -56,7 +56,8 @@ DotNetFrameworkVersion = '4.7.2'
5656
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.10.3'; })
5757

5858
# Assemblies that must be loaded prior to importing this module
59-
RequiredAssemblies = 'Microsoft.Azure.PowerShell.AlertsManagement.Management.Sdk.dll'
59+
RequiredAssemblies = 'Microsoft.Azure.PowerShell.AlertsManagement.Management.Sdk.dll',
60+
'PrometheusRuleGroups.Autorest\bin\Az.PrometheusRuleGroups.private.dll'
6061

6162
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
6263
# ScriptsToProcess = @()
@@ -66,13 +67,18 @@ RequiredAssemblies = 'Microsoft.Azure.PowerShell.AlertsManagement.Management.Sdk
6667

6768
# Format files (.ps1xml) to be loaded when importing this module
6869
FormatsToProcess =
69-
'Microsoft.Azure.PowerShell.Cmdlets.AlertsManagement.generated.format.ps1xml'
70+
'Microsoft.Azure.PowerShell.Cmdlets.AlertsManagement.generated.format.ps1xml',
71+
'PrometheusRuleGroups.Autorest\Az.PrometheusRuleGroups.format.ps1xml'
7072

7173
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
72-
NestedModules = @('Microsoft.Azure.PowerShell.Cmdlets.AlertsManagement.dll')
74+
NestedModules = @('Microsoft.Azure.PowerShell.Cmdlets.AlertsManagement.dll',
75+
'PrometheusRuleGroups.Autorest\Az.PrometheusRuleGroups.psm1')
7376

7477
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
75-
FunctionsToExport = @()
78+
FunctionsToExport = 'Get-AzPrometheusRuleGroup', 'New-AzPrometheusRuleGroup',
79+
'New-AzPrometheusRuleGroupActionObject',
80+
'New-AzPrometheusRuleObject', 'Remove-AzPrometheusRuleGroup',
81+
'Update-AzPrometheusRuleGroup'
7682

7783
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
7884
CmdletsToExport = 'Get-AzAlert', 'Get-AzAlertObjectHistory', 'Update-AzAlertState',
@@ -82,7 +88,7 @@ CmdletsToExport = 'Get-AzAlert', 'Get-AzAlertObjectHistory', 'Update-AzAlertStat
8288
'Update-AzAlertProcessingRule', 'Remove-AzAlertProcessingRule'
8389

8490
# Variables to export from this module
85-
# VariablesToExport = @()
91+
VariablesToExport = '*'
8692

8793
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
8894
AliasesToExport = @()
@@ -102,7 +108,7 @@ PrivateData = @{
102108
PSData = @{
103109

104110
# Tags applied to this module. These help with module discovery in online galleries.
105-
Tags = 'Azure','Alerts','AlertsManagement','Notifications'
111+
Tags = 'Azure', 'Alerts', 'AlertsManagement', 'Notifications'
106112

107113
# A URL to the license for this module.
108114
LicenseUri = 'https://aka.ms/azps-license'
@@ -127,7 +133,7 @@ PrivateData = @{
127133

128134
} # End of PSData hashtable
129135

130-
} # End of PrivateData hashtable
136+
} # End of PrivateData hashtable
131137

132138
# HelpInfo URI of this module
133139
# HelpInfoURI = ''

src/AlertsManagement/AlertsManagement/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Added cmdlets for Prometheus rule group
2122

2223
## Version 0.5.0
2324
* Added parameter `comment` for `Update-AzAlerteState`

src/AlertsManagement/AlertsManagement/help/Az.AlertsManagement.md

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@ Locale: en-US
1111
Manages alerts, smart groups and action rule configuration for Alerts Management Platform.
1212

1313
## Az.AlertsManagement Cmdlets
14-
### [Get-AzActionRule](Get-AzActionRule.md)
15-
Get Action Rules Information
16-
1714
### [Get-AzAlert](Get-AzAlert.md)
1815
Get Alerts Information
1916

2017
### [Get-AzAlertObjectHistory](Get-AzAlertObjectHistory.md)
2118
Gets Alert History information
2219

20+
### [Get-AzAlertProcessingRule](Get-AzAlertProcessingRule.md)
21+
Get AlertProcessing Rules Information
22+
23+
### [Get-AzPrometheusRuleGroup](Get-AzPrometheusRuleGroup.md)
24+
Retrieve a Prometheus rule group definition.
25+
2326
### [Get-AzSmartGroup](Get-AzSmartGroup.md)
2427
Gets Smart Groups information
2528

@@ -29,18 +32,33 @@ Gets smart group history
2932
### [Measure-AzAlertStatistic](Measure-AzAlertStatistic.md)
3033
Gets Alert Summary Information
3134

32-
### [Remove-AzActionRule](Remove-AzActionRule.md)
33-
Deletes a action group
35+
### [New-AzPrometheusRuleGroup](New-AzPrometheusRuleGroup.md)
36+
Create or update a Prometheus rule group definition.
37+
38+
### [New-AzPrometheusRuleGroupActionObject](New-AzPrometheusRuleGroupActionObject.md)
39+
Create an in-memory object for PrometheusRuleGroupAction.
3440

35-
### [Set-AzActionRule](Set-AzActionRule.md)
36-
Create or update an action rule.
41+
### [New-AzPrometheusRuleObject](New-AzPrometheusRuleObject.md)
42+
Create an in-memory object for PrometheusRule.
3743

38-
### [Update-AzActionRule](Update-AzActionRule.md)
39-
Updates action rule properties.
44+
### [Remove-AzAlertProcessingRule](Remove-AzAlertProcessingRule.md)
45+
Deletes an alert processing rule
46+
47+
### [Remove-AzPrometheusRuleGroup](Remove-AzPrometheusRuleGroup.md)
48+
Delete a Prometheus rule group definition.
49+
50+
### [Set-AzAlertProcessingRule](Set-AzAlertProcessingRule.md)
51+
Create or update an alert processing rule.
52+
53+
### [Update-AzAlertProcessingRule](Update-AzAlertProcessingRule.md)
54+
Updates alert processing rule properties.
4055

4156
### [Update-AzAlertState](Update-AzAlertState.md)
4257
Updates alert state
4358

59+
### [Update-AzPrometheusRuleGroup](Update-AzPrometheusRuleGroup.md)
60+
Update an Prometheus rule group definition.
61+
4462
### [Update-AzSmartGroupState](Update-AzSmartGroupState.md)
4563
Updates smart group state
4664

src/AlertsManagement/AlertsManagement/help/Get-AzAlert.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ Get Alert details by Id (GUID) or Resource Id (Complete ARM Id)
6060
Get Alerts Information. (autogenerated)
6161

6262
<!-- Aladdin Generated Example -->
63+
64+
6365
```powershell
6466
Get-AzAlert -IncludeContext $true -TimeRange '1h'
6567
```

src/AlertsManagement/AlertsManagement/help/Get-AzAlertProcessingRule.md

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,24 @@ Get AlertProcessing Rules Information
1414

1515
### ListAlertProcessingRules (Default)
1616
```
17-
Get-AzAlertProcessingRule [-Name <String>] [-ResourceGroupName <String>]
18-
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
17+
Get-AzAlertProcessingRule [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
1918
```
2019

21-
### ResourceId
20+
### AlertProcessingRuleByName
2221
```
23-
Get-AzActionRule -ResourceId <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
22+
Get-AzAlertProcessingRule -Name <String> -ResourceGroupName <String> [-DefaultProfile <IAzureContextContainer>]
23+
[<CommonParameters>]
2424
```
2525

2626
### ListAlertProcessingRulesByResourceGroupName
2727
```
28-
Get-AzAlertProcessingRule -ResourceGroupName <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
28+
Get-AzAlertProcessingRule -ResourceGroupName <String> [-DefaultProfile <IAzureContextContainer>]
29+
[<CommonParameters>]
2930
```
3031

31-
### AlertProcessingRuleByName
32+
### ResourceId
3233
```
33-
Get-AzAlertProcessingRule -Name <String> -ResourceGroupName <String> [-DefaultProfile <IAzureContextContainer>]
34-
[<CommonParameters>]
34+
Get-AzAlertProcessingRule -ResourceId <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
3535
```
3636

3737
## DESCRIPTION
@@ -77,22 +77,9 @@ Accept pipeline input: False
7777
Accept wildcard characters: False
7878
```
7979
80-
8180
### -Name
8281
Name of alert processing rule.
8382
84-
```yaml
85-
Type: System.String
86-
Parameter Sets: ListAlertProcessingRules
87-
Aliases:
88-
89-
Required: False
90-
Position: Named
91-
Default value: None
92-
Accept pipeline input: False
93-
Accept wildcard characters: False
94-
```
95-
9683
```yaml
9784
Type: System.String
9885
Parameter Sets: AlertProcessingRuleByName
@@ -110,19 +97,22 @@ Resource Group Name in which alert processing rule resides.
11097
11198
```yaml
11299
Type: System.String
113-
Parameter Sets: ListAlertProcessingRules, ListAlertProcessingRulesByResourceGroupName
100+
Parameter Sets: AlertProcessingRuleByName, ListAlertProcessingRulesByResourceGroupName
114101
Aliases:
115102

116-
Required: False
103+
Required: True
117104
Position: Named
118105
Default value: None
119106
Accept pipeline input: False
120107
Accept wildcard characters: False
121108
```
122109
110+
### -ResourceId
111+
Get Alert Processing rule by resource id.
112+
123113
```yaml
124114
Type: System.String
125-
Parameter Sets: AlertProcessingRuleByName
115+
Parameter Sets: ResourceId
126116
Aliases:
127117

128118
Required: True
@@ -132,7 +122,6 @@ Accept pipeline input: False
132122
Accept wildcard characters: False
133123
```
134124
135-
136125
### CommonParameters
137126
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
138127

0 commit comments

Comments
 (0)