Skip to content

Commit 48c7c1a

Browse files
Migrate ElasticSan from generation to main (#24509)
* Move ElasticSan to main * Update ChangeLog.md --------- Co-authored-by: Vincent Dai <[email protected]>
1 parent dcc0d9f commit 48c7c1a

File tree

186 files changed

+8134
-829
lines changed

Some content is hidden

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

186 files changed

+8134
-829
lines changed
Lines changed: 20 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,141 +1,23 @@
1-
#
2-
# Module manifest for module 'Az.ElasticSan'
3-
#
4-
# Generated by: Microsoft Corporation
5-
#
6-
# Generated on: 10/12/2023
7-
#
8-
91
@{
10-
11-
# Script module or binary module file associated with this manifest.
12-
RootModule = './Az.ElasticSan.psm1'
13-
14-
# Version number of this module.
15-
ModuleVersion = '0.1.2'
16-
17-
# Supported PSEditions
18-
CompatiblePSEditions = 'Core', 'Desktop'
19-
20-
# ID used to uniquely identify this module
21-
GUID = 'ed90c36c-f150-4ad2-96ae-57e0ebb0a376'
22-
23-
# Author of this module
24-
Author = 'Microsoft Corporation'
25-
26-
# Company or vendor of this module
27-
CompanyName = 'Microsoft Corporation'
28-
29-
# Copyright statement for this module
30-
Copyright = 'Microsoft Corporation. All rights reserved.'
31-
32-
# Description of the functionality provided by this module
33-
Description = 'Microsoft Azure PowerShell: ElasticSan cmdlets'
34-
35-
# Minimum version of the PowerShell engine required by this module
36-
PowerShellVersion = '5.1'
37-
38-
# Name of the PowerShell host required by this module
39-
# PowerShellHostName = ''
40-
41-
# Minimum version of the PowerShell host required by this module
42-
# PowerShellHostVersion = ''
43-
44-
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45-
DotNetFrameworkVersion = '4.7.2'
46-
47-
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48-
# ClrVersion = ''
49-
50-
# Processor architecture (None, X86, Amd64) required by this module
51-
# ProcessorArchitecture = ''
52-
53-
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.13.1'; })
55-
56-
# Assemblies that must be loaded prior to importing this module
57-
RequiredAssemblies = './bin/Az.ElasticSan.private.dll'
58-
59-
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60-
# ScriptsToProcess = @()
61-
62-
# Type files (.ps1xml) to be loaded when importing this module
63-
# TypesToProcess = @()
64-
65-
# Format files (.ps1xml) to be loaded when importing this module
66-
FormatsToProcess = './Az.ElasticSan.format.ps1xml'
67-
68-
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69-
# NestedModules = @()
70-
71-
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72-
FunctionsToExport = 'Add-AzElasticSanVolumeGroupNetworkRule', 'Get-AzElasticSan',
73-
'Get-AzElasticSanSkuList', 'Get-AzElasticSanVolume',
74-
'Get-AzElasticSanVolumeGroup', 'Get-AzElasticSanVolumeSnapshot',
75-
'New-AzElasticSan', 'New-AzElasticSanVirtualNetworkRuleObject',
76-
'New-AzElasticSanVolume', 'New-AzElasticSanVolumeGroup',
77-
'New-AzElasticSanVolumeSnapshot', 'Remove-AzElasticSan',
78-
'Remove-AzElasticSanVolume', 'Remove-AzElasticSanVolumeGroup',
79-
'Remove-AzElasticSanVolumeGroupNetworkRule',
80-
'Remove-AzElasticSanVolumeSnapshot', 'Update-AzElasticSan',
81-
'Update-AzElasticSanVolume', 'Update-AzElasticSanVolumeGroup'
82-
83-
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
84-
CmdletsToExport = @()
85-
86-
# Variables to export from this module
87-
# VariablesToExport = @()
88-
89-
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
90-
AliasesToExport = @()
91-
92-
# DSC resources to export from this module
93-
# DscResourcesToExport = @()
94-
95-
# List of all modules packaged with this module
96-
# ModuleList = @()
97-
98-
# List of all files packaged with this module
99-
# FileList = @()
100-
101-
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
102-
PrivateData = @{
103-
2+
GUID = 'ed90c36c-f150-4ad2-96ae-57e0ebb0a376'
3+
RootModule = './Az.ElasticSan.psm1'
4+
ModuleVersion = '0.3.0'
5+
CompatiblePSEditions = 'Core', 'Desktop'
6+
Author = 'Microsoft Corporation'
7+
CompanyName = 'Microsoft Corporation'
8+
Copyright = 'Microsoft Corporation. All rights reserved.'
9+
Description = 'Microsoft Azure PowerShell: ElasticSan cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.ElasticSan.private.dll'
13+
FormatsToProcess = './Az.ElasticSan.format.ps1xml'
14+
FunctionsToExport = 'Add-AzElasticSanVolumeGroupNetworkRule', 'Get-AzElasticSan', 'Get-AzElasticSanSkuList', 'Get-AzElasticSanVolume', 'Get-AzElasticSanVolumeGroup', 'Get-AzElasticSanVolumeSnapshot', 'New-AzElasticSan', 'New-AzElasticSanVirtualNetworkRuleObject', 'New-AzElasticSanVolume', 'New-AzElasticSanVolumeGroup', 'New-AzElasticSanVolumeSnapshot', 'Remove-AzElasticSan', 'Remove-AzElasticSanVolume', 'Remove-AzElasticSanVolumeGroup', 'Remove-AzElasticSanVolumeGroupNetworkRule', 'Remove-AzElasticSanVolumeSnapshot', 'Update-AzElasticSan', 'Update-AzElasticSanVolume', 'Update-AzElasticSanVolumeGroup'
15+
PrivateData = @{
10416
PSData = @{
105-
106-
# Tags applied to this module. These help with module discovery in online galleries.
107-
Tags = 'Azure','ResourceManager','ARM','PSModule','ElasticSan'
108-
109-
# A URL to the license for this module.
110-
LicenseUri = 'https://aka.ms/azps-license'
111-
112-
# A URL to the main website for this project.
113-
ProjectUri = 'https://github.com/Azure/azure-powershell'
114-
115-
# A URL to an icon representing this module.
116-
# IconUri = ''
117-
118-
# ReleaseNotes of this module
119-
ReleaseNotes = '* Added support for CMK and volume snapshots'
120-
121-
# Prerelease string of this module
122-
# Prerelease = ''
123-
124-
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
125-
# RequireLicenseAcceptance = $false
126-
127-
# External dependent modules of this module
128-
# ExternalModuleDependencies = @()
129-
130-
} # End of PSData hashtable
131-
132-
} # End of PrivateData hashtable
133-
134-
# HelpInfo URI of this module
135-
# HelpInfoURI = ''
136-
137-
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
138-
# DefaultCommandPrefix = ''
139-
17+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'ElasticSan'
18+
LicenseUri = 'https://aka.ms/azps-license'
19+
ProjectUri = 'https://github.com/Azure/azure-powershell'
20+
ReleaseNotes = ''
21+
}
22+
}
14023
}
141-

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

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
This directory contains the PowerShell module for the ElasticSan service.
44

