EagleML API Client - Example of Use (Sync)

In this example, we launch the EagleMLAPI Client in synchronous mode generating RTR from the command line.

  • RTR is formed from this query:

    -data="EN|EN|ActionType;EXTRACT;StreamName;eagle_ml-2-0_default_out_q;FeedType;ENTITYEXTRACT;maxrows;10;"
  • Metrics are have additional logging in metricsDir folder

  • Extracted data is saved to results folder
  • All necessary libraries required for the process are in the lib folder
  • To start execution we create runapitestSync.cmd file with the following contents:

    set EAGLEAPIPASS=[PASS]
    java -jar lib/eaglemlapiclient-2.1.9.jar -data="EN|EN|ActionType;EXTRACT;StreamName;eagle_ml-2-0_default_out_q;FeedType;ENTITYEXTRACT;maxrows;10;" -execution=sync -endpoint=https://[REGION]/EagleMLWebService20 -login=[LOGIN] -resultsdir=results -csvmetricsdir=metricsdir
  • To set IP address to receive response use (port is optional, any available port is used if value is not set):

    -callback-address=clientipaddress[:port]

This is how a working folder for such parameters should look like:

Run runapitestSync.cmd:

  1. A RunTaskRequest with task parameters from the -data command has been created with corrId EN_LYQMQAFV6LJA:

    INFO  [LINE:1,CORRID:EN_LYQMQAFV6LJA] Executing request.
  2. askStatusResponse with SUCCESS status arrived:

    INFO  TSR status SUCCESS
  3. Extract file has been unzipped and saved to results folder:

    INFO  [LINE:1,CORRID:EN_LYQMQAFV6LJA] Output file results\EN_LYQMQAFV6LJA.xml written in 10 ms

    This extract process can be also examined via Message Center Console:


    The RTR created by EagleML API client in MCC:

    <EagleML xmlnxsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RunTaskRequest" eaglemlVersion="2-0" eaglemlType="RunTaskRequest">
    <header>
    <messageId>EN_LYQMQAFV6LJA</messageId>
    <sentBy>user</sentBy>
    <sendTo>http://www.eagleinvsys.com/eagle_ml-2-0_default_cm_control_message</sendTo>
    <replyTo></replyTo>
    <creationTimestamp>2016-12-08 07:54:59</creationTimestamp>
    </header>
    <taskIdentifier>
    <correlationId correlationIdScheme="correlationIdScheme">EN_LYQMQAFV6LJA</correlationId>
    <businessTaskId correlationIdScheme="businessTaskIdScheme">EN</businessTaskId>
    </taskIdentifier>
    <synchronousExecution>yes</synchronousExecution>
    <taskParameters>
    <taskParameter>
    <name>maxrows</name>
    <value>10</value>
    </taskParameter>
    <taskParameter>
    <name>FeedType</name>
    <value>ENTITYEXTRACT</value>
    </taskParameter>
    <taskParameter>
    <name>ActionType</name>
    <value>EXTRACT</value>
    </taskParameter>
    <taskParameter>
    <name>StreamName</name>
    <value>eagle_ml-2-0_default_out_q</value>
    </taskParameter>
    <taskParameter>
    <name>CompressExtract</name>
    <value>Y</value>
    </taskParameter>
    </taskParameters>
    </EagleML>





    results folder:

    Data extract file has been received and saved to the appropriate folder.