Skip to content

Commit c857402

Browse files
Kdonga/vmware ps 2023 (#23928)
* updated the vmware ps commands to 2023 version * Added Test Recordings * additional testing for ps vmware modules * updated files according to autorest v4 spec * Removed packages lock file * new recordings * additional recording files * cmdlet workload network is hidden * removed the test files for workload network * New Recordings for additional cmdlts * replace localhost to management.azure.com * Add missing examples * added tests for the missing examples * made updates to AzVMwareGlobalReachConnection test case --------- Co-authored-by: Ana Arias Rosales <[email protected]>
1 parent f2a637c commit c857402

File tree

187 files changed

+6170
-1958
lines changed

Some content is hidden

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

187 files changed

+6170
-1958
lines changed

src/VMware/VMware.Autorest/Az.VMware.psd1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
DotNetFrameworkVersion = '4.7.2'
1212
RequiredAssemblies = './bin/Az.VMware.private.dll'
1313
FormatsToProcess = './Az.VMware.format.ps1xml'
14-
FunctionsToExport = 'Get-AzVMwareAddon', 'Get-AzVMwareAuthorization', 'Get-AzVMwareCloudLink', 'Get-AzVMwareCluster', 'Get-AzVMwareDatastore', 'Get-AzVMwareGlobalReachConnection', 'Get-AzVMwarePlacementPolicy', 'Get-AzVMwarePrivateCloud', 'Get-AzVMwarePrivateCloudAdminCredential', 'Get-AzVMwareVirtualMachine', 'New-AzVMwareAddon', 'New-AzVMwareAddonSrmPropertiesObject', 'New-AzVMwareAddonVrPropertiesObject', 'New-AzVMwareAuthorization', 'New-AzVMwareCloudLink', 'New-AzVMwareCluster', 'New-AzVMwareDatastore', 'New-AzVMwareGlobalReachConnection', 'New-AzVMwarePlacementPolicy', 'New-AzVMwarePrivateCloud', 'New-AzVMwarePrivateCloudNsxtPassword', 'New-AzVMwarePrivateCloudVcenterPassword', 'New-AzVMwarePSCredentialExecutionParameterObject', 'New-AzVMwareScriptSecureStringExecutionParameterObject', 'New-AzVMwareScriptStringExecutionParameterObject', 'New-AzVMwareVmHostPlacementPolicyPropertiesObject', 'New-AzVMwareVMPlacementPolicyPropertiesObject', 'Remove-AzVMwareAddon', 'Remove-AzVMwareAuthorization', 'Remove-AzVMwareCloudLink', 'Remove-AzVMwareCluster', 'Remove-AzVMwareDatastore', 'Remove-AzVMwareGlobalReachConnection', 'Remove-AzVMwarePlacementPolicy', 'Remove-AzVMwarePrivateCloud', 'Test-AzVMwareLocationQuotaAvailability', 'Test-AzVMwareLocationTrialAvailability', 'Update-AzVMwareCluster', 'Update-AzVMwarePlacementPolicy', 'Update-AzVMwarePrivateCloud', '*'
15-
AliasesToExport = '*'
14+
FunctionsToExport = 'Get-AzVMwareAddon', 'Get-AzVMwareAuthorization', 'Get-AzVMwareCloudLink', 'Get-AzVMwareCluster', 'Get-AzVMwareClusterZone', 'Get-AzVMwareDatastore', 'Get-AzVMwareGlobalReachConnection', 'Get-AzVMwarePlacementPolicy', 'Get-AzVMwarePrivateCloud', 'Get-AzVMwarePrivateCloudAdminCredential', 'Get-AzVMwareVirtualMachine', 'New-AzVMwareAddon', 'New-AzVMwareAddonSrmPropertiesObject', 'New-AzVMwareAddonVrPropertiesObject', 'New-AzVMwareAuthorization', 'New-AzVMwareCloudLink', 'New-AzVMwareCluster', 'New-AzVMwareDatastore', 'New-AzVMwareGlobalReachConnection', 'New-AzVMwareIdentitySourceObject', 'New-AzVMwarePlacementPolicy', 'New-AzVMwarePrivateCloud', 'New-AzVMwarePrivateCloudNsxtPassword', 'New-AzVMwarePrivateCloudVcenterPassword', 'New-AzVMwarePSCredentialExecutionParameterObject', 'New-AzVMwareScriptSecureStringExecutionParameterObject', 'New-AzVMwareScriptStringExecutionParameterObject', 'New-AzVMwareVmHostPlacementPolicyPropertiesObject', 'New-AzVMwareVMPlacementPolicyPropertiesObject', 'Remove-AzVMwareAddon', 'Remove-AzVMwareAuthorization', 'Remove-AzVMwareCloudLink', 'Remove-AzVMwareCluster', 'Remove-AzVMwareDatastore', 'Remove-AzVMwareGlobalReachConnection', 'Remove-AzVMwarePlacementPolicy', 'Remove-AzVMwarePrivateCloud', 'Test-AzVMwareLocationQuotaAvailability', 'Test-AzVMwareLocationTrialAvailability', 'Update-AzVMwareAuthorization', 'Update-AzVMwareCloudLink', 'Update-AzVMwareCluster', 'Update-AzVMwareDatastore', 'Update-AzVMwareGlobalReachConnection', 'Update-AzVMwarePlacementPolicy', 'Update-AzVMwarePrivateCloud'
1615
PrivateData = @{
1716
PSData = @{
1817
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'VMware'

src/VMware/VMware.Autorest/README.md

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,17 @@ In this directory, run AutoRest:
4747
> see https://aka.ms/autorest
4848
4949
``` yaml
50-
commit: 2e665b044670074d91e8a9e6d04f23fbe3c8a06e
50+
commit: 0baf811c3c76c87b3c127d098519bd97141222dd
5151
require:
5252
- $(this-folder)/../../readme.azure.noprofile.md
5353
input-file:
54-
- $(repo)/specification/vmware/resource-manager/Microsoft.AVS/stable/2021-12-01/vmware.json
54+
- $(repo)/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/vmware.json
5555

5656
module-version: 0.4.0
5757
title: VMware
5858
subject-prefix: $(service-name)
5959

60-
identity-correction-for-post: true
61-
resourcegroup-append: true
62-
nested-object-to-string: true
63-
64-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
65-
use-extension:
66-
"@autorest/powershell": "3.x"
60+
support-json-input: false
6761

6862
directive:
6963
- from: swagger-document
@@ -87,7 +81,7 @@ directive:
8781
"format": "password"
8882
}
8983
- where:
90-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
84+
variant: ^(Create|Update)(?!.*?Expanded)
9185
remove: true
9286
- where:
9387
variant: ^Restrict$|^RestrictViaIdentity$
@@ -125,12 +119,47 @@ directive:
125119
remove: true
126120
- where:
127121
verb: Test
128-
subject: ^LocationTrialAvailability$|^LocationQuotaAvailability$
122+
subject: ^LocationQuotaAvailability$
129123
variant: ^CheckViaIdentity$
130124
remove: true
125+
# Remove v4 variant
126+
- where:
127+
verb: Test
128+
subject: ^LocationTrialAvailability$
129+
variant: ^Check$|CheckViaIdentity
130+
remove: true
131+
- where:
132+
verb: New
133+
subject: PrivateCloud
134+
variant: CreateViaIdentityExpanded
135+
remove: true
136+
# custom set SKU Name optional
137+
# - where:
138+
# verb: Test
139+
# subject: ^LocationTrialAvailability$
140+
# hide: true
141+
# Remove the list variant as the workloadNetwork only have one enum value
142+
- where:
143+
verb: Get
144+
subject: WorkloadNetwork
145+
# variant: List
146+
hide: true
147+
# Hide parent object variant to fix 'multiple types define RestrictMovement [string, IVirtualMachineRestrictMovement]'
148+
- where:
149+
verb: Lock
150+
subject: VirtualMachineMovement
151+
variant: ^RestrictViaIdentityCluster$|^RestrictViaIdentityPrivateCloud$
152+
remove: true
153+
# Hide HcxEnterpriseSite, ScriptExecution, Addon update
154+
- where:
155+
verb: Update
156+
subject: HcxEnterpriseSite|ScriptExecution|Addon
157+
remove: true
131158
- no-inline:
132159
- AddonProperties
133160
- PlacementPolicyProperties
161+
- model-cmdlet:
162+
- model-name: IdentitySource
134163
# Re-name and custom it
135164
# - model-cmdlet:
136165
# - VMPlacementPolicyProperties
Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "locations",
3-
"apiVersion": "2021-12-01",
3+
"apiVersion": "2023-03-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
66
},
@@ -37,39 +37,6 @@
3737
]
3838
}
3939
]
40-
},
41-
{
42-
"name": "Test-AzVMwareLocationTrialAvailability",
43-
"description": "Return trial status for subscription by region",
44-
"path": "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability",
45-
"help": {
46-
"learnMore": {
47-
"url": "https://learn.microsoft.com/powershell/module/az.vmware/test-azvmwarelocationtrialavailability"
48-
},
49-
"parameterSets": [
50-
{
51-
"parameters": [
52-
"-Location <String>",
53-
"[-SubscriptionId <String>]"
54-
]
55-
}
56-
]
57-
},
58-
"examples": [
59-
{
60-
"description": "Return trial status for subscription by region",
61-
"parameters": [
62-
{
63-
"name": "-Location",
64-
"value": "[Path.location]"
65-
},
66-
{
67-
"name": "-SubscriptionId",
68-
"value": "[Path.subscriptionId]"
69-
}
70-
]
71-
}
72-
]
7340
}
7441
]
7542
}

src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-authorizations.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "privateClouds/authorizations",
3-
"apiVersion": "2021-12-01",
3+
"apiVersion": "2023-03-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
66
},

src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-cloudLinks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "privateClouds/cloudLinks",
3-
"apiVersion": "2021-12-01",
3+
"apiVersion": "2023-03-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
66
},

src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters-datastores.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "privateClouds/clusters/datastores",
3-
"apiVersion": "2021-12-01",
3+
"apiVersion": "2023-03-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
66
},

src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters-placementPolicies.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "privateClouds/clusters/placementPolicies",
3-
"apiVersion": "2021-12-01",
3+
"apiVersion": "2023-03-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
66
},

src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters-virtualMachines.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "privateClouds/clusters/virtualMachines",
3-
"apiVersion": "2021-12-01",
3+
"apiVersion": "2023-03-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
66
},

src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "privateClouds/clusters",
3-
"apiVersion": "2021-12-01",
3+
"apiVersion": "2023-03-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
66
},

src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-globalReachConnections.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "privateClouds/globalReachConnections",
3-
"apiVersion": "2021-12-01",
3+
"apiVersion": "2023-03-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
66
},

src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds.json

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

src/VMware/VMware.Autorest/custom/Get-AzVMwareAddon.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ vr Microsoft.AVS/privateClouds/addons azps_test_group
3636
.Inputs
3737
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity
3838
.Outputs
39-
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon
39+
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon
4040
.Notes
4141
COMPLEX PARAMETER PROPERTIES
4242
@@ -72,7 +72,7 @@ INPUTOBJECT <IVMwareIdentity>: Identity Parameter
7272
https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareaddon
7373
#>
7474
function Get-AzVMwareAddon {
75-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon])]
75+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon])]
7676
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
7777
param(
7878
[Parameter(ParameterSetName='Get', Mandatory)]

src/VMware/VMware.Autorest/custom/New-AzVMwareAddon.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Name Type ResourceGroupName
2828
vr Microsoft.AVS/privateClouds/addons azps_test_group
2929
3030
.Outputs
31-
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon
31+
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon
3232
.Notes
3333
COMPLEX PARAMETER PROPERTIES
3434
@@ -40,7 +40,7 @@ PROPERTY <IAddonProperties>: The properties of an addon resource
4040
https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareaddon
4141
#>
4242
function New-AzVMwareAddon {
43-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon])]
43+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon])]
4444
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
4545
param(
4646
[Parameter(Mandatory)]
@@ -65,7 +65,7 @@ param(
6565

6666
[Parameter()]
6767
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')]
68-
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties]
68+
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties]
6969
# The properties of an addon resource
7070
# To construct, see NOTES section for PROPERTY properties and create a hash table.
7171
${Property},

src/VMware/VMware.Autorest/custom/New-AzVMwareAddonSrmPropertiesObject.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# ----------------------------------------------------------------------------------
32
#
43
# Copyright Microsoft Corporation
@@ -20,12 +19,12 @@
2019
Create a in-memory object for AddonSrmProperties
2120
2221
.Outputs
23-
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonSrmProperties
22+
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonSrmProperties
2423
.Link
2524
https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareAddonSrmPropertiesObject
2625
#>
2726
function New-AzVMwareAddonSrmPropertiesObject {
28-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonSrmProperties')]
27+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonSrmProperties')]
2928
[CmdletBinding(PositionalBinding=$false)]
3029
Param(
3130

@@ -35,7 +34,7 @@
3534
)
3635

3736
process {
38-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonSrmProperties]::New()
37+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonSrmProperties]::New()
3938

4039
$Object.LicenseKey = $LicenseKey
4140
$Object.AddonType = "SRM"

src/VMware/VMware.Autorest/custom/New-AzVMwareAddonVrPropertiesObject.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# ----------------------------------------------------------------------------------
32
#
43
# Copyright Microsoft Corporation
@@ -20,12 +19,12 @@
2019
Create a in-memory object for AddonVrProperties
2120
2221
.Outputs
23-
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonVrProperties
22+
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonVrProperties
2423
.Link
2524
https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareAddonVrPropertiesObject
2625
#>
2726
function New-AzVMwareAddonVrPropertiesObject {
28-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonVrProperties')]
27+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonVrProperties')]
2928
[CmdletBinding(PositionalBinding=$false)]
3029
Param(
3130

@@ -35,7 +34,7 @@
3534
)
3635

3736
process {
38-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonVrProperties]::New()
37+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonVrProperties]::New()
3938

4039
$Object.VrsCount = $VrsCount
4140
$Object.AddonType = "VR"

src/VMware/VMware.Autorest/custom/New-AzVMwarePSCredentialExecutionParameterObject.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
Create a in-memory object for PSCredentialExecutionParameter
2121
2222
.Outputs
23-
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PSCredentialExecutionParameter
23+
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PSCredentialExecutionParameter
2424
.Link
2525
https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwarePSCredentialExecutionParameterObject
2626
#>
2727
function New-AzVMwarePSCredentialExecutionParameterObject {
28-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PSCredentialExecutionParameter')]
28+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PSCredentialExecutionParameter')]
2929
[CmdletBinding(PositionalBinding=$false)]
3030
Param(
3131

@@ -41,7 +41,7 @@
4141
)
4242

4343
process {
44-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PSCredentialExecutionParameter]::New()
44+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PSCredentialExecutionParameter]::New()
4545

4646
$Object.Password = $Password
4747
$Object.Username = $Username

0 commit comments

Comments
 (0)