Big Fix Rest API to get List of patches installed on server in last 30 days

Hi i need to use big fix rest api to get list of computers with the list of patches installed on them in last 30 days

Below is relevance query i am using

(names of computers of it, names of actions of it, exit codes of it,statuses of it,detailed statuses of it,values of results from (bes properties "WK_Patch_Class") of computers of it,names of issuers of actions of it,start times of it,end times of it) of results of bes actions whose (exists end date of it and now > ((end date of it as string & " " & end time_of_day of it as string & " " & local time zone as string) as time) and now - ((end date of it as string & " " & end time_of_day of it as string & " " & local time zone as string) as time) < 30*day)

this works when i use web reports ie https://:8083/webreports?page=QNA

but i cant use it in rest api gives zero result

Depending on the client you use to connect to REST API, you may need to URL-encode the query.

Hi

https://:52311/api/query?relevance=%28names%20of%20computers%20of%20it%2C%20names%20of%20actions%20of%20it%2C%20exit%20codes%20of%20it%2Cstatuses%20of%20it%2Cdetailed%20statuses%20of%20it%2Cvalues%20of%20results%20from%20%28bes%20properties%20%22WK_Patch_Class%22%29%20of%20computers%20of%20it%2Cnames%20of%20issuers%20of%20actions%20of%20it%2Cstart%20times%20of%20it%2Cend%20times%20of%20it%29%20of%20results%20of%20bes%20actions%20whose%20%28exists%20end%20date%20of%20it%20and%20now%20%3E%20%28%28end%20date%20of%20it%20as%20string%20%26%20%22%20%22%20%26%20end%20time_of_day%20of%20it%20as%20string%20%26%20%22%20%22%20%26%20local%20time%20zone%20as%20string%29%20as%20time%29%20and%20now%20-%20%28%28end%20date%20of%20it%20as%20string%20%26%20%22%20%22%20%26%20end%20time_of_day%20of%20it%20as%20string%20%26%20%22%20%22%20%26%20local%20time%20zone%20as%20string%29%20as%20time%29%20%3C%2030%2Aday%29

tried it still same result This XML file does not appear to have any style information associated with it. The document tree is shown below.

<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd">
<Query Resource="(names of computers of it, names of actions of it, exit codes of it,statuses of it,detailed statuses of it,values of results from (bes properties "WK_Patch_Class") of computers of it,names of issuers of actions of it,start times of it,end times of it) of results of bes actions whose (exists end date of it and now > ((end date of it as string & " " & end time_of_day of it as string & " " & local time zone as string) as time) and now - ((end date of it as string & " " & end time_of_day of it as string & " " & local time zone as string) as time) < 30*day)">
<Result/>
<Evaluation>
<Time>0.118ms</Time>
<Plurality>Plural</Plurality>
</Evaluation>
</Query>
</BESAPI>

Try starting simpler. Try these queries in REST -

Number of bes actions


Names of bes actions

If these give expected results, start adding the action filters and see where/if you end up with empty results.

i get results via web reports for

image

but not via rest api

my goal is to get servers with below information
last patch installation date
missing security patches to be installed
list of patches installed

its fine if this can be achieved in any other way

Ok, that’s strange and indicates a configuration problem somewhere.

  • Are you using the same account in Web Reports as in REST API? I’d check that the API account has the rights “Show other operators Actions” and has management rights to the computers that ran the action.

  • When you use the Console, is the Web Reports link in the Console correct? If there are multiple Web Reports servers, or the Root server cannot reach Web Reports, that could explain the REST query failing (but in that case I’d expect a 503 error indicating Web Reports is not available, not just an empty result, actually)