REST API /analysis/

(imported topic written by cstoneba)

is it possible to return all the results of an analysis via the Rest API? I tried u
sing something like
https://BES_SERVER:52311/api/analysis/external/bes%20support/2
04, but it only pulls back details of the analysis, not the actual results of each client.

(imported comment written by BrianPGreen)

I’m not sure whether this is possible. If I recall correctly, it’s possible to get the results of global properties, but I’m not sure it’s possible to get the results of analysis properties. I’ll check it out tomorrow. (Sorry for the super late response).

(imported comment written by BrianPGreen)

I’m sorry, it does not look like this is currently possible.

(imported comment written by lynchmv)

Pulling back custom properties from an analysis is possible, but took some research.

I found the perl RelevanceRequest.pm and example script from IBM that will parse your relevance and return the result. Armed with this, I was able to come up with a script that would pull the needed info.

IBM provided perl module:

https://www.ibm.com/developerworks/community/wikis/home?lang=en#/wiki/Tivoli%20Endpoint%20Manager/page/SOAP%20API%20Example

I edited relExample.pl filling in my data for the server and user/password then after searching the web, came up with the following relevance to return properties from an analysis:

=== BEGIN CODE SNIPPET ===

#!/usr/bin/perl
use RelevanceRequest;

   # use your web reports servername (and specify port if not port 80), username, and password
   my $relRequest = new RelevanceRequest('http://your.tem.server/webreports', 'domain\username', 'password');
  
   # Queries are in the form of "BigFix Session Relevance"
  
   my $query = '((((id of computer of it,name of computer of it,"arch",(values of results from (bes property "DTU-os.arch") of it) of    computer of it as string) of results from (bes computers) whose (relevant flag of it) of (bes fixlets whose (name of it contains      "UNIX Properties")))as string))';
   my @computerNames = $relRequest->evalRel($query) ;
   print join("\n" ,@computerNames );
  
   print "\n";

my $query = ’ ( ( ( ( id of computer of it, name of computer of it, “serviceip”, ( values of results from ( bes property “DTU-service.ip”) of it) of computer of it as string) of results from ( bes computers) whose ( relevant flag of it) of ( bes fixlets whose ( name of it contains “UNIX Properties”))) as string))’;
my @computerNames = $relRequest->evalRel($query) ;
print join("\n" ,@computerNames );

   print "\n";

=== END CODE SNIPPET ===

=== BEGIN OUTPUT SNIPPET ===

36103, , arch, sparc
36865, , arch, s390x
48781, , arch, x86_64
57264, , arch, x86_64
71207, , arch, x86_64
75916, , arch, i386

468228, , serviceip, 10.x.x.x
512635, , serviceip, 10.x.x.x
583479, , serviceip, 10.x.x.x
624223, , serviceip, 10.x.x.x

=== END OUTPUT SNIPPET ===

Hope that helps.