We have got requirements to check expired action in last two hours and identify list of servers which not been patched (whose status does not shows as completed or pending restart).
Can anyone please guide how to collect this information using rest api query.
You would probably want to use the query resource for this one. Your query would have to be written in BigFix relevance language.
Tricky part of this query is defining “last two hours”. Are your actions setup in client local time or in UTC? If they are setup in client local time then “last two hours” would be time zone dependent. To create the proper query, you would also need a time zone property for each computer.
Hi @Shweta1, Did you find a solution for this query ?
We are willing to extract a list of Expired/Stopped Jobs (Excluding some operators) using REST API for which we are looking for suggestions. Can anyone please suggest
But this says: This inspector was deprecated after version 5.0 and now only returns False.
I think this is probably because this is when the option to do UTC was introduced. I wish it would just be normalized and always return the value as UTC instead of just being deprecated, but I think this is also an issue since I don’t think the metadata stores it in a way that is obvious to map to UTC.
This is technically correct depending on the time of day. “current date” never includes time in the result, only the date.
Is it possible to parse Date and time in API which will fetch Action status?
For example, if Action start Date & time was 10th-Jan-2021 10 AM UTC and action went to expired state then API to provide the status of the Server and patch is applied or not
You’d need to do the time manipulations in a higher-level language like Python or PowerShell and generate your API calls based on that. The API won’t do this for you, but you can do just about anything in a higher-level language by invoking the API.