55
---
6-
76
## Info
87
- Modifiable: yes
98
- Generated: all
@@ -29,9 +28,9 @@ For information on how to develop for `Az.ElasticSan`, see [how-to.md](how-to.md
2928
3029
``` yaml
3130
# Please specify the commit id that includes your features to make sure generated codes stable.
32-
branch: 9770615578c920dad8cb6fce33d79c7e112824c0
31+
commit: 9770615578c920dad8cb6fce33d79c7e112824c0
3332
require:
34-
- $(this-folder)/../readme.azure.noprofile.md
33+
- $(this-folder)/../../readme.azure.noprofile.md
3534
input-file:
3635
- $(repo)/specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/elasticsan.json
3736

@@ -40,12 +39,12 @@ title: ElasticSan
4039
# For new RP, the version is 0.1.0
4140
module-version: 0.3.0
4241
subject-prefix: $(service-name)
42+
disable-transform-identity-type: true
43+
flatten-userassignedidentity: false
4344

44-
use-extension:
45-
"@autorest/powershell": "4.x"
4645
enable-parent-pipeline-input: true
4746

48-
# If there are post APIs for some kinds of actions in the RP, you may need to
47+
# If there are post APIs for some kinds of actions in the RP, you may need to
4948
# uncomment following line to support viaIdentity for these post APIs
5049
# identity-correction-for-post: true
5150

@@ -68,12 +67,12 @@ directive:
6867
alias: ElasticSanName
6968
- where:
7069
subject: VolumeGroup
71-
parameter-name: Name
70+
parameter-name: Name
7271
set:
7372
alias: VolumeGroupName
7473
- where:
7574
subject: Volume
76-
parameter-name: Name
75+
parameter-name: Name
7776
set:
7877
alias: VolumeName
7978
- where:
@@ -85,7 +84,7 @@ directive:
8584
set:
8685
parameter-name: ForceDelete
8786
- where:
88-
parameter-name: SnapshotName
87+
parameter-name: SnapshotName
8988
set:
9089
parameter-name: Name
9190
- where:
@@ -106,7 +105,7 @@ directive:
106105
parameter-name: GroupName
107106
set:
108107
parameter-name: VolumeGroupName
109-
- where:
108+
- where:
110109
subject: VolumeSnapshot
111110
verb: Update
112111
remove: true
@@ -139,14 +138,14 @@ directive:
139138
- where:
140139
subject: ^PrivateEndpointConnection$|^PrivateLinkResource$
141140
hide: true
142-
- where:
141+
- where:
143142
verb: ^New$|^Update$
144143
subject: ^VolumeGroup$
145144
hide: true
146-
- where:
145+
- where:
147146
verb: New
148-
subject: Volume
149-
parameter-name: ManagedByResourceId
147+
subject: Volume
148+
parameter-name: ManagedByResourceId
150149
hide: true
151150
- from: IdentityUserAssignedIdentities.dictionary.cs
152151
where: $

src/ElasticSan/ElasticSan.Autorest/build-module.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,10 @@ Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFol
171171
Write-Host -ForegroundColor Green 'Creating example stubs...'
172172
Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder
173173

174+
if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
175+
{
176+
Write-Host -ForegroundColor Green 'Creating ux metadata...'
177+
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
178+
}
179+
174180
Write-Host -ForegroundColor Green '-------------Done-------------'

src/ElasticSan/ElasticSan.Autorest/exports/Add-AzElasticSanVolumeGroupNetworkRule.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ COMPLEX PARAMETER PROPERTIES
3939
4040
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.
4141
42-
NETWORKACLSVIRTUALNETWORKRULE <IVirtualNetworkRule[]>: The list of virtual network rules.
42+
NETWORKACLSVIRTUALNETWORKRULE <IVirtualNetworkRule[]>: The list of virtual network rules. To construct, see NOTES section for NETWORKACLSVIRTUALNETWORKRULE properties and create a hash table.
4343
VirtualNetworkResourceId <String>: Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.
4444
[Action <String>]: The action of virtual network rule.
4545
.Link
@@ -179,7 +179,13 @@ begin {
179179
NetworkRuleResourceId = 'Az.ElasticSan.custom\Add-AzElasticSanVolumeGroupNetworkRule';
180180
}
181181
if (('NetworkRuleObject', 'NetworkRuleResourceId') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
182-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
182+
$testPlayback = $false
183+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
184+
if ($testPlayback) {
185+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
186+
} else {
187+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
188+
}
183189
}
184190
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
185191
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/ElasticSan/ElasticSan.Autorest/exports/Get-AzElasticSan.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ param(
7979
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')]
8080
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity]
8181
# Identity Parameter
82-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
8382
${InputObject},
8483

8584
[Parameter()]
@@ -163,7 +162,13 @@ begin {
163162
List1 = 'Az.ElasticSan.private\Get-AzElasticSan_List1';
164163
}
165164
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
166-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
165+
$testPlayback = $false
166+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
167+
if ($testPlayback) {
168+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
169+
} else {
170+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
171+
}
167172
}
168173
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
169174
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/ElasticSan/ElasticSan.Autorest/exports/Get-AzElasticSanSkuList.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,13 @@ begin {
122122
List = 'Az.ElasticSan.private\Get-AzElasticSanSkuList_List';
123123
}
124124
if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
125-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
125+
$testPlayback = $false
126+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
127+
if ($testPlayback) {
128+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
129+
} else {
130+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
131+
}
126132
}
127133
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
128134
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

0 commit comments

Comments
 (0)