I am working on a PowerShell script to get status information about all actions in our environment.
Due to the large number of actions this process takes a couple of hours.
I understand that this might be because there are too many actions, and this is the reason for the script.
My question is, is it possible to run multiple concurrent requests? I’ve adjusted the script to run multiple tasks in parallel (anywhere from 2 to 300) and didn’t noticed a speed increase.
if you are checking multiple actions at the same time, maybe you could pull the BigFix data for all those actions in one single REST API call and do the processing on your code?
You could post a session relevance expression to the rest api to pull all the actions, or a subset based on whatever your search criteria would be, to pull the data back as an xml or json output, then process that programmatically.
An example of session relevance you may be able to build upon and its XML result
(ids of it, states of it, statuses of results of it, names of it) of bes actions
I tried your approach and it looks like it works.
I just had to modify the query to include the start time and filter only tasks older than 30 days.
When running without the filter after 4 hours it drained all the memory of my VM
With the filter took under 2 minutes.
That solved my problem, but I’m still curious though, if the API manages multiple requests in parallel. Do you know if it supports? Maybe in the future it will be useful.
The API certainly can handle concurrent requests. The performance will depend upon your architecture, the number of endpoints reporting to your root server and the queries you are running, among other factors.