How to query fixlet actions through REST API

Dears, I am quite new to IEM and would like to get a list of available actions for a particular custom site.

After reading the REST API wiki, my current understanding is to user /api/fixlets/custom/mysite to get a list of fixlets in this cusotm site, but it only return fixlet name and id as

MyFixlet
40

There is no information about action in the fixlet or task.

The /api/actions is to get a list of executed actions, but not available action in fixlet.

Then how I can get available actions in fixlet/task in a custom site?

Many thanks! :slight_smile:

I think you’ll need to use a relevance query

https://bigfix:52311/api/query?relevance=

Here’s a similar thread with the relevance you could start with

1 Like

First you should build the session relevance query you need to get the information you are looking for using the “BigFix Session Relevance Tester”: http://bigfix.me/fixlet/details/3969

Once you have the query written, then you can use: https :// bigfix:52311/api/query?relevance= to get the results of the query through the REST API.

I have code that uses the REST API to get session relevance results, among other things, here: https://github.com/jgstew/remote-relevance/blob/master/python/test_receive_results.py

Hi, gearoid and jgstew

thanks very much for so quick help!

I now start to learn about relevance expression, what I got is a document of BES relevance language reference. It provides the basic grammar and keywords, but seems not cover all. For example, based on information in the thread gearoid recommend, here are several tests I did:

  1. use { ids of taken actions of bes fixlets whose (name of it is “Capture Password Never Expires WIN-MULTI”) }, it can return a list of executed actions of this fixlet.
  2. use { ids of actions of bes fixlets whose (name of it is “Capture Password Never Expires WIN-MULTI”) }, it said The operator “ids” is not defined.
  3. use { ids of actions of bes site whose (name of it is “My Windows Site”) }, there is no error message, but the result element is empty.

could you please help share me where I can find the relevance expression doc about getting action, fixlet, etc?
What I want to do is to get all available actions in a site, the result is something like

<site name="My Windows Site">
      **<fixlet id="1">
            **<action name="Action1"/>
            **<action name="Action2"/>
      **</fixlet>
</site>

thanks again! :smile:

Here’s a post on common relevance errors which I hope will help you.
And here’s another post with links to the reference on the relevance language.

Once you get the relevance working and you get the XML you may then have to do some post processing of the XML to get it to the exact format you need.

2 Likes

https://support.bigfix.com/inspectors/Session%20Objects_Any.html#bes%20action

https://support.bigfix.com/inspectors/Session%20Objects_Any.html#bes%20fixlet%20action

The difference is:

  • the bes action is the action which has been taken, in the console this is the Actions which you see listed on the left in their own twisty.
  • the bes fixlet action is the content of the action (like the Action Script) within
    the fixlet itself, in the console when you’re editing a fixlet it’s the Actions on the Action tab.
    In the docs above you’ll see there is no ID property for bes fixlet action

If you want to see the properties of a given object there’s a couple of ways to go:

  • Use the docs above.
  • Use the Console’s Presentation Debugger (ctrl+shift+alt+D ) and use properties of type:
properties of type "bes action"
...
sets of <bes action>: bes action set
unique values of <bes action>: bes action with multiplicity
member action set of <bes action>: bes action set
member actions of <bes action>: bes action
parent group of <bes action>: bes action
reported computer set of <bes action>: bes computer set
results of <bes action>: bes action result
result from <bes computer> of <bes action>: bes action result
id of <bes action>: integer

2 Likes

@gearoid thanks very much! It really helps me a lot! :smiley:

Also see this post:

Also, there are many examples of session relevance on BigFix.me