Skip to content

Commit cc5b2cd

Browse files
Migrate StackHCIVM from generation to main (#24486)
* Move StackHCIVM to main * Update ChangeLog.md --------- Co-authored-by: Vincent Dai <[email protected]>
1 parent ff8f36a commit cc5b2cd

File tree

290 files changed

+7656
-6553
lines changed

Some content is hidden

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

290 files changed

+7656
-6553
lines changed

src/StackHCIVM/StackHCIVM.Autorest/Az.StackHCIVM.format.ps1xml

Lines changed: 0 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -2713,108 +2713,6 @@
27132713
</TableRowEntries>
27142714
</TableControl>
27152715
</View>
2716-
<View>
2717-
<Name>Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.Operation</Name>
2718-
<ViewSelectedBy>
2719-
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.Operation#Multiple</TypeName>
2720-
</ViewSelectedBy>
2721-
<TableControl>
2722-
<TableHeaders>
2723-
<TableColumnHeader>
2724-
<Label>ActionType</Label>
2725-
</TableColumnHeader>
2726-
<TableColumnHeader>
2727-
<Label>IsDataAction</Label>
2728-
</TableColumnHeader>
2729-
<TableColumnHeader>
2730-
<Label>Name</Label>
2731-
</TableColumnHeader>
2732-
<TableColumnHeader>
2733-
<Label>Origin</Label>
2734-
</TableColumnHeader>
2735-
</TableHeaders>
2736-
<TableRowEntries>
2737-
<TableRowEntry>
2738-
<TableColumnItems>
2739-
<TableColumnItem>
2740-
<PropertyName>ActionType</PropertyName>
2741-
</TableColumnItem>
2742-
<TableColumnItem>
2743-
<PropertyName>IsDataAction</PropertyName>
2744-
</TableColumnItem>
2745-
<TableColumnItem>
2746-
<PropertyName>Name</PropertyName>
2747-
</TableColumnItem>
2748-
<TableColumnItem>
2749-
<PropertyName>Origin</PropertyName>
2750-
</TableColumnItem>
2751-
</TableColumnItems>
2752-
</TableRowEntry>
2753-
</TableRowEntries>
2754-
</TableControl>
2755-
</View>
2756-
<View>
2757-
<Name>Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.OperationDisplay</Name>
2758-
<ViewSelectedBy>
2759-
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.OperationDisplay#Multiple</TypeName>
2760-
</ViewSelectedBy>
2761-
<TableControl>
2762-
<TableHeaders>
2763-
<TableColumnHeader>
2764-
<Label>Description</Label>
2765-
</TableColumnHeader>
2766-
<TableColumnHeader>
2767-
<Label>Operation</Label>
2768-
</TableColumnHeader>
2769-
<TableColumnHeader>
2770-
<Label>Provider</Label>
2771-
</TableColumnHeader>
2772-
<TableColumnHeader>
2773-
<Label>Resource</Label>
2774-
</TableColumnHeader>
2775-
</TableHeaders>
2776-
<TableRowEntries>
2777-
<TableRowEntry>
2778-
<TableColumnItems>
2779-
<TableColumnItem>
2780-
<PropertyName>Description</PropertyName>
2781-
</TableColumnItem>
2782-
<TableColumnItem>
2783-
<PropertyName>Operation</PropertyName>
2784-
</TableColumnItem>
2785-
<TableColumnItem>
2786-
<PropertyName>Provider</PropertyName>
2787-
</TableColumnItem>
2788-
<TableColumnItem>
2789-
<PropertyName>Resource</PropertyName>
2790-
</TableColumnItem>
2791-
</TableColumnItems>
2792-
</TableRowEntry>
2793-
</TableRowEntries>
2794-
</TableControl>
2795-
</View>
2796-
<View>
2797-
<Name>Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.OperationListResult</Name>
2798-
<ViewSelectedBy>
2799-
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.OperationListResult#Multiple</TypeName>
2800-
</ViewSelectedBy>
2801-
<TableControl>
2802-
<TableHeaders>
2803-
<TableColumnHeader>
2804-
<Label>NextLink</Label>
2805-
</TableColumnHeader>
2806-
</TableHeaders>
2807-
<TableRowEntries>
2808-
<TableRowEntry>
2809-
<TableColumnItems>
2810-
<TableColumnItem>
2811-
<PropertyName>NextLink</PropertyName>
2812-
</TableColumnItem>
2813-
</TableColumnItems>
2814-
</TableRowEntry>
2815-
</TableRowEntries>
2816-
</TableControl>
2817-
</View>
28182716
<View>
28192717
<Name>Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.OperationValue</Name>
28202718
<ViewSelectedBy>

src/StackHCIVM/StackHCIVM.Autorest/Az.StackHCIVM.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.StackHCIVM.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/StackHCIVM/StackHCIVM.Autorest/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,20 @@ In this directory, run AutoRest:
5151
> see https://aka.ms/autorest
5252
5353
```yaml
54-
commit: 59883fd93ea3f0911d2070a533a3724bf9c2516a
54+
commit: 812f964651d5f1f7148b54ed2cc35cb97be12523
5555
require:
5656
- $(this-folder)/../../readme.azure.noprofile.md
5757
repo: azure-rest-api-specs
5858

5959
input-file:
60-
- $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/common.json
61-
- $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/galleryImages.json
62-
- $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/marketplaceGalleryImages.json
63-
- $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/networkInterfaces.json
64-
- $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/storageContainers.json
65-
- $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/virtualHardDisks.json
66-
- $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/virtualMachineInstances.json
67-
- $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/logicalNetworks.json
60+
- $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/common.json
61+
- $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/galleryImages.json
62+
- $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/marketplaceGalleryImages.json
63+
- $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/networkInterfaces.json
64+
- $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/storageContainers.json
65+
- $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/virtualHardDisks.json
66+
- $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/virtualMachineInstances.json
67+
- $(repo)/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/logicalNetworks.json
6868
- $(repo)/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-03-15-preview/HybridCompute.json
6969

7070
module-version: 0.1.0

src/StackHCIVM/StackHCIVM.Autorest/UX/Microsoft.AzureStackHCI/logicalNetworks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "logicalNetworks",
3-
"apiVersion": "2023-09-01-preview",
3+
"apiVersion": "2024-01-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.stackhcivm"
66
},

src/StackHCIVM/StackHCIVM.Autorest/UX/Microsoft.AzureStackHCI/networkInterfaces.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "networkInterfaces",
3-
"apiVersion": "2023-09-01-preview",
3+
"apiVersion": "2024-01-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.stackhcivm"
66
},

src/StackHCIVM/StackHCIVM.Autorest/UX/Microsoft.AzureStackHCI/storageContainers.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "storageContainers",
3-
"apiVersion": "2023-09-01-preview",
3+
"apiVersion": "2024-01-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.stackhcivm"
66
},

src/StackHCIVM/StackHCIVM.Autorest/UX/Microsoft.AzureStackHCI/virtualHardDisks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "virtualHardDisks",
3-
"apiVersion": "2023-09-01-preview",
3+
"apiVersion": "2024-01-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.stackhcivm"
66
},

src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMImage.ps1

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,12 @@ function New-AzStackHCIVMImage{
340340
}
341341

342342
} catch {
343-
Write-Error $_.Exception.Message -ErrorAction Stop
343+
$e = $_
344+
if ($e.FullyQualifiedErrorId -match "MissingAzureKubernetesMapping" ){
345+
Write-Error "An older version of the Arc VM cluster extension is installed on your cluster. Please downgrade the Az.StackHCIVm version to 1.0.1 to proceed." -ErrorAction Stop
346+
} else {
347+
Write-Error $e.Exception.Message -ErrorAction Stop
348+
}
344349
}
345350

346351

@@ -397,16 +402,29 @@ function New-AzStackHCIVMImage{
397402
}
398403

399404
} catch {
400-
Write-Error $_.Exception.Message -ErrorAction Stop
405+
$e = $_
406+
if ($e.FullyQualifiedErrorId -match "MissingAzureKubernetesMapping" ){
407+
Write-Error "An older version of the Arc VM cluster extension is installed on your cluster. Please downgrade the Az.StackHCIVm version to 1.0.1 to proceed." -ErrorAction Stop
408+
} else {
409+
Write-Error $e.Exception.Message -ErrorAction Stop
410+
}
401411
}
402412

403413

404414
}
405415

406416
if ($PSCmdlet.ParameterSetName -eq "GalleryImage")
407417
{
408-
409-
Az.StackHCIVM.internal\New-AzStackHCIVMGalleryImage @PSBoundParameters
418+
try{
419+
Az.StackHCIVM.internal\New-AzStackHCIVMGalleryImage -ErrorAction Stop @PSBoundParameters
420+
} catch {
421+
$e = $_
422+
if ($e.FullyQualifiedErrorId -match "MissingAzureKubernetesMapping" ){
423+
Write-Error "An older version of the Arc VM cluster extension is installed on your cluster. Please downgrade the Az.StackHCIVm version to 1.0.1 to proceed." -ErrorAction Stop
424+
} else {
425+
Write-Error $e.Exception.Message -ErrorAction Stop
426+
}
427+
}
410428
}
411429

412430

src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMLogicalNetwork_New.ps1

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,17 @@ function New-AzStackHCIVMLogicalNetwork {
340340
$PSBoundParameters.Add("Subnet", $SubnetNew)
341341

342342
}
343+
344+
try{
345+
Az.StackHCIVM.internal\New-AzStackHCIVMLogicalNetwork -ErrorAction Stop @PSBoundParameters
346+
} catch {
347+
$e = $_
348+
if ($e.FullyQualifiedErrorId -match "MissingAzureKubernetesMapping" ){
349+
Write-Error "An older version of the Arc VM cluster extension is installed on your cluster. Please downgrade the Az.StackHCIVm version to 1.0.1 to proceed." -ErrorAction Stop
350+
} else {
351+
Write-Error $e.Exception.Message -ErrorAction Stop
352+
}
353+
}
343354

344-
return Az.StackHCIVM.internal\New-AzStackHCIVMLogicalNetwork @PSBoundParameters
345355
}
346356

src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMNetworkInterface_New.ps1

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,16 @@ param(
273273
if ($Tag){
274274
$PSBoundParameters.Add("Tag", $Tag)
275275
}
276-
return Az.StackHCIVM.internal\New-AzStackHCIVMNetworkInterface @PSBoundParameters
277-
276+
277+
try{
278+
Az.StackHCIVM.internal\New-AzStackHCIVMNetworkInterface -ErrorAction Stop @PSBoundParameters
279+
} catch {
280+
$e = $_
281+
if ($e.FullyQualifiedErrorId -match "MissingAzureKubernetesMapping" ){
282+
Write-Error "An older version of the Arc VM cluster extension is installed on your cluster. Please downgrade the Az.StackHCIVm version to 1.0.1 to proceed." -ErrorAction Stop
283+
} else {
284+
Write-Error $e.Exception.Message -ErrorAction Stop
285+
}
286+
}
287+
278288
}

src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMStoragePath_New.ps1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ param(
146146
}
147147

148148

149-
return Az.StackHCIVM.internal\New-AzStackHCIVMStoragePath @PSBoundParameters
149+
try{
150+
Az.StackHCIVM.internal\New-AzStackHCIVMStoragePath -ErrorAction Stop @PSBoundParameters
151+
} catch {
152+
$e = $_
153+
if ($e.FullyQualifiedErrorId -match "MissingAzureKubernetesMapping" ){
154+
Write-Error "An older version of the Arc VM cluster extension is installed on your cluster. Please downgrade the Az.StackHCIVm version to 1.0.1 to proceed." -ErrorAction Stop
155+
} else {
156+
Write-Error $e.Exception.Message -ErrorAction Stop
157+
}
158+
}
150159

151160
}

src/StackHCIVM/StackHCIVM.Autorest/custom/New-AzStackHCIVMVirtualHardDisk_New.ps1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,16 @@ param(
241241
$null = $PSBoundParameters.Remove("StoragePathResourceGroup")
242242
}
243243

244-
return Az.StackHCIVM.internal\New-AzStackHCIVMVirtualHardDisk @PSBoundParameters
244+
try{
245+
Az.StackHCIVM.internal\New-AzStackHCIVMVirtualHardDisk -ErrorAction Stop @PSBoundParameters
246+
} catch {
247+
$e = $_
248+
if ($e.FullyQualifiedErrorId -match "MissingAzureKubernetesMapping" ){
249+
Write-Error "An older version of the Arc VM cluster extension is installed on your cluster. Please downgrade the Az.StackHCIVm version to 1.0.1 to proceed." -ErrorAction Stop
250+
} else {
251+
Write-Error $e.Exception.Message -ErrorAction Stop
252+
}
253+
}
245254

246255
}
247256

0 commit comments

Comments
 (0)