Skip to content

Commit 9a417cc

Browse files
JoyerJinVeryEarly
authored andcommitted
[PS] migrate DiagnosticSetting in Monitor module to autorest v4 (Azure#28162)
Co-authored-by: Yabo Hu <[email protected]>
1 parent 269cd51 commit 9a417cc

File tree

47 files changed

+1979
-270
lines changed

Some content is hidden

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

47 files changed

+1979
-270
lines changed

src/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@
2323
[assembly: System.Reflection.AssemblyFileVersionAttribute("6.0.2")]
2424
[assembly: System.Reflection.AssemblyVersionAttribute("6.0.2")]
2525
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26-
[assembly: System.CLSCompliantAttribute(false)]
27-
26+
[assembly: System.CLSCompliantAttribute(false)]

src/Monitor/DiagnosticSetting.Autorest/README.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,6 @@ title: DiagnosticSetting
4242
module-version: 0.1.0
4343
subject-prefix: DiagnosticSetting
4444
namespace: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting
45-
nested-object-to-string: true
46-
47-
# If there are post APIs for some kinds of actions in the RP, you may need to
48-
# uncomment following line to support viaIdentity for these post APIs
49-
# identity-correction-for-post: true
50-
51-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
52-
use-extension:
53-
"@autorest/powershell": "3.x"
5445

5546
directive:
5647
- where:
@@ -107,7 +98,7 @@ directive:
10798
# 1. Remove the unexpanded parameter set
10899
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
109100
- where:
110-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
101+
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))|^CreateViaIdentityExpanded$
111102
remove: true
112103
# Remove Set cmdlet
113104
- where:
@@ -129,7 +120,7 @@ directive:
129120
subject-prefix: ""
130121

