PowervRA icon indicating copy to clipboard operation
PowervRA copied to clipboard

Cmdlet can only return 100 objects regardless of the value from the Limit parameter

Open leander091 opened this issue 5 years ago • 6 comments

Steps to reproduce

  • Populate a VRA infrastrcture with more than 100 custom groups.
  • Execute a Cmdlet like Get-vRAGroupPrincipal -Limit 999 -Verbose
  • You will see that only the first 100 will be returned as a object when you count the members.
  • If you execute the linked REST request like https://vraurl/identity/api/tenants/tenantname/groups?limit=999 the full list will be returned.

Expected behavior

Return every group specified in the VRA infrastructure and set the limit based on the -Limit parameter.

Actual behavior

The actual behavior is that only the first 100 groups will be returned and that the limit parameter is not working as expected.

Environment data

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.3
PSEdition                      Core
GitCommitId                    6.1.3
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

$vRAConnection

Server             : https://vrafqdn
Token              :  sensitive
Tenant             : tenantname
Username        : username
APIVersion       : 7.4
SignedCertificates : True
SslProtocol        : Default

leander091 avatar Mar 21 '19 21:03 leander091

It is a limit of the rest API, using a rest client, you will also get this behavior even when trying to force a bigger limit you can use the following synthax to get around it: -limit "100&page=2" and increment the page number

nuclear12 avatar Mar 25 '19 17:03 nuclear12

@nuclear12 Thanks for your answer, however this project is a Powershell implementation to query the REST api.

Maybe this fix could be integrated by the maintainers of the repo.

leander091 avatar Mar 28 '19 18:03 leander091

@leander091 Old ticket, but this should be fixed with PR #232. Can this issue be closed?

martin9700 avatar Nov 01 '21 15:11 martin9700

@martin9700, This issue is related to vRA7 with an different API. So if this PR could be back-ported to the version of powerVRA (3.7.0) which support vRA7 then this issue could be closed.

leander091 avatar Nov 16 '21 18:11 leander091

I created in the past an draft of an own implementation of pagination support for vRA7. I am going to test my solution and contribute it if it is works as expected

leander091 avatar Nov 16 '21 18:11 leander091

Sounds good, I don't have access to vRA7 so wouldn't be able to help.

martin9700 avatar Nov 16 '21 18:11 martin9700