REST API call to return Single Actions and Master Actions only (basically Console view)

When calling the Action API to get back a list of actions, it returns all actions even if they are a subaction of a master action. I am looking for a BigFix Rest API that would return a list of actions are are only “master” actions (MultipleActionGroup) or “single” actions (SingleAction). This would basically be the equivalent of the BES Console action view. I assume this would use the Query endpoint but haven’t stumbled on how to do that.

This is a report I currently have, that could be converted to an API call, how does that data line up with what you want?

Jared

1 Like

That’s a great point. There is an opportunity to return more detailed response for all actions than just the standard /actions API that returns Name, LastModified, and ID.

With that in mind I would probably start with:

  • ID
  • Status (Open, Closed, Expired)
  • Name
  • Date Issued
  • Start Time
  • End Time
  • Issued By
  • Type (SingleAction, ActionGroup)

Amazing custom report and post by @JasonWalker, check it out below.

https://github.com/Jwalker107/BigFix/blob/master/Test%20Content/Web%20Reports/dataTables%20-%20Action%20Details%20Report%20by%20Action%20with%20Filters.beswrpt3

Looking at the code behind the report, I suppose I could try and extract and modify the relevance but it’s quite a long query and probably a bit more complicated that I am looking for in my API REST call.

I assume there is someone out there already that a REST API command nearly ready :slight_smile:
It’s pretty straightforward need when working with automation to get all singleaction/actiongroups and then can go from there for reporting, action cleanup, etc.

Yes, I’m not sure which properties you want from the action, but the ‘flags’ will probably cover your filtering needs.

(these are documented at developer.bigfix.com, or if you like exploring yourself, you can use the Introspectors to retrieve things like properties of type "bes action" )

(id of it, name of it) of bes actions whose (single flag of it or top level flag of it)

1 Like

Thanks!

We have a next step!

1 Like

Following up on this. We have been successful in building a report. What we found is we only need “top level flag of it”. That basically returns a list of actions identical to the console, that includes single fixlets that were deployed and baselines. Including singleflag of it, goes to deep, and returns every single action and sub-action.

Here is our python query.

BES_QUERY_RELEVANCE = urllib.parse.quote_plus("""
(id of it,
state of it,
name of it | "Missing",
time issued of it,
time stopped of it as string | "",
name of issuer of it,
End Date of it as string | "",
End Time_Of_Day of it as string | "",
(if (exists Multiple Flag of it | false) then (concatenations "%0A" of (Multiple Flag of it as string)) else ("<none>")),
(if (exists Member Actions of it and exists IDs of Member Actions of it | false) then (concatenations "%0A" of (IDs of Member Actions of it as string)) else ("<none>")),
(if (exists Member Actions of it and exists Names of Member Actions of it | false) then (concatenations "%0A" of (Names of Member Actions of it as string)) else ("<none>")),
Name of Source Fixlet of it as string | "Missing",
Text of Comments of it as string | "")
of bes actions whose (top level flag of it)
""")
3 Likes