Reactive API
For reactive api mist supports MQTT and Kafka. You can run jobs and consume job-event from Mist. By default it is turned off. Check out configuration to see how to turn it on.
Run-job request is json message and should has following format:
{
"functionId": "functionId",
"parameters": {"foo": "bar"}, // job arguments
"externalId": "myId" // optional
}
Then you can listen publish-topic
to catch events from the job
Lifecycle events
There were several async interfaces described bellow, that can be used to track lifecycle events from jobs.
All events have 2 required fields: event
, id
, and some of them provide more:
{
"event": "event-name",
"id": "job id"
}
initialized
- job has been assigned to invocation, also returns all job parametersqueued
- job has been queued (wait before worker assign job)job-file-downloading
- worker is downloading job artifactstarted
- job has been sent to workercancelling
- user sent cancel requestcancelled
- job has been canceled by userfinished
- job has been finished successfully, also hasresult
fieldfailed
- job has been finished unsuccessfully, also haserror
fieldlogs
- job produced some log messages
Events fromat TODO: describe all events
Websocket
For new UI there is a websocket interface for listening to lifecycle events from jobs Events are sent to the client to the following paths:
/v2/api/ws
- subscribe to all events from mist/v2/api/jobs/{id}/ws
- subscribe to events from particular job