Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

AdhocReport POST endpoint


Pace report REST API base path http://host:port/eagle/report/v1 and REST API definition resides at http://host:port/eagle/report/v1/api-doc

Details how to get host and port you can find at REST Endpoints

Executing Ad Hoc Report asynchronously with a callback

In order to get report asynchronously you should send POST request to the http://host:port/eagle/report/v1/adhocReport with HTTP header x-eagle-rest-callback: http://your_host/your_endpoint (result will be sent to defined URL) and set query parameters in JSON format as a request body

Example:

curl -X POST -H "x-eagle-rest-callback: http://your_host/your_endpoint" -d @requestBody.json "http://host:port/eagle/report/v1/adhocReport"

requstBody.json content:

{
"reportName": "RF PLA SM LPO",
"entityId": "2005P01",
"beginDate": "20140101",
"endDate": "20140131",
"fields": "",
"outputFormat":"JSON"
}

In response you will get ACK with scheduleId and correlationId

{
  "taskIdentifier": {
    "correlationId": {
      "value": "QJPUFAJAJ0KRA0PWF"
    }
  },
  "isNegative": false,
  "reason": {
    "reasonTypeEnum": "INFO",
    "reasonCode": {
      "value": "3556152"
    }
  },
  "header": {
    "sentBy": {
      "value": "http://www.eagleinvsys.com/"
    },
    "creationTimestamp": "2018-03-23T13:00:28.349-04:00",
    "messageId": {
      "value": "Q57Y8G6AJC"
    }
  }
}

In the response above "reasonCode" value is a schedule definition id. After successful processing result will be sent on URL defined as a callback.

In case of unavailable pace-report service server or any error before actual processing takes place server will respond negative ACK with error description

Example:

{
  "taskIdentifier": {
    "correlationId": {
      "value": "8RTFPDOM5CQCNOVB1"
    }
  },
  "isNegative": true,
  "reason": {
    "reasonTypeEnum": "ERROR",
    "description": "Service Temporarily Unavailable"
  },
  "header": {
    "sentBy": {
      "value": "http://www.eagleinvsys.com/"
    },
    "creationTimestamp": "2018-03-23T12:31:57.541-04:00",
    "messageId": {
      "value": "L2364E1UX6"
    }
  }
}

Executing Ad Hoc Report with ticketing

To be able track the status of processing send request with x-eagle-return-ticket: true

Example:

curl -X POST -H "x-eagle-return-ticket: true" -d @requestBody.json "http://host:port/eagle/report/v1/adhocReport"

Response will be the same ACK as in case with callback, but you can use correlationId value as a key to get information about processing or, in case of success, result.

To get status of your request send request to the http://host:port/eagle/report/v1/adhocReport/correlationId?statusonly=1 where correlationId is value from response above.

Example:

curl -X GET "http://host:port/eagle/report/v1/adhocReport/correlationId?statusonly=1"

If report request is processed you will get TSR with status of request

{
  "statusItem": [
    {
      "taskIdentifier": {
        "correlationId": {
          "value": "8S8WFEP8H14HIZJT9"
        }
      },
      "status": "SUCCESS",
      "severityCode": {
        "value": "1"
      },
      "reason": [
        {}
      ]
    }
  ],
  "header": {
    "sentBy": {
      "value": "http://www.eagleinvsys.com/"
    },
    "creationTimestamp": "2018-03-23T13:01:50.312-04:00"
  }
}

Where status could be "SUCCESS" of "FAILED" or if request still in processing you will get ACK similar to the first one. In case of success you can get report sending the request http://host:port/eagle/report/v1/adhocReport/correlationId

If you accidently define wrong correlationId you will get TSR with error description

{
  "statusItem": [
    {
      "taskIdentifier": {
        "correlationId": {
          "value": "89OVZ7XM47N4WUVYJ"
        }
      },
      "status": "FAILED",
      "severityCode": {
        "value": "1"
      },
      "reason": [
        {
          "description": "Could not find any request with correlation id 8RTFPDOM5CQCNOVB1q"
        }
      ]
    }
  ],
  "header": {
    "sentBy": {
      "value": "http://www.eagleinvsys.com/"
    },
    "creationTimestamp": "2018-03-22T15:22:39.864-04:00"
  }
}

You can also use x-eagle-correlation-id HTTP header to specify your correlation id.

AdhocReport GET endpoint in MC2


This endpoint redirects requests to the existing AdhocReport POST endpoint transforming GET parameters into JSON HTTP body and allows using HTTP GET parameters like in the examples below.

Let's take the next uri as an example:


https://host:port/eagle/v2/adhocreport?reportName=RM_PerfTotalExtended&entityId=41038M&beginDate=20150101&endDate=20151231&fields=1 Yr Net Return vs BM,10 Yr Annual Net Return vs BM&outputFormat=JSON


HTTP parameters will be taken as is and transformed into JSON HTTP body:


{
"reportName": "RM_PerfTotalExtended",
"entityId": "41038M",
"beginDate": "20150101",
"endDate": "20151231",
"fields": "1 Yr Net Return vs BM,10 Yr Annual Net Return vs BM",
"outputFormat":"JSON"
}


and redirected to the AdhocReport POST endpoint:


http://host:port/eagle/report/v1/adhocReport


If "fields" parameter is empty/not present in uri: http://host:port/eagle/v2/adhocreport?reportName=RM_PerfTotalExtended&entityselectiontype=EntityID&entityselectionvalue=41038M&beginDate=20150101&endDate=20151231&outputFormat=JSON

then it will be empty in JSON body:


{
"reportName": "RM_PerfTotalExtended",
"entityId": "41038M",
"beginDate": "20150101",
"endDate": "20151231",
"fields": "",
"outputFormat":"JSON"
}

As in case with AdhocReport POST endpoint above there is possibility to use x-eagle-return-ticket, x-eagle-rest-callback and x-eagle-correlation-id HTTP headers.

  • No labels