Skip to content

Commit 4514105

Browse files
committed
migrate StackHCI module to autorest v4
1 parent ada0b93 commit 4514105

File tree

87 files changed

+3446
-683
lines changed

Some content is hidden

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

87 files changed

+3446
-683
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 - StackHci")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.6.1")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("2.6.1")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]
27+

src/StackHCI/StackHCI.Autorest/README.md

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ subject-prefix: $(service-name)
6666

6767
inlining-threshold: 50
6868

69-
resourcegroup-append: true
70-
71-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
72-
use-extension:
73-
"@autorest/powershell": "3.x"
74-
7569
directive:
7670
# Rename function
7771
- where:
@@ -80,8 +74,14 @@ directive:
8074
set:
8175
subject: ConsentAndInstallDefaultExtension
8276
# Remove the unexpanded parameter set
77+
# Generate Create variant for "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity"
78+
- where:
79+
subject: ArcSetting$|Cluster|DeploymentSetting|EdgeDevice|Extension|SecuritySetting|Update$|UpdateRun|UpdateSummary
80+
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))|^CreateViaIdentityExpanded$
81+
remove: true
8382
- where:
84-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
83+
subject: ExtendClusterSoftwareAssuranceBenefit
84+
variant: ^(Extend)(?!.*?(Expanded|JsonFilePath|JsonString))
8585
remove: true
8686
- where:
8787
verb: Set
@@ -115,8 +115,8 @@ directive:
115115
# Remove Update-AzStackHciArcSetting
116116
- where:
117117
verb: Update
118-
subject: ArcSetting
119-
remove: true
118+
subject: ArcSetting|DeploymentSetting|EdgeDevice|SecuritySetting|Update$|UpdateRun|UpdateSummary
119+
remove: true
120120
# Hide aadClientId from Update-AzStackHCICluster
121121
- where:
122122
verb: Update
@@ -208,4 +208,22 @@ directive:
208208
- ResourceGroupName
209209
labels:
210210
ResourceGroupName: Resource Group
211+
- from: source-file-csharp
212+
where: $
213+
transform: $ = $.replace(/"Get the get run for a specified update"/g, '"Get the Update run for a specified update"');
214+
- from: source-file-csharp
215+
where: $
216+
transform: $ = $.replace(/"Get all get summaries under the HCI cluster"/g, '"Get all Update summaries under the HCI cluster"');
217+
- from: source-file-csharp
218+
where: $
219+
transform: $ = $.replace(/"Delete specified delete Run"/g, '"Delete specified Update Run"');
220+
- from: source-file-csharp
221+
where: $
222+
transform: $ = $.replace(/"Delete delete Summaries"/g, '"Delete Update Summaries"');
223+
- from: source-file-csharp
224+
where: $
225+
transform: $ = $.replace(/"Put put runs for a specified update"/g, '"Put Update runs for a specified update"');
226+
- from: source-file-csharp
227+
where: $
228+
transform: $ = $.replace(/"Put put summaries under the HCI cluster"/g, '"Put Update summaries under the HCI cluster"');
211229
```

src/StackHCI/StackHCI.Autorest/UX/Microsoft.AzureStackHCI/clusters.json

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -81,44 +81,6 @@
8181
}
8282
]
8383
},
84-
{
85-
"name": "Invoke-AzStackHciExtendClusterSoftwareAssuranceBenefit",
86-
"description": "Extends Software Assurance Benefit to a cluster",
87-
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/extendSoftwareAssuranceBenefit",
88-
"help": {
89-
"learnMore": {
90-
"url": "https://learn.microsoft.com/powershell/module/az.stackhci/invoke-azstackhciextendclustersoftwareassurancebenefit"
91-
},
92-
"parameterSets": [
93-
{
94-
"parameters": [
95-
"-ClusterName <String>",
96-
"-ResourceGroupName <String>",
97-
"[-SubscriptionId <String>]"
98-
]
99-
}
100-
]
101-
},
102-
"examples": [
103-
{
104-
"description": "Extends Software Assurance Benefit to a cluster",
105-
"parameters": [
106-
{
107-
"name": "-ClusterName",
108-
"value": "[Path.clusterName]"
109-
},
110-
{
111-
"name": "-ResourceGroupName",
112-
"value": "[Path.resourceGroupName]"
113-
},
114-
{
115-
"name": "-SubscriptionId",
116-
"value": "[Path.subscriptionId]"
117-
}
118-
]
119-
}
120-
]
121-
},
12284
{
12385
"name": "Remove-AzStackHciCluster",
12486
"description": "Delete an HCI cluster.",

src/StackHCI/StackHCI.Autorest/UX/Microsoft.AzureStackHCI/edgeDevices.json

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -70,39 +70,6 @@
7070
]
7171
}
7272
]
73-
},
74-
{
75-
"name": "Test-AzStackHciEdgeDevice",
76-
"description": "A long-running resource action.",
77-
"path": "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}/validate",
78-
"help": {
79-
"learnMore": {
80-
"url": "https://learn.microsoft.com/powershell/module/az.stackhci/test-azstackhciedgedevice"
81-
},
82-
"parameterSets": [
83-
{
84-
"parameters": [
85-
"-Name <String>",
86-
"-ResourceUri <String>"
87-
]
88-
}
89-
]
90-
},
91-
"examples": [
92-
{
93-
"description": "A long-running resource action.",
94-
"parameters": [
95-
{
96-
"name": "-Name",
97-
"value": "[Path.edgeDeviceName]"
98-
},
99-
{
100-
"name": "-ResourceUri",
101-
"value": "[Path.resourceUri]"
102-
}
103-
]
104-
}
105-
]
10673
}
10774
]
10875
}

src/StackHCI/StackHCI.Autorest/custom/stackhci.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ Function Print-FunctionParameters{
497497
}
498498

499499
function Confirm-UserAcknowledgmentToUpgradeOS {
500+
[Microsoft.Azure.PowerShell.Cmdlets.StackHCI.DoNotExportAttribute()]
500501
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
501502
param(
502503
[Parameter(Mandatory=$true)]
@@ -521,6 +522,7 @@ function Confirm-UserAcknowledgmentToUpgradeOS {
521522
}
522523

523524
function Confirm-UserAcknowledgmentUpgradeToSolution {
525+
[Microsoft.Azure.PowerShell.Cmdlets.StackHCI.DoNotExportAttribute()]
524526
[CmdletBinding()]
525527
param(
526528
[Parameter(Mandatory=$true)]
@@ -4141,7 +4143,7 @@ function New-ClusterWithRetries {
41414143
GraphAccessToken is deprecated.
41424144
41434145
.PARAMETER AccountId
4144-
Specifies the AccoundId. Specifying this along with ArmAccessToken will avoid Azure interactive logon.
4146+
Specifies the AccountId. Specifying this along with ArmAccessToken will avoid Azure interactive logon.
41454147
41464148
.PARAMETER EnvironmentName
41474149
Specifies the Azure Environment. Default is AzureCloud. Valid values are AzureCloud, AzureChinaCloud, AzurePPE, AzureCanary, AzureUSGovernment

src/StackHCI/StackHCI.Autorest/docs/Az.StackHCI.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.StackHCI
3-
Module Guid: 18e6b2a3-7e2d-4f6e-a8d2-09edaf462fd8
3+
Module Guid: ecca9195-88b3-4c8f-a865-4fa09629fc69
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.stackhci
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -80,6 +80,9 @@ Apply Update
8080
### [New-AzStackHciArcSetting](New-AzStackHciArcSetting.md)
8181
Create ArcSetting for HCI cluster.
8282

83+
### [New-AzStackHciArcSettingIdentity](New-AzStackHciArcSettingIdentity.md)
84+
Create Aad identity for arc settings.
85+
8386
### [New-AzStackHciCluster](New-AzStackHciCluster.md)
8487
Create an HCI cluster.
8588

@@ -135,13 +138,13 @@ Remove-AzStackHCIVMAttestation removes guests from AzureStack HCI IMDS Attestati
135138
Set-AzStackHCI modifies resource properties of the Microsoft.AzureStackHCI cloud resource representing the on-premises cluster to enable or disable features.
136139

137140
### [Set-AzStackHciDeploymentSetting](Set-AzStackHciDeploymentSetting.md)
138-
Create a DeploymentSetting
141+
Update a DeploymentSetting
139142

140143
### [Set-AzStackHciEdgeDevice](Set-AzStackHciEdgeDevice.md)
141-
Create a EdgeDevice
144+
Update a EdgeDevice
142145

143146
### [Set-AzStackHciSecuritySetting](Set-AzStackHciSecuritySetting.md)
144-
Create a security setting
147+
Update a security setting
145148

146149
### [Set-AzStackHciUpdate](Set-AzStackHciUpdate.md)
147150
Put specified Update

src/StackHCI/StackHCI.Autorest/docs/Get-AzStackHciArcSetting.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ Get-AzStackHciArcSetting -ClusterName <String> -Name <String> -ResourceGroupName
2929
Get-AzStackHciArcSetting -InputObject <IStackHciIdentity> [-DefaultProfile <PSObject>] [<CommonParameters>]
3030
```
3131

