Skip to content

Events

Message contracts v1.0

Job event

  • Description: Emitted by Job Service change during the computation. The job state can either be: Pending, Running or Finished. See the job lifecycle documentation for information about the Code property.
  • Sample:
{
  "specversion": "1.0",
   "customerid": "<customerId>",
   "projectid": "<projectId>",
   "userid": "<userId>",
   "resourceid": "<jobId>",
   "type": "dhi.waterdata.jobs.events.jobevent",
   "source": "/dhi/platform/job",
   "id": "460efa00-5d50-4300-9642-4453f999a407",
   "time": "2021-04-26T08:39:02.5923813Z",
   "subject": "Job event",
   "dataschema": "https://schemas.mike-cloud.com/platform/job/v1.0/jobevent", 
   "datacontenttype": "application/json",
   "data": {
     "JobId": "<jobId>",
     "State": "Finished",
     "Code": 150,
     "Message": "Output ready",
     "CustomerGuid": "<customerId>",
     "ProjectId": "<projectId>",
     "UserId": "<userId>"
    },
    "offset": "25775732512"
}

Note:
ResourceId represents the ID of the job computation.

Job error event

  • Description: Emitted by various Job Service processes to indicate something went wrong during job execution. The error usually results in restart of the job (depending on settings that govern the restart policy), however by itself the error does not indicate a lifecycle transition. It is only an information that something unexepected occurred.

    Note:
    Due to the nature of event/error processing each error event may be sent multiple times under some circumstances. Since the errors are only informational this should not cause any issues.

  • Sample:

{
  "specversion": "1.0",
   "customerid": "<customerId>",
   "projectid": "<projectId>",
   "userid": "<userId>",
   "resourceid": "603f5c80-f190-4fab-822b-6cf28614ae82",
   "type": "dhi.waterdata.jobs.events.joberrorevent",
   "source": "/dhi/platform/job",
   "id": "460efa00-5d50-4300-9642-4453f999a407",
   "time": "2021-04-26T08:39:02.5923813Z",
   "subject": "Job error event",
   "dataschema": "https://schemas.mike-cloud.com/platform/job/v1.0/joberrorevent", 
   "datacontenttype": "application/json",
   "data": {
     "JobId": "<jobId>",
     "Message": "Container b80cef54-a138-4041-9b40-02ed48a0a46a-0 from docker.io/library/busybox:latest exited with code 1",
     "CustomerGuid": "<customerId>",
     "ProjectId": "<projectId>",
     "UserId": "<userId>"
    },
    "offset": "25775732512"
}

Note:
ResourceId represents the ID of the job computation.

Job progress event

  • Description: This event is produced by the job service infrastructure based on input from the running job. It is the user code that governs when these events are fired and what payload they carry. See job progress events documentation

  • Sample:

{
  "specversion": "1.0",
   "customerid": "<customerId>",
   "projectid": "<projectId>",
   "userid": "<userId>",
   "resourceid": "603f5c80-f190-4fab-822b-6cf28614ae82",
   "type": "dhi.waterdata.jobs.events.jobprogressevent",
   "source": "/dhi/platform/job",
   "id": "460efa00-5d50-4300-9642-4453f999a407",
   "time": "2021-04-26T08:39:02.5923813Z",
   "subject": "Job progress event",
   "dataschema": "https://schemas.mike-cloud.com/platform/job/v1.0/jobprogressevent", 
   "datacontenttype": "application/json",
   "data": {
     "JobId": "<jobId>",
     "CustomerGuid": "<customerId>",
     "ProjectId": "<projectId>",
     "UserId": "<userId>"
     "Message": "This is a message defined by the user",
     "Payload": {
       "type": "Payload type is an arbitrary property defined by the user"
       "anotherType": "another example"
     }
    },
    "offset": "25775732512"
}

Note:
ResourceId represents the ID of the job computation.