Skip to content

Commit c149b23

Browse files
authored
[Az.Dashboard] Update generation tool version: autorest.powershell v3->v4 (Azure#27574)
1 parent 2860c78 commit c149b23

26 files changed

+1449
-1382
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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 - Dashboard")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.3")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("0.1.3")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]
27+

src/Dashboard/Dashboard.Autorest/README.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@ title: Dashboard
3737
module-version: 0.1.0
3838
subject-prefix: Grafana
3939

40-
identity-correction-for-post: true
41-
resourcegroup-append: true
42-
nested-object-to-string: true
43-
44-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
45-
use-extension:
46-
"@autorest/powershell": "3.x"
47-
4840
directive:
4941
- from: swagger-document
5042
where: $.definitions.ResourceSku.properties
@@ -67,7 +59,10 @@ directive:
6759
}
6860
}
6961
- where:
70-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
62+
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
63+
remove: true
64+
- where:
65+
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$
7166
remove: true
7267
- where:
7368
parameter-name: WorkspaceName
@@ -88,7 +83,7 @@ directive:
8883
parameter-name: GrafanaIntegrationAzureMonitorWorkspaceIntegration
8984
set:
9085
parameter-name: MonitorWorkspaceIntegration
91-
# The cmdlet's name to long, Re-name it
92-
# - model-cmdlet:
93-
# - AzureMonitorWorkspaceIntegration
86+
- model-cmdlet:
87+
- model-name: AzureMonitorWorkspaceIntegration
88+
cmdlet-name: New-AzGrafanaMonitorWorkspaceIntegrationObject
9489
```

src/Dashboard/Dashboard.Autorest/custom/New-AzGrafana.ps1

Lines changed: 47 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This API is idempotent, so user can either create a new grafana or update an exi
2525
New-AzGrafana -Name azpstest-grafana -ResourceGroupName azpstest-gp -ApiKey Enabled -AutoGeneratedDomainNameLabelScope 'TenantReuse' -DeterministicOutboundIP 'Enabled' -IdentityType 'SystemAssigned' -Location eastus -PublicNetworkAccess 'Enabled' -SkuName Standard -ZoneRedundancy 'Enabled' -Tag @{"Environment"="Dev"}
2626
2727
.Outputs
28-
Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api20220801.IManagedGrafana
28+
Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.IManagedGrafana
2929
.Notes
3030
COMPLEX PARAMETER PROPERTIES
3131
@@ -37,7 +37,7 @@ GRAFANAINTEGRATIONAZUREMONITORWORKSPACEINTEGRATION <IAzureMonitorWorkspaceIntegr
3737
https://learn.microsoft.com/powershell/module/az.dashboard/new-azgrafana
3838
#>
3939
function New-AzGrafana {
40-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api20220801.IManagedGrafana])]
40+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.IManagedGrafana])]
4141
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
4242
param(
4343
[Parameter(Mandatory)]
@@ -61,90 +61,100 @@ param(
6161
# The ID of the target subscription.
6262
${SubscriptionId},
6363

64-
[Parameter(Mandatory)]
65-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.ApiKey])]
64+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
65+
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.PSArgumentCompleterAttribute("Disabled", "Enabled")]
6666
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
67-
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.ApiKey]
67+
[System.String]
6868
# The api key setting of the Grafana instance.
6969
${ApiKey},
7070

71-
[Parameter(Mandatory)]
72-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.AutoGeneratedDomainNameLabelScope])]
71+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
72+
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.PSArgumentCompleterAttribute("TenantReuse")]
7373
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
74-
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.AutoGeneratedDomainNameLabelScope]
74+
[System.String]
7575
# Scope for dns deterministic name hash calculation.
7676
${AutoGeneratedDomainNameLabelScope},
7777

78-
[Parameter(Mandatory)]
79-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.DeterministicOutboundIP])]
78+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
79+
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.PSArgumentCompleterAttribute("Disabled", "Enabled")]
8080
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
81-
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.DeterministicOutboundIP]
81+
[System.String]
8282
# Whether a Grafana instance uses deterministic outbound IPs.
8383
${DeterministicOutboundIP},
8484

85-
[Parameter(Mandatory)]
86-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.ManagedServiceIdentityType])]
85+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
8786
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
88-
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.ManagedServiceIdentityType]
89-
# Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
90-
${IdentityType},
87+
[System.Management.Automation.SwitchParameter]
88+
# Determines whether to enable a system-assigned identity for the resource.
89+
${EnableSystemAssignedIdentity},
9190

92-
[Parameter()]
91+
[Parameter(ParameterSetName='CreateExpanded')]
92+
[AllowEmptyCollection()]
9393
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
94-
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api30.IUserAssignedIdentities]))]
95-
[System.Collections.Hashtable]
96-
# The set of user assigned identities associated with the resource.
97-
# The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
98-
# The dictionary values can be empty objects ({}) in requests.
99-
${IdentityUserAssignedIdentity},
94+
[System.String[]]
95+
# The array of user assigned identities associated with the resource.
96+
# The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'
97+
${UserAssignedIdentity},
10098

101-
[Parameter(Mandatory)]
99+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
102100
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
103101
[System.String]
104102
# The geo-location where the grafana resource lives
105103
${Location},
106104

107-
[Parameter()]
105+
[Parameter(ParameterSetName='CreateExpanded')]
108106
[AllowEmptyCollection()]
109107
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
110-
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api20220801.IAzureMonitorWorkspaceIntegration[]]
108+
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.IAzureMonitorWorkspaceIntegration[]]
111109
# The MonitorWorkspaceIntegration of Azure Managed Grafana.
112-
# To construct, see NOTES section for MONITORWORKSPACEINTEGRATION properties and create a hash table.
113110
${MonitorWorkspaceIntegration},
114111

115-
[Parameter(Mandatory)]
116-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.PublicNetworkAccess])]
112+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
113+
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.PSArgumentCompleterAttribute("Enabled", "Disabled")]
117114
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
118-
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.PublicNetworkAccess]
115+
[System.String]
119116
# Indicate the state for enable or disable traffic over the public interface.
120117
${PublicNetworkAccess},
121118

122-
[Parameter(Mandatory)]
119+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
123120
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
124121
[System.String]
125122
# The Sku of the grafana resource.
126123
${SkuName},
127124

128-
[Parameter()]
125+
[Parameter(ParameterSetName='CreateExpanded')]
129126
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
130-
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api20220801.IManagedGrafanaTags]))]
127+
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.IManagedGrafanaTags]))]
131128
[System.Collections.Hashtable]
132129
# The tags for grafana resource.
133130
${Tag},
134131

135-
[Parameter(Mandatory)]
136-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.ZoneRedundancy])]
132+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
133+
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.PSArgumentCompleterAttribute("Disabled", "Enabled")]
137134
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
138-
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Support.ZoneRedundancy]
135+
[System.String]
139136
# The zone redundancy setting of the Grafana instance.
140137
${ZoneRedundancy},
141138

139+
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
140+
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
141+
[System.String]
142+
# Path of Json file supplied to the Create operation
143+
${JsonFilePath},
144+
145+
[Parameter(ParameterSetName='CreateViaJsonString', Mandatory)]
146+
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Body')]
147+
[System.String]
148+
# Json string supplied to the Create operation
149+
${JsonString},
150+
142151
[Parameter()]
143152
[Alias('AzureRMContext', 'AzureCredential')]
144153
[ValidateNotNull()]
145154
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Category('Azure')]
146155
[System.Management.Automation.PSObject]
147-
# The credentials, account, tenant, and subscription used for communication with Azure.
156+
# The DefaultProfile parameter is not functional.
157+
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
148158
${DefaultProfile},
149159

150160
[Parameter()]

src/Dashboard/Dashboard.Autorest/custom/New-AzGrafanaMonitorWorkspaceIntegrationObject.ps1 renamed to src/Dashboard/Dashboard.Autorest/custom/autogen-model-cmdlets/New-AzGrafanaMonitorWorkspaceIntegrationObject.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 AzureMonitorWorkspaceIntegration.
2121
Create an in-memory object for AzureMonitorWorkspaceIntegration.
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api20220801.AzureMonitorWorkspaceIntegration
24+
Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.AzureMonitorWorkspaceIntegration
2525
.Link
26-
https://learn.microsoft.com/powershell/module/az.dashboard/new-azgrafanamonitorworkspaceintegrationobject
26+
https://learn.microsoft.com/powershell/module/Az.Dashboard/new-azgrafanamonitorworkspaceintegrationobject
2727
#>
2828
function New-AzGrafanaMonitorWorkspaceIntegrationObject {
29-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api20220801.AzureMonitorWorkspaceIntegration')]
29+
[Microsoft.Azure.PowerShell.Cmdlets.Dashboard.ModelCmdletAttribute()]
30+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.AzureMonitorWorkspaceIntegration')]
3031
[CmdletBinding(PositionalBinding=$false)]
3132
Param(
3233

@@ -36,7 +37,7 @@ function New-AzGrafanaMonitorWorkspaceIntegrationObject {
3637
)
3738

3839
process {
39-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api20220801.AzureMonitorWorkspaceIntegration]::New()
40+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.AzureMonitorWorkspaceIntegration]::New()
4041

4142
if ($PSBoundParameters.ContainsKey('AzureMonitorWorkspaceResourceId')) {
4243
$Object.AzureMonitorWorkspaceResourceId = $AzureMonitorWorkspaceResourceId

src/Dashboard/Dashboard.Autorest/docs/Az.Dashboard.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.Dashboard
3-
Module Guid: 8475f339-2250-485a-a9cc-aba350de72d2
3+
Module Guid: d7271e13-06f6-4847-8499-12633a408ce4
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.dashboard
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -25,5 +25,6 @@ Create an in-memory object for AzureMonitorWorkspaceIntegration.
2525
Delete a workspace for Grafana resource.
2626

2727
### [Update-AzGrafana](Update-AzGrafana.md)
28-
Update a workspace for Grafana resource.
28+
update a workspace for Grafana resource.
29+
This API is idempotent, so user can either update a new grafana or update an existing grafana.
2930

src/Dashboard/Dashboard.Autorest/docs/Get-AzGrafana.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ Accept wildcard characters: False
9898
9999
### -InputObject
100100
Identity Parameter
101-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
102101
103102
```yaml
104103
Type: Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.IDashboardIdentity
@@ -167,7 +166,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
167166
168167
## OUTPUTS
169168
170-
### Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.Api20220801.IManagedGrafana
169+
### Microsoft.Azure.PowerShell.Cmdlets.Dashboard.Models.IManagedGrafana
171170
172171
## NOTES
173172

0 commit comments

Comments
 (0)