32+
### GetViaIdentityCluster
33+
```
34+
Get-AzStackHciArcSetting -ClusterInputObject <IStackHciIdentity> -Name <String> [-DefaultProfile <PSObject>]
35+
[<CommonParameters>]
36+
```
37+
3238
## DESCRIPTION
3339
Get ArcSetting resource details of HCI Cluster.
3440

@@ -50,6 +56,21 @@ To see the details use : "Write-Host( $arcSettings | Format-List | Out-String)"
5056

5157
## PARAMETERS
5258

59+
### -ClusterInputObject
60+
Identity Parameter
61+
62+
```yaml
63+
Type: Microsoft.Azure.PowerShell.Cmdlets.StackHCI.Models.IStackHciIdentity
64+
Parameter Sets: GetViaIdentityCluster
65+
Aliases:
66+
67+
Required: True
68+
Position: Named
69+
Default value: None
70+
Accept pipeline input: True (ByValue)
71+
Accept wildcard characters: False
72+
```
73+
5374
### -ClusterName
5475
The name of the cluster.
5576
@@ -83,7 +104,6 @@ Accept wildcard characters: False
83104
84105
### -InputObject
85106
Identity Parameter
86-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
87107
88108
```yaml
89109
Type: Microsoft.Azure.PowerShell.Cmdlets.StackHCI.Models.IStackHciIdentity
@@ -102,7 +122,7 @@ The name of the proxy resource holding details of HCI ArcSetting information.
102122
103123
```yaml
104124
Type: System.String
105-
Parameter Sets: Get
125+
Parameter Sets: Get, GetViaIdentityCluster
106126
Aliases: ArcSettingName
107127

