Using the REST API with multiple concurrent requests

Hello everyone,

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.

Thank you!

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?

Hi, thanks for your answer.
Currently I’m retrieving all the actions with the request:
/api/actions

Then I get the status for all actions with this request:
/api/action/{action id}/status

Is it possible to request all the status in the first place?

Thank you!

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

3 Likes

Hi thank you for the reply.

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 :smiley:
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.

Here is the last run:

Thank you!

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.

2 Likes