Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 20 additions & 138 deletions src/ElasticSan/ElasticSan.Autorest/Az.ElasticSan.psd1
Original file line number Diff line number Diff line change
@@ -1,141 +1,23 @@
#
# Module manifest for module 'Az.ElasticSan'
#
# Generated by: Microsoft Corporation
#
# Generated on: 10/12/2023
#

@{

# Script module or binary module file associated with this manifest.
RootModule = './Az.ElasticSan.psm1'

# Version number of this module.
ModuleVersion = '0.1.2'

# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'

# ID used to uniquely identify this module
GUID = 'ed90c36c-f150-4ad2-96ae-57e0ebb0a376'

# Author of this module
Author = 'Microsoft Corporation'

# Company or vendor of this module
CompanyName = 'Microsoft Corporation'

# Copyright statement for this module
Copyright = 'Microsoft Corporation. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Microsoft Azure PowerShell: ElasticSan cmdlets'

# Minimum version of the PowerShell engine required by this module
PowerShellVersion = '5.1'

# Name of the PowerShell host required by this module
# PowerShellHostName = ''

# Minimum version of the PowerShell host required by this module
# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
DotNetFrameworkVersion = '4.7.2'

# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# ClrVersion = ''

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.13.1'; })

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = './bin/Az.ElasticSan.private.dll'

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = './Az.ElasticSan.format.ps1xml'

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()

# 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.
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'

# 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.
CmdletsToExport = @()

# Variables to export from this module
# VariablesToExport = @()

# 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.
AliasesToExport = @()

# DSC resources to export from this module
# DscResourcesToExport = @()

# List of all modules packaged with this module
# ModuleList = @()

# List of all files packaged with this module
# FileList = @()

# 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.
PrivateData = @{

GUID = 'ed90c36c-f150-4ad2-96ae-57e0ebb0a376'
RootModule = './Az.ElasticSan.psm1'
ModuleVersion = '0.3.0'
CompatiblePSEditions = 'Core', 'Desktop'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = 'Microsoft Corporation. All rights reserved.'
Description = 'Microsoft Azure PowerShell: ElasticSan cmdlets'
PowerShellVersion = '5.1'
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.ElasticSan.private.dll'
FormatsToProcess = './Az.ElasticSan.format.ps1xml'
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'
PrivateData = @{
PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = 'Azure','ResourceManager','ARM','PSModule','ElasticSan'

# A URL to the license for this module.
LicenseUri = 'https://aka.ms/azps-license'

# A URL to the main website for this project.
ProjectUri = 'https://github.com/Azure/azure-powershell'

# A URL to an icon representing this module.
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '* Added support for CMK and volume snapshots'

# Prerelease string of this module
# Prerelease = ''

# Flag to indicate whether the module requires explicit user acceptance for install/update/save
# RequireLicenseAcceptance = $false

# External dependent modules of this module
# ExternalModuleDependencies = @()

} # End of PSData hashtable

} # End of PrivateData hashtable

# HelpInfo URI of this module
# HelpInfoURI = ''

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'ElasticSan'
LicenseUri = 'https://aka.ms/azps-license'
ProjectUri = 'https://github.com/Azure/azure-powershell'
ReleaseNotes = ''
}
}
}

24 changes: 14 additions & 10 deletions src/ElasticSan/ElasticSan.Autorest/Az.ElasticSan.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,41 @@

# Ask for the shared functionality table
$VTable = Register-AzModule

# Tweaks the pipeline on module load
$instance.OnModuleLoad = $VTable.OnModuleLoad

# Following two delegates are added for telemetry
$instance.GetTelemetryId = $VTable.GetTelemetryId
$instance.Telemetry = $VTable.Telemetry


# Delegate to sanitize the output object
$instance.SanitizeOutput = $VTable.SanitizerHandler

# Delegate to get the telemetry info
$instance.GetTelemetryInfo = $VTable.GetTelemetryInfo

# Tweaks the pipeline per call
$instance.OnNewRequest = $VTable.OnNewRequest

# Gets shared parameter values
$instance.GetParameterValue = $VTable.GetParameterValue

# Allows shared module to listen to events from this module
$instance.EventListener = $VTable.EventListener

# Gets shared argument completers
$instance.ArgumentCompleter = $VTable.ArgumentCompleter

# The name of the currently selected Azure profile
$instance.ProfileName = $VTable.ProfileName


# Load the custom module
$customModulePath = Join-Path $PSScriptRoot './custom/Az.ElasticSan.custom.psm1'
if(Test-Path $customModulePath) {
$null = Import-Module -Name $customModulePath
}

# Export nothing to clear implicit exports
Export-ModuleMember

Expand All @@ -97,12 +101,12 @@
# Load the last folder if no profile is selected
$profileDirectory = $directories | Select-Object -Last 1
}

if($profileDirectory) {
Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
$exportsPath = $profileDirectory.FullName
}

if($exportsPath) {
Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
$cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
Expand Down
27 changes: 13 additions & 14 deletions src/ElasticSan/ElasticSan.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
This directory contains the PowerShell module for the ElasticSan service.

---

## Info
- Modifiable: yes
- Generated: all
Expand All @@ -29,9 +28,9 @@ For information on how to develop for `Az.ElasticSan`, see [how-to.md](how-to.md

``` yaml
# Please specify the commit id that includes your features to make sure generated codes stable.
branch: 9770615578c920dad8cb6fce33d79c7e112824c0
commit: 9770615578c920dad8cb6fce33d79c7e112824c0
require:
- $(this-folder)/../readme.azure.noprofile.md
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/elasticsan.json

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

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

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

Expand All @@ -68,12 +67,12 @@ directive:
alias: ElasticSanName
- where:
subject: VolumeGroup
parameter-name: Name
parameter-name: Name
set:
alias: VolumeGroupName
- where:
subject: Volume
parameter-name: Name
parameter-name: Name
set:
alias: VolumeName
- where:
Expand All @@ -85,7 +84,7 @@ directive:
set:
parameter-name: ForceDelete
- where:
parameter-name: SnapshotName
parameter-name: SnapshotName
set:
parameter-name: Name
- where:
Expand All @@ -106,7 +105,7 @@ directive:
parameter-name: GroupName
set:
parameter-name: VolumeGroupName
- where:
- where:
subject: VolumeSnapshot
verb: Update
remove: true
Expand Down Expand Up @@ -139,14 +138,14 @@ directive:
- where:
subject: ^PrivateEndpointConnection$|^PrivateLinkResource$
hide: true
- where:
- where:
verb: ^New$|^Update$
subject: ^VolumeGroup$
hide: true
- where:
- where:
verb: New
subject: Volume
parameter-name: ManagedByResourceId
subject: Volume
parameter-name: ManagedByResourceId
hide: true
- from: IdentityUserAssignedIdentities.dictionary.cs
where: $
Expand Down
6 changes: 6 additions & 0 deletions src/ElasticSan/ElasticSan.Autorest/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,10 @@ Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFol
Write-Host -ForegroundColor Green 'Creating example stubs...'
Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder

if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
{
Write-Host -ForegroundColor Green 'Creating ux metadata...'
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
}

Write-Host -ForegroundColor Green '-------------Done-------------'
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ COMPLEX PARAMETER PROPERTIES

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.

NETWORKACLSVIRTUALNETWORKRULE <IVirtualNetworkRule[]>: The list of virtual network rules.
NETWORKACLSVIRTUALNETWORKRULE <IVirtualNetworkRule[]>: The list of virtual network rules. To construct, see NOTES section for NETWORKACLSVIRTUALNETWORKRULE properties and create a hash table.
VirtualNetworkResourceId <String>: Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.
[Action <String>]: The action of virtual network rule.
.Link
Expand Down Expand Up @@ -179,7 +179,13 @@ begin {
NetworkRuleResourceId = 'Az.ElasticSan.custom\Add-AzElasticSanVolumeGroupNetworkRule';
}
if (('NetworkRuleObject', 'NetworkRuleResourceId') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter()]
Expand Down Expand Up @@ -163,7 +162,13 @@ begin {
List1 = 'Az.ElasticSan.private\Get-AzElasticSan_List1';
}
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,13 @@ begin {
List = 'Az.ElasticSan.private\Get-AzElasticSanSkuList_List';
}
if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
Loading