Topic
  • 3 replies
  • Latest Post - ‏2013-12-06T17:55:24Z by lynchmv
cstoneba
cstoneba
64 Posts

Pinned topic REST API /analysis/

‏2013-09-12T13:01:46Z |

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

 

 

  • BrianPGreen
    BrianPGreen
    30 Posts

    Re: REST API /analysis/

    ‏2013-11-22T08:18:38Z  

    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).

  • BrianPGreen
    BrianPGreen
    30 Posts

    Re: REST API /analysis/

    ‏2013-11-23T00:17:07Z  

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

  • lynchmv
    lynchmv
    2 Posts

    Re: REST API /analysis/

    ‏2013-12-06T17:55:24Z  

    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, <servername>, arch, sparc
    36865, <servername>, arch, s390x
    48781, <servername>, arch, x86_64
    57264, <servername>, arch, x86_64
    71207, <servername>, arch, x86_64
    75916, <servername>, arch, i386

    ...

    468228, <servername>, serviceip,  10.x.x.x
    512635, <servername>, serviceip, 10.x.x.x
    583479, <servername>, serviceip,  10.x.x.x
    624223, <servername>, serviceip, 10.x.x.x

    === END OUTPUT SNIPPET ===

     

    Hope that helps.