(imported topic written by cwmenard)
Anyone have any pointers or tips on how to programmatically export content? Fixlets and tasks for an example and retain/return them to the proper XML format.
(imported topic written by cwmenard)
Anyone have any pointers or tips on how to programmatically export content? Fixlets and tasks for an example and retain/return them to the proper XML format.
(imported comment written by SystemAdmin)
I have thought about making a tool which will export all custom content for backup and file system uses.
I haven’t gotten anywhere with developing it but my first thoughts turn to the console API for doing this.
(imported comment written by SystemAdmin)
You can use the SOAP API with WebReports. That will let you evaluate session relevance against the Web Reports data which can be used to get Fixlet XML.
This is an example SOAP request for relevance evaluation:
<s:Envelope xmlns:s=“http://schemas.xmlsoap.org/soap/envelope/”>
<s:Body xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=“http://www.w3.org/2001/XMLSchema”>
bes fixlet whose (id of it is 701) as xml
bigfix
bigfix
</s:Body>
</s:Envelope>
Q: bes fixlet whose (id of it is 701) as xml
Multiple results can be returned as well.
An example response would be:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/”>
BES FIXLET XML
</soapenv:Body>
</soapenv:Envelope>
(imported comment written by cwmenard)
Q: bes fixlet whose (id of it is 701) as xml
E: The operator “string” is not defined.
That doesn’t seem to work in web reports.
(imported comment written by PeterLoer)
The issue here is that the xml string returned is of a relevance type “utf8 string” that doesn’t coerce into a normal relevance string… you can see the same problem if you put that same relevance into the presentation debugger inside the console.
As an example of how it is still possible to work with the data, in the console you can’t evaluate this relevance as string, but you the following will work if you put it into the “evaluate as presentation” mode:
Basically, because this data type does not coerce to string, it is hard to work with it in the relevance tools, but if you are actually interacting with it programmatically through the apis you should be fine.
(we have opened an internal issue to add the coerce to string capability in the future to make this easier to work with)
cheers,
peter
(imported comment written by cwmenard)
Thanks for the update Peter. Shouldn’t this work through SOAP though?
My SOAP request:
<s:Envelope xmlns:s=“http://schemas.xmlsoap.org/soap/envelope/”>
<s:Body xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=“http://www.w3.org/2001/XMLSchema”>
bes fixlets whose (id of it is 411802) as xml
username
password
</s:Body>
</s:Envelope>
My XML return:
<env:Envelope xmlns:env=“http://schemas.xmlsoap.org/soap/envelope/”>
env:Client
The operator “string” is not defined.
</env:Fault>
</env:Body>
</env:Envelope>
The Raw return:
HTTP/1.1 200 OK
Content-type: text/xml
Transfer-Encoding: chunked
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env=“http://schemas.xmlsoap.org/soap/envelope/”>
env:Client
The operator “string” is not defined.
</env:Fault>
</env:Body>
</env:Envelope>
(imported comment written by JoshPena)
Has anyone been able to provide a working model of this yet? I am using a PHP script to execute a SOAP query that would ideally return the fixlets as xml so I can programmitcally parse the various fields. I can get any session relevance query to execute successfully except the " as xml" as described above.
(imported comment written by cwmenard)
If you’re on version 9.x you can use the RESTAPI for this quite easily. For some good info
http://www.bigfix.me/restapi
(imported comment written by JoshPena)
Thank you for the quick response. Unfortunately, our entire environment (consisting of at least nine TEM servers) is using version 8.2. Anything else you’re aware of that might help me get this working?
(imported comment written by cwmenard)
Before we upgraded to 9, I used the BESAPI COM objects to do this. You may look in that direction. That was the only way I was able to get the complete Fixlet/Task xml out.
(imported comment written by Lee Wei 2)
Here is one idea.
Web Reports actually has an HTTP XML interface, where you can send Session Relevance queries via HTTP and get results back in XML.
This should be documented in the Web Reports User’s Guide. It has the following form.
http://[webreports_server]:[port_number]/webreports?page=EvaluateRelevanceOnly&Username=leewei&Password=welcome&expr=[Session Relevance Statement]
An example would be:
http://localhost:52312/webreports?page=EvaluateRelevanceOnly&Username=leewei&Password=welcome&expr=number of bes computers
Or:
http://localhost:52312/webreports?page=EvaluateRelevanceOnly&Username=leewei&Password=welcome&expr=(name of it, id of it, source severity of it) of bes fixlets whose (current date - source release date of it < 43 * day)
(imported comment written by JoshPena)
Interesting, I was unaware of that (I typically just use the web reports QNA for adhoc session relevance queries).
Unfortunately, this still returns the same error, because it is expecting a “normal string” to be returned, but the " as xml" inspector returns a “utf8 string” containing the actual xml document that represents the fixlet.