Efficient API call to pull external + custom sites

I am trying to hammer out a relevance api call (REST API) for getting a list of all sites in bigfix along with their subscribed computers if the sitename contains “CIS”. These CIS sites can be both external and custom type sites.

I’ve made it this far:

(id of items 0 of it, name of items 0 of it, display name of items 1 of it) of (subscribed computers of it, it) of all bes sites whose (display name of it as lowercase contains "cis")

Average time ~:200ms

(id of items 0 of it, name of items 0 of it, display name of items 1 of it) of (subscribed computers of it, it) of bes sites whose (display name of it as lowercase contains "cis")

Average ~:60ms

(id of items 0 of it, name of items 0 of it, display name of items 1 of it) of (subscribed computers of it, it) of bes custom sites whose (display name of it as lowercase contains "cis")

Average ~:50ms

The problem I am facing is that bes sites does not report the custom sites, all bes sites would look for operator sites as well and it takes too long (3x4 times longer).

I’m wondering if there’s a way of merging the logic of both bes sites and bes custom sites in order to have one efficient API call? The call is part of an automation job that runs once every few hours and potentially could cause significant performance issues on the Bigfix environment.

You’re working on very small gains here, if you are trying to optimize a sub-200 millisecond response, but…you might try

(Bes sites; Bes custom sites) whose (display name of it as lowercase contains "cis")

Depending on your site naming convention, starts with "cis" should be faster than contains "cis" and skipping the conversion to lowercase and comparing with “CIS” should help too.

Thank you for your help, but I already tried (bes sites; bes custom sites) and does not seem to work

(id of items 0 of it, name of items 0 of it, display name of items 1 of it) of (subscribed computers of it, it) of (Bes sites; Bes custom sites) whose (display name of it as lowercase starts with "cis")

This expression could not be parsed.

(id of items 0 of it, name of items 0 of it, display name of items 1 of it) of (subscribed computers of it, it) of (All Bes sites) whose (display name of it as lowercase starts with "cis")

Works. “starts with” seems a bit faster indeed, unfortunately custom sites can be lowercase “CIS”, I have to leave the lowercase check in place.

I think I’ll just leave it as it is, thank you so much for your help.