Skip to content

Commit

Permalink
Migrate VMware from generation to main (#24503)
Browse files Browse the repository at this point in the history
* Move VMware to main

* Update ChangeLog.md

---------

Co-authored-by: Vincent Dai <[email protected]>
  • Loading branch information
azure-powershell-bot and vidai-msft authored Mar 25, 2024
1 parent ab525e6 commit b316bfb
Show file tree
Hide file tree
Showing 416 changed files with 8,277 additions and 881 deletions.
24 changes: 14 additions & 10 deletions src/VMware/VMware.Autorest/Az.VMware.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,41 @@

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

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

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


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

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

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

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

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

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

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


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

# Export nothing to clear implicit exports
Export-ModuleMember

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

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

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

---

## Info
- Modifiable: yes
- Generated: all
Expand Down Expand Up @@ -48,17 +47,19 @@ In this directory, run AutoRest:
commit: 0baf811c3c76c87b3c127d098519bd97141222dd
require:
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
input-file:
- $(repo)/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/vmware.json

module-version: 0.4.0
title: VMware
subject-prefix: $(service-name)
disable-transform-identity-type: true
flatten-userassignedidentity: false

support-json-input: false

directive:
- from: swagger-document
- from: swagger-document
where: $.definitions.AdminCredentials.properties.nsxtPassword
transform: >-
return {
Expand All @@ -68,7 +69,7 @@ directive:
"x-ms-secret": true,
"format": "password"
}
- from: swagger-document
- from: swagger-document
where: $.definitions.AdminCredentials.properties.vcenterPassword
transform: >-
return {
Expand Down Expand Up @@ -136,7 +137,7 @@ directive:
# verb: Test
# subject: ^LocationTrialAvailability$
# hide: true
# Remove the list variant as the workloadNetwork only have one enum value
# Remove the list variant as the workloadNetwork only have one enum value
- where:
verb: Get
subject: WorkloadNetwork
Expand Down
10 changes: 8 additions & 2 deletions src/VMware/VMware.Autorest/exports/Get-AzVMwareAddon.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT <IVMwareIdentity>: Identity Parameter
INPUTOBJECT <IVMwareIdentity>: Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
[AddonName <String>]: Name of the addon for the private cloud
[AuthorizationName <String>]: Name of the ExpressRoute Circuit Authorization in the private cloud
[CloudLinkName <String>]: Name of the cloud link resource
Expand Down Expand Up @@ -183,7 +183,13 @@ begin {
GetViaIdentity = 'Az.VMware.custom\Get-AzVMwareAddon';
}
if (('List', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
10 changes: 7 additions & 3 deletions src/VMware/VMware.Autorest/exports/Get-AzVMwareAuthorization.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,12 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
# Identity Parameter
# To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table.
${PrivateCloudInputObject},

[Parameter()]
Expand Down Expand Up @@ -221,7 +219,13 @@ begin {
List = 'Az.VMware.private\Get-AzVMwareAuthorization_List';
}
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
10 changes: 7 additions & 3 deletions src/VMware/VMware.Autorest/exports/Get-AzVMwareCloudLink.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,12 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
# Identity Parameter
# To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table.
${PrivateCloudInputObject},

[Parameter()]
Expand Down Expand Up @@ -221,7 +219,13 @@ begin {
List = 'Az.VMware.private\Get-AzVMwareCloudLink_List';
}
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
10 changes: 7 additions & 3 deletions src/VMware/VMware.Autorest/exports/Get-AzVMwareCluster.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,12 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
# Identity Parameter
# To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table.
${PrivateCloudInputObject},

[Parameter()]
Expand Down Expand Up @@ -221,7 +219,13 @@ begin {
List = 'Az.VMware.private\Get-AzVMwareCluster_List';
}
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,13 @@ begin {
List = 'Az.VMware.private\Get-AzVMwareClusterZone_List';
}
if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
11 changes: 7 additions & 4 deletions src/VMware/VMware.Autorest/exports/Get-AzVMwareDatastore.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -167,21 +167,18 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
# Identity Parameter
# To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table.
${ClusterInputObject},

[Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
# Identity Parameter
# To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table.
${PrivateCloudInputObject},

[Parameter()]
Expand Down Expand Up @@ -266,7 +263,13 @@ begin {
List = 'Az.VMware.private\Get-AzVMwareDatastore_List';
}
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,12 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
# Identity Parameter
# To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table.
${PrivateCloudInputObject},

[Parameter()]
Expand Down Expand Up @@ -221,7 +219,13 @@ begin {
List = 'Az.VMware.private\Get-AzVMwareGlobalReachConnection_List';
}
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,21 +167,18 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
# Identity Parameter
# To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table.
${ClusterInputObject},

[Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
# Identity Parameter
# To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table.
${PrivateCloudInputObject},

[Parameter()]
Expand Down Expand Up @@ -266,7 +263,13 @@ begin {
List = 'Az.VMware.private\Get-AzVMwarePlacementPolicy_List';
}
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

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

0 comments on commit b316bfb

Please sign in to comment.