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

Pinned topic REST API /analysis/

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

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
    30 Posts

    Re: REST API /analysis/


    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
    30 Posts

    Re: REST API /analysis/


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

  • lynchmv
    2 Posts

    Re: REST API /analysis/


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

    I found the perl 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:


    I edited 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:



    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 ===


    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



    Hope that helps.