When passing in objects to Get-SkylineAffectedObject, it was possible for duplicate queries to be invoked for the same product. This commit fixes that by moving some of the string manipulation inside the correct loop for this function. Additionally, the text replace lines were consolidated to reduce some confusion with variable assignment that led to this bug in the first place.
Signed-off-by: Brian Wuchner <brian.wuchner@gmail.com>
I accidentally committed a version with a query problem in Get-SkylineAffectedObject. This version does not contain that search problem.
Signed-off-by: Brian Wuchner <brian.wuchner@gmail.com>
Apologies for the delay on getting this commit to address the final open item in the PR. This change removes the "hit a 429 and retry" logic as it was not effective. Replaced it with a global variable that stores the time of the last query. If a query has happened within the last 501ms we wait before sending. I've issued a few thousand queries with this logic added and have not yet hit the 429 error. The logic to find and report on 429's in a more friendly way still exists, just in case.
Additionally I've implemented a counter to track number of queries that is reset by Connect-SkylineInsights, to track how many queries are executed. This was more of a debugging tool, but felt the overhead was low enough to leave it in for future troubleshooting.
Signed-off-by: Brian Wuchner <brian.wuchner@gmail.com>
Fixing minor issue uncovered by testing where only a product (vCenter Name) was passed to Get-SkylineFinding function. When passed by pipeline, the product was applied to each pipeline input. Making a change to require passing through pipeline by property name only.
Signed-off-by: Brian Wuchner <brian.wuchner@gmail.com>
Initial commit of VMware.SkylineInsightsApi module, containing the following functions:
Connect-SkylineInsights, Disconnect-SkylineInsights, Invoke-SkylineInsightsApi, Get-SkylineFinding, Get-SkylineAffectedObject, Format-SkylineResult, Start-SkylineInsightsApiExplorer
Signed-off-by: Brian Wuchner <brian.wuchner@gmail.com>