Skip to content

Commit fec683f

Browse files
authored
[PS] migrate MonitoringSolutions module to autorest v4 (Azure#27566)
1 parent f809835 commit fec683f

20 files changed

+187
-60
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0 (the ""License"");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software
7+
// distributed under the License is distributed on an ""AS IS"" BASIS,
8+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
// See the License for the specific language governing permissions and
10+
// limitations under the License.
11+
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
12+
// is regenerated.
13+
14+
using System;
15+
using System.Reflection;
16+
using System.Runtime.CompilerServices;
17+
using System.Runtime.InteropServices;
18+
19+
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
20+
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
21+
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
22+
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - MonitoringSolutions")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.2")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("0.1.2")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]

src/MonitoringSolutions/MonitoringSolutions.Autorest/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ subject-prefix: MonitorLogAnalytics
5555

5656
inlining-threshold: 40
5757

58-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
59-
use-extension:
60-
"@autorest/powershell": "3.x"
61-
6258
directive:
6359
# Fix error in swagger: PUT, PATCH, DELETE of solutions are not long running
6460
- from: swagger-document
@@ -67,7 +63,10 @@ directive:
6763
transform: return $.replace(/"x-ms-long-running-operation":\ true/g, "\"x-ms-long-running-operation\":\ false")
6864
# Remove the unexpanded parameter set
6965
- where:
70-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
66+
variant: ^(Create|Update)(?!.*?Expanded)
67+
remove: true
68+
- where:
69+
variant: ^CreateViaIdentityExpanded$
7170
remove: true
7271
# Remove the set-* cmdlet
7372
- where:

src/MonitoringSolutions/MonitoringSolutions.Autorest/custom/New-AzMonitorLogAnalyticsSolution.ps1

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# ----------------------------------------------------------------------------------
33
#
4-
# Copyright Microsoft Corporation
4+
# Copyright (c) Microsoft Corporation. All rights reserved.
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
77
# You may obtain a copy of the License at
@@ -11,22 +11,43 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
15+
# is regenerated.
1416
# ----------------------------------------------------------------------------------
1517

1618
<#
1719
.Synopsis
1820
Creates a log analytics solution.
1921
.Description
2022
Creates a log analytics solution.
23+
.Example
24+
$workspace = Get-AzOperationalInsightsWorkspace -ResourceGroupName azureps-manual-test -Name monitoringworkspace-2vob7n
25+
New-AzMonitorLogAnalyticsSolution -Type Containers -ResourceGroupName azureps-manual-test -Location $workspace.Location -WorkspaceResourceId $workspace.ResourceId
26+
27+
.Inputs
28+
Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity
2129
.Outputs
22-
Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution
30+
Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution
31+
.Notes
32+
COMPLEX PARAMETER PROPERTIES
33+
34+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
35+
36+
INPUTOBJECT <IMonitoringSolutionsIdentity>: Identity Parameter
37+
[Id <String>]: Resource identity path
38+
[ManagementAssociationName <String>]: User ManagementAssociation Name.
39+
[ManagementConfigurationName <String>]: User Management Configuration Name.
40+
[ProviderName <String>]: Provider name for the parent resource.
41+
[ResourceGroupName <String>]: The name of the resource group to get. The name is case insensitive.
42+
[ResourceName <String>]: Parent resource name.
43+
[ResourceType <String>]: Resource type for the parent resource
44+
[SolutionName <String>]: User Solution Name.
45+
[SubscriptionId <String>]: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
2346
.Link
2447
https://learn.microsoft.com/powershell/module/az.monitoringsolutions/new-azmonitorloganalyticssolution
25-
.LINK
26-
[Get-AzOperationalInsightsWorkspace](https://learn.microsoft.com/powershell/module/az.operationalinsights/get-azoperationalinsightsworkspace)
2748
#>
2849
function New-AzMonitorLogAnalyticsSolution {
29-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution])]
50+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution])]
3051
[CmdletBinding(DefaultParameterSetName = 'CreateExpanded', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
3152
param(
3253
[Parameter(Mandatory)]
@@ -58,12 +79,12 @@ function New-AzMonitorLogAnalyticsSolution {
5879

5980
[Parameter()]
6081
[Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category('Body')]
61-
[Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info(PossibleTypes = ([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags]))]
82+
[Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info(PossibleTypes = ([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags]))]
6283
[System.Collections.Hashtable]
6384
# Resource tags
6485
${Tag},
6586

66-
[Parameter(Mandatory)]
87+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
6788
[Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category('Body')]
6889
[System.String]
6990
# The Azure resource ID for the workspace where the solution will be deployed/enabled.
@@ -74,7 +95,8 @@ function New-AzMonitorLogAnalyticsSolution {
7495
[ValidateNotNull()]
7596
[Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category('Azure')]
7697
[System.Management.Automation.PSObject]
77-
# The credentials, account, tenant, and subscription used for communication with Azure.
98+
# The DefaultProfile parameter is not functional.
99+
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
78100
${DefaultProfile},
79101

80102
[Parameter(DontShow)]

src/MonitoringSolutions/MonitoringSolutions.Autorest/docs/Az.MonitoringSolutions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.MonitoringSolutions
3-
Module Guid: 4e0cdc62-833e-41bd-aa97-f8f042986de3
3+
Module Guid: a1bb7fa0-c386-4a56-a152-18e635e436e2
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.monitoringsolutions
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -21,5 +21,5 @@ Creates a log analytics solution.
2121
Deletes the solution in the subscription.
2222

2323
### [Update-AzMonitorLogAnalyticsSolution](Update-AzMonitorLogAnalyticsSolution.md)
24-
Update the tags of a solution.
24+
update the tags of a solution.
2525

src/MonitoringSolutions/MonitoringSolutions.Autorest/docs/Get-AzMonitorLogAnalyticsSolution.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ Accept wildcard characters: False
128128
129129
### -InputObject
130130
Identity Parameter
131-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
132131
133132
```yaml
134133
Type: Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity
@@ -198,7 +197,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
198197
199198
## OUTPUTS
200199
201-
### Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution
200+
### Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution
201+
202+
### Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList
202203
203204
## NOTES
204205

src/MonitoringSolutions/MonitoringSolutions.Autorest/docs/New-AzMonitorLogAnalyticsSolution.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ Commonly used types are:
6161
## PARAMETERS
6262

6363
### -DefaultProfile
64-
The credentials, account, tenant, and subscription used for communication with Azure.
64+
The DefaultProfile parameter is not functional.
65+
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
6566

6667
```yaml
6768
Type: System.Management.Automation.PSObject
@@ -205,15 +206,13 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
205206
206207
## INPUTS
207208
209+
### Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity
210+
208211
## OUTPUTS
209212
210-
### Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution
213+
### Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution
211214
212215
## NOTES
213216
214217
## RELATED LINKS
215218
216-
217-
218-
[Get-AzOperationalInsightsWorkspace](https://learn.microsoft.com/powershell/module/az.operationalinsights/get-azoperationalinsightsworkspace)
219-

src/MonitoringSolutions/MonitoringSolutions.Autorest/docs/Remove-AzMonitorLogAnalyticsSolution.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ Accept wildcard characters: False
7171
7272
### -InputObject
7373
Identity Parameter
74-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
7574
7675
```yaml
7776
Type: Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity

src/MonitoringSolutions/MonitoringSolutions.Autorest/docs/Update-AzMonitorLogAnalyticsSolution.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ schema: 2.0.0
88
# Update-AzMonitorLogAnalyticsSolution
99

1010
## SYNOPSIS
11-
Update the tags of a solution.
11+
update the tags of a solution.
1212

1313
## SYNTAX
1414

@@ -25,7 +25,7 @@ Update-AzMonitorLogAnalyticsSolution -InputObject <IMonitoringSolutionsIdentity>
2525
```
2626

2727
## DESCRIPTION
28-
Update the tags of a solution.
28+
update the tags of a solution.
2929

3030
## EXAMPLES
3131

@@ -76,7 +76,6 @@ Accept wildcard characters: False
7676
7777
### -InputObject
7878
Identity Parameter
79-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
8079
8180
```yaml
8281
Type: Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity
@@ -192,7 +191,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
192191
193192
## OUTPUTS
194193
195-
### Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution
194+
### Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution
196195
197196
## NOTES
198197

src/MonitoringSolutions/MonitoringSolutions.Autorest/examples/New-AzMonitorLogAnalyticsSolution.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@ Commonly used types are:
3232
| AzureAutomation | Automation Hybrid Worker |
3333
| LogicAppsManagement | Logic Apps Management |
3434
| SQLDataClassification | SQL Data Discovery & Classification |
35-
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"generate_Id": "dcbd66ba-7ce8-4e55-ab03-e426736a30af"
2+
"generate_Id": "0f52014a-cf5f-4a75-a510-d654b383d47c"
33
}

0 commit comments

Comments
 (0)