Skip to content

Commit ed08be2

Browse files
Move Monitor to wyunchi/main/metric
1 parent 97b8871 commit ed08be2

File tree

362 files changed

+7266
-1210
lines changed

Some content is hidden

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

362 files changed

+7266
-1210
lines changed

src/Monitor/ActionGroup.Autorest/Az.ActionGroup.psm1

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,37 +47,41 @@
4747

4848
# Ask for the shared functionality table
4949
$VTable = Register-AzModule
50-
50+
5151
# Tweaks the pipeline on module load
5252
$instance.OnModuleLoad = $VTable.OnModuleLoad
5353

5454
# Following two delegates are added for telemetry
5555
$instance.GetTelemetryId = $VTable.GetTelemetryId
5656
$instance.Telemetry = $VTable.Telemetry
57-
57+
58+
# Delegate to sanitize the output object
59+
$instance.SanitizeOutput = $VTable.SanitizerHandler
60+
61+
# Delegate to get the telemetry info
62+
$instance.GetTelemetryInfo = $VTable.GetTelemetryInfo
5863

5964
# Tweaks the pipeline per call
6065
$instance.OnNewRequest = $VTable.OnNewRequest
61-
66+
6267
# Gets shared parameter values
6368
$instance.GetParameterValue = $VTable.GetParameterValue
64-
69+
6570
# Allows shared module to listen to events from this module
6671
$instance.EventListener = $VTable.EventListener
67-
72+
6873
# Gets shared argument completers
6974
$instance.ArgumentCompleter = $VTable.ArgumentCompleter
70-
75+
7176
# The name of the currently selected Azure profile
7277
$instance.ProfileName = $VTable.ProfileName
7378

74-
7579
# Load the custom module
7680
$customModulePath = Join-Path $PSScriptRoot './custom/Az.ActionGroup.custom.psm1'
7781
if(Test-Path $customModulePath) {
7882
$null = Import-Module -Name $customModulePath
7983
}
80-
84+
8185
# Export nothing to clear implicit exports
8286
Export-ModuleMember
8387

@@ -97,12 +101,12 @@
97101
# Load the last folder if no profile is selected
98102
$profileDirectory = $directories | Select-Object -Last 1
99103
}
100-
104+
101105
if($profileDirectory) {
102106
Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
103107
$exportsPath = $profileDirectory.FullName
104108
}
105-
109+
106110
if($exportsPath) {
107111
Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
108112
$cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath

src/Monitor/ActionGroup.Autorest/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
This directory contains the PowerShell module for the ActionGroup service.
44

55
---
6-
76
## Info
87
- Modifiable: yes
98
- Generated: all
@@ -44,6 +43,8 @@ namespace: Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup
4443
subject-prefix: ActionGroup
4544
resourcegroup-append: true
4645
nested-object-to-string: true
46+
disable-transform-identity-type: true
47+
flatten-userassignedidentity: false
4748

4849
use-extension:
4950
"@autorest/powershell": "4.x"

src/Monitor/ActionGroup.Autorest/exports/Enable-AzActionGroupReceiver.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ param(
7878
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Category('Path')]
7979
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IActionGroupIdentity]
8080
# Identity Parameter
81-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
8281
${InputObject},
8382

8483
[Parameter(ParameterSetName='EnableExpanded', Mandatory)]
@@ -187,7 +186,13 @@ begin {
187186
EnableViaJsonString = 'Az.ActionGroup.private\Enable-AzActionGroupReceiver_EnableViaJsonString';
188187
}
189188
if (('EnableExpanded', 'EnableViaJsonFilePath', 'EnableViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
190-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
189+
$testPlayback = $false
190+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
191+
if ($testPlayback) {
192+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
193+
} else {
194+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
195+
}
191196
}
192197
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
193198
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Monitor/ActionGroup.Autorest/exports/Get-AzActionGroup.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ param(
7474
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Category('Path')]
7575
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IActionGroupIdentity]
7676
# Identity Parameter
77-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
7877
${InputObject},
7978

8079
[Parameter()]
@@ -158,7 +157,13 @@ begin {
158157
List1 = 'Az.ActionGroup.private\Get-AzActionGroup_List1';
159158
}
160159
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
161-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
160+
$testPlayback = $false
161+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
162+
if ($testPlayback) {
163+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
164+
} else {
165+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
166+
}
162167
}
163168
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
164169
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Monitor/ActionGroup.Autorest/exports/New-AzActionGroup.ps1

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ param(
149149
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Category('Path')]
150150
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IActionGroupIdentity]
151151
# Identity Parameter
152-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
153152
${InputObject},
154153

