Http api

Functions:

Method Path Params Description
GET /v2/api/functions None List of all functions
GET /v2/api/functions/{id} None Get function by id
DELETE /v2/api/functions/{id} None Delete function by id
POST /v2/api/functions

Post body - json: function configuration:

  • name
  • path
  • className
  • defaultContext

Create function
POST /v2/api/functions/{id}/jobs

Post body: function (MistFn) arguments

Query params:

  • context - optional, specify contextId/namespace/spark conf
  • startTimeout - optional (default Inf) - max time for staying in queue (e.g: 10s, 10ms, 10minute)
  • performTimeout - optional (default Inf) - max time for invocation (e.g: 10s, 10ms, 10minute)

Start job on function
GET /v2/api/functions/{id}/jobs Query params:
  • limit - optional (default 25)
  • offset - optional (default 0)
  • status - optional, repeated (values: started, finished ... )
  • paginate - boolean (default false) - response with struct `{"jobs": [array of jobs], "total": int}`
List of jobs that was ran with given function

Jobs:

Method Path Params Description
GET /v2/api/jobs Query params:
  • limit - optional (default 25)
  • offset - optional (default 0)
  • status - optional, repeated (values: started, finished ... )
  • paginate - boolean (default false) - response with struct `{"jobs": [array of jobs], "total": int}`
List of all jobs that was ran on all functions
GET /v2/api/jobs/{id} None Get info about particular job
GET /v2/api/jobs/{id}/logs None Logs from job
DELETE /v2/api/jobs/{id} None Try cancel job execution

Workers:

Method Path Params Description
GET /v2/api/workers None List of all active workers
DELETE /v2/api/workers/{id} None Stop worker
GET /v2/api/workers/{id} None Get detailed worker info(context config, jobs, etc..)
GET /v2/api/workers/{id}/jobs Query params:
  • limit - optional (default 25)
  • offset - optional (default 0)
  • status - optional, repeated (values: started, finished ... )
  • paginate - boolean (default false) - response with struct `{"jobs": [array of jobs], "total": int}`
List of all jobs that was ran on worker

Contexts:

Method Path Params Description
GET /v2/api/contexts None List of all contexts
GET /v2/api/contexts/{id} None Get context by id
DELETE /v2/api/contexts/{id} None Delete context by id
POST /v2/api/contexts Json body:
  • name
  • sparkConf - Key-value string->string object
  • downtime - Idle timeout before worker shut self down - Duration
  • maxJobs - max parallel jobs - Int
  • workerMode - worker mode (shared | exclusive) - String
  • precreated - Boolean
  • runOptions - String
  • streamingDuration - Duration
Get context by id

Status

Method Path Params Description
GET /v2/api/status None Mist status info (version, start time, spark version)

Artifacts

Method Path Params Description
GET /v2/api/artifacts None list of all artifacts
GET /v2/api/artifacts/{id} None artifact info
DELETE /v2/api/artifacts/{id} None Delete artifact
POST /v2/api/artifacts file: Multipart form data upload new artifact

Note: Mist always has default context settings, you can obtain it by “default” id.