131122
- model-cmdlet:
132-
- MetricSettings
133-
- LogSettings
134-
- SubscriptionLogSettings
123+
- model-name: MetricSettings
124+
- model-name: LogSettings
125+
- model-name: SubscriptionLogSettings
135126
```

src/Monitor/DiagnosticSetting.Autorest/custom/autogen-model-cmdlets/New-AzDiagnosticSettingLogSettingsObject.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ Create an in-memory object for LogSettings.
2121
Create an in-memory object for LogSettings.
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettings
24+
Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettings
2525
.Link
26-
https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingLogSettingsObject
26+
https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettinglogsettingsobject
2727
#>
2828
function New-AzDiagnosticSettingLogSettingsObject {
29-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettings')]
29+
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ModelCmdletAttribute()]
30+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettings')]
3031
[CmdletBinding(PositionalBinding=$false)]
3132
Param(
3233

@@ -48,7 +49,7 @@ function New-AzDiagnosticSettingLogSettingsObject {
4849
)
4950

5051
process {
51-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettings]::New()
52+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettings]::New()
5253

5354
if ($PSBoundParameters.ContainsKey('Category')) {
5455
$Object.Category = $Category

src/Monitor/DiagnosticSetting.Autorest/custom/autogen-model-cmdlets/New-AzDiagnosticSettingMetricSettingsObject.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ Create an in-memory object for MetricSettings.
2121
Create an in-memory object for MetricSettings.
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings
24+
Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettings
2525
.Link
26-
https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingMetricSettingsObject
26+
https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettingmetricsettingsobject
2727
#>
2828
function New-AzDiagnosticSettingMetricSettingsObject {
29-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings')]
29+
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ModelCmdletAttribute()]
30+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettings')]
3031
[CmdletBinding(PositionalBinding=$false)]
3132
Param(
3233

@@ -48,7 +49,7 @@ function New-AzDiagnosticSettingMetricSettingsObject {
4849
)
4950

5051
process {
51-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings]::New()
52+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettings]::New()
5253

5354
if ($PSBoundParameters.ContainsKey('Category')) {
5455
$Object.Category = $Category

src/Monitor/DiagnosticSetting.Autorest/custom/autogen-model-cmdlets/New-AzDiagnosticSettingSubscriptionLogSettingsObject.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ Create an in-memory object for SubscriptionLogSettings.
2121
Create an in-memory object for SubscriptionLogSettings.
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettings
24+
Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettings
2525
.Link
26-
https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingSubscriptionLogSettingsObject
26+
https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettingsubscriptionlogsettingsobject
2727
#>
2828
function New-AzDiagnosticSettingSubscriptionLogSettingsObject {
29-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettings')]
29+
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ModelCmdletAttribute()]
30+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettings')]
3031
[CmdletBinding(PositionalBinding=$false)]
3132
Param(
3233

@@ -42,7 +43,7 @@ function New-AzDiagnosticSettingSubscriptionLogSettingsObject {
4243
)
4344

4445
process {
45-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettings]::New()
46+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettings]::New()
4647

4748
if ($PSBoundParameters.ContainsKey('Category')) {
4849
$Object.Category = $Category

src/Monitor/DiagnosticSetting.Autorest/docs/Az.DiagnosticSetting.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The current list includes the following: Administrative, Security, ServiceHealth
2525
Gets the active subscription diagnostic settings for the specified resource.
2626

2727
### [New-AzDiagnosticSetting](New-AzDiagnosticSetting.md)
28-
Creates or updates diagnostic settings for the specified resource.
28+
Create diagnostic settings for the specified resource.
2929

3030
### [New-AzDiagnosticSettingLogSettingsObject](New-AzDiagnosticSettingLogSettingsObject.md)
3131
Create an in-memory object for LogSettings.
@@ -37,11 +37,17 @@ Create an in-memory object for MetricSettings.
3737
Create an in-memory object for SubscriptionLogSettings.
3838

3939
### [New-AzSubscriptionDiagnosticSetting](New-AzSubscriptionDiagnosticSetting.md)
40-
Creates or updates subscription diagnostic settings for the specified resource.
40+
Create subscription diagnostic settings for the specified resource.
4141

4242
### [Remove-AzDiagnosticSetting](Remove-AzDiagnosticSetting.md)
4343
Deletes existing diagnostic settings for the specified resource.
4444

4545
### [Remove-AzSubscriptionDiagnosticSetting](Remove-AzSubscriptionDiagnosticSetting.md)
4646
Deletes existing subscription diagnostic settings for the specified resource.
4747

48+
### [Update-AzDiagnosticSetting](Update-AzDiagnosticSetting.md)
49+
Update diagnostic settings for the specified resource.
50+
51+
### [Update-AzSubscriptionDiagnosticSetting](Update-AzSubscriptionDiagnosticSetting.md)
52+
Update subscription diagnostic settings for the specified resource.
53+

src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzDiagnosticSetting.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ Accept wildcard characters: False
6969
7070
### -InputObject
7171
Identity Parameter
72-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
7372
7473
```yaml
7574
Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity
@@ -122,7 +121,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
122121
123122
## OUTPUTS
124123
125-
### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource
124+
### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource
126125
127126
## NOTES
128127

src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzDiagnosticSettingCategory.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ Accept wildcard characters: False
6262
6363
### -InputObject
6464
Identity Parameter
65-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
6665
6766
```yaml
6867
Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity
@@ -115,7 +114,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
115114
116115
## OUTPUTS
117116
118-
### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource
117+
### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource
119118
120119
## NOTES
121120

src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzEventCategory.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
6868
6969
## OUTPUTS
7070
71-
### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString
71+
### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString
7272
7373
## NOTES
7474

src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzSubscriptionDiagnosticSetting.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ Accept wildcard characters: False
6969
7070
### -InputObject
7171
Identity Parameter
72-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
7372
7473
```yaml
7574
Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity
@@ -122,7 +121,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
122121
123122
## OUTPUTS
124123
125-
### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource
124+
### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource
126125
127126
## NOTES
128127

0 commit comments

Comments
 (0)