155154
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
@@ -166,7 +165,6 @@ param(
166165
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IArmRoleReceiver[]]
167166
# The list of ARM role receivers that are part of this action group.
168167
# Roles are Azure RBAC roles and only built-in roles are supported.
169-
# To construct, see NOTES section for ARMROLERECEIVER properties and create a hash table.
170168
${ArmRoleReceiver},
171169

172170
[Parameter(ParameterSetName='CreateExpanded')]
@@ -175,7 +173,6 @@ param(
175173
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Category('Body')]
176174
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IAutomationRunbookReceiver[]]
177175
# The list of AutomationRunbook receivers that are part of this action group.
178-
# To construct, see NOTES section for AUTOMATIONRUNBOOKRECEIVER properties and create a hash table.
179176
${AutomationRunbookReceiver},
180177

181178
[Parameter(ParameterSetName='CreateExpanded')]
@@ -184,7 +181,6 @@ param(
184181
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Category('Body')]
185182
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IAzureAppPushReceiver[]]
186183
# The list of AzureAppPush receivers that are part of this action group.
187-
# To construct, see NOTES section for AZUREAPPPUSHRECEIVER properties and create a hash table.
188184
${AzureAppPushReceiver},
189185

190186
[Parameter(ParameterSetName='CreateExpanded')]
@@ -193,7 +189,6 @@ param(
193189
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Category('Body')]
194190
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IAzureFunctionReceiver[]]
195191
# The list of azure function receivers that are part of this action group.
196-
# To construct, see NOTES section for AZUREFUNCTIONRECEIVER properties and create a hash table.
197192
${AzureFunctionReceiver},
198193

199194
[Parameter(ParameterSetName='CreateExpanded')]
@@ -202,7 +197,6 @@ param(
202197
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Category('Body')]
203198
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IEmailReceiver[]]
204199
# The list of email receivers that are part of this action group.
205-
# To construct, see NOTES section for EMAILRECEIVER properties and create a hash table.
206200
${EmailReceiver},
207201

208202
[Parameter(ParameterSetName='CreateExpanded')]
@@ -219,7 +213,6 @@ param(
219213
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Category('Body')]
220214
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IEventHubReceiver[]]
221215
# The list of event hub receivers that are part of this action group.
222-
# To construct, see NOTES section for EVENTHUBRECEIVER properties and create a hash table.
223216
${EventHubReceiver},
224217

225218
[Parameter(ParameterSetName='CreateExpanded')]
@@ -237,7 +230,6 @@ param(
237230
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Category('Body')]
238231
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IItsmReceiver[]]
239232
# The list of ITSM receivers that are part of this action group.
240-
# To construct, see NOTES section for ITSMRECEIVER properties and create a hash table.
241233
${ItsmReceiver},
242234

243235
[Parameter(ParameterSetName='CreateExpanded')]
@@ -246,7 +238,6 @@ param(
246238
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Category('Body')]
247239
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.ILogicAppReceiver[]]
248240
# The list of logic app receivers that are part of this action group.
249-
# To construct, see NOTES section for LOGICAPPRECEIVER properties and create a hash table.
250241
${LogicAppReceiver},
251242

252243
[Parameter(ParameterSetName='CreateExpanded')]
@@ -255,7 +246,6 @@ param(
255246
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Category('Body')]
256247
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.ISmsReceiver[]]
257248
# The list of SMS receivers that are part of this action group.
258-
# To construct, see NOTES section for SMSRECEIVER properties and create a hash table.
259249
${SmsReceiver},
260250

261251
[Parameter(ParameterSetName='CreateExpanded')]
@@ -272,7 +262,6 @@ param(
272262
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Category('Body')]
273263
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IVoiceReceiver[]]
274264
# The list of voice receivers that are part of this action group.
275-
# To construct, see NOTES section for VOICERECEIVER properties and create a hash table.
276265
${VoiceReceiver},
277266

278267
[Parameter(ParameterSetName='CreateExpanded')]
@@ -281,7 +270,6 @@ param(
281270
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Category('Body')]
282271
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IWebhookReceiver[]]
283272
# The list of webhook receivers that are part of this action group.
284-
# To construct, see NOTES section for WEBHOOKRECEIVER properties and create a hash table.
285273
${WebhookReceiver},
286274

287275
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
@@ -377,7 +365,13 @@ begin {
377365
CreateViaJsonString = 'Az.ActionGroup.private\New-AzActionGroup_CreateViaJsonString';
378366
}
379367
if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
380-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
368+
$testPlayback = $false
369+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
370+
if ($testPlayback) {
371+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
372+
} else {
373+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
374+
}
381375
}
382376
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
383377
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

0 commit comments

Comments
 (0)