vmware-samples / nsx-t

Sample code for NSX-T APIs
Other
67 stars 27 forks source link

inconsistent IpAddressBlock visibility - powercli VMware.Sdk.Nsx.Policy 4.1.0.21605558 #38

Open abbedsedk opened 1 year ago

abbedsedk commented 1 year ago

Describe the bug

Uppon creation of NSX Project, in the scenario when adding an External ip address block to the project for external connectivity, the Invoke-OrgsOrgIdProjectsProjectIdInfraCreateOrPatchIpAddressBlock command expect a visibility of "EXTERNAL" but before using the invoke command, the Initialize-IpAddressBlock command expect a visibility of "PUBLIC".

Reproduction steps

1.$IpAddressBlock = Initialize-IpAddressBlock -Description $ProjectPUBipBlockId -Id $ProjectPUBipBlockId -Cidr $ProjectPUBcidr -Visibility "EXTERNAL" Initialize-IpAddressBlock: Cannot bind parameter 'Visibility'. Cannot convert value "EXTERNAL" to type "VMware.Bindings.Nsx.Policy.Model.IpAddressBlock+VisibilityEnum". Error: "Unable to match the identifier name EXTERNAL to a valid enumerator name. Specify one of the following enumerator names and try again: PRIVATE, PUBLIC" 2.$IpAddressBlock = Initialize-IpAddressBlock -Description $ProjectPUBipBlockId -Id $ProjectPUBipBlockId -Cidr $ProjectPUBcidr -Visibility "PUBLIC"

  1. Invoke-OrgsOrgIdProjectsProjectIdInfraCreateOrPatchIpAddressBlock -orgId $Orgs -projectId $ProjectName -ipBlockId $ProjectPUBipBlockId -ipAddressBlock $ipAddressBlock -Verbose -Debug Invoke-OrgsOrgIdProjectsProjectIdInfraCreateOrPatchIpAddressBlock: Error calling OrgsOrgIdProjectsProjectIdInfraCreateOrPatchIpAddressBlock: { "details" : "Field level validation errors: {value PUBLIC of property visibility is not one of the allowed values [PRIVATE, EXTERNAL]}", "httpStatus" : "BAD_REQUEST", "error_code" : 255, "module_name" : "common-services", "error_message" : "Field level validation errors: {value PUBLIC of property visibility is not one of the allowed values [PRIVATE, EXTERNAL]}" }

Expected behavior

Initialize-IpAddressBlock should be expecting the same allowed values property of visibility [PRIVATE, EXTERNAL] as Invoke-OrgsOrgIdProjectsProjectIdInfraCreateOrPatchIpAddressBlock

Additional context

No response