I don’t believe you can get the xml output like that by default when using api/query?relevance=. When using api/query?relevance= you’ll get something like this depending on the query.
Ok, perhaps I did not phrase my question right. The response can be any form, XML/JSON/ any other
What I need is to pull all properties associated with computers (including custom/analyse properties) without actually querying for bes properties by name.
This is what i need
{“result”: [
{id: 123456,name: COMPUTERNAME, property1Name: property1Value(s), …},
{id: 123456,name: COMPUTERNAME, property1Name: property1Value(s), …},
…
]}
Purpose: I need to dump the bigfix computer properties snapshots (all that you can see for a computer in the console) in a DB periodically.
Any suggestions? Can this be done using relevance query?
((names of it, (if analysis flag of it=True then name of source analysis of it else "global")) of properties of it, values of it) of property results of (bes computers whose (name of it as lowercase = "computername"))
I want to get snapshot in a single relevance query call for all computers at once. The result expected is either XML/JSON such that I can easily access all properties of computers
For e.g.
Computer 1 => [ array of key value pairs for all its properties]
Computer 2 => [array of key value pairs for all its properties]
What I do NOT want is 1) making multiple queries. 2) result in form where properties are not grouped by computer ids
https://<hostname>:<port>/api/query?output=json&relevance=((id of it), ((names of properties of it, values of it) of property results of it)) of bes computers
It does not have exact data structure you want: it has a computer ID together with each pair property name/value:
I am using something similar. Even though the result is always sorted by computer ids, I was hoping for something that a xml or json parser could parse. Doesn’t seem to be possible at the moment. I shall continue using this and do line by line processing of the response to accumulate all properties for computers. Thanks.