108128
Required: True
@@ -153,7 +173,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
153173
154174
## OUTPUTS
155175
156-
### Microsoft.Azure.PowerShell.Cmdlets.StackHCI.Models.Api20240401.IArcSetting
176+
### Microsoft.Azure.PowerShell.Cmdlets.StackHCI.Models.IArcSetting
157177
158178
## NOTES
159179

src/StackHCI/StackHCI.Autorest/docs/Get-AzStackHciCluster.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ Accept wildcard characters: False
8888
8989
### -InputObject
9090
Identity Parameter
91-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
9291
9392
```yaml
9493
Type: Microsoft.Azure.PowerShell.Cmdlets.StackHCI.Models.IStackHciIdentity
@@ -158,7 +157,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
158157
159158
## OUTPUTS
160159
161-
### Microsoft.Azure.PowerShell.Cmdlets.StackHCI.Models.Api20240401.ICluster
160+
### Microsoft.Azure.PowerShell.Cmdlets.StackHCI.Models.ICluster
162161
163162
## NOTES
164163

src/StackHCI/StackHCI.Autorest/docs/Get-AzStackHciDeploymentSetting.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ Get-AzStackHciDeploymentSetting -InputObject <IStackHciIdentity> [-DefaultProfil
3030
[<CommonParameters>]
3131
```
3232

33+
### GetViaIdentityCluster
34+
```
35+
Get-AzStackHciDeploymentSetting -ClusterInputObject <IStackHciIdentity> -SName <String>
36+
[-DefaultProfile <PSObject>] [<CommonParameters>]
37+
```
38+
3339
## DESCRIPTION
3440
Get a DeploymentSetting
3541

@@ -50,6 +56,21 @@ Gets the deployment setting in the cluster
5056

5157
## PARAMETERS
5258

59+
### -ClusterInputObject
60+
Identity Parameter
61+
62+
```yaml
63+
Type: Microsoft.Azure.PowerShell.Cmdlets.StackHCI.Models.IStackHciIdentity
64+
Parameter Sets: GetViaIdentityCluster
65+
Aliases:
66+
67+
Required: True
68+
Position: Named
69+
Default value: None
70+
Accept pipeline input: True (ByValue)
71+
Accept wildcard characters: False
72+
```
73+
5374
### -ClusterName
5475
The name of the cluster.
5576
@@ -83,7 +104,6 @@ Accept wildcard characters: False
83104
84105
### -InputObject
85106
Identity Parameter
86-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
87107
88108
```yaml
89109
Type: Microsoft.Azure.PowerShell.Cmdlets.StackHCI.Models.IStackHciIdentity
@@ -118,7 +138,7 @@ Name of Deployment Setting
118138
119139
```yaml
120140
Type: System.String
121-
Parameter Sets: Get
141+
Parameter Sets: Get, GetViaIdentityCluster
122142
Aliases: DeploymentSettingsName
123143

124144
Required: True
@@ -153,7 +173,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
153173
154174
## OUTPUTS
155175
156-
### Microsoft.Azure.PowerShell.Cmdlets.StackHCI.Models.Api20240401.IDeploymentSetting
176+
### Microsoft.Azure.PowerShell.Cmdlets.StackHCI.Models.IDeploymentSetting
157177
158178
## NOTES
159179

src/StackHCI/StackHCI.Autorest/docs/Get-AzStackHciEdgeDevice.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ Accept wildcard characters: False
6666
6767
### -InputObject
6868
Identity Parameter
69-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
7069
7170
```yaml
7271
Type: Microsoft.Azure.PowerShell.Cmdlets.StackHCI.Models.IStackHciIdentity
@@ -119,7 +118,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
119118
120119
## OUTPUTS
121120
122-
### Microsoft.Azure.PowerShell.Cmdlets.StackHCI.Models.Api20240401.IEdgeDevice
121+
### Microsoft.Azure.PowerShell.Cmdlets.StackHCI.Models.IEdgeDevice
123122
124123
## NOTES
125124

0 commit comments

Comments
 (0)