You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$response = Invoke-vRARestMethod -Method GET -Uri "/policy/api/policies"
Expected behavior
Return the first page of policies - or, ideally, cycle through all pages and return all the policies
Actual behavior
Gets stuck in infinite loop fetching data.
I believe this is because the /policy/api/policies endpoint returns the standard paginated portion of the payload, including the property 'last' which is used by Invoke-vRARestMethod to identify paginated data and auto-request the next page by using the 'page' parameter. Except that the /policy/api/policies endpoint appears to ignore the 'page' parameter (using $skip and $top instead), so it continually returns the same set of results and so 'last' is never reached.
Environment data
>$PSVersionTable
Name Value
---------
PSVersion 7.2.7
PSEdition Core
GitCommitId 7.2.7
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://[FQDN]
Token : eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjEwMTcwNjYzODc5MTk4NDA1NzcxIn0...K7ZYqD8jPfTqubk5080wklQJ6SvqNCjLFUe08GsWA
RefreshToken : Ap1X0X...4V9ibSBK
APIVersion : 2021-07-15
SignedCertificates : True
SslProtocol : Default> (Get-Module PowervRA).Version
Major Minor Build Revision
-----------------------520-1
The text was updated successfully, but these errors were encountered:
Steps to reproduce
$response = Invoke-vRARestMethod -Method GET -Uri "/policy/api/policies"
Expected behavior
Return the first page of policies - or, ideally, cycle through all pages and return all the policies
Actual behavior
Gets stuck in infinite loop fetching data.
I believe this is because the
/policy/api/policies
endpoint returns the standard paginated portion of the payload, including the property 'last' which is used byInvoke-vRARestMethod
to identify paginated data and auto-request the next page by using the 'page' parameter. Except that the/policy/api/policies
endpoint appears to ignore the 'page' parameter (using $skip and $top instead), so it continually returns the same set of results and so 'last' is never reached.Environment data
The text was updated successfully, but these errors were encountered: