Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can execute Data Services using EQL and Generic Extractor REST APIs. Below are examples showing how to run Data Services extracts using the MC2 Swagger user interface.

Run Data Services Extracts Using Generic Extractor

One option to run EBS extracts is to use the Generic Extractor REST API. You can retrieve the Swagger for the Generic Extractor REST API at:

Code Block
https://eagle-web-server/eagle/v2/generic/extract/api-doc


The Generic Extract REST API allows for the execution of multiple extracts, both standard EagleML extracts and Data Services extracts with one HTTP POST request and returns the extracted data in a ZIP file.

All parameters supported by the Generic Extractor are supported in the REST request.

Execute a Test Request Using the Swagger UI

You can use the Swagger user interface to execute a test REST request.

To execute a test REST request:
 

  1. Open the browser (Chrome) to point to the mc2/swagger-ui.html endpoint:

    Code Block
    https://eagle-web-server/mc2/swagger-ui.html


2. Select Generic Extractor from the dropdown list in the right top corner:

3. Click on eaglegenericextractrestapi, then click on POST and Try It Out:

4. In the Example Value Model, add

Code Block
languagejs
themeConfluence
titleSample Generic Extractor POST Body
{
  "extractParameters": [
    {
      "name": "ebs:default:outputformat",
      "value": "EagleJSON"
    },

    {
      "name": "ebs:default:invalidatecache",
      "value": "Y"
    }
  ],
  "extracts": [
    {
      "name": "ebs:genericentity",
      "extractParameters": [
        {
          "name": "maxrows",
          "value": "5"
        }
      ]
    },
    {
      "name": "ebs:interfaces",
      "extractParameters": [
        {
          "name": "maxrows",
          "value": "10"
        }
      ]
    }
  ]

}

5. Click Execute.


The result is a ZIP file with two extracts as show below:

When you download the zip, you see two files:

Run Data Services Extracts Using EQL REST API

To run data services extracts using EQL REST API:

  1. The EQL REST API Swagger is available at:

    Code Block
    languagejs
    http://eagle-web-server/eagle/v2/eql/api-doc
    
    

    The EQL interface allows for the execution of a custom or core Eagle Data Services interface. You can execute a request from the EQL REST API using the MC2 Swagger UI at:

    Code Block
    http://eagle-web-server/mc2/swagger-ui.html


  2. Select EQL from the dropdown list:
  3. Click eql-rest, then click POST and Try it Out, for eql-rest GET, please go to step 6
  4. In the Example Value Model enter the following:

    Code Block
    languagejs
    themeConfluence
    titleSample EQL REST API post body to execute EDS interface (example using core EDS interface genericentity)
    {
                "FeedType" : "genericentity" ,
                "emlObjectType": "Entity",
                "outputformat": "EagleJSON",
                "filters": {
                    "maxrows" : "5"
                },
                "SaveSQLQuery": "Y",
                "invalidatecache": "Y"
    }


  5.  Click Execute.

    The result is shown in the Response Body box below:


Sample POST body to execute a user defined EDS interface:

{
 "FeedType" : "wh_position_smf_ratings",
 "outputformat": "EagleJSON",
 "filters": {
  "effectivedate" : "2019-06-09",
  "entityId" : "ASTL1900"
  }
}


6. Click eql-rest, then click GET and Try it Out.

image2020-3-26_11-28-31.png

7. enter the values in the parameters and click execute

image2020-3-26_11-31-49.png

8. The result is shown in the Response Body box below:

image2020-3-26_11-35-31.png


Sample curl GET request:

curl -X GET "https://o171-q001-ww01.eagleinvsys.com/eagle/v2/eql?FeedType=genericentity&maxrows=1&invalidatecache=Y" -H "accept: */*"

On this page

Table of Contents