Dan P Posted May 14, 2021 Posted May 14, 2021 I have what was a working PowerShell script to get a list of all my systems in Pulseway. It is no longer working. I am getting a 200 response, just no data. I even tried to replicate it in Node JS since there is official documentation for it, but I get the same response - 200 but no data. $username = 'administrator' $password = '*************' #Adding credentials to header $header = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("$($username):$($password)")) } #Call API to return first 100 systems - calls are limited to 100 results $first100 = Invoke-RestMethod -uri https://xxxxxxxxxxxx.pulseway.com/api/v2/systems -Method GET -Header $header -ContentType "application/json" #Call API to return second 100 systems using offset of 100 as a query $second100 = Invoke-RestMethod -uri https://xxxxxxxxxxx.pulseway.com/api/v2/systems?offset=100 -Method GET -Header $header -ContentType "application/json" #Create and calculate variable for total number of systems counted $total = 0 $total += $first100.data.length $total += $second100.data.length Foreach ($r in $first100.data) { If ($r.name[6] -match "-" -and $r.group -match "US Workstations") { Write-Host $r.name } } Foreach ($r in $second100.data) { If ($r.name[6] -match "-" -and $r.group -match "US Workstations") { Write-Host $r.name }
WYE Posted May 20, 2021 Posted May 20, 2021 I cannot replicate the issue: I have just run your script, only modifying the password, the URI, and I removed the IF statement so it returned all hosts. It worked first time. I suggest you raise this with Support, as it is most likely to be something with your tenancy - and hopefully they can see why? Would appreciate you posting the solution if you get it! I'm going to embark on API integration soon, so I may come across similar issues! Thanks,
Jamie Taylor Posted May 21, 2021 Posted May 21, 2021 Hey Dan, This was a bug and it is fixed recently. The script should work now, please check.
WYE Posted May 21, 2021 Posted May 21, 2021 (edited) @Jamie Taylor - I've mentioned this before to our account manager and in general feedback, but is it possible that customers could get a list of defects resolved per release? Its frustrating to not know what has or hasn't been fixed. All we see in the release notes is the new features, not development that has improved existing functionality. FYI - This should not be a feature request, this is something nearly all SaaS companies do in one way or another. Please don't direct me to the feature request upvoting site! Edited May 21, 2021 by WYE missed out the word "not"!
Jamie Taylor Posted May 21, 2021 Posted May 21, 2021 Hey, Sure, I understand your point of view, I will bring it up to the dev team ASAP, so the release notes can include more details. Thanks for the feedback!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now