diff --git a/src/DiskPool/Az.DiskPool.csproj b/src/DiskPool/Az.DiskPool.csproj
new file mode 100644
index 000000000000..53d1b069b022
--- /dev/null
+++ b/src/DiskPool/Az.DiskPool.csproj
@@ -0,0 +1,7 @@
+
+
+ DiskPool
+
+
+
+
diff --git a/src/DiskPool/Az.DiskPool.format.ps1xml b/src/DiskPool/Az.DiskPool.format.ps1xml
new file mode 100644
index 000000000000..c3f5d1bdd6c6
--- /dev/null
+++ b/src/DiskPool/Az.DiskPool.format.ps1xml
@@ -0,0 +1,1019 @@
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.DiskPoolIdentity
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.DiskPoolIdentity
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DiskPoolName
+
+
+ IscsiTargetName
+
+
+ Location
+
+
+ ResourceGroupName
+
+
+ SubscriptionId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Acl
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Acl
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InitiatorIqn
+
+
+ MappedLun
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPool
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolCreate
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolCreate
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolCreateProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolCreateProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AdditionalCapability
+
+
+ AvailabilityZone
+
+
+ SubnetId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolCreateTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolCreateTags
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolListResult
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AdditionalCapability
+
+
+ AvailabilityZone
+
+
+ ProvisioningState
+
+
+ Status
+
+
+ SubnetId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolUpdateTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolUpdateTags
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolZoneInfo
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolZoneInfo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AdditionalCapability
+
+
+ AvailabilityZone
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolZoneListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolZoneListResult
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.EndpointDependency
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.EndpointDependency
+
+
+
+
+
+
+
+
+
+
+
+ DomainName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.EndpointDetail
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.EndpointDetail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IPAddress
+
+
+ IsAccessible
+
+
+ Latency
+
+
+ Port
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ErrorAdditionalInfo
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ErrorAdditionalInfo
+
+
+
+
+
+
+
+
+
+
+
+ Type
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ErrorResponse
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ErrorResponse
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Message
+
+
+ Target
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLun
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLun
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Lun
+
+
+ ManagedDiskAzureResourceId
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiTarget
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiTarget
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiTargetCreate
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiTargetCreate
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiTargetCreateProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiTargetCreateProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AclMode
+
+
+ TargetIqn
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiTargetList
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiTargetList
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiTargetProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiTargetProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AclMode
+
+
+ Endpoint
+
+
+ Port
+
+
+ ProvisioningState
+
+
+ Status
+
+
+ TargetIqn
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiTargetUpdate
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiTargetUpdate
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.OutboundEnvironmentEndpoint
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.OutboundEnvironmentEndpoint
+
+
+
+
+
+
+
+
+
+
+
+ Category
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.OutboundEnvironmentEndpointList
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.OutboundEnvironmentEndpointList
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ProxyResource
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ProxyResource
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Resource
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Resource
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Sku
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Sku
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Tier
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.StoragePoolOperationDisplay
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.StoragePoolOperationDisplay
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+ Operation
+
+
+ Provider
+
+
+ Resource
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.StoragePoolOperationListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.StoragePoolOperationListResult
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.StoragePoolRpOperation
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.StoragePoolRpOperation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ActionType
+
+
+ IsDataAction
+
+
+ Name
+
+
+ Origin
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.SystemMetadata
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.SystemMetadata
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.TrackedResource
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.TrackedResource
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+ Location
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.TrackedResourceTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.TrackedResourceTags
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/DiskPool/Az.DiskPool.psd1 b/src/DiskPool/Az.DiskPool.psd1
new file mode 100644
index 000000000000..95de7ba5d98d
--- /dev/null
+++ b/src/DiskPool/Az.DiskPool.psd1
@@ -0,0 +1,136 @@
+#
+# Module manifest for module 'Az.DiskPool'
+#
+# Generated by: Microsoft Corporation
+#
+# Generated on: 5/27/2021
+#
+
+@{
+
+# Script module or binary module file associated with this manifest.
+RootModule = './Az.DiskPool.psm1'
+
+# Version number of this module.
+ModuleVersion = '0.1.0'
+
+# Supported PSEditions
+CompatiblePSEditions = 'Core', 'Desktop'
+
+# ID used to uniquely identify this module
+GUID = '4ef9a257-25da-4db7-832b-0c44a0e44cf0'
+
+# 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: DiskPool 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.3.0'; })
+
+# Assemblies that must be loaded prior to importing this module
+RequiredAssemblies = './bin/Az.DiskPool.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.DiskPool.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 = 'Get-AzDiskPool', 'Get-AzDiskPoolIscsiTarget', 'New-AzDiskPool',
+ 'New-AzDiskPoolAclObject', 'New-AzDiskPoolIscsiLunObject',
+ 'New-AzDiskPoolIscsiTarget', 'Remove-AzDiskPool',
+ 'Remove-AzDiskPoolIscsiTarget', 'Start-AzDiskPool', 'Stop-AzDiskPool',
+ 'Update-AzDiskPool', 'Update-AzDiskPoolIscsiTarget'
+
+# 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 = @{
+
+ PSData = @{
+
+ # Tags applied to this module. These help with module discovery in online galleries.
+ Tags = 'Azure','ResourceManager','ARM','PSModule','DiskPool'
+
+ # 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 = ''
+
+ # 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 = ''
+
+}
+
diff --git a/src/DiskPool/Az.DiskPool.psm1 b/src/DiskPool/Az.DiskPool.psm1
new file mode 100644
index 000000000000..bccabd935d0c
--- /dev/null
+++ b/src/DiskPool/Az.DiskPool.psm1
@@ -0,0 +1,109 @@
+# region Generated
+ # ----------------------------------------------------------------------------------
+ #
+ # Copyright Microsoft Corporation
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ # http://www.apache.org/licenses/LICENSE-2.0
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ # ----------------------------------------------------------------------------------
+ # Load required Az.Accounts module
+ $accountsName = 'Az.Accounts'
+ $accountsModule = Get-Module -Name $accountsName
+ if(-not $accountsModule) {
+ $localAccountsPath = Join-Path $PSScriptRoot 'generated\modules'
+ if(Test-Path -Path $localAccountsPath) {
+ $localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1
+ if($localAccounts) {
+ $accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru
+ }
+ }
+ if(-not $accountsModule) {
+ $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.2.3' } | Measure-Object).Count -gt 0
+ if($hasAdequateVersion) {
+ $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.2.3 -Scope Global -PassThru
+ }
+ }
+ }
+
+ if(-not $accountsModule) {
+ Write-Error "`nThis module requires $accountsName version 2.2.3 or greater. For installation instructions, please see: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps" -ErrorAction Stop
+ } elseif (($accountsModule.Version -lt [System.Version]'2.2.3') -and (-not $localAccounts)) {
+ Write-Error "`nThis module requires $accountsName version 2.2.3 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
+ }
+ Write-Information "Loaded Module '$($accountsModule.Name)'"
+
+ # Load the private module dll
+ $null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.DiskPool.private.dll')
+
+ # Get the private module's instance
+ $instance = [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Module]::Instance
+
+ # Ask for the shared functionality table
+ $VTable = Register-AzModule
+
+ # Tweaks the pipeline on module load
+ $instance.OnModuleLoad = $VTable.OnModuleLoad
+
+ # 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.DiskPool.custom.psm1'
+ if(Test-Path $customModulePath) {
+ $null = Import-Module -Name $customModulePath
+ }
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
+
+ # Export proxy cmdlet scripts
+ $exportsPath = Join-Path $PSScriptRoot './exports'
+ $directories = Get-ChildItem -Directory -Path $exportsPath
+ $profileDirectory = $null
+ if($instance.ProfileName) {
+ if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) {
+ $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName }
+ } else {
+ # Don't export anything if the profile doesn't exist for the module
+ $exportsPath = $null
+ Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded."
+ }
+ } elseif(($directories | Measure-Object).Count -gt 0) {
+ # 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
+ Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias)
+ }
+
+ # Finalize initialization of this module
+ $instance.Init();
+ Write-Information "Loaded Module '$($instance.Name)'"
+# endregion
diff --git a/src/DiskPool/Changelog.md b/src/DiskPool/Changelog.md
new file mode 100644
index 000000000000..d5c75a321b59
--- /dev/null
+++ b/src/DiskPool/Changelog.md
@@ -0,0 +1,24 @@
+
+## Upcoming Release
+
+## Version 0.1.0
+* First preview release for module Az.DiskPool
+
diff --git a/src/DiskPool/DiskPool.sln b/src/DiskPool/DiskPool.sln
new file mode 100644
index 000000000000..4875da311d9b
--- /dev/null
+++ b/src/DiskPool/DiskPool.sln
@@ -0,0 +1,48 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29709.97
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{62843FE6-7575-4D88-B989-7DF7EEC0BC01}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{442C609B-A431-4A71-B289-08F0B63C83E5}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{59E8F6B8-8F0E-403F-B88B-9736DBC396D9}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Az.DiskPool", "Az.DiskPool.csproj", "{1C203C0C-E0FD-40D2-B79E-C6DA52E4E350}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {62843FE6-7575-4D88-B989-7DF7EEC0BC01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {62843FE6-7575-4D88-B989-7DF7EEC0BC01}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {62843FE6-7575-4D88-B989-7DF7EEC0BC01}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {62843FE6-7575-4D88-B989-7DF7EEC0BC01}.Release|Any CPU.Build.0 = Release|Any CPU
+ {442C609B-A431-4A71-B289-08F0B63C83E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {442C609B-A431-4A71-B289-08F0B63C83E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {442C609B-A431-4A71-B289-08F0B63C83E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {442C609B-A431-4A71-B289-08F0B63C83E5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {59E8F6B8-8F0E-403F-B88B-9736DBC396D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {59E8F6B8-8F0E-403F-B88B-9736DBC396D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {59E8F6B8-8F0E-403F-B88B-9736DBC396D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {59E8F6B8-8F0E-403F-B88B-9736DBC396D9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1C203C0C-E0FD-40D2-B79E-C6DA52E4E350}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1C203C0C-E0FD-40D2-B79E-C6DA52E4E350}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1C203C0C-E0FD-40D2-B79E-C6DA52E4E350}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1C203C0C-E0FD-40D2-B79E-C6DA52E4E350}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {F9B3D96E-9680-40BE-A917-02EE655D6030}
+ EndGlobalSection
+EndGlobal
diff --git a/src/DiskPool/Properties/AssemblyInfo.cs b/src/DiskPool/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000000..91b99fb2a676
--- /dev/null
+++ b/src/DiskPool/Properties/AssemblyInfo.cs
@@ -0,0 +1,28 @@
+// ----------------------------------------------------------------------------------
+//
+// Copyright Microsoft Corporation
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// ----------------------------------------------------------------------------------
+
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("Microsoft Azure Powershell - DiskPool")]
+[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
+[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
+[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
+
+[assembly: ComVisible(false)]
+[assembly: CLSCompliant(false)]
+[assembly: Guid("cab30302-f17b-4dd6-8c5f-2902b85e7cec")]
+[assembly: AssemblyVersion("0.1.0")]
+[assembly: AssemblyFileVersion("0.1.0")]
diff --git a/src/DiskPool/build-module.ps1 b/src/DiskPool/build-module.ps1
new file mode 100644
index 000000000000..b404d28a2d03
--- /dev/null
+++ b/src/DiskPool/build-module.ps1
@@ -0,0 +1,157 @@
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs)
+$ErrorActionPreference = 'Stop'
+
+if($PSEdition -ne 'Core') {
+ Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.'
+}
+
+if(-not $Isolated -and -not $Debugger) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
+
+ if($LastExitCode -ne 0) {
+ # Build failed. Don't attempt to run the module.
+ return
+ }
+
+ if($Test) {
+ . (Join-Path $PSScriptRoot 'test-module.ps1')
+ if($LastExitCode -ne 0) {
+ # Tests failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($Docs) {
+ . (Join-Path $PSScriptRoot 'generate-help.ps1')
+ if($LastExitCode -ne 0) {
+ # Docs generation failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($Pack) {
+ . (Join-Path $PSScriptRoot 'pack-module.ps1')
+ if($LastExitCode -ne 0) {
+ # Packing failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ $runModulePath = Join-Path $PSScriptRoot 'run-module.ps1'
+ if($Code) {
+ . $runModulePath -Code
+ } elseif($Run) {
+ . $runModulePath
+ } else {
+ Write-Host -ForegroundColor Cyan "To run this module in an isolated PowerShell session, run the 'run-module.ps1' script or provide the '-Run' parameter to this script."
+ }
+ return
+}
+
+$binFolder = Join-Path $PSScriptRoot 'bin'
+$objFolder = Join-Path $PSScriptRoot 'obj'
+
+if(-not $Debugger) {
+ Write-Host -ForegroundColor Green 'Cleaning build folders...'
+ $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
+
+ if((Test-Path $binFolder) -or (Test-Path $objFolder)) {
+ Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?'
+ Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.'
+ }
+
+ Write-Host -ForegroundColor Green 'Compiling module...'
+ $buildConfig = 'Debug'
+ if($Release) {
+ $buildConfig = 'Release'
+ }
+ dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo
+ if($LastExitCode -ne 0) {
+ Write-Error 'Compilation failed.'
+ }
+
+ $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release')
+}
+
+$dll = Join-Path $PSScriptRoot 'bin\Az.DiskPool.private.dll'
+if(-not (Test-Path $dll)) {
+ Write-Error "Unable to find output assembly in '$binFolder'."
+}
+
+# Load DLL to use build-time cmdlets
+$null = Import-Module -Name $dll
+
+$modulePaths = $dll
+$customPsm1 = Join-Path $PSScriptRoot 'custom\Az.DiskPool.custom.psm1'
+if(Test-Path $customPsm1) {
+ $modulePaths = @($dll, $customPsm1)
+}
+
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+if(Test-Path $exportsFolder) {
+ $null = Get-ChildItem -Path $exportsFolder -Recurse -Exclude 'readme.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $exportsFolder
+
+$internalFolder = Join-Path $PSScriptRoot 'internal'
+if(Test-Path $internalFolder) {
+ $null = Get-ChildItem -Path $internalFolder -Recurse -Exclude '*.psm1', 'readme.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $internalFolder
+
+$psd1 = Join-Path $PSScriptRoot './Az.DiskPool.psd1'
+$guid = Get-ModuleGuid -Psd1Path $psd1
+$moduleName = 'Az.DiskPool'
+$examplesFolder = Join-Path $PSScriptRoot 'examples'
+$null = New-Item -ItemType Directory -Force -Path $examplesFolder
+
+Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
+$modelCmdlets = @('Acl', 'IscsiLun')
+. (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1') -Models $modelCmdlets
+$moduleName = 'Az.DiskPool'
+if($NoDocs) {
+ Write-Host -ForegroundColor Green 'Creating exports...'
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder
+} else {
+ Write-Host -ForegroundColor Green 'Creating exports and docs...'
+ $moduleDescription = 'Microsoft Azure PowerShell: DiskPool cmdlets'
+ $docsFolder = Join-Path $PSScriptRoot 'docs'
+ if(Test-Path $docsFolder) {
+ $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'readme.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+ }
+ $null = New-Item -ItemType Directory -Force -Path $docsFolder
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid
+}
+
+Write-Host -ForegroundColor Green 'Creating format.ps1xml...'
+$formatPs1xml = Join-Path $PSScriptRoot './Az.DiskPool.format.ps1xml'
+Export-FormatPs1xml -FilePath $formatPs1xml
+
+Write-Host -ForegroundColor Green 'Creating psd1...'
+$customFolder = Join-Path $PSScriptRoot 'custom'
+Export-Psd1 -ExportsFolder $exportsFolder -CustomFolder $customFolder -Psd1Path $psd1 -ModuleGuid $guid
+
+Write-Host -ForegroundColor Green 'Creating test stubs...'
+$testFolder = Join-Path $PSScriptRoot 'test'
+$null = New-Item -ItemType Directory -Force -Path $testFolder
+Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFolder $testFolder
+
+Write-Host -ForegroundColor Green 'Creating example stubs...'
+Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
diff --git a/src/DiskPool/check-dependencies.ps1 b/src/DiskPool/check-dependencies.ps1
new file mode 100644
index 000000000000..657140612d88
--- /dev/null
+++ b/src/DiskPool/check-dependencies.ps1
@@ -0,0 +1,64 @@
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources)
+$ErrorActionPreference = 'Stop'
+
+if(-not $Isolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+ & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
+ return
+}
+
+function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
+ if($predicate) {
+ $module = Get-Module -ListAvailable -Name $moduleName
+ if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0)) {
+ $null = New-Item -ItemType Directory -Force -Path $path
+ Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
+ if ($requiredVersion) {
+ Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path
+ }elseif($versionMinimum) {
+ Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path
+ } else {
+ Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path
+ }
+ }
+ }
+}
+
+$ProgressPreference = 'SilentlyContinue'
+$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1
+
+$localModulesPath = Join-Path $PSScriptRoot 'generated\modules'
+if(Test-Path -Path $localModulesPath) {
+ $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
+}
+
+DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.2.3'
+DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'
+
+$tools = Join-Path $PSScriptRoot 'tools'
+$resourceDir = Join-Path $tools 'Resources'
+$resourceModule = Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psm1'
+
+if ($Resources.IsPresent -and ((-not (Test-Path -Path $resourceModule)) -or $RegenerateSupportModule.IsPresent)) {
+ Write-Host -ForegroundColor Green "Building local Resource module used for test..."
+ Set-Location $resourceDir
+ $null = autorest .\readme.md --use:@autorest/powershell@3.0.414 --output-folder=$HOME/.PSSharedModules/Resources
+ $null = Copy-Item custom/* $HOME/.PSSharedModules/Resources/custom/
+ Set-Location $HOME/.PSSharedModules/Resources
+ $null = .\build-module.ps1
+ Set-Location $PSScriptRoot
+}
diff --git a/src/DiskPool/create-model-cmdlets.ps1 b/src/DiskPool/create-model-cmdlets.ps1
new file mode 100644
index 000000000000..3574ed90cd95
--- /dev/null
+++ b/src/DiskPool/create-model-cmdlets.ps1
@@ -0,0 +1,165 @@
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+param([string[]]$Models)
+
+if ($Models.Count -eq 0)
+{
+ return
+}
+
+$ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
+$ModuleName = 'Az.DiskPool'.Split(".")[1]
+$OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
+$null = New-Item -ItemType Directory -Force -Path $OutputDir
+
+$CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
+$Content = ''
+$null = $CsFiles | ForEach-Object -Process { if ($_.Name.Split('.').count -eq 2 )
+ { $Content += get-content $_.fullname -raw
+ } }
+
+$Tree = [Microsoft.CodeAnalysis.CSharp.SyntaxFactory]::ParseCompilationUnit($Content)
+$Nodes = $Tree.ChildNodes().ChildNodes()
+foreach ($Model in $Models)
+{
+ $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$Model") }
+ if ($InterfaceNode.count -eq 0) {
+ continue
+ }
+ # through a queue, we iterate all the parent models.
+ $Queue = @($InterfaceNode)
+ $visited = @("I$Model")
+ $AllInterfaceNodes = @()
+ while ($Queue.count -ne 0)
+ {
+ $AllInterfaceNodes += $Queue[0]
+ # Baselist contains the direct parent models.
+ foreach ($parent in $Queue[0].BaseList.Types)
+ {
+ if (($parent.Type.Right.Identifier.Value -ne 'IJsonSerializable') -and (-not $visited.Contains($parent.Type.Right.Identifier.Value)))
+ {
+ $Queue = [Array]$Queue + ($Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq $parent.Type.Right.Identifier.Value) })
+ $visited = [Array]$visited + $parent.Type.Right.Identifier.Value
+ }
+ }
+ $first, $Queue = $Queue
+ }
+
+ $Namespace = $InterfaceNode.Parent.Name
+ $ObjectType = $Model
+ $ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
+ # remove duplicated module name
+ if ($ObjectType.StartsWith($ModuleName)) {
+ $ModulePrefix = ''
+ } else {
+ $ModulePrefix = $ModuleName
+ }
+ $OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir
+
+ $ParameterDefineScriptList = New-Object System.Collections.Generic.List[string]
+ $ParameterAssignScriptList = New-Object System.Collections.Generic.List[string]
+ foreach ($Node in $AllInterfaceNodes)
+ {
+ foreach ($Member in $Node.Members)
+ {
+ $Arguments = $Member.AttributeLists.Attributes.ArgumentList.Arguments
+ $Required = $false
+ $Description = ""
+ $Readonly = $False
+ foreach ($Argument in $Arguments)
+ {
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Required")
+ {
+ $Required = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Description")
+ {
+ $Description = $Argument.Expression.Token.Value.Trim('.').replace('"', '`"')
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Readonly")
+ {
+ $Readonly = $Argument.Expression.Token.Value
+ }
+ }
+ if ($Readonly)
+ {
+ continue
+ }
+ $Identifier = $Member.Identifier.Value
+ $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1]
+ $ParameterDefinePropertyList = New-Object System.Collections.Generic.List[string]
+ if ($Required)
+ {
+ $ParameterDefinePropertyList.Add("Mandatory")
+ }
+ if ($Description -ne "")
+ {
+ $ParameterDefinePropertyList.Add("HelpMessage=`"${Description}.`"")
+ }
+ $ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList)
+ $ParameterDefineScript = "
+ [Parameter($ParameterDefineProperty)]
+ [${Type}]
+ `$${Identifier}"
+ $ParameterDefineScriptList.Add($ParameterDefineScript)
+ $ParameterAssignScriptList.Add("
+ `$Object.${Identifier} = `$${Identifier}")
+ }
+ }
+ $ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator ","
+ $ParameterAssignScript = $ParameterAssignScriptList | Join-String -Separator ""
+
+ $Script = "
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the \`"License\`");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an \`"AS IS\`" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for ${ObjectType}
+.Description
+Create a in-memory object for ${ObjectType}
+
+.Outputs
+${ObjectTypeWithNamespace}
+.Link
+https://docs.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
+#>
+function New-Az${ModulePrefix}${ObjectType}Object {
+ [OutputType('${ObjectTypeWithNamespace}')]
+ [CmdletBinding(PositionalBinding=`$false)]
+ Param(
+${ParameterDefineScript}
+ )
+
+ process {
+ `$Object = [${ObjectTypeWithNamespace}]::New()
+${ParameterAssignScript}
+ return `$Object
+ }
+}
+"
+ Set-Content -Path $OutputPath -Value $Script
+}
diff --git a/src/DiskPool/custom/Az.DiskPool.custom.psm1 b/src/DiskPool/custom/Az.DiskPool.custom.psm1
new file mode 100644
index 000000000000..c587a4aef3ed
--- /dev/null
+++ b/src/DiskPool/custom/Az.DiskPool.custom.psm1
@@ -0,0 +1,17 @@
+# region Generated
+ # Load the private module dll
+ $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.DiskPool.private.dll')
+
+ # Load the internal module
+ $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.DiskPool.internal.psm1'
+ if(Test-Path $internalModulePath) {
+ $null = Import-Module -Name $internalModulePath
+ }
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
+
+ # Export script cmdlets
+ Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
+ Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias)
+# endregion
diff --git a/src/DiskPool/custom/New-AzDiskPool.ps1 b/src/DiskPool/custom/New-AzDiskPool.ps1
new file mode 100644
index 000000000000..aa25a9461908
--- /dev/null
+++ b/src/DiskPool/custom/New-AzDiskPool.ps1
@@ -0,0 +1,197 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create or Update Disk pool.
+.Description
+Create or Update Disk pool.
+.Example
+PS C:\> {{ Add code here }}
+
+{{ Add output here }}
+.Example
+PS C:\> {{ Add code here }}
+
+{{ Add output here }}
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool
+.Notes
+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.
+
+DISK : List of Azure Managed Disks to attach to a Disk Pool.
+ Id : Unique Azure Resource ID of the Managed Disk.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/new-azdiskpool
+#>
+function New-AzDiskPool {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool])]
+[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Alias('DiskPoolName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String[]]
+ # Logical zone for Disk Pool resource; example: ["1"].
+ ${AvailabilityZone},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # The geo-location where the resource lives.
+ ${Location},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [ValidateSet('Standard')]
+ [System.String]
+ # .
+ ${SkuName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # Azure Resource ID of a Subnet for the Disk Pool.
+ ${SubnetId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String[]]
+ # List of additional capabilities for a Disk Pool.
+ ${AdditionalCapability},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String[]]
+ # List of Azure Managed Disk Ids to attach to a Disk Pool.
+ # To construct, see NOTES section for DISK properties and create a hash table.
+ ${DiskId},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.DiskPoolTier])]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # Tier to use for the Disk Pool.
+ ${SkuTier},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreateTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags.
+ ${Tag},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+ process {
+ try {
+ if ($PSBoundParameters.ContainsKey("DiskId")){
+ $disk = @()
+ for ($i = 0; $i -lt $DiskId.Count; $i++) {
+ $diskObject=Â [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Disk]::New()
+ $diskObject.Id = $DiskId[$i]
+ $disk += $diskObject
+ }
+ $PSBoundParameters["Disk"] = $disk
+ $null = $PSBoundParameters.Remove("DiskId")
+ }
+ Az.DiskPool.internal\New-AzDiskPool @PSBoundParameters
+ } catch {
+ throw
+ }
+ }
+
+}
diff --git a/src/DiskPool/custom/New-AzDiskPoolIscsiTarget.ps1 b/src/DiskPool/custom/New-AzDiskPoolIscsiTarget.ps1
new file mode 100644
index 000000000000..a56ca21a71e0
--- /dev/null
+++ b/src/DiskPool/custom/New-AzDiskPoolIscsiTarget.ps1
@@ -0,0 +1,175 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create or Update an iSCSI Target.
+.Description
+Create or Update an iSCSI Target.
+.Example
+PS C:\> {{ Add code here }}
+
+{{ Add output here }}
+.Example
+PS C:\> {{ Add code here }}
+
+{{ Add output here }}
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget
+.Notes
+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.
+
+LUN : List of LUNs to be exposed through iSCSI Target.
+ ManagedDiskAzureResourceId : Azure Resource ID of the Managed Disk.
+ Name : User defined name for iSCSI LUN; example: "lun0"
+
+STATICACLS : Access Control List (ACL) for an iSCSI Target; defines LUN masking policy
+ InitiatorIqn : iSCSI initiator IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:client".
+ MappedLun : List of LUN names mapped to the ACL.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/new-azdiskpooliscsitarget
+#>
+function New-AzDiskPoolIscsiTarget {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget])]
+ [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${DiskPoolName},
+
+ [Parameter(Mandatory)]
+ [Alias('IscsiTargetName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the iSCSI Target.
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.IscsiTargetAclMode])]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # Mode for Target connectivity.
+ ${AclMode},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLun[]]
+ # List of LUNs to be exposed through iSCSI Target.
+ # To construct, see NOTES section for LUN properties and create a hash table.
+ ${Lun},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IAcl[]]
+ # Access Control List (ACL) for an iSCSI Target; defines LUN masking policy
+ # To construct, see NOTES section for STATICACLS properties and create a hash table.
+ ${StaticAcl},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server".
+ ${TargetIqn},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+ )
+ process {
+ try {
+ if ($PSBoundParameters.ContainsKey("StaticAcl")){
+ $PSBoundParameters["StaticAcls"] = $StaticAcl
+ $null = $PSBoundParameters.Remove("StaticAcl")
+ }
+ Az.DiskPool.internal\New-AzDiskPoolIscsiTarget @PSBoundParameters
+ } catch {
+ throw
+ }
+ }
+}
diff --git a/src/DiskPool/custom/Update-AzDiskPool.ps1 b/src/DiskPool/custom/Update-AzDiskPool.ps1
new file mode 100644
index 000000000000..bbf20ddb7c7a
--- /dev/null
+++ b/src/DiskPool/custom/Update-AzDiskPool.ps1
@@ -0,0 +1,174 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Update a Disk pool.
+.Description
+Update a Disk pool.
+.Example
+PS C:\> {{ Add code here }}
+
+{{ Add output here }}
+.Example
+PS C:\> {{ Add code here }}
+
+{{ Add output here }}
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool
+.Notes
+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.
+
+DISK : List of Azure Managed Disks to attach to a Disk Pool.
+ Id : Unique Azure Resource ID of the Managed Disk.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/az.module/diskpool/update-azdiskpool
+#>
+function Update-AzDiskPool {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool])]
+[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Alias('DiskPoolName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${Name},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='UpdateExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String[]]
+ # List of Azure Managed Disk Ids to attach to a Disk Pool.
+ # To construct, see NOTES section for DISK properties and create a hash table.
+ ${DiskId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags.
+ ${Tag},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+ process {
+ try {
+ if ($PSBoundParameters.ContainsKey("DiskId")){
+ $disk = @()
+ for ($i = 0; $i -lt $DiskId.Count; $i++) {
+ $diskObject=Â [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Disk]::New()
+ $diskObject.Id = $DiskId[$i]
+ $disk += $diskObject
+ }
+ $PSBoundParameters["Disk"] = $disk
+ $null = $PSBoundParameters.Remove("DiskId")
+ }
+ Az.DiskPool.internal\Update-AzDiskPool @PSBoundParameters
+ } catch {
+ throw
+ }
+ }
+}
diff --git a/src/DiskPool/custom/Update-AzDiskPoolIscsiTarget.ps1 b/src/DiskPool/custom/Update-AzDiskPoolIscsiTarget.ps1
new file mode 100644
index 000000000000..af0f722b0a22
--- /dev/null
+++ b/src/DiskPool/custom/Update-AzDiskPoolIscsiTarget.ps1
@@ -0,0 +1,179 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Update an iSCSI Target.
+.Description
+Update an iSCSI Target.
+.Example
+PS C:\> {{ Add code here }}
+
+{{ Add output here }}
+.Example
+PS C:\> {{ Add code here }}
+
+{{ Add output here }}
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+
+LUN : List of LUNs to be exposed through iSCSI Target.
+ ManagedDiskAzureResourceId : Azure Resource ID of the Managed Disk.
+ Name : User defined name for iSCSI LUN; example: "lun0"
+
+STATICACL : Access Control List (ACL) for an iSCSI Target; defines LUN masking policy
+ InitiatorIqn : iSCSI initiator IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:client".
+ MappedLun : List of LUN names mapped to the ACL.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/update-azdiskpooliscsitarget
+#>
+function Update-AzDiskPoolIscsiTarget {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget])]
+[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${DiskPoolName},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Alias('IscsiTargetName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the iSCSI Target.
+ ${Name},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='UpdateExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLun[]]
+ # List of LUNs to be exposed through iSCSI Target.
+ # To construct, see NOTES section for LUN properties and create a hash table.
+ ${Lun},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IAcl[]]
+ # Access Control List (ACL) for an iSCSI Target; defines LUN masking policy
+ # To construct, see NOTES section for STATICACLS properties and create a hash table.
+ ${StaticAcl},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+process {
+ try {
+ if ($PSBoundParameters.ContainsKey("StaticAcl")){
+ $PSBoundParameters["StaticAcls"] = $StaticAcl
+ $null = $PSBoundParameters.Remove("StaticAcl")
+ }
+ Az.DiskPool.internal\Update-AzDiskPoolIscsiTarget @PSBoundParameters
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/DiskPool/custom/autogen-model-cmdlets/New-AzDiskPoolAclObject.ps1 b/src/DiskPool/custom/autogen-model-cmdlets/New-AzDiskPoolAclObject.ps1
new file mode 100644
index 000000000000..ea60b618643b
--- /dev/null
+++ b/src/DiskPool/custom/autogen-model-cmdlets/New-AzDiskPoolAclObject.ps1
@@ -0,0 +1,48 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the \"License\");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an \"AS IS\" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for Acl
+.Description
+Create a in-memory object for Acl
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Acl
+.Link
+https://docs.microsoft.com/powershell/module/az.DiskPool/new-AzDiskPoolAclObject
+#>
+function New-AzDiskPoolAclObject {
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Acl')]
+ [CmdletBinding(PositionalBinding=$false)]
+ Param(
+
+ [Parameter(Mandatory, HelpMessage="iSCSI initiator IQN (iSCSI Qualified Name); example: `"iqn.2005-03.org.iscsi:client`".")]
+ [string]
+ $InitiatorIqn,
+ [Parameter(Mandatory, HelpMessage="List of LUN names mapped to the ACL.")]
+ [string[]]
+ $MappedLun
+ )
+
+ process {
+ $Object = [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Acl]::New()
+
+ $Object.InitiatorIqn = $InitiatorIqn
+ $Object.MappedLun = $MappedLun
+ return $Object
+ }
+}
+
diff --git a/src/DiskPool/custom/autogen-model-cmdlets/New-AzDiskPoolIscsiLunObject.ps1 b/src/DiskPool/custom/autogen-model-cmdlets/New-AzDiskPoolIscsiLunObject.ps1
new file mode 100644
index 000000000000..13bcdcddac1e
--- /dev/null
+++ b/src/DiskPool/custom/autogen-model-cmdlets/New-AzDiskPoolIscsiLunObject.ps1
@@ -0,0 +1,48 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the \"License\");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an \"AS IS\" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for IscsiLun
+.Description
+Create a in-memory object for IscsiLun
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLun
+.Link
+https://docs.microsoft.com/powershell/module/az.DiskPool/new-AzDiskPoolIscsiLunObject
+#>
+function New-AzDiskPoolIscsiLunObject {
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLun')]
+ [CmdletBinding(PositionalBinding=$false)]
+ Param(
+
+ [Parameter(Mandatory, HelpMessage="Azure Resource ID of the Managed Disk.")]
+ [string]
+ $ManagedDiskAzureResourceId,
+ [Parameter(Mandatory, HelpMessage="User defined name for iSCSI LUN; example: `"lun0`".")]
+ [string]
+ $Name
+ )
+
+ process {
+ $Object = [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLun]::New()
+
+ $Object.ManagedDiskAzureResourceId = $ManagedDiskAzureResourceId
+ $Object.Name = $Name
+ return $Object
+ }
+}
+
diff --git a/src/DiskPool/custom/readme.md b/src/DiskPool/custom/readme.md
new file mode 100644
index 000000000000..f40f0cc0e9c8
--- /dev/null
+++ b/src/DiskPool/custom/readme.md
@@ -0,0 +1,41 @@
+# Custom
+This directory contains custom implementation for non-generated cmdlets for the `Az.DiskPool` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.DiskPool.custom.psm1`. This file should not be modified.
+
+## Info
+- Modifiable: yes
+- Generated: partial
+- Committed: yes
+- Packaged: yes
+
+## Details
+For `Az.DiskPool` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*.
+
+For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.DiskPool.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder.
+
+For script cmdlets, these are loaded via the `Az.DiskPool.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundemental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.
+
+## Purpose
+This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder.
+
+## Usage
+The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
+- Break
+- DefaultProfile
+- HttpPipelineAppend
+- HttpPipelinePrepend
+- Proxy
+- ProxyCredential
+- ProxyUseDefaultCredentials
+
+These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.DiskPool`. For C#, follow the usage seen in the `ProcessRecordAsync` method.
+
+### Attributes
+For processing the cmdlets, we've created some additional attributes:
+- `Microsoft.Azure.PowerShell.Cmdlets.DiskPool.DescriptionAttribute`
+ - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propegated to reference documentation via [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts.
+- `Microsoft.Azure.PowerShell.Cmdlets.DiskPool.DoNotExportAttribute`
+ - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.DiskPool`.
+- `Microsoft.Azure.PowerShell.Cmdlets.DiskPool.InternalExportAttribute`
+ - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.DiskPool`. For more information, see [readme.md](..\internal/readme.md) in the `..\internal` folder.
+- `Microsoft.Azure.PowerShell.Cmdlets.DiskPool.ProfileAttribute`
+ - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.
\ No newline at end of file
diff --git a/src/DiskPool/examples/Get-AzDiskPool.md b/src/DiskPool/examples/Get-AzDiskPool.md
new file mode 100644
index 000000000000..e5abe5a6c70a
--- /dev/null
+++ b/src/DiskPool/examples/Get-AzDiskPool.md
@@ -0,0 +1,47 @@
+### Example 1: List all Disk Pools in a resource group
+```powershell
+PS C:\> Get-AzDiskPool -ResourceGroupName 'storagepool-rg-test'
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+westeurope disk-pool-5 Microsoft.StoragePool/diskPools
+```
+
+This command lists all Disk Pools in a resource group
+
+### Example 2: Get a Disk Pool
+```powershell
+PS C:\> Get-AzDiskPool -ResourceGroupName 'storagepool-rg-test' -Name 'disk-pool-1'
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+```
+
+This command gets a Disk Pool.
+
+### Example 3: List all Disk Pools under a subscription
+```powershell
+PS C:\> Get-AzDiskPool
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+westeurope disk-pool-5 Microsoft.StoragePool/diskPools
+WestUS2 disk-pool-01 Microsoft.StoragePool/diskPools
+```
+
+This command lists all the Disk Pools in a subscription.
+
+### Example 4: Get a Disk Pool by object
+```powershell
+PS C:\> New-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test' -Location 'westeurope' -SkuName 'Standard' -SkuTier 'Standard' -SubnetId '/subscriptions/eff9fadd-6918-4253-b667-c39271e7435c/resourceGroups/storagepool-rg-test/providers/Microsoft.Network/virtualNetworks/disk-pool-vnet/subnets/default' -AvailabilityZone "1" | Get-AzDiskPool
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+```
+
+This command gets a Disk Pool by object.
+
diff --git a/src/DiskPool/examples/Get-AzDiskPoolIscsiTarget.md b/src/DiskPool/examples/Get-AzDiskPoolIscsiTarget.md
new file mode 100644
index 000000000000..9a2fe9001fe7
--- /dev/null
+++ b/src/DiskPool/examples/Get-AzDiskPoolIscsiTarget.md
@@ -0,0 +1,32 @@
+### Example 1: List iSCSI targets in a Disk Pool
+```powershell
+PS C:\> Get-AzDiskPoolIscsiTarget -ResourceGroupName 'storagepool-rg-test' -DiskPoolName 'disk-pool-5'
+
+Name Type
+---- ----
+target0 Microsoft.StoragePool/diskPools/iscsiTargets
+```
+
+This command lists all iSCSI targets in a Disk Pool.
+
+### Example 2: Get an iSCSI target
+```powershell
+PS C:\> Get-AzDiskPoolIscsiTarget -ResourceGroupName 'storagepool-rg-test' -DiskPoolName 'disk-pool-5' -Name 'target0'
+
+Name Type
+---- ----
+target0 Microsoft.StoragePool/diskPools/iscsiTargets
+```
+
+This command gets an iSCSI target.
+
+### Example 3: Get an iSCSI target by object
+```powershell
+PS C:\> New-AzDiskPoolIscsiTarget -DiskPoolName 'disk-pool-5' -Name 'target1' -ResourceGroupName 'storagepool-rg-test' -AclMode 'Dynamic' | Get-AzDiskPoolIscsiTarget
+
+Name Type
+---- ----
+target1 Microsoft.StoragePool/diskPools/iscsiTargets
+```
+
+This command gets an iSCSI target by object.
diff --git a/src/DiskPool/examples/New-AzDiskPool.md b/src/DiskPool/examples/New-AzDiskPool.md
new file mode 100644
index 000000000000..02c7cf21f91e
--- /dev/null
+++ b/src/DiskPool/examples/New-AzDiskPool.md
@@ -0,0 +1,12 @@
+### Example 1: Create a Disk Pool
+```powershell
+PS C:\> New-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test' -Location 'westeurope' -SkuName 'Standard' -SkuTier 'Standard' -SubnetId '/subscriptions/eff9fadd-6918-4253-b667-c39271e7435c/resourceGroups/storagepool-rg-test/providers/Microsoft.Network/virtualNetworks/disk-pool-vnet/subnets/default' -AvailabilityZone "1"
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+```
+
+This command creates a Disk Pool.
+
+
diff --git a/src/DiskPool/examples/New-AzDiskPoolAclObject.md b/src/DiskPool/examples/New-AzDiskPoolAclObject.md
new file mode 100644
index 000000000000..fabb8ef12355
--- /dev/null
+++ b/src/DiskPool/examples/New-AzDiskPoolAclObject.md
@@ -0,0 +1,11 @@
+### Example 1: Create an acl object
+```powershell
+PS C:\> New-AzDiskPoolAclObject -InitiatorIqn 'iqn.2021-05.com.microsoft:target0' -MappedLun @('lun0')
+
+InitiatorIqn MappedLun
+------------ ---------
+iqn.2021-05.com.microsoft:target0 {lun0}
+```
+
+This command creates an acl object.
+
diff --git a/src/DiskPool/examples/New-AzDiskPoolIscsiLunObject.md b/src/DiskPool/examples/New-AzDiskPoolIscsiLunObject.md
new file mode 100644
index 000000000000..2eb598161cf0
--- /dev/null
+++ b/src/DiskPool/examples/New-AzDiskPoolIscsiLunObject.md
@@ -0,0 +1,8 @@
+### Example 1: Create an iSCSI lun object
+```powershell
+PS C:\> New-AzDiskPoolIscsiLunObject -ManagedDiskAzureResourceId "/subscriptions/eff9fadd-6918-4253-b667-c39271e7435c/resourceGroups/storagepool-rg-test/providers/Microsoft.Compute/disks/disk-pool-disk-1" -Name 'lun0'
+
+```
+
+This command creates an iSCSI lun object.
+
diff --git a/src/DiskPool/examples/New-AzDiskPoolIscsiTarget.md b/src/DiskPool/examples/New-AzDiskPoolIscsiTarget.md
new file mode 100644
index 000000000000..bb4afd30c31d
--- /dev/null
+++ b/src/DiskPool/examples/New-AzDiskPoolIscsiTarget.md
@@ -0,0 +1,11 @@
+### Example 1: Create an iSCSI target
+```powershell
+PS C:\> New-AzDiskPoolIscsiTarget -DiskPoolName 'disk-pool-1' -Name 'target1' -ResourceGroupName 'storagepool-rg-test' -AclMode 'Dynamic'
+
+Name Type
+---- ----
+target1 Microsoft.StoragePool/diskPools/iscsiTargets
+```
+
+This command creates an iSCSI target.
+
diff --git a/src/DiskPool/examples/Remove-AzDiskPool.md b/src/DiskPool/examples/Remove-AzDiskPool.md
new file mode 100644
index 000000000000..0b55599e78ab
--- /dev/null
+++ b/src/DiskPool/examples/Remove-AzDiskPool.md
@@ -0,0 +1,15 @@
+### Example 1: Delete a Disk Pool
+```powershell
+PS C:\> Remove-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test'
+
+```
+
+This command deletes a Disk Pool.
+
+### Example 2: Delete a Disk Pool by object
+```powershell
+PS C:\> Get-AzDiskPool -ResourceGroupName 'storagepool-rg-test' -Name 'disk-pool-1' | Remove-AzDiskPool
+
+```
+
+This command deletes a Disk Pool by object.
diff --git a/src/DiskPool/examples/Remove-AzDiskPoolIscsiTarget.md b/src/DiskPool/examples/Remove-AzDiskPoolIscsiTarget.md
new file mode 100644
index 000000000000..0615d10008c0
--- /dev/null
+++ b/src/DiskPool/examples/Remove-AzDiskPoolIscsiTarget.md
@@ -0,0 +1,16 @@
+### Example 1: Remove an iSCSI target
+```powershell
+PS C:\> Remove-AzDiskPoolIscsiTarget -ResourceGroupName 'storagepool-rg-test' -DiskPoolName 'disk-pool-5' -Name 'target0'
+
+```
+
+This command removes an iSCSI target.
+
+### Example 2: Remove an iSCSI target by object
+```powershell
+PS C:\> Get-AzDiskPoolIscsiTarget -ResourceGroupName 'storagepool-rg-test' -DiskPoolName 'disk-pool-5' -Name 'target0' | Remove-AzDiskPoolIscsiTarget
+
+```
+
+This command removes an iSCSI target by object.
+
diff --git a/src/DiskPool/examples/Start-AzDiskPool.md b/src/DiskPool/examples/Start-AzDiskPool.md
new file mode 100644
index 000000000000..135644a30e3b
--- /dev/null
+++ b/src/DiskPool/examples/Start-AzDiskPool.md
@@ -0,0 +1,16 @@
+### Example 1: Start a Disk Pool
+```powershell
+PS C:\> Start-AzDiskPool -DiskPoolName 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test'
+
+```
+
+This command starts a Disk Pool.
+
+### Example 2: Start a Disk Pool by object
+```powershell
+PS C:\> Get-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test' | Start-AzDiskPool
+
+```
+
+This command starts a Disk Pool by object.
+
diff --git a/src/DiskPool/examples/Stop-AzDiskPool.md b/src/DiskPool/examples/Stop-AzDiskPool.md
new file mode 100644
index 000000000000..ce25cd8f758b
--- /dev/null
+++ b/src/DiskPool/examples/Stop-AzDiskPool.md
@@ -0,0 +1,15 @@
+### Example 1: Stop a Disk Pool
+```powershell
+PS C:\> Stop-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test'
+
+```
+
+This command deallocates a Disk Pool.
+
+### Example 2: Stop a Disk Pool by object
+```powershell
+PS C:\> Get-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test' | Stop-AzDiskPool
+
+```
+
+This command deallocates a Disk Pool by object.
diff --git a/src/DiskPool/examples/Update-AzDiskPool.md b/src/DiskPool/examples/Update-AzDiskPool.md
new file mode 100644
index 000000000000..d32b81fee6c5
--- /dev/null
+++ b/src/DiskPool/examples/Update-AzDiskPool.md
@@ -0,0 +1,22 @@
+### Example 1: Update a Disk Pool
+```powershell
+PS C:\> Update-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test' -DiskId @()
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+```
+
+This command updates a Disk Pool.
+
+### Example 2: Update a Disk Pool by object
+```powershell
+PS C:\> Get-AzDiskPool -ResourceGroupName 'storagepool-rg-test' -Name 'disk-pool-1' | Update-AzDiskPool -DiskId @()
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+```
+
+This command updates a Disk Pool by object.
+
diff --git a/src/DiskPool/examples/Update-AzDiskPoolIscsiTarget.md b/src/DiskPool/examples/Update-AzDiskPoolIscsiTarget.md
new file mode 100644
index 000000000000..2a8f6e90dd96
--- /dev/null
+++ b/src/DiskPool/examples/Update-AzDiskPoolIscsiTarget.md
@@ -0,0 +1,24 @@
+### Example 1: Update an iSCSI target
+```powershell
+PS C:\> $lun0 = New-AzDiskPoolIscsiLunObject -ManagedDiskAzureResourceId "/subscriptions/eff9fadd-6918-4253-b667-c39271e7435c/resourceGroups/storagepool-rg-test/providers/Microsoft.Compute/disks/disk1" -Name "lun0"
+PS C:\> Update-AzDiskPoolIscsiTarget -Name 'target0' -DiskPoolName 'disk-pool-5' -ResourceGroupName 'storagepool-rg-test' -Lun @($lun0)
+
+Name Type
+---- ----
+target0 Microsoft.StoragePool/diskPools/iscsiTargets
+```
+
+This command updates an iSCSI target.
+
+### Example 2: Update an iSCSI target by object
+```powershell
+PS C:\> $lun0 = New-AzDiskPoolIscsiLunObject -ManagedDiskAzureResourceId "/subscriptions/eff9fadd-6918-4253-b667-c39271e7435c/resourceGroups/storagepool-rg-test/providers/Microsoft.Compute/disks/disk1" -Name "lun0"
+PS C:\> Get-AzDiskPoolIscsiTarget -ResourceGroupName 'storagepool-rg-test' -DiskPoolName 'disk-pool-5' -Name 'target0' | Update-AzDiskPoolIscsiTarget -Lun @($lun0)
+
+Name Type
+---- ----
+target0 Microsoft.StoragePool/diskPools/iscsiTargets
+```
+
+This command updates an iSCSI target by object.
+
diff --git a/src/DiskPool/export-surface.ps1 b/src/DiskPool/export-surface.ps1
new file mode 100644
index 000000000000..9792a6e189e1
--- /dev/null
+++ b/src/DiskPool/export-surface.ps1
@@ -0,0 +1,40 @@
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+param([switch]$Isolated, [switch]$IncludeGeneralParameters, [switch]$UseExpandedFormat)
+$ErrorActionPreference = 'Stop'
+
+$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+if(-not $Isolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
+ return
+}
+
+$dll = Join-Path $PSScriptRoot 'bin\Az.DiskPool.private.dll'
+if(-not (Test-Path $dll)) {
+ Write-Error "Unable to find output assembly in '$binFolder'."
+}
+$null = Import-Module -Name $dll
+
+$moduleName = 'Az.DiskPool'
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+$resourcesFolder = Join-Path $PSScriptRoot 'resources'
+
+Export-CmdletSurface -ModuleName $moduleName -CmdletFolder $exportsFolder -OutputFolder $resourcesFolder -IncludeGeneralParameters $IncludeGeneralParameters.IsPresent -UseExpandedFormat $UseExpandedFormat.IsPresent
+Write-Host -ForegroundColor Green "CmdletSurface file(s) created in '$resourcesFolder'"
+
+Export-ModelSurface -OutputFolder $resourcesFolder -UseExpandedFormat $UseExpandedFormat.IsPresent
+Write-Host -ForegroundColor Green "ModelSurface file created in '$resourcesFolder'"
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
\ No newline at end of file
diff --git a/src/DiskPool/exports/Get-AzDiskPool.ps1 b/src/DiskPool/exports/Get-AzDiskPool.ps1
new file mode 100644
index 000000000000..df2236c1f772
--- /dev/null
+++ b/src/DiskPool/exports/Get-AzDiskPool.ps1
@@ -0,0 +1,191 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Get a Disk pool.
+.Description
+Get a Disk pool.
+.Example
+PS C:\> Get-AzDiskPool -ResourceGroupName 'storagepool-rg-test'
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+westeurope disk-pool-5 Microsoft.StoragePool/diskPools
+.Example
+PS C:\> Get-AzDiskPool -ResourceGroupName 'storagepool-rg-test' -Name 'disk-pool-1'
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+.Example
+PS C:\> Get-AzDiskPool
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+westeurope disk-pool-5 Microsoft.StoragePool/diskPools
+WestUS2 disk-pool-01 Microsoft.StoragePool/diskPools
+.Example
+PS C:\> New-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test' -Location 'westeurope' -SkuName 'Standard' -SkuTier 'Standard' -SubnetId '/subscriptions/eff9fadd-6918-4253-b667-c39271e7435c/resourceGroups/storagepool-rg-test/providers/Microsoft.Network/virtualNetworks/disk-pool-vnet/subnets/default' -AvailabilityZone "1" | Get-AzDiskPool
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/get-azdiskpool
+#>
+function Get-AzDiskPool {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Alias('DiskPoolName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List1', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Parameter(ParameterSetName='List1')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Get = 'Az.DiskPool.private\Get-AzDiskPool_Get';
+ GetViaIdentity = 'Az.DiskPool.private\Get-AzDiskPool_GetViaIdentity';
+ List = 'Az.DiskPool.private\Get-AzDiskPool_List';
+ List1 = 'Az.DiskPool.private\Get-AzDiskPool_List1';
+ }
+ if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/DiskPool/exports/Get-AzDiskPoolIscsiTarget.ps1 b/src/DiskPool/exports/Get-AzDiskPoolIscsiTarget.ps1
new file mode 100644
index 000000000000..bc9088e69357
--- /dev/null
+++ b/src/DiskPool/exports/Get-AzDiskPoolIscsiTarget.ps1
@@ -0,0 +1,187 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Get an iSCSI Target.
+.Description
+Get an iSCSI Target.
+.Example
+PS C:\> Get-AzDiskPoolIscsiTarget -ResourceGroupName 'storagepool-rg-test' -DiskPoolName 'disk-pool-5'
+
+Name Type
+---- ----
+target0 Microsoft.StoragePool/diskPools/iscsiTargets
+.Example
+PS C:\> Get-AzDiskPoolIscsiTarget -ResourceGroupName 'storagepool-rg-test' -DiskPoolName 'disk-pool-5' -Name 'target0'
+
+Name Type
+---- ----
+target0 Microsoft.StoragePool/diskPools/iscsiTargets
+.Example
+PS C:\> New-AzDiskPoolIscsiTarget -DiskPoolName 'disk-pool-5' -Name 'target1' -ResourceGroupName 'storagepool-rg-test' -AclMode 'Dynamic' | Get-AzDiskPoolIscsiTarget
+
+Name Type
+---- ----
+target1 Microsoft.StoragePool/diskPools/iscsiTargets
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/get-azdiskpooliscsitarget
+#>
+function Get-AzDiskPoolIscsiTarget {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${DiskPoolName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Alias('IscsiTargetName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the iSCSI Target.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Get = 'Az.DiskPool.private\Get-AzDiskPoolIscsiTarget_Get';
+ GetViaIdentity = 'Az.DiskPool.private\Get-AzDiskPoolIscsiTarget_GetViaIdentity';
+ List = 'Az.DiskPool.private\Get-AzDiskPoolIscsiTarget_List';
+ }
+ if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/DiskPool/exports/New-AzDiskPool.ps1 b/src/DiskPool/exports/New-AzDiskPool.ps1
new file mode 100644
index 000000000000..4291455d1fca
--- /dev/null
+++ b/src/DiskPool/exports/New-AzDiskPool.ps1
@@ -0,0 +1,206 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create or Update Disk pool.
+.Description
+Create or Update Disk pool.
+.Example
+PS C:\> New-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test' -Location 'westeurope' -SkuName 'Standard' -SkuTier 'Standard' -SubnetId '/subscriptions/eff9fadd-6918-4253-b667-c39271e7435c/resourceGroups/storagepool-rg-test/providers/Microsoft.Network/virtualNetworks/disk-pool-vnet/subnets/default' -AvailabilityZone "1"
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/new-azdiskpool
+#>
+function New-AzDiskPool {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool])]
+[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Alias('DiskPoolName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # The geo-location where the resource lives.
+ ${Location},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # .
+ ${SkuName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # Azure Resource ID of a Subnet for the Disk Pool.
+ ${SubnetId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String[]]
+ # Logical zone for Disk Pool resource; example: ["1"].
+ ${AvailabilityZone},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String[]]
+ # List of additional capabilities for a Disk Pool.
+ ${AdditionalCapability},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String[]]
+ # List of Azure Managed Disk Ids to attach to a Disk Pool.
+ # To construct, see NOTES section for DISK properties and create a hash table.
+ ${DiskId},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.DiskPoolTier])]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # Tier to use for the Disk Pool.
+ ${SkuTier},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreateTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags.
+ ${Tag},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ CreateExpanded = 'Az.DiskPool.custom\New-AzDiskPool';
+ }
+ if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/DiskPool/exports/New-AzDiskPoolAclObject.ps1 b/src/DiskPool/exports/New-AzDiskPoolAclObject.ps1
new file mode 100644
index 000000000000..b491d933d6c5
--- /dev/null
+++ b/src/DiskPool/exports/New-AzDiskPoolAclObject.ps1
@@ -0,0 +1,84 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for Acl
+.Description
+Create a in-memory object for Acl
+.Example
+PS C:\> New-AzDiskPoolAclObject -InitiatorIqn 'iqn.2021-05.com.microsoft:target0' -MappedLun @('lun0')
+
+InitiatorIqn MappedLun
+------------ ---------
+iqn.2021-05.com.microsoft:target0 {lun0}
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Acl
+.Link
+https://docs.microsoft.com/powershell/module/az.DiskPool/new-AzDiskPoolAclObject
+#>
+function New-AzDiskPoolAclObject {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Acl])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # iSCSI initiator IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:client".
+ ${InitiatorIqn},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String[]]
+ # List of LUN names mapped to the ACL.
+ ${MappedLun}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ __AllParameterSets = 'Az.DiskPool.custom\New-AzDiskPoolAclObject';
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/DiskPool/exports/New-AzDiskPoolIscsiLunObject.ps1 b/src/DiskPool/exports/New-AzDiskPoolIscsiLunObject.ps1
new file mode 100644
index 000000000000..0b65f87d3130
--- /dev/null
+++ b/src/DiskPool/exports/New-AzDiskPoolIscsiLunObject.ps1
@@ -0,0 +1,81 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for IscsiLun
+.Description
+Create a in-memory object for IscsiLun
+.Example
+PS C:\> New-AzDiskPoolIscsiLunObject -ManagedDiskAzureResourceId "/subscriptions/eff9fadd-6918-4253-b667-c39271e7435c/resourceGroups/storagepool-rg-test/providers/Microsoft.Compute/disks/disk-pool-disk-1" -Name 'lun0'
+
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLun
+.Link
+https://docs.microsoft.com/powershell/module/az.DiskPool/new-AzDiskPoolIscsiLunObject
+#>
+function New-AzDiskPoolIscsiLunObject {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLun])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # Azure Resource ID of the Managed Disk.
+ ${ManagedDiskAzureResourceId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # User defined name for iSCSI LUN; example: "lun0".
+ ${Name}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ __AllParameterSets = 'Az.DiskPool.custom\New-AzDiskPoolIscsiLunObject';
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/DiskPool/exports/New-AzDiskPoolIscsiTarget.ps1 b/src/DiskPool/exports/New-AzDiskPoolIscsiTarget.ps1
new file mode 100644
index 000000000000..3339f2d44537
--- /dev/null
+++ b/src/DiskPool/exports/New-AzDiskPoolIscsiTarget.ps1
@@ -0,0 +1,201 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create or Update an iSCSI Target.
+.Description
+Create or Update an iSCSI Target.
+.Example
+PS C:\> New-AzDiskPoolIscsiTarget -DiskPoolName 'disk-pool-1' -Name 'target1' -ResourceGroupName 'storagepool-rg-test' -AclMode 'Dynamic'
+
+Name Type
+---- ----
+target1 Microsoft.StoragePool/diskPools/iscsiTargets
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget
+.Notes
+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.
+
+LUN : List of LUNs to be exposed through iSCSI Target.
+ ManagedDiskAzureResourceId : Azure Resource ID of the Managed Disk.
+ Name : User defined name for iSCSI LUN; example: "lun0"
+
+STATICACL : Access Control List (ACL) for an iSCSI Target; defines LUN masking policy To construct, see NOTES section for STATICACLS properties and create a hash table.
+ InitiatorIqn : iSCSI initiator IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:client".
+ MappedLun : List of LUN names mapped to the ACL.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/new-azdiskpooliscsitarget
+#>
+function New-AzDiskPoolIscsiTarget {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget])]
+[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${DiskPoolName},
+
+ [Parameter(Mandatory)]
+ [Alias('IscsiTargetName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the iSCSI Target.
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.IscsiTargetAclMode])]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # Mode for Target connectivity.
+ ${AclMode},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLun[]]
+ # List of LUNs to be exposed through iSCSI Target.
+ # To construct, see NOTES section for LUN properties and create a hash table.
+ ${Lun},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IAcl[]]
+ # Access Control List (ACL) for an iSCSI Target; defines LUN masking policy
+ # To construct, see NOTES section for STATICACLS properties and create a hash table.
+ # To construct, see NOTES section for STATICACL properties and create a hash table.
+ ${StaticAcl},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server".
+ ${TargetIqn},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ CreateExpanded = 'Az.DiskPool.custom\New-AzDiskPoolIscsiTarget';
+ }
+ if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/DiskPool/exports/ProxyCmdletDefinitions.ps1 b/src/DiskPool/exports/ProxyCmdletDefinitions.ps1
new file mode 100644
index 000000000000..2de77089bbe3
--- /dev/null
+++ b/src/DiskPool/exports/ProxyCmdletDefinitions.ps1
@@ -0,0 +1,2100 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Get an iSCSI Target.
+.Description
+Get an iSCSI Target.
+.Example
+PS C:\> Get-AzDiskPoolIscsiTarget -ResourceGroupName 'storagepool-rg-test' -DiskPoolName 'disk-pool-5'
+
+Name Type
+---- ----
+target0 Microsoft.StoragePool/diskPools/iscsiTargets
+.Example
+PS C:\> Get-AzDiskPoolIscsiTarget -ResourceGroupName 'storagepool-rg-test' -DiskPoolName 'disk-pool-5' -Name 'target0'
+
+Name Type
+---- ----
+target0 Microsoft.StoragePool/diskPools/iscsiTargets
+.Example
+PS C:\> New-AzDiskPoolIscsiTarget -DiskPoolName 'disk-pool-5' -Name 'target1' -ResourceGroupName 'storagepool-rg-test' -AclMode 'Dynamic' | Get-AzDiskPoolIscsiTarget
+
+Name Type
+---- ----
+target1 Microsoft.StoragePool/diskPools/iscsiTargets
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/get-azdiskpooliscsitarget
+#>
+function Get-AzDiskPoolIscsiTarget {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${DiskPoolName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Alias('IscsiTargetName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the iSCSI Target.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Get = 'Az.DiskPool.private\Get-AzDiskPoolIscsiTarget_Get';
+ GetViaIdentity = 'Az.DiskPool.private\Get-AzDiskPoolIscsiTarget_GetViaIdentity';
+ List = 'Az.DiskPool.private\Get-AzDiskPoolIscsiTarget_List';
+ }
+ if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Get a Disk pool.
+.Description
+Get a Disk pool.
+.Example
+PS C:\> Get-AzDiskPool -ResourceGroupName 'storagepool-rg-test'
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+westeurope disk-pool-5 Microsoft.StoragePool/diskPools
+.Example
+PS C:\> Get-AzDiskPool -ResourceGroupName 'storagepool-rg-test' -Name 'disk-pool-1'
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+.Example
+PS C:\> Get-AzDiskPool
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+westeurope disk-pool-5 Microsoft.StoragePool/diskPools
+WestUS2 disk-pool-01 Microsoft.StoragePool/diskPools
+.Example
+PS C:\> New-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test' -Location 'westeurope' -SkuName 'Standard' -SkuTier 'Standard' -SubnetId '/subscriptions/eff9fadd-6918-4253-b667-c39271e7435c/resourceGroups/storagepool-rg-test/providers/Microsoft.Network/virtualNetworks/disk-pool-vnet/subnets/default' -AvailabilityZone "1" | Get-AzDiskPool
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/get-azdiskpool
+#>
+function Get-AzDiskPool {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Alias('DiskPoolName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List1', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Parameter(ParameterSetName='List1')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Get = 'Az.DiskPool.private\Get-AzDiskPool_Get';
+ GetViaIdentity = 'Az.DiskPool.private\Get-AzDiskPool_GetViaIdentity';
+ List = 'Az.DiskPool.private\Get-AzDiskPool_List';
+ List1 = 'Az.DiskPool.private\Get-AzDiskPool_List1';
+ }
+ if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Delete an iSCSI Target.
+.Description
+Delete an iSCSI Target.
+.Example
+PS C:\> Remove-AzDiskPoolIscsiTarget -ResourceGroupName 'storagepool-rg-test' -DiskPoolName 'disk-pool-5' -Name 'target0'
+
+.Example
+PS C:\> Get-AzDiskPoolIscsiTarget -ResourceGroupName 'storagepool-rg-test' -DiskPoolName 'disk-pool-5' -Name 'target0' | Remove-AzDiskPoolIscsiTarget
+
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+System.Boolean
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/remove-azdiskpooliscsitarget
+#>
+function Remove-AzDiskPoolIscsiTarget {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${DiskPoolName},
+
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Alias('IscsiTargetName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the iSCSI Target.
+ ${Name},
+
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Delete')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Delete = 'Az.DiskPool.private\Remove-AzDiskPoolIscsiTarget_Delete';
+ DeleteViaIdentity = 'Az.DiskPool.private\Remove-AzDiskPoolIscsiTarget_DeleteViaIdentity';
+ }
+ if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Delete a Disk pool.
+.Description
+Delete a Disk pool.
+.Example
+PS C:\> Remove-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test'
+
+.Example
+PS C:\> Get-AzDiskPool -ResourceGroupName 'storagepool-rg-test' -Name 'disk-pool-1' | Remove-AzDiskPool
+
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+System.Boolean
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/remove-azdiskpool
+#>
+function Remove-AzDiskPool {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Alias('DiskPoolName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${Name},
+
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Delete')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Delete = 'Az.DiskPool.private\Remove-AzDiskPool_Delete';
+ DeleteViaIdentity = 'Az.DiskPool.private\Remove-AzDiskPool_DeleteViaIdentity';
+ }
+ if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to start a Disk Pool.
+.Description
+The operation to start a Disk Pool.
+.Example
+PS C:\> Start-AzDiskPool -DiskPoolName 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test'
+
+.Example
+PS C:\> Get-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test' | Start-AzDiskPool
+
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+System.Boolean
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/start-azdiskpool
+#>
+function Start-AzDiskPool {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Start', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Start', Mandatory)]
+ [Alias('DiskPoolName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${Name},
+
+ [Parameter(ParameterSetName='Start', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Start')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='StartViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Start = 'Az.DiskPool.private\Start-AzDiskPool_Start';
+ StartViaIdentity = 'Az.DiskPool.private\Start-AzDiskPool_StartViaIdentity';
+ }
+ if (('Start') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Shuts down the Disk Pool and releases the compute resources.
+You are not billed for the compute resources that this Disk Pool uses.
+.Description
+Shuts down the Disk Pool and releases the compute resources.
+You are not billed for the compute resources that this Disk Pool uses.
+.Example
+PS C:\> Stop-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test'
+
+.Example
+PS C:\> Get-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test' | Stop-AzDiskPool
+
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+System.Boolean
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/stop-azdiskpool
+#>
+function Stop-AzDiskPool {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Deallocate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Deallocate', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${DiskPoolName},
+
+ [Parameter(ParameterSetName='Deallocate', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Deallocate')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='DeallocateViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Deallocate = 'Az.DiskPool.private\Stop-AzDiskPool_Deallocate';
+ DeallocateViaIdentity = 'Az.DiskPool.private\Stop-AzDiskPool_DeallocateViaIdentity';
+ }
+ if (('Deallocate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create or Update Disk pool.
+.Description
+Create or Update Disk pool.
+.Example
+PS C:\> New-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test' -Location 'westeurope' -SkuName 'Standard' -SkuTier 'Standard' -SubnetId '/subscriptions/eff9fadd-6918-4253-b667-c39271e7435c/resourceGroups/storagepool-rg-test/providers/Microsoft.Network/virtualNetworks/disk-pool-vnet/subnets/default' -AvailabilityZone "1"
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool
+.Link
+https://docs.microsoft.com/powershell/module/diskpool/new-azdiskpool
+#>
+function New-AzDiskPool {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool])]
+[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Alias('DiskPoolName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # The geo-location where the resource lives.
+ ${Location},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # .
+ ${SkuName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # Azure Resource ID of a Subnet for the Disk Pool.
+ ${SubnetId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String[]]
+ # Logical zone for Disk Pool resource; example: ["1"].
+ ${AvailabilityZone},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String[]]
+ # List of additional capabilities for a Disk Pool.
+ ${AdditionalCapability},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String[]]
+ # List of Azure Managed Disk Ids to attach to a Disk Pool.
+ # To construct, see NOTES section for DISK properties and create a hash table.
+ ${DiskId},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.DiskPoolTier])]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # Tier to use for the Disk Pool.
+ ${SkuTier},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreateTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags.
+ ${Tag},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ CreateExpanded = 'Az.DiskPool.custom\New-AzDiskPool';
+ }
+ if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for Acl
+.Description
+Create a in-memory object for Acl
+.Example
+PS C:\> New-AzDiskPoolAclObject -InitiatorIqn 'iqn.2021-05.com.microsoft:target0' -MappedLun @('lun0')
+
+InitiatorIqn MappedLun
+------------ ---------
+iqn.2021-05.com.microsoft:target0 {lun0}
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Acl
+.Link
+https://docs.microsoft.com/powershell/module/az.DiskPool/new-AzDiskPoolAclObject
+#>
+function New-AzDiskPoolAclObject {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Acl])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # iSCSI initiator IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:client".
+ ${InitiatorIqn},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String[]]
+ # List of LUN names mapped to the ACL.
+ ${MappedLun}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ __AllParameterSets = 'Az.DiskPool.custom\New-AzDiskPoolAclObject';
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for IscsiLun
+.Description
+Create a in-memory object for IscsiLun
+.Example
+PS C:\> New-AzDiskPoolIscsiLunObject -ManagedDiskAzureResourceId "/subscriptions/eff9fadd-6918-4253-b667-c39271e7435c/resourceGroups/storagepool-rg-test/providers/Microsoft.Compute/disks/disk-pool-disk-1" -Name 'lun0'
+
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLun
+.Link
+https://docs.microsoft.com/powershell/module/az.DiskPool/new-AzDiskPoolIscsiLunObject
+#>
+function New-AzDiskPoolIscsiLunObject {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLun])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # Azure Resource ID of the Managed Disk.
+ ${ManagedDiskAzureResourceId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # User defined name for iSCSI LUN; example: "lun0".
+ ${Name}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ __AllParameterSets = 'Az.DiskPool.custom\New-AzDiskPoolIscsiLunObject';
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create or Update an iSCSI Target.
+.Description
+Create or Update an iSCSI Target.
+.Example
+PS C:\> New-AzDiskPoolIscsiTarget -DiskPoolName 'disk-pool-1' -Name 'target1' -ResourceGroupName 'storagepool-rg-test' -AclMode 'Dynamic'
+
+Name Type
+---- ----
+target1 Microsoft.StoragePool/diskPools/iscsiTargets
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget
+.Notes
+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.
+
+LUN : List of LUNs to be exposed through iSCSI Target.
+ ManagedDiskAzureResourceId : Azure Resource ID of the Managed Disk.
+ Name : User defined name for iSCSI LUN; example: "lun0"
+
+STATICACL : Access Control List (ACL) for an iSCSI Target; defines LUN masking policy To construct, see NOTES section for STATICACLS properties and create a hash table.
+ InitiatorIqn : iSCSI initiator IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:client".
+ MappedLun : List of LUN names mapped to the ACL.
+.Link
+https://docs.microsoft.com/powershell/module/diskpool/new-azdiskpooliscsitarget
+#>
+function New-AzDiskPoolIscsiTarget {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget])]
+[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${DiskPoolName},
+
+ [Parameter(Mandatory)]
+ [Alias('IscsiTargetName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the iSCSI Target.
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.IscsiTargetAclMode])]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # Mode for Target connectivity.
+ ${AclMode},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLun[]]
+ # List of LUNs to be exposed through iSCSI Target.
+ # To construct, see NOTES section for LUN properties and create a hash table.
+ ${Lun},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IAcl[]]
+ # Access Control List (ACL) for an iSCSI Target; defines LUN masking policy
+ # To construct, see NOTES section for STATICACLS properties and create a hash table.
+ # To construct, see NOTES section for STATICACL properties and create a hash table.
+ ${StaticAcl},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String]
+ # iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server".
+ ${TargetIqn},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ CreateExpanded = 'Az.DiskPool.custom\New-AzDiskPoolIscsiTarget';
+ }
+ if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Update a Disk pool.
+.Description
+Update a Disk pool.
+.Example
+PS C:\> Update-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test' -DiskId @()
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+.Example
+PS C:\> Get-AzDiskPool -ResourceGroupName 'storagepool-rg-test' -Name 'disk-pool-1' | Update-AzDiskPool -DiskId @()
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/module/diskpool/update-azdiskpool
+#>
+function Update-AzDiskPool {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool])]
+[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Alias('DiskPoolName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${Name},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='UpdateExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String[]]
+ # List of Azure Managed Disk Ids to attach to a Disk Pool.
+ # To construct, see NOTES section for DISK properties and create a hash table.
+ ${DiskId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags.
+ ${Tag},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ UpdateExpanded = 'Az.DiskPool.custom\Update-AzDiskPool';
+ UpdateViaIdentityExpanded = 'Az.DiskPool.custom\Update-AzDiskPool';
+ }
+ if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Update an iSCSI Target.
+.Description
+Update an iSCSI Target.
+.Example
+PS C:\> $lun0 = New-AzDiskPoolIscsiLunObject -ManagedDiskAzureResourceId "/subscriptions/eff9fadd-6918-4253-b667-c39271e7435c/resourceGroups/storagepool-rg-test/providers/Microsoft.Compute/disks/disk1" -Name "lun0"
+PS C:\> Update-AzDiskPoolIscsiTarget -Name 'target0' -DiskPoolName 'disk-pool-5' -ResourceGroupName 'storagepool-rg-test' -Lun @($lun0)
+
+Name Type
+---- ----
+target0 Microsoft.StoragePool/diskPools/iscsiTargets
+.Example
+PS C:\> $lun0 = New-AzDiskPoolIscsiLunObject -ManagedDiskAzureResourceId "/subscriptions/eff9fadd-6918-4253-b667-c39271e7435c/resourceGroups/storagepool-rg-test/providers/Microsoft.Compute/disks/disk1" -Name "lun0"
+PS C:\> Get-AzDiskPoolIscsiTarget -ResourceGroupName 'storagepool-rg-test' -DiskPoolName 'disk-pool-5' -Name 'target0' | Update-AzDiskPoolIscsiTarget -Lun @($lun0)
+
+Name Type
+---- ----
+target0 Microsoft.StoragePool/diskPools/iscsiTargets
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+
+LUN : List of LUNs to be exposed through iSCSI Target.
+ ManagedDiskAzureResourceId : Azure Resource ID of the Managed Disk.
+ Name : User defined name for iSCSI LUN; example: "lun0"
+
+STATICACL : Access Control List (ACL) for an iSCSI Target; defines LUN masking policy To construct, see NOTES section for STATICACLS properties and create a hash table.
+ InitiatorIqn : iSCSI initiator IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:client".
+ MappedLun : List of LUN names mapped to the ACL.
+.Link
+https://docs.microsoft.com/powershell/module/diskpool/update-azdiskpooliscsitarget
+#>
+function Update-AzDiskPoolIscsiTarget {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget])]
+[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${DiskPoolName},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Alias('IscsiTargetName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the iSCSI Target.
+ ${Name},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='UpdateExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLun[]]
+ # List of LUNs to be exposed through iSCSI Target.
+ # To construct, see NOTES section for LUN properties and create a hash table.
+ ${Lun},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IAcl[]]
+ # Access Control List (ACL) for an iSCSI Target; defines LUN masking policy
+ # To construct, see NOTES section for STATICACLS properties and create a hash table.
+ # To construct, see NOTES section for STATICACL properties and create a hash table.
+ ${StaticAcl},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ UpdateExpanded = 'Az.DiskPool.custom\Update-AzDiskPoolIscsiTarget';
+ UpdateViaIdentityExpanded = 'Az.DiskPool.custom\Update-AzDiskPoolIscsiTarget';
+ }
+ if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/DiskPool/exports/Remove-AzDiskPool.ps1 b/src/DiskPool/exports/Remove-AzDiskPool.ps1
new file mode 100644
index 000000000000..64c74e7e7e56
--- /dev/null
+++ b/src/DiskPool/exports/Remove-AzDiskPool.ps1
@@ -0,0 +1,183 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Delete a Disk pool.
+.Description
+Delete a Disk pool.
+.Example
+PS C:\> Remove-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test'
+
+.Example
+PS C:\> Get-AzDiskPool -ResourceGroupName 'storagepool-rg-test' -Name 'disk-pool-1' | Remove-AzDiskPool
+
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+System.Boolean
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/remove-azdiskpool
+#>
+function Remove-AzDiskPool {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Alias('DiskPoolName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${Name},
+
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Delete')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Delete = 'Az.DiskPool.private\Remove-AzDiskPool_Delete';
+ DeleteViaIdentity = 'Az.DiskPool.private\Remove-AzDiskPool_DeleteViaIdentity';
+ }
+ if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/DiskPool/exports/Remove-AzDiskPoolIscsiTarget.ps1 b/src/DiskPool/exports/Remove-AzDiskPoolIscsiTarget.ps1
new file mode 100644
index 000000000000..0d256c4d49c0
--- /dev/null
+++ b/src/DiskPool/exports/Remove-AzDiskPoolIscsiTarget.ps1
@@ -0,0 +1,189 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Delete an iSCSI Target.
+.Description
+Delete an iSCSI Target.
+.Example
+PS C:\> Remove-AzDiskPoolIscsiTarget -ResourceGroupName 'storagepool-rg-test' -DiskPoolName 'disk-pool-5' -Name 'target0'
+
+.Example
+PS C:\> Get-AzDiskPoolIscsiTarget -ResourceGroupName 'storagepool-rg-test' -DiskPoolName 'disk-pool-5' -Name 'target0' | Remove-AzDiskPoolIscsiTarget
+
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+System.Boolean
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/remove-azdiskpooliscsitarget
+#>
+function Remove-AzDiskPoolIscsiTarget {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${DiskPoolName},
+
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Alias('IscsiTargetName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the iSCSI Target.
+ ${Name},
+
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Delete')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Delete = 'Az.DiskPool.private\Remove-AzDiskPoolIscsiTarget_Delete';
+ DeleteViaIdentity = 'Az.DiskPool.private\Remove-AzDiskPoolIscsiTarget_DeleteViaIdentity';
+ }
+ if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/DiskPool/exports/Start-AzDiskPool.ps1 b/src/DiskPool/exports/Start-AzDiskPool.ps1
new file mode 100644
index 000000000000..a067d2bd0eef
--- /dev/null
+++ b/src/DiskPool/exports/Start-AzDiskPool.ps1
@@ -0,0 +1,183 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The operation to start a Disk Pool.
+.Description
+The operation to start a Disk Pool.
+.Example
+PS C:\> Start-AzDiskPool -DiskPoolName 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test'
+
+.Example
+PS C:\> Get-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test' | Start-AzDiskPool
+
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+System.Boolean
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/start-azdiskpool
+#>
+function Start-AzDiskPool {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Start', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Start', Mandatory)]
+ [Alias('DiskPoolName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${Name},
+
+ [Parameter(ParameterSetName='Start', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Start')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='StartViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Start = 'Az.DiskPool.private\Start-AzDiskPool_Start';
+ StartViaIdentity = 'Az.DiskPool.private\Start-AzDiskPool_StartViaIdentity';
+ }
+ if (('Start') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/DiskPool/exports/Stop-AzDiskPool.ps1 b/src/DiskPool/exports/Stop-AzDiskPool.ps1
new file mode 100644
index 000000000000..e03e96968f6a
--- /dev/null
+++ b/src/DiskPool/exports/Stop-AzDiskPool.ps1
@@ -0,0 +1,184 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Shuts down the Disk Pool and releases the compute resources.
+You are not billed for the compute resources that this Disk Pool uses.
+.Description
+Shuts down the Disk Pool and releases the compute resources.
+You are not billed for the compute resources that this Disk Pool uses.
+.Example
+PS C:\> Stop-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test'
+
+.Example
+PS C:\> Get-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test' | Stop-AzDiskPool
+
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+System.Boolean
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/stop-azdiskpool
+#>
+function Stop-AzDiskPool {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Deallocate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Deallocate', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${DiskPoolName},
+
+ [Parameter(ParameterSetName='Deallocate', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Deallocate')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='DeallocateViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Deallocate = 'Az.DiskPool.private\Stop-AzDiskPool_Deallocate';
+ DeallocateViaIdentity = 'Az.DiskPool.private\Stop-AzDiskPool_DeallocateViaIdentity';
+ }
+ if (('Deallocate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/DiskPool/exports/Update-AzDiskPool.ps1 b/src/DiskPool/exports/Update-AzDiskPool.ps1
new file mode 100644
index 000000000000..8450fd98f937
--- /dev/null
+++ b/src/DiskPool/exports/Update-AzDiskPool.ps1
@@ -0,0 +1,197 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Update a Disk pool.
+.Description
+Update a Disk pool.
+.Example
+PS C:\> Update-AzDiskPool -Name 'disk-pool-1' -ResourceGroupName 'storagepool-rg-test' -DiskId @()
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+.Example
+PS C:\> Get-AzDiskPool -ResourceGroupName 'storagepool-rg-test' -Name 'disk-pool-1' | Update-AzDiskPool -DiskId @()
+
+Location Name Type
+-------- ---- ----
+westeurope disk-pool-1 Microsoft.StoragePool/diskPools
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/update-azdiskpool
+#>
+function Update-AzDiskPool {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool])]
+[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Alias('DiskPoolName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${Name},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='UpdateExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [System.String[]]
+ # List of Azure Managed Disk Ids to attach to a Disk Pool.
+ # To construct, see NOTES section for DISK properties and create a hash table.
+ ${DiskId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags.
+ ${Tag},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ UpdateExpanded = 'Az.DiskPool.custom\Update-AzDiskPool';
+ UpdateViaIdentityExpanded = 'Az.DiskPool.custom\Update-AzDiskPool';
+ }
+ if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/DiskPool/exports/Update-AzDiskPoolIscsiTarget.ps1 b/src/DiskPool/exports/Update-AzDiskPoolIscsiTarget.ps1
new file mode 100644
index 000000000000..7e9147c2da35
--- /dev/null
+++ b/src/DiskPool/exports/Update-AzDiskPoolIscsiTarget.ps1
@@ -0,0 +1,214 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Update an iSCSI Target.
+.Description
+Update an iSCSI Target.
+.Example
+PS C:\> $lun0 = New-AzDiskPoolIscsiLunObject -ManagedDiskAzureResourceId "/subscriptions/eff9fadd-6918-4253-b667-c39271e7435c/resourceGroups/storagepool-rg-test/providers/Microsoft.Compute/disks/disk1" -Name "lun0"
+PS C:\> Update-AzDiskPoolIscsiTarget -Name 'target0' -DiskPoolName 'disk-pool-5' -ResourceGroupName 'storagepool-rg-test' -Lun @($lun0)
+
+Name Type
+---- ----
+target0 Microsoft.StoragePool/diskPools/iscsiTargets
+.Example
+PS C:\> $lun0 = New-AzDiskPoolIscsiLunObject -ManagedDiskAzureResourceId "/subscriptions/eff9fadd-6918-4253-b667-c39271e7435c/resourceGroups/storagepool-rg-test/providers/Microsoft.Compute/disks/disk1" -Name "lun0"
+PS C:\> Get-AzDiskPoolIscsiTarget -ResourceGroupName 'storagepool-rg-test' -DiskPoolName 'disk-pool-5' -Name 'target0' | Update-AzDiskPoolIscsiTarget -Lun @($lun0)
+
+Name Type
+---- ----
+target0 Microsoft.StoragePool/diskPools/iscsiTargets
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget
+.Notes
+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.
+
+INPUTOBJECT : Identity Parameter
+ [DiskPoolName ]: The name of the Disk Pool.
+ [Id ]: Resource identity path
+ [IscsiTargetName ]: The name of the iSCSI Target.
+ [Location ]: The location of the resource.
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+
+LUN : List of LUNs to be exposed through iSCSI Target.
+ ManagedDiskAzureResourceId : Azure Resource ID of the Managed Disk.
+ Name : User defined name for iSCSI LUN; example: "lun0"
+
+STATICACL : Access Control List (ACL) for an iSCSI Target; defines LUN masking policy To construct, see NOTES section for STATICACLS properties and create a hash table.
+ InitiatorIqn : iSCSI initiator IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:client".
+ MappedLun : List of LUN names mapped to the ACL.
+.Link
+https://docs.microsoft.com/powershell/module/az.diskpool/update-azdiskpooliscsitarget
+#>
+function Update-AzDiskPoolIscsiTarget {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget])]
+[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the Disk Pool.
+ ${DiskPoolName},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Alias('IscsiTargetName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the iSCSI Target.
+ ${Name},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='UpdateExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLun[]]
+ # List of LUNs to be exposed through iSCSI Target.
+ # To construct, see NOTES section for LUN properties and create a hash table.
+ ${Lun},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IAcl[]]
+ # Access Control List (ACL) for an iSCSI Target; defines LUN masking policy
+ # To construct, see NOTES section for STATICACLS properties and create a hash table.
+ # To construct, see NOTES section for STATICACL properties and create a hash table.
+ ${StaticAcl},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ UpdateExpanded = 'Az.DiskPool.custom\Update-AzDiskPoolIscsiTarget';
+ UpdateViaIdentityExpanded = 'Az.DiskPool.custom\Update-AzDiskPoolIscsiTarget';
+ }
+ if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/DiskPool/exports/readme.md b/src/DiskPool/exports/readme.md
new file mode 100644
index 000000000000..b1aaa0920c61
--- /dev/null
+++ b/src/DiskPool/exports/readme.md
@@ -0,0 +1,20 @@
+# Exports
+This directory contains the cmdlets *exported by* `Az.DiskPool`. No other cmdlets in this repository are directly exported. What that means is the `Az.DiskPool` module will run [Export-ModuleMember](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation.
+
+## Info
+- Modifiable: no
+- Generated: all
+- Committed: no
+- Packaged: yes
+
+## Details
+The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`..\bin\Az.DiskPool.private.dll`) and from the `..\custom\Az.DiskPool.custom.psm1` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [readme.md](..\internal/readme.md) in the `..\internal` folder.
+
+## Purpose
+We generate script cmdlets out of the binary cmdlets and custom cmdlets. The format of script cmdlets are simplistic; thus, easier to generate at build time. Generating the cmdlets is required as to allow merging of generated binary, hand-written binary, and hand-written custom cmdlets. For Azure cmdlets, having script cmdlets simplifies the mechanism for exporting Azure profiles.
+
+## Structure
+The cmdlets generated here will flat in the directory (no sub-folders) as long as there are no Azure profiles specified for any cmdlets. Azure profiles (the `Profiles` attribute) is only applied when generating with the `--azure` attribute (or `azure: true` in the configuration). When Azure profiles are applied, the folder structure has a folder per profile. Each profile folder has only those cmdlets that apply to that profile.
+
+## Usage
+When `./Az.DiskPool.psm1` is loaded, it dynamically exports cmdlets here based on the folder structure and on the selected profile. If there are no sub-folders, it exports all cmdlets at the root of this folder. If there are sub-folders, it checks to see the selected profile. If no profile is selected, it exports the cmdlets in the last sub-folder (alphabetically). If a profile is selected, it exports the cmdlets in the sub-folder that matches the profile name. If there is no sub-folder that matches the profile name, it exports no cmdlets and writes a warning message.
\ No newline at end of file
diff --git a/src/DiskPool/generate-help.ps1 b/src/DiskPool/generate-help.ps1
new file mode 100644
index 000000000000..83c16feb68d9
--- /dev/null
+++ b/src/DiskPool/generate-help.ps1
@@ -0,0 +1,73 @@
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------------
+param([switch]$Isolated)
+$ErrorActionPreference = 'Stop'
+
+$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+if(-not $Isolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
+ return
+}
+
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+if(-not (Test-Path $exportsFolder)) {
+ Write-Error "Exports folder '$exportsFolder' was not found."
+}
+
+$directories = Get-ChildItem -Directory -Path $exportsFolder
+$hasProfiles = ($directories | Measure-Object).Count -gt 0
+if(-not $hasProfiles) {
+ $directories = Get-Item -Path $exportsFolder
+}
+
+$docsFolder = Join-Path $PSScriptRoot 'docs'
+if(Test-Path $docsFolder) {
+ $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'readme.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $docsFolder -ErrorAction SilentlyContinue
+$examplesFolder = Join-Path $PSScriptRoot 'examples'
+
+$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.DiskPool.psd1')
+$modulePath = $modulePsd1.FullName
+$moduleName = $modulePsd1.BaseName
+
+# Load DLL to use build-time cmdlets
+Import-Module -Name $modulePath
+Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.DiskPool.private.dll')
+$instance = [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Module]::Instance
+# Module info is shared per profile
+$moduleInfo = Get-Module -Name $moduleName
+
+foreach($directory in $directories)
+{
+ if($hasProfiles) {
+ Select-AzProfile -Name $directory.Name
+ }
+ # Reload module per profile
+ Import-Module -Name $modulePath -Force
+
+ $cmdletNames = Get-ScriptCmdlet -ScriptFolder $directory.FullName
+ $cmdletHelpInfo = $cmdletNames | ForEach-Object { Get-Help -Name $_ -Full }
+ $cmdletFunctionInfo = Get-ScriptCmdlet -ScriptFolder $directory.FullName -AsFunctionInfo
+
+ $docsPath = Join-Path $docsFolder $directory.Name
+ $null = New-Item -ItemType Directory -Force -Path $docsPath -ErrorAction SilentlyContinue
+ $examplesPath = Join-Path $examplesFolder $directory.Name
+
+ Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath
+ Write-Host -ForegroundColor Green "Created documentation in '$docsPath'"
+}
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
\ No newline at end of file
diff --git a/src/DiskPool/generate-info.json b/src/DiskPool/generate-info.json
new file mode 100644
index 000000000000..4b95d9fb80aa
--- /dev/null
+++ b/src/DiskPool/generate-info.json
@@ -0,0 +1,8 @@
+{
+ "autorest_modelerfour": "4.15.414",
+ "autorest_powershell": "3.0.430",
+ "autorest_core": "3.0.6375",
+ "node": "v10.15.3",
+ "swagger_commit": "9875f8eebd8c1392a83c052bc50a79c8251b1174",
+ "autorest": "3.0.6187"
+}
diff --git a/src/DiskPool/generated/Module.cs b/src/DiskPool/generated/Module.cs
new file mode 100644
index 000000000000..8c6d240ef3e3
--- /dev/null
+++ b/src/DiskPool/generated/Module.cs
@@ -0,0 +1,158 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.DiskPool
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Extensions;
+ using SendAsyncStepDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>;
+ using PipelineChangeDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>;
+ using GetParameterDelegate = global::System.Func;
+ using ModuleLoadPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>;
+ using NewRequestPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>;
+ using ArgumentCompleterDelegate = global::System.Func;
+ using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>;
+ using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>;
+ using NextDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>;
+
+ /// A class that contains the module-common code and data.
+ public partial class Module
+ {
+ /// The currently selected profile.
+ public string Profile = global::System.String.Empty;
+
+ public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler();
+
+ /// the ISendAsync pipeline instance
+ private Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.HttpPipeline _pipeline;
+
+ /// the ISendAsync pipeline instance (when proxy is enabled)
+ private Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.HttpPipeline _pipelineWithProxy;
+
+ public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy();
+
+ /// Gets completion data for azure specific fields
+ public ArgumentCompleterDelegate ArgumentCompleter { get; set; }
+
+ /// The instance of the Client API
+ public Microsoft.Azure.PowerShell.Cmdlets.DiskPool.DiskPool ClientAPI { get; set; }
+
+ /// A delegate that gets called for each signalled event
+ public EventListenerDelegate EventListener { get; set; }
+
+ /// The delegate to call to get parameter data from a common module.
+ public GetParameterDelegate GetParameterValue { get; set; }
+
+ /// Backing field for property.
+ private static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Module _instance;
+
+ /// the singleton of this module class
+ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Module());
+
+ /// The Name of this module
+ public string Name => @"Az.DiskPool";
+
+ /// The delegate to call when this module is loaded (supporting a commmon module).
+ public ModuleLoadPipelineDelegate OnModuleLoad { get; set; }
+
+ /// The delegate to call before each new request (supporting a commmon module).
+ public NewRequestPipelineDelegate OnNewRequest { get; set; }
+
+ /// The name of the currently selected Azure profile
+ public global::System.String ProfileName { get; set; }
+
+ /// The ResourceID for this module (azure arm).
+ public string ResourceId => @"Az.DiskPool";
+
+ /// The from the cmdlet
+ /// The HttpPipeline for the request
+
+ partial void AfterCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.HttpPipeline pipeline);
+
+ /// The from the cmdlet
+ /// The HttpPipeline for the request
+
+ partial void BeforeCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.HttpPipeline pipeline);
+
+ partial void CustomInit();
+
+ /// Creates an instance of the HttpPipeline for each call.
+ /// The from the cmdlet
+ /// the cmdlet's correlation id.
+ /// the cmdlet's process record correlation id.
+ /// the cmdlet's parameterset name.
+ /// An instance of Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.HttpPipeline for the remote call.
+ public Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.HttpPipeline CreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string processRecordId, string parameterSetName = null)
+ {
+ Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.HttpPipeline pipeline = null;
+ BeforeCreatePipeline(invocationInfo, ref pipeline);
+ pipeline = (pipeline ?? (_handler.UseProxy ? _pipelineWithProxy : _pipeline)).Clone();
+ AfterCreatePipeline(invocationInfo, ref pipeline);
+ pipeline.Append(new Runtime.CmdInfoHandler(processRecordId, invocationInfo, parameterSetName).SendAsync);
+ OnNewRequest?.Invoke( invocationInfo, correlationId,processRecordId, (step)=> { pipeline.Prepend(step); } , (step)=> { pipeline.Append(step); } );
+ return pipeline;
+ }
+
+ /// Gets parameters from a common module.
+ /// The from the cmdlet
+ /// the cmdlet's correlation id.
+ /// The name of the parameter to get the value for.
+ ///
+ /// The parameter value from the common module. (Note: this should be type converted on the way back)
+ ///
+ public object GetParameter(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string parameterName) => GetParameterValue?.Invoke( ResourceId, Name, invocationInfo, correlationId,parameterName );
+
+ /// Initialization steps performed after the module is loaded.
+ public void Init()
+ {
+ OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } );
+ OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } );
+ CustomInit();
+ }
+
+ /// Creates the module instance.
+ private Module()
+ {
+ /// constructor
+ ClientAPI = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.DiskPool();
+ _handler.Proxy = _webProxy;
+ _pipeline = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient()));
+ _pipelineWithProxy = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient(_handler)));
+ }
+
+ /// The HTTP Proxy to use.
+ /// The HTTP Proxy Credentials
+ /// True if the proxy should use default credentials
+ public void SetProxyConfiguration(global::System.Uri proxy, global::System.Management.Automation.PSCredential proxyCredential, bool proxyUseDefaultCredentials)
+ {
+ // set the proxy configuration
+ _webProxy.Address = proxy;
+ _webProxy.BypassProxyOnLocal = false;
+ _webProxy.Credentials = proxyCredential ?.GetNetworkCredential();
+ _webProxy.UseDefaultCredentials = proxyUseDefaultCredentials;
+ _handler.UseProxy = proxy != null;
+ }
+
+ /// Called to dispatch events to the common module listener
+ /// The ID of the event
+ /// The cancellation token for the event
+ /// A delegate to get the detailed event data
+ /// The callback for the event dispatcher
+ /// The from the cmdlet
+ /// the cmdlet's parameterset name.
+ /// the cmdlet's correlation id.
+ /// the cmdlet's process record correlation id.
+ /// the exception that is being thrown (if available)
+ ///
+ /// A that will be complete when handling of the event is completed.
+ ///
+ public async global::System.Threading.Tasks.Task Signal(string id, global::System.Threading.CancellationToken token, global::System.Func getEventData, SignalDelegate signal, global::System.Management.Automation.InvocationInfo invocationInfo, string parameterSetName, string correlationId, string processRecordId, global::System.Exception exception)
+ {
+ using( NoSynchronizationContext )
+ {
+ await EventListener?.Invoke(id,token,getEventData, signal, invocationInfo, parameterSetName, correlationId,processRecordId,exception);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/DiskPool/generated/api/DiskPool.cs b/src/DiskPool/generated/api/DiskPool.cs
new file mode 100644
index 000000000000..2a118bf463b9
--- /dev/null
+++ b/src/DiskPool/generated/api/DiskPool.cs
@@ -0,0 +1,3561 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.DiskPool
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Extensions;
+
+ ///
+ /// Low-level API implementation for the DiskPool service.
+ ///
+ public partial class DiskPool
+ {
+
+ /// Lists available Disk Pool Skus in an Azure location.
+ /// The ID of the target subscription.
+ /// The location of the resource.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task DiskPoolZonesList(string subscriptionId, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-04-01-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.StoragePool/locations/"
+ + global::System.Uri.EscapeDataString(location)
+ + "/diskPoolZones"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.DiskPoolZonesList_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Lists available Disk Pool Skus in an Azure location.
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task DiskPoolZonesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-04-01-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.StoragePool/locations/(?[^/]+)/diskPoolZones$").Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.StoragePool/locations/{location}/diskPoolZones'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var location = _match.Groups["location"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/providers/Microsoft.StoragePool/locations/"
+ + location
+ + "/diskPoolZones"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.DiskPoolZonesList_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task DiskPoolZonesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolZoneListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
+ ///
+ /// The ID of the target subscription.
+ /// The location of the resource.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task DiskPoolZonesList_Validate(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1);
+ await eventListener.AssertNotNull(nameof(location),location);
+ }
+ }
+
+ /// Create or Update Disk pool.
+ /// The ID of the target subscription.
+ /// The name of the resource group. The name is case insensitive.
+ /// The name of the Disk Pool.
+ /// Request payload for Disk Pool create operation
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task DiskPoolsCreateOrUpdate(string subscriptionId, string resourceGroupName, string diskPoolName, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-04-01-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.StoragePool/diskPools/"
+ + global::System.Uri.EscapeDataString(diskPoolName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.DiskPoolsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Create or Update Disk pool.
+ ///
+ /// Request payload for Disk Pool create operation
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task DiskPoolsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-04-01-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StoragePool/diskPools/(?[^/]+)$").Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var diskPoolName = _match.Groups["diskPoolName"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.StoragePool/diskPools/"
+ + diskPoolName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.DiskPoolsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task DiskPoolsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // this operation supports x-ms-long-running-operation
+ var _originalUri = request.RequestUri.AbsoluteUri;
+ // declared final-state-via: azure-async-operation
+ var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ var location = _response.GetFirstHeader(@"Location");
+ while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+
+ // get the delay before polling. (default to 30 seconds if not present)
+ int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // start the delay timer (we'll await later...)
+ var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token );
+
+ // while we wait, let's grab the headers and get ready to poll.
+ if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) {
+ asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ }
+ if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) {
+ location = _response.GetFirstHeader(@"Location");
+ }
+ var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation;
+ request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Get);
+
+ // and let's look at the current response body and see if we have some information we can give back to the listener
+ var content = await _response.Content.ReadAsStringAsync();
+ await waiting;
+
+ // check for cancellation
+ if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the polling call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // if we got back an OK, take a peek inside and see if it's done
+ if( _response.StatusCode == global::System.Net.HttpStatusCode.OK)
+ {
+ var error = false;
+ try {
+ if( Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject json)
+ {
+ var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status");
+ if( state is null )
+ {
+ // the body doesn't contain any information that has the state of the LRO
+ // we're going to just get out, and let the consumer have the result
+ break;
+ }
+
+ switch( state?.ToString()?.ToLower() )
+ {
+ case "failed":
+ error = true;
+ break;
+ case "succeeded":
+ case "canceled":
+ // we're done polling.
+ break;
+
+ default:
+ // need to keep polling!
+ _response.StatusCode = global::System.Net.HttpStatusCode.Created;
+ continue;
+ }
+ }
+ } catch {
+ // if we run into a problem peeking into the result,
+ // we really don't want to do anything special.
+ }
+ if (error) {
+ throw new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.UndeclaredResponseException(_response);
+ }
+ }
+
+ // check for terminal status code
+ if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ continue;
+ }
+ // we are done polling, do a request on final target?
+ // create a new request with the final uri
+ request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Get);
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the final call
+ _response = await sender.SendAsync(request, eventListener);
+ break;
+ }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPool.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get
+ /// validation events back.
+ ///
+ /// The ID of the target subscription.
+ /// The name of the resource group. The name is case insensitive.
+ /// The name of the Disk Pool.
+ /// Request payload for Disk Pool create operation
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task DiskPoolsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string diskPoolName, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreate body, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1);
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90);
+ await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._]*[0-9A-Za-z]$");
+ await eventListener.AssertNotNull(nameof(diskPoolName),diskPoolName);
+ await eventListener.AssertNotNull(nameof(body), body);
+ await eventListener.AssertObjectIsValid(nameof(body), body);
+ }
+ }
+
+ ///
+ /// Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that this Disk
+ /// Pool uses.
+ ///
+ /// The ID of the target subscription.
+ /// The name of the resource group. The name is case insensitive.
+ /// The name of the Disk Pool.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task DiskPoolsDeallocate(string subscriptionId, string resourceGroupName, string diskPoolName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-04-01-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.StoragePool/diskPools/"
+ + global::System.Uri.EscapeDataString(diskPoolName)
+ + "/deallocate"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.DiskPoolsDeallocate_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that this Disk
+ /// Pool uses.
+ ///
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task DiskPoolsDeallocateViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-04-01-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StoragePool/diskPools/(?[^/]+)$").Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/deallocate'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var diskPoolName = _match.Groups["diskPoolName"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.StoragePool/diskPools/"
+ + diskPoolName
+ + "/deallocate"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.DiskPoolsDeallocate_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task DiskPoolsDeallocate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // this operation supports x-ms-long-running-operation
+ var _originalUri = request.RequestUri.AbsoluteUri;
+ // declared final-state-via: azure-async-operation
+ var _finalUri = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ var location = _response.GetFirstHeader(@"Location");
+ while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+
+ // get the delay before polling. (default to 30 seconds if not present)
+ int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // start the delay timer (we'll await later...)
+ var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token );
+
+ // while we wait, let's grab the headers and get ready to poll.
+ if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) {
+ asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ }
+ if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) {
+ location = _response.GetFirstHeader(@"Location");
+ }
+ var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation;
+ request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Get);
+
+ // and let's look at the current response body and see if we have some information we can give back to the listener
+ var content = await _response.Content.ReadAsStringAsync();
+ await waiting;
+
+ // check for cancellation
+ if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the polling call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // if we got back an OK, take a peek inside and see if it's done
+ if( _response.StatusCode == global::System.Net.HttpStatusCode.OK)
+ {
+ var error = false;
+ try {
+ if( Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject json)
+ {
+ var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status");
+ if( state is null )
+ {
+ // the body doesn't contain any information that has the state of the LRO
+ // we're going to just get out, and let the consumer have the result
+ break;
+ }
+
+ switch( state?.ToString()?.ToLower() )
+ {
+ case "failed":
+ error = true;
+ break;
+ case "succeeded":
+ case "canceled":
+ // we're done polling.
+ break;
+
+ default:
+ // need to keep polling!
+ _response.StatusCode = global::System.Net.HttpStatusCode.Created;
+ continue;
+ }
+ }
+ } catch {
+ // if we run into a problem peeking into the result,
+ // we really don't want to do anything special.
+ }
+ if (error) {
+ throw new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.UndeclaredResponseException(_response);
+ }
+ }
+
+ // check for terminal status code
+ if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ continue;
+ }
+ // we are done polling, do a request on final target?
+ // create a new request with the final uri
+ request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Get);
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the final call
+ _response = await sender.SendAsync(request, eventListener);
+ break;
+ }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response);
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
+ ///
+ /// The ID of the target subscription.
+ /// The name of the resource group. The name is case insensitive.
+ /// The name of the Disk Pool.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task DiskPoolsDeallocate_Validate(string subscriptionId, string resourceGroupName, string diskPoolName, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1);
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90);
+ await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._]*[0-9A-Za-z]$");
+ await eventListener.AssertNotNull(nameof(diskPoolName),diskPoolName);
+ }
+ }
+
+ /// Delete a Disk pool.
+ /// The ID of the target subscription.
+ /// The name of the resource group. The name is case insensitive.
+ /// The name of the Disk Pool.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task DiskPoolsDelete(string subscriptionId, string resourceGroupName, string diskPoolName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-04-01-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.StoragePool/diskPools/"
+ + global::System.Uri.EscapeDataString(diskPoolName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Delete, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.DiskPoolsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Delete a Disk pool.
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task DiskPoolsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-04-01-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StoragePool/diskPools/(?[^/]+)$").Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var diskPoolName = _match.Groups["diskPoolName"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.StoragePool/diskPools/"
+ + diskPoolName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Delete, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.DiskPoolsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task DiskPoolsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // this operation supports x-ms-long-running-operation
+ var _originalUri = request.RequestUri.AbsoluteUri;
+ // declared final-state-via: azure-async-operation
+ var _finalUri = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ var location = _response.GetFirstHeader(@"Location");
+ while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+
+ // get the delay before polling. (default to 30 seconds if not present)
+ int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // start the delay timer (we'll await later...)
+ var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token );
+
+ // while we wait, let's grab the headers and get ready to poll.
+ if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) {
+ asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ }
+ if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) {
+ location = _response.GetFirstHeader(@"Location");
+ }
+ var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation;
+ request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Get);
+
+ // and let's look at the current response body and see if we have some information we can give back to the listener
+ var content = await _response.Content.ReadAsStringAsync();
+ await waiting;
+
+ // check for cancellation
+ if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the polling call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // if we got back an OK, take a peek inside and see if it's done
+ if( _response.StatusCode == global::System.Net.HttpStatusCode.OK)
+ {
+ var error = false;
+ try {
+ if( Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject json)
+ {
+ var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status");
+ if( state is null )
+ {
+ // the body doesn't contain any information that has the state of the LRO
+ // we're going to just get out, and let the consumer have the result
+ break;
+ }
+
+ switch( state?.ToString()?.ToLower() )
+ {
+ case "failed":
+ error = true;
+ break;
+ case "succeeded":
+ case "canceled":
+ // we're done polling.
+ break;
+
+ default:
+ // need to keep polling!
+ _response.StatusCode = global::System.Net.HttpStatusCode.Created;
+ continue;
+ }
+ }
+ } catch {
+ // if we run into a problem peeking into the result,
+ // we really don't want to do anything special.
+ }
+ if (error) {
+ throw new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.UndeclaredResponseException(_response);
+ }
+ }
+
+ // check for terminal status code
+ if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ continue;
+ }
+ // we are done polling, do a request on final target?
+ // create a new request with the final uri
+ request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Get);
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the final call
+ _response = await sender.SendAsync(request, eventListener);
+ break;
+ }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response);
+ break;
+ }
+ case global::System.Net.HttpStatusCode.NoContent:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onNoContent(_response);
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
+ ///
+ /// The ID of the target subscription.
+ /// The name of the resource group. The name is case insensitive.
+ /// The name of the Disk Pool.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task DiskPoolsDelete_Validate(string subscriptionId, string resourceGroupName, string diskPoolName, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1);
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90);
+ await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._]*[0-9A-Za-z]$");
+ await eventListener.AssertNotNull(nameof(diskPoolName),diskPoolName);
+ }
+ }
+
+ /// Get a Disk pool.
+ /// The ID of the target subscription.
+ /// The name of the resource group. The name is case insensitive.
+ /// The name of the Disk Pool.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task DiskPoolsGet(string subscriptionId, string resourceGroupName, string diskPoolName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-04-01-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.StoragePool/diskPools/"
+ + global::System.Uri.EscapeDataString(diskPoolName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.DiskPoolsGet_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Get a Disk pool.
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task DiskPoolsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-04-01-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StoragePool/diskPools/(?[^/]+)$").Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var diskPoolName = _match.Groups["diskPoolName"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.StoragePool/diskPools/"
+ + diskPoolName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.DiskPoolsGet_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task DiskPoolsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPool.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
+ ///
+ /// The ID of the target subscription.
+ /// The name of the resource group. The name is case insensitive.
+ /// The name of the Disk Pool.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task DiskPoolsGet_Validate(string subscriptionId, string resourceGroupName, string diskPoolName, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1);
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90);
+ await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._]*[0-9A-Za-z]$");
+ await eventListener.AssertNotNull(nameof(diskPoolName),diskPoolName);
+ }
+ }
+
+ /// Gets a list of DiskPools in a resource group.
+ /// The ID of the target subscription.
+ /// The name of the resource group. The name is case insensitive.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task DiskPoolsListByResourceGroup(string subscriptionId, string resourceGroupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-04-01-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.StoragePool/diskPools"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.DiskPoolsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Gets a list of DiskPools in a resource group.
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A