Skip to content

Kdonga/vmware ps 2023 #23928

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
6daa10f
updated the vmware ps commands to 2023 version
keyurdonga-msft Dec 19, 2023
2472aa7
Added Test Recordings
anaarias-msft Dec 21, 2023
9303248
Merge pull request #1 from AnaAriasRosales/kdonga/vmware-ps-2023
keyurdonga-msft Dec 21, 2023
4be4b8a
additional testing for ps vmware modules
keyurdonga-msft Jan 10, 2024
7abd917
Merge branch 'generation' of https://github.com/keyurdonga-msft/azure…
keyurdonga-msft Jan 10, 2024
a35afb4
updated files according to autorest v4 spec
keyurdonga-msft Jan 11, 2024
b7a1395
Removed packages lock file
keyurdonga-msft Jan 11, 2024
af992d7
new recordings
anaarias-msft Jan 11, 2024
80db0ee
Merge pull request #2 from AnaAriasRosales/kdonga/vmware-ps-2023
keyurdonga-msft Jan 12, 2024
60d1bbc
additional recording files
keyurdonga-msft Jan 12, 2024
14f0830
cmdlet workload network is hidden
keyurdonga-msft Jan 12, 2024
20b2837
removed the test files for workload network
keyurdonga-msft Jan 12, 2024
cbefd2b
New Recordings for additional cmdlts
anaarias-msft Jan 12, 2024
f02570c
Merge pull request #3 from AnaAriasRosales/kdonga/vmware-ps-2023
keyurdonga-msft Jan 12, 2024
72dffdf
replace localhost to management.azure.com
anaarias-msft Jan 18, 2024
01aa0fb
Add missing examples
anaarias-msft Jan 22, 2024
24b25ff
Merge pull request #4 from AnaAriasRosales/kdonga/vmware-ps-2023
keyurdonga-msft Jan 23, 2024
7010cad
added tests for the missing examples
keyurdonga-msft Jan 23, 2024
d936649
made updates to AzVMwareGlobalReachConnection test case
keyurdonga-msft Jan 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/VMware/VMware.Autorest/Az.VMware.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.VMware.private.dll'
FormatsToProcess = './Az.VMware.format.ps1xml'
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', '*'
AliasesToExport = '*'
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'
PrivateData = @{
PSData = @{
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'VMware'
Expand Down
51 changes: 40 additions & 11 deletions src/VMware/VMware.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,17 @@ In this directory, run AutoRest:
> see https://aka.ms/autorest

``` yaml
commit: 2e665b044670074d91e8a9e6d04f23fbe3c8a06e
commit: 0baf811c3c76c87b3c127d098519bd97141222dd
require:
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/vmware/resource-manager/Microsoft.AVS/stable/2021-12-01/vmware.json
- $(repo)/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/vmware.json

module-version: 0.4.0
title: VMware
subject-prefix: $(service-name)

identity-correction-for-post: true
resourcegroup-append: true
nested-object-to-string: true

# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
"@autorest/powershell": "3.x"
support-json-input: false

directive:
- from: swagger-document
Expand All @@ -87,7 +81,7 @@ directive:
"format": "password"
}
- where:
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
variant: ^(Create|Update)(?!.*?Expanded)
remove: true
- where:
variant: ^Restrict$|^RestrictViaIdentity$
Expand Down Expand Up @@ -125,12 +119,47 @@ directive:
remove: true
- where:
verb: Test
subject: ^LocationTrialAvailability$|^LocationQuotaAvailability$
subject: ^LocationQuotaAvailability$
variant: ^CheckViaIdentity$
remove: true
# Remove v4 variant
- where:
verb: Test
subject: ^LocationTrialAvailability$
variant: ^Check$|CheckViaIdentity
remove: true
- where:
verb: New
subject: PrivateCloud
variant: CreateViaIdentityExpanded
remove: true
# custom set SKU Name optional
# - where:
# verb: Test
# subject: ^LocationTrialAvailability$
# hide: true
# Remove the list variant as the workloadNetwork only have one enum value
- where:
verb: Get
subject: WorkloadNetwork
# variant: List
hide: true
# Hide parent object variant to fix 'multiple types define RestrictMovement [string, IVirtualMachineRestrictMovement]'
- where:
verb: Lock
subject: VirtualMachineMovement
variant: ^RestrictViaIdentityCluster$|^RestrictViaIdentityPrivateCloud$
remove: true
# Hide HcxEnterpriseSite, ScriptExecution, Addon update
- where:
verb: Update
subject: HcxEnterpriseSite|ScriptExecution|Addon
remove: true
- no-inline:
- AddonProperties
- PlacementPolicyProperties
- model-cmdlet:
- model-name: IdentitySource
# Re-name and custom it
# - model-cmdlet:
# - VMPlacementPolicyProperties
Expand Down
35 changes: 1 addition & 34 deletions src/VMware/VMware.Autorest/UX/Microsoft.AVS/locations.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "locations",
"apiVersion": "2021-12-01",
"apiVersion": "2023-03-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
},
Expand Down Expand Up @@ -37,39 +37,6 @@
]
}
]
},
{
"name": "Test-AzVMwareLocationTrialAvailability",
"description": "Return trial status for subscription by region",
"path": "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.vmware/test-azvmwarelocationtrialavailability"
},
"parameterSets": [
{
"parameters": [
"-Location <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Return trial status for subscription by region",
"parameters": [
{
"name": "-Location",
"value": "[Path.location]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "privateClouds/authorizations",
"apiVersion": "2021-12-01",
"apiVersion": "2023-03-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "privateClouds/cloudLinks",
"apiVersion": "2021-12-01",
"apiVersion": "2023-03-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "privateClouds/clusters/datastores",
"apiVersion": "2021-12-01",
"apiVersion": "2023-03-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "privateClouds/clusters/placementPolicies",
"apiVersion": "2021-12-01",
"apiVersion": "2023-03-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "privateClouds/clusters/virtualMachines",
"apiVersion": "2021-12-01",
"apiVersion": "2023-03-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "privateClouds/clusters",
"apiVersion": "2021-12-01",
"apiVersion": "2023-03-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "privateClouds/globalReachConnections",
"apiVersion": "2021-12-01",
"apiVersion": "2023-03-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "privateClouds",
"apiVersion": "2021-12-01",
"apiVersion": "2023-03-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.vmware"
},
Expand Down
4 changes: 2 additions & 2 deletions src/VMware/VMware.Autorest/custom/Get-AzVMwareAddon.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ vr Microsoft.AVS/privateClouds/addons azps_test_group
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon
.Notes
COMPLEX PARAMETER PROPERTIES

Expand Down Expand Up @@ -72,7 +72,7 @@ INPUTOBJECT <IVMwareIdentity>: Identity Parameter
https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareaddon
#>
function Get-AzVMwareAddon {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get', Mandatory)]
Expand Down
6 changes: 3 additions & 3 deletions src/VMware/VMware.Autorest/custom/New-AzVMwareAddon.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Name Type ResourceGroupName
vr Microsoft.AVS/privateClouds/addons azps_test_group

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon
.Notes
COMPLEX PARAMETER PROPERTIES

Expand All @@ -40,7 +40,7 @@ PROPERTY <IAddonProperties>: The properties of an addon resource
https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareaddon
#>
function New-AzVMwareAddon {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon])]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
Expand All @@ -65,7 +65,7 @@ param(

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties]
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties]
# The properties of an addon resource
# To construct, see NOTES section for PROPERTY properties and create a hash table.
${Property},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
Expand All @@ -20,12 +19,12 @@
Create a in-memory object for AddonSrmProperties

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonSrmProperties
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonSrmProperties
.Link
https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareAddonSrmPropertiesObject
#>
function New-AzVMwareAddonSrmPropertiesObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonSrmProperties')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonSrmProperties')]
[CmdletBinding(PositionalBinding=$false)]
Param(

Expand All @@ -35,7 +34,7 @@
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonSrmProperties]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonSrmProperties]::New()

$Object.LicenseKey = $LicenseKey
$Object.AddonType = "SRM"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
Expand All @@ -20,12 +19,12 @@
Create a in-memory object for AddonVrProperties

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonVrProperties
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonVrProperties
.Link
https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareAddonVrPropertiesObject
#>
function New-AzVMwareAddonVrPropertiesObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonVrProperties')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonVrProperties')]
[CmdletBinding(PositionalBinding=$false)]
Param(

Expand All @@ -35,7 +34,7 @@
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonVrProperties]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonVrProperties]::New()

$Object.VrsCount = $VrsCount
$Object.AddonType = "VR"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
Create a in-memory object for PSCredentialExecutionParameter

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PSCredentialExecutionParameter
Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PSCredentialExecutionParameter
.Link
https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwarePSCredentialExecutionParameterObject
#>
function New-AzVMwarePSCredentialExecutionParameterObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PSCredentialExecutionParameter')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PSCredentialExecutionParameter')]
[CmdletBinding(PositionalBinding=$false)]
Param(

Expand All @@ -41,7 +41,7 @@
)

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

$Object.Password = $Password
$Object.Username = $Username
Expand Down
Loading