Developer Guide > Data Integration Hub Publications and Subscriptions APIs > Event Status API
  

Event Status API

When you use a Data Integration Hub Run Publication Subscription API to start the running of a publication or of a subscription and the action succeeds, Data Integration Hub returns the event ID of the publication or the subscription event that it generates.
The manner in which Data Integration Hub returns the event ID depends on the API that you use to run the publication or the subscription:
You can use the Data Integration Hub Event Status REST API to query the status of the publication or subscription event according to the event ID. You can see whether the publication or subscription process is still running, and after the process is complete, you can see whether it completed successfully. If the process fails, the response to the query includes the cause of the failure.
To query the status of an event, use a GET command with the following REST URL:
http://<DIH_console_host_port>/dih-console/api/v1/event/<eventId>
For example:
http://localhost:18080/dih-console/api/v1/event/2435
Sample Files
The <DIH_InstallationDir>\samples\api\restapi\examples\event folder contains the following files:

Event Status API Response

When you use the Data Integration Hub Event Status API to query the status of a publication or a subscription event, the API returns the event response in an EventResponse.java model class.
The response includes the following information:
Property
Description
responseCode
Response of the Run Publication Subscription API action.
eventId
ID of the event that Data Integration Hub generates for the publication or for the subscription.
eventType
Type of the event that Data Integration Hub generates for the publication or for the subscription.
topicName
Name of the topic that is associated with the publication or with the subscription.
publicationName or subscriptionName
Name of the publication or of the subscription.
applicationName
Name of the publishing or of the subscribing application.
eventStatus
Status of the event that Data Integration Hub generates for the publication or for the subscription.
eventStartTimeLong
Time when the publication or the subscription event started. System time in milliseconds as returned by Java API java.lang.System.currentTimeMillis.
eventEndTimeLong
Time when the publication or the subscription event ended. System time in milliseconds as returned by Java API java.lang.System.currentTimeMillis.
referencedEventsList
Applicable for file publication events, aggregated subscription events, and compound subscription events. List of event IDs that are related to the file publication, the aggregated subscription, or the compound subscription event.
For example, the referencedEventsList of a file publication event includes the file events of the files that are published as part of the publication event.
isFinal
Is the event in a final state.
isError
Is the event in Error status.
sourceSuccessRows
Number of source rows that Data Integration Hub read successfully.
sourceFailedRows
Number of source rows that Data Integration Hub failed to read.
targetFailedRows
Number of target rows that Data Integration Hub failed to write.
targetSuccessRows
Number of target rows that Data Integration Hub wrote successfully.
detailedMessage
Applicable for events in an Error status. If the error is caused by Data Integration Hub, detailedMessage returns the error message from the Data Integration Hub event. For any other error, for example an authentication failure or an incorrect REST URL request, detailedMessage includes a message that describes the cause of the error.

Sample Event Status API Responses

Response to a request to query the status of publication event 4003:
{
"responseCode": "SUCCESS",
"eventId": 4003,
"eventType": "Publication",
"topicName": "top_120",
"publicationName": "ng_pub_120_1",
"applicationName": "app1",
"eventStatus": "Complete",
"eventStartTimeLong": 1431078308560,
"eventEndTimeLong": 1431078313780,
"isFinal": true,
"isError": false,
"sourceSuccessRows": 10,
"sourceFailedRows": 0,
"targetFailedRows": 0,
"targetSuccessRows: 10}
Response to a request to query the status of aggregated subscription event 3009, which includes subscription events 3008 and 3007:
{
"responseCode": "SUCCESS",
"eventId": 3009,
"eventType": "Aggregated Subscription",
"topicName": "topic1",
"subscriptionName": "sub1",
"applicationName": "app1",
"eventStatus": "Complete",
"eventStartTimeLong": 1431065700088,
"eventEndTimeLong": 1431065704372,
"referencedEventsList": "3008,3007"
"isFinal": true,
"isError": false,
"sourceSuccessRows": 15,
"sourceFailedRows": 0,
"targetFailedRows": 0,
"targetSuccessRows: 15
}
Response to a request to query the status of publication event 3016, where the publication process failed:
Response:

{
"responseCode": "SUCCESS",
"eventId": 3016,
"eventType": "Publication",
"topicName": "top_120",
"publicationName": "ng_pub_120_1",
"applicationName": "app1",
"eventStatus": "Error",
"eventStartTimeLong": 1431066353202,
"eventEndTimeLong": 1431066357162,
"isFinal": true,
"isError": true,
"sourceSuccessRows": 2,
"sourceFailedRows": 1,
"targetFailedRows": 1,
"targetSuccessRows: 2
"detailedMessage": "Error while copying several rows :\nSrcFailedRows: 1\nTgtFailedRows: 1\nSrcSuccessRows: 2\nTgtSuccessRows: 2\nPowerCenter workflow: s__DIH_pub_ng_pub_120_1\nPowerCenter session: s__DIH_pub_ng_pub_120_1\n\nCheck the PowerCenter session log for more information."
}