Warning
(2014-10-5): API described in this document might slightly change within a short period of time (2-3 weeks) and should be now considered experimental. Mistral team is now actively working on stabilization.
This API describes the ways of interacting with Mistral service via HTTP protocol using Representational State Transfer concept (ReST).
Currently this API relies on JSON to represent states of REST resources.
The common HTTP Response Status Codes (https://github.com/for-GET/know-your-http-well/blob/master/status-codes.md) are used.
Application Root provides links to all possible API methods for Mistral. URLs for other resources described below are relative to Application Root.
All API v2 urls are relative to API v2 root.
Workbook resource.
Data samples:
{
"created_at": "1970-01-01T00:00:00.000000",
"definition": "HERE GOESWORKBOOK DEFINITION IN MISTRAL DSL v2",
"id": "123e4567-e89b-12d3-a456-426655440000",
"name": "book",
"scope": "private",
"tags": [
"large",
"expensive"
],
"updated_at": "1970-01-01T00:00:00.000000"
}
Type: | unicode |
---|
workbook definition in Mistral v2 DSL
Type: | Enum(private, public) |
---|
‘private’ or ‘public’
name is immutable. tags is a list of values associated with a workbook that a user can use to group workbooks by some criteria (deployment workbooks, Big Data processing workbooks etc.). Note that name and tags get inferred from workbook definition when Mistral service receives a POST request. So they can’t be changed in another way.
A collection of Workbooks.
Data samples:
{
"workbooks": [
{
"created_at": "1970-01-01T00:00:00.000000",
"definition": "HERE GOESWORKBOOK DEFINITION IN MISTRAL DSL v2",
"id": "123e4567-e89b-12d3-a456-426655440000",
"name": "book",
"scope": "private",
"tags": [
"large",
"expensive"
],
"updated_at": "1970-01-01T00:00:00.000000"
}
]
}
Return all workbooks.
Where project_id is the same as the requestor or project_id is different but the scope is public.
Return type: | Workbooks |
---|
Create a new workbook.
Update a workbook.
Delete the named workbook. :type name: unicode
Workflow resource.
Data samples:
{
"created_at": "1970-01-01T00:00:00.000000",
"definition": "HERE GOESWORKFLOW DEFINITION IN MISTRAL DSL v2",
"id": "123e4567-e89b-12d3-a456-426655440000",
"input": "param1, param2",
"name": "flow",
"scope": "private",
"tags": [
"large",
"expensive"
],
"updated_at": "1970-01-01T00:00:00.000000"
}
Type: | unicode |
---|
Workflow definition in Mistral v2 DSL
Type: | Enum(private, public) |
---|
‘private’ or ‘public’
name is immutable. tags is a list of values associated with a workflow that a user can use to group workflows by some criteria. Note that name and tags get inferred from workflow definition when Mistral service receives a POST request. So they can’t be changed in another way.
A collection of workflows.
Data samples:
{
"workflows": [
{
"created_at": "1970-01-01T00:00:00.000000",
"definition": "HERE GOESWORKFLOW DEFINITION IN MISTRAL DSL v2",
"id": "123e4567-e89b-12d3-a456-426655440000",
"input": "param1, param2",
"name": "flow",
"scope": "private",
"tags": [
"large",
"expensive"
],
"updated_at": "1970-01-01T00:00:00.000000"
}
]
}
Return all workflows.
Where project_id is the same as the requester or project_id is different but the scope is public.
Return type: | Workflows |
---|
Create a new workflow.
Update one or more workflows.
Delete the named workflow. :type name: unicode
Action resource.
NOTE: name is immutable. Note that name and description get inferred from action definition when Mistral service receives a POST request. So they can’t be changed in another way.
Data samples:
{
"created_at": "1970-01-01T00:00:00.000000",
"definition": "HERE GOES ACTION DEFINITION IN MISTRAL DSL v2",
"id": "123e4567-e89b-12d3-a456-426655440000",
"name": "flow",
"scope": "private",
"tags": [
"large",
"expensive"
],
"updated_at": "1970-01-01T00:00:00.000000"
}
A collection of Actions.
Data samples:
{
"actions": [
{
"created_at": "1970-01-01T00:00:00.000000",
"definition": "HERE GOES ACTION DEFINITION IN MISTRAL DSL v2",
"id": "123e4567-e89b-12d3-a456-426655440000",
"name": "flow",
"scope": "private",
"tags": [
"large",
"expensive"
],
"updated_at": "1970-01-01T00:00:00.000000"
}
]
}
Return all actions.
Where project_id is the same as the requester or project_id is different but the scope is public.
Return type: | Actions |
---|
Create a new action.
Update one or more actions.
Delete the named action. :type name: unicode
Execution resource.
Data samples:
{
"created_at": "1970-01-01T00:00:00.000000",
"id": "123e4567-e89b-12d3-a456-426655440000",
"input": "{}",
"output": "{}",
"params": "{\"env\": {\"k1\": \"abc\", \"k2\": 123}}",
"state": "SUCCESS",
"updated_at": "1970-01-01T00:00:00.000000",
"workflow_name": "flow"
}
Type: | unicode |
---|
id is immutable and auto assigned.
Type: | unicode |
---|
input is a JSON structure containing workflow input values.
Type: | unicode |
---|
output is a workflow output.
Type: | unicode |
---|
params define workflow type specific parameters. For example, reverse workflow takes one parameter ‘task_name’ that defines a target task.
Type: | unicode |
---|
state can be one of: RUNNING, SUCCESS, ERROR, PAUSED
Type: | unicode |
---|
an optional state information string
Type: | unicode |
---|
reference to workflow definition
A collection of Execution resources.
Data samples:
{
"executions": [
{
"created_at": "1970-01-01T00:00:00.000000",
"id": "123e4567-e89b-12d3-a456-426655440000",
"input": "{}",
"output": "{}",
"params": "{\"env\": {\"k1\": \"abc\", \"k2\": 123}}",
"state": "SUCCESS",
"updated_at": "1970-01-01T00:00:00.000000",
"workflow_name": "flow"
}
]
}
Return all Executions.
Return type: | Executions |
---|
Create a new Execution.
Parameters: |
|
---|---|
Return type: |
Update the specified Execution.
Parameters: |
|
---|---|
Return type: |
Delete the specified Execution. :type id: unicode
When a workflow starts Mistral creates an execution. It in turn consists of a set of tasks. So Task is an instance of a task described in a Workflow that belongs to a particular execution.
Task resource.
Data samples:
{
"created_at": "1970-01-01T00:00:00.000000",
"id": "123e4567-e89b-12d3-a456-426655440000",
"name": "task",
"state": "SUCCESS",
"updated_at": "1970-01-01T00:00:00.000000",
"workflow_execution_id": "123e4567-e89b-12d3-a456-426655440000",
"workflow_name": "flow"
}
Type: | unicode |
---|
state can take one of the following values: IDLE, RUNNING, SUCCESS, ERROR, DELAYED
A collection of tasks.
Data samples:
{
"tasks": [
{
"created_at": "1970-01-01T00:00:00.000000",
"id": "123e4567-e89b-12d3-a456-426655440000",
"name": "task",
"state": "SUCCESS",
"updated_at": "1970-01-01T00:00:00.000000",
"workflow_execution_id": "123e4567-e89b-12d3-a456-426655440000",
"workflow_name": "flow"
}
]
}