V2 API
This API describes the ways of interacting with Mistral service via HTTP protocol using Representational State Transfer concept (ReST).
Basics
Application Root [/]
Application Root provides links to all possible API methods for Mistral. URLs for other resources described below are relative to Application Root.
API v2 Root [/v2/]
All API v2 urls are relative to API v2 root.
Workbooks
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.
-
GET /v2/workbooks
Return a list of workbooks.
Parameters: |
- marker – Optional. Pagination marker for large data sets.
- limit – Optional. Maximum number of resources to return in a
single result. Default value is None for backward
compatibility.
- sort_keys – Optional. Columns to sort results by.
Default: created_at.
- sort_dirs – Optional. Directions to sort corresponding to
sort_keys, “asc” or “desc” can be chosen.
Default: asc.
- fields – Optional. A specified list of fields of the resource to
be returned. ‘id’ will be included automatically in
fields if it’s provided, since it will be used when
constructing ‘next’ link.
- name – Optional. Keep only resources with a specific name.
- definition – Optional. Keep only resources with a specific
definition.
- tags – Optional. Keep only resources containing specific tags.
- scope – Optional. Keep only resources with a specific scope.
- created_at – Optional. Keep only resources created at a specific
time and date.
- updated_at – Optional. Keep only resources with specific latest
update time and date.
|
Where project_id is the same as the requester or
project_id is different but the scope is public.
:type marker: uuid
:type limit: int
:type sort_keys: uniquelist
:type sort_dirs: list
:type fields: uniquelist
:type created_at: unicode
:type definition: unicode
:type name: unicode
:type scope: Enum(private, public)
:type tags: unicode
:type updated_at: unicode
-
GET /v2/workbooks
Return the named workbook.
:type name: unicode
-
POST /v2/workbooks
Create a new workbook.
-
PUT /v2/workbooks
Update a workbook.
-
DELETE /v2/workbooks
Delete the named workbook.
:type name: unicode
Workflows
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.
-
GET /v2/workflows
Return a list of workflows.
Parameters: |
- marker (uuid) – Optional. Pagination marker for large data sets.
- limit (int) – Optional. Maximum number of resources to return in a
single result. Default value is None for backward
compatibility.
- sort_keys (uniquelist) – Optional. Columns to sort results by.
Default: created_at.
- sort_dirs (list) – Optional. Directions to sort corresponding to
sort_keys, “asc” or “desc” can be chosen.
Default: asc.
- fields (uniquelist) – Optional. A specified list of fields of the resource to
be returned. ‘id’ will be included automatically in
fields if it’s provided, since it will be used when
constructing ‘next’ link.
- name (unicode) – Optional. Keep only resources with a specific name.
- input (unicode) – Optional. Keep only resources with a specific input.
- definition (unicode) – Optional. Keep only resources with a specific
definition.
- tags (unicode) – Optional. Keep only resources containing specific tags.
- scope (Enum(private, public)) – Optional. Keep only resources with a specific scope.
- project_id (uuid) – Optional. The same as the requester project_id
or different if the scope is public.
- created_at (unicode) – Optional. Keep only resources created at a specific
time and date.
- updated_at (unicode) – Optional. Keep only resources with specific latest
update time and date.
|
Return type: | Workflows
|
-
GET /v2/workflows
Return the named workflow.
:type identifier: unicode
-
POST /v2/workflows
Create a new workflow.
- NOTE: The text is allowed to have definitions
- of multiple workflows. In this case they all will be created.
-
PUT /v2/workflows
Update one or more workflows.
Parameters: |
- identifier – Optional. If provided, it’s UUID of a workflow.
Only one workflow can be updated with identifier param.
|
The text is allowed to have definitions of multiple workflows. In this
case they all will be updated.
-
DELETE /v2/workflows
Delete a workflow.
:type identifier: unicode
Actions
-
GET /v2/actions
Return all actions.
Parameters: |
- marker – Optional. Pagination marker for large data sets.
- limit – Optional. Maximum number of resources to return in a
single result. Default value is None for backward
compatibility.
- sort_keys – Optional. Columns to sort results by.
Default: name.
- sort_dirs – Optional. Directions to sort corresponding to
sort_keys, “asc” or “desc” can be chosen.
Default: asc.
- fields – Optional. A specified list of fields of the resource to
be returned. ‘id’ will be included automatically in
fields if it’s provided, since it will be used when
constructing ‘next’ link.
- name – Optional. Keep only resources with a specific name.
- scope – Optional. Keep only resources with a specific scope.
- definition – Optional. Keep only resources with a specific
definition.
- is_system – Optional. Keep only system actions or ad-hoc
actions (if False).
- input – Optional. Keep only resources with a specific input.
- description – Optional. Keep only resources with a specific
description.
- tags – Optional. Keep only resources containing specific tags.
- created_at – Optional. Keep only resources created at a specific
time and date.
- updated_at – Optional. Keep only resources with specific latest
update time and date.
|
Where project_id is the same as the requester or
project_id is different but the scope is public.
:type marker: uuid
:type limit: int
:type sort_keys: uniquelist
:type sort_dirs: list
:type fields: uniquelist
:type created_at: unicode
:type name: unicode
:type scope: Enum(private, public)
:type tags: unicode
:type updated_at: unicode
:type description: unicode
:type definition: unicode
:type is_system: unicode
:type input: unicode
-
GET /v2/actions
Return the named action.
Parameters: |
- identifier (unicode) – ID or name of the Action to get.
|
Return type: | Action
|
-
POST /v2/actions
Create a new action.
- NOTE: This text is allowed to have definitions
- of multiple actions. In this case they all will be created.
-
PUT /v2/actions
Update one or more actions.
- NOTE: This text is allowed to have definitions
- of multiple actions. In this case they all will be updated.
-
DELETE /v2/actions
Delete the named action.
:type identifier: unicode
Executions
-
GET /v2/executions
Return all Executions.
Parameters: |
- marker (uuid) – Optional. Pagination marker for large data sets.
- limit (int) – Optional. Maximum number of resources to return in a
single result. Default value is None for backward
compatibility.
- sort_keys (uniquelist) – Optional. Columns to sort results by.
Default: created_at, which is backward compatible.
- sort_dirs (list) – Optional. Directions to sort corresponding to
sort_keys, “asc” or “desc” can be chosen.
Default: desc. The length of sort_dirs can be equal
or less than that of sort_keys.
- fields (uniquelist) – Optional. A specified list of fields of the resource to
be returned. ‘id’ will be included automatically in
fields if it’s provided, since it will be used when
constructing ‘next’ link.
- workflow_name (unicode) – Optional. Keep only resources with a specific
workflow name.
- workflow_id (uuid) – Optional. Keep only resources with a specific
workflow ID.
- description (unicode) – Optional. Keep only resources with a specific
description.
- params (json) – Optional. Keep only resources with specific parameters.
- task_execution_id (uuid) – Optional. Keep only resources with a
specific task execution ID.
- state (Enum(IDLE, RUNNING, SUCCESS, ERROR, PAUSED, CANCELLED)) – Optional. Keep only resources with a specific state.
- state_info (unicode) – Optional. Keep only resources with specific
state information.
- input (json) – Optional. Keep only resources with a specific input.
- output (json) – Optional. Keep only resources with a specific output.
- created_at (unicode) – Optional. Keep only resources created at a specific
time and date.
- updated_at (unicode) – Optional. Keep only resources with specific latest
update time and date.
|
Return type: | Executions
|
-
GET /v2/executions
Return the specified Execution.
:type id: unicode
-
POST /v2/executions
Create a new Execution.
Parameters: |
- wf_ex (Execution) – Execution object with input content.
|
Return type: | Execution
|
-
PUT /v2/executions
Update the specified workflow execution.
Parameters: |
- id (unicode) – execution ID.
- wf_ex (Execution) – Execution object.
|
Return type: | Execution
|
-
DELETE /v2/executions
Delete the specified Execution.
:type id: unicode
Tasks
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.
-
GET /v2/tasks
Return all tasks.
Where project_id is the same as the requester or
project_id is different but the scope is public.
Parameters: |
- marker (uuid) – Optional. Pagination marker for large data sets.
- limit (int) – Optional. Maximum number of resources to return in a
single result. Default value is None for backward
compatibility.
- sort_keys (uniquelist) – Optional. Columns to sort results by.
Default: created_at, which is backward compatible.
- sort_dirs (list) – Optional. Directions to sort corresponding to
sort_keys, “asc” or “desc” can be chosen.
Default: desc. The length of sort_dirs can be equal
or less than that of sort_keys.
- fields (uniquelist) – Optional. A specified list of fields of the resource to
be returned. ‘id’ will be included automatically in
fields if it’s provided, since it will be used when
constructing ‘next’ link.
- name (unicode) – Optional. Keep only resources with a specific name.
- workflow_name (unicode) – Optional. Keep only resources with a specific
workflow name.
- workflow_id (uuid) – Optional. Keep only resources with a specific
workflow ID.
- workflow_execution_id (uuid) – Optional. Keep only resources with a
specific workflow execution ID.
- state (Enum(IDLE, RUNNING, SUCCESS, ERROR, DELAYED)) – Optional. Keep only resources with a specific state.
- state_info (unicode) – Optional. Keep only resources with specific
state information.
- result (unicode) – Optional. Keep only resources with a specific result.
- published (json) – Optional. Keep only resources with specific
published content.
- processed (bool) – Optional. Keep only resources which have been
processed or not.
- reset (bool) – Optional. Keep only resources which have been reset or
not.
- env (json) – Optional. Keep only resources with a specific environment.
- created_at (unicode) – Optional. Keep only resources created at a specific
time and date.
- updated_at (unicode) – Optional. Keep only resources with specific latest
update time and date.
|
Return type: | Tasks
|
-
GET /v2/tasks
Return the specified task.
:type id: unicode
-
PUT /v2/tasks
Update the specified task execution.
Parameters: |
- id (unicode) – Task execution ID.
- task (Task) – Task execution object.
|
Return type: | Task
|
-
GET /v2/executions
Return all tasks within the execution.
Where project_id is the same as the requester or
project_id is different but the scope is public.
Parameters: |
- marker (uuid) – Optional. Pagination marker for large data sets.
- limit (int) – Optional. Maximum number of resources to return in a
single result. Default value is None for backward
compatibility.
- sort_keys (uniquelist) – Optional. Columns to sort results by.
Default: created_at, which is backward compatible.
- sort_dirs (list) – Optional. Directions to sort corresponding to
sort_keys, “asc” or “desc” can be chosen.
Default: desc. The length of sort_dirs can be equal
or less than that of sort_keys.
- fields (uniquelist) – Optional. A specified list of fields of the resource to
be returned. ‘id’ will be included automatically in
fields if it’s provided, since it will be used when
constructing ‘next’ link.
- name (unicode) – Optional. Keep only resources with a specific name.
- workflow_name (unicode) – Optional. Keep only resources with a specific
workflow name.
- workflow_id (uuid) – Optional. Keep only resources with a specific
workflow ID.
- workflow_execution_id (uuid) – Optional. Keep only resources with a
specific workflow execution ID.
- state (Enum(IDLE, RUNNING, SUCCESS, ERROR, DELAYED)) – Optional. Keep only resources with a specific state.
- state_info (unicode) – Optional. Keep only resources with specific
state information.
- result (unicode) – Optional. Keep only resources with a specific result.
- published (json) – Optional. Keep only resources with specific
published content.
- processed (bool) – Optional. Keep only resources which have been
processed or not.
- reset (bool) – Optional. Keep only resources which have been reset or
not.
- env (json) – Optional. Keep only resources with a specific environment.
- created_at (unicode) – Optional. Keep only resources created at a specific
time and date.
- updated_at (unicode) – Optional. Keep only resources with specific latest
update time and date.
|
Return type: | Tasks
|
Action Executions
When a Task starts Mistral creates a set of Action Executions. So Action Execution is an instance of an action call described in a Workflow Task that belongs to a particular execution.
-
GET /v2/action_executions
Return all tasks within the execution.
Where project_id is the same as the requester or
project_id is different but the scope is public.
Parameters: |
- marker (uuid) – Optional. Pagination marker for large data sets.
- limit (int) – Optional. Maximum number of resources to return in a
single result. Default value is None for backward
compatibility.
- sort_keys (uniquelist) – Optional. Columns to sort results by.
Default: created_at, which is backward compatible.
- sort_dirs (list) – Optional. Directions to sort corresponding to
sort_keys, “asc” or “desc” can be chosen.
Default: desc. The length of sort_dirs can be equal
or less than that of sort_keys.
- fields (uniquelist) – Optional. A specified list of fields of the resource to
be returned. ‘id’ will be included automatically in
fields if it’s provided, since it will be used when
constructing ‘next’ link.
- name (unicode) – Optional. Keep only resources with a specific name.
- workflow_name (unicode) – Optional. Keep only resources with a specific
workflow name.
- task_name (unicode) – Optional. Keep only resources with a specific
task name.
- task_execution_id (uuid) – Optional. Keep only resources within a
specific task execution.
- state (unicode) – Optional. Keep only resources with a specific state.
- state_info (unicode) – Optional. Keep only resources with specific state
information.
- accepted (bool) – Optional. Keep only resources which have been accepted
or not.
- input (json) – Optional. Keep only resources with a specific input.
- output (json) – Optional. Keep only resources with a specific output.
- params (json) – Optional. Keep only resources with specific parameters.
- description (unicode) – Optional. Keep only resources with a specific
description.
- tags (unicode) – Optional. Keep only resources containing specific tags.
- created_at (unicode) – Optional. Keep only resources created at a specific
time and date.
- updated_at (unicode) – Optional. Keep only resources with specific latest
update time and date.
|
Return type: | ActionExecutions
|
-
GET /v2/action_executions
Return the specified action_execution.
:type id: unicode
Return type: | ActionExecution |
-
POST /v2/action_executions
Create new action_execution.
:type action_ex: ActionExecution
Return type: | ActionExecution |
-
PUT /v2/action_executions
Update the specified action_execution.
:type id: unicode
:type action_ex: ActionExecution
Return type: | ActionExecution |
-
DELETE /v2/action_executions
Delete the specified action_execution.
:type id: unicode
-
GET /v2/tasks
Return all tasks within the execution.
Where project_id is the same as the requester or
project_id is different but the scope is public.
Parameters: |
- task_execution_id (uuid) – Keep only resources within a specific task
execution.
- marker (uuid) – Optional. Pagination marker for large data sets.
- limit (int) – Optional. Maximum number of resources to return in a
single result. Default value is None for backward
compatibility.
- sort_keys (uniquelist) – Optional. Columns to sort results by.
Default: created_at, which is backward compatible.
- sort_dirs (list) – Optional. Directions to sort corresponding to
sort_keys, “asc” or “desc” can be chosen.
Default: desc. The length of sort_dirs can be equal
or less than that of sort_keys.
- fields (uniquelist) – Optional. A specified list of fields of the resource to
be returned. ‘id’ will be included automatically in
fields if it’s provided, since it will be used when
constructing ‘next’ link.
- name (uniquelist) – Optional. Keep only resources with a specific name.
- workflow_name (unicode) – Optional. Keep only resources with a specific
workflow name.
- task_name (unicode) – Optional. Keep only resources with a specific
task name.
- state (unicode) – Optional. Keep only resources with a specific state.
- state_info (unicode) – Optional. Keep only resources with specific state
information.
- accepted (bool) – Optional. Keep only resources which have been accepted
or not.
- input (json) – Optional. Keep only resources with a specific input.
- output (json) – Optional. Keep only resources with a specific output.
- params (json) – Optional. Keep only resources with specific parameters.
- description (unicode) – Optional. Keep only resources with a specific
description.
- tags (unicode) – Optional. Keep only resources containing specific tags.
- created_at (unicode) – Optional. Keep only resources created at a specific
time and date.
- updated_at (unicode) – Optional. Keep only resources with specific latest
update time and date.
|
Return type: | ActionExecutions
|
-
GET /v2/tasks
Return the specified action_execution.
:type task_execution_id: unicode
:type action_ex_id: unicode
Return type: | ActionExecution |
Cron Triggers
Cron trigger is an object that allows to run Mistral workflows according to a time pattern (Unix crontab patterns format). Once a trigger is created it will run a specified workflow according to its properties: pattern, first_execution_time and remaining_executions.
-
GET /v2/cron_triggers
Return all cron triggers.
Parameters: |
- marker (uuid) – Optional. Pagination marker for large data sets.
- limit (int) – Optional. Maximum number of resources to return in a
single result. Default value is None for backward
compatibility.
- sort_keys (uniquelist) – Optional. Columns to sort results by.
Default: created_at, which is backward compatible.
- sort_dirs (list) – Optional. Directions to sort corresponding to
sort_keys, “asc” or “desc” can be chosen.
Default: desc. The length of sort_dirs can be equal
or less than that of sort_keys.
- fields (uniquelist) – Optional. A specified list of fields of the resource to
be returned. ‘id’ will be included automatically in
fields if it’s provided, since it will be used when
constructing ‘next’ link.
- name (unicode) – Optional. Keep only resources with a specific name.
- workflow_name (unicode) – Optional. Keep only resources with a specific
workflow name.
- workflow_id (uuid) – Optional. Keep only resources with a specific
workflow ID.
- workflow_input (json) – Optional. Keep only resources with a specific
workflow input.
- workflow_params (json) – Optional. Keep only resources with specific
workflow parameters.
- scope (Enum(private, public)) – Optional. Keep only resources with a specific scope.
- pattern (unicode) – Optional. Keep only resources with a specific pattern.
- remaining_executions (integer) – Optional. Keep only resources with a
specific number of remaining executions.
- first_execution_time (unicode) – Optional. Keep only resources with a
specific time and date of first execution.
- next_execution_time (unicode) – Optional. Keep only resources with a
specific time and date of next execution.
- created_at (unicode) – Optional. Keep only resources created at a specific
time and date.
- updated_at (unicode) – Optional. Keep only resources with specific latest
update time and date.
|
Return type: | CronTriggers
|
-
GET /v2/cron_triggers
Returns the named cron_trigger.
:type name: unicode
-
POST /v2/cron_triggers
Creates a new cron trigger.
:type cron_trigger: CronTrigger
-
DELETE /v2/cron_triggers
Delete cron trigger.
:type name: unicode
Environments
Environment contains a set of variables which can be used in specific workflow. Using Environment possible to create and map action default values - just provide ‘__actions’ key in ‘variables’. All these variables can be accessed in workflow DSL by <% $.__env %> expression.
Example of using in DSL:
workflow:
tasks:
task1:
action: std.echo output=<% $.__env.my_echo_output %>
Example of creating action defaults:
...ENV...
"variables": {
"__actions": {
"std.echo": {
"output": "my_output"
}
}
},
...ENV...
Note: using CLI, Environment can be created via JSON or YAML file.
-
GET /v2/environments
Return all environments.
Where project_id is the same as the requester or
project_id is different but the scope is public.
Parameters: |
- marker (uuid) – Optional. Pagination marker for large data sets.
- limit (int) – Optional. Maximum number of resources to return in a
single result. Default value is None for backward
compatibility.
- sort_keys (uniquelist) – Optional. Columns to sort results by.
Default: created_at, which is backward compatible.
- sort_dirs (list) – Optional. Directions to sort corresponding to
sort_keys, “asc” or “desc” can be chosen.
Default: desc. The length of sort_dirs can be equal
or less than that of sort_keys.
- fields (uniquelist) – Optional. A specified list of fields of the resource to
be returned. ‘id’ will be included automatically in
fields if it’s provided, since it will be used when
constructing ‘next’ link.
- name (unicode) – Optional. Keep only resources with a specific name.
- description (unicode) – Optional. Keep only resources with a specific
description.
- variables (json) – Optional. Keep only resources with specific
variables.
- scope (Enum(private, public)) – Optional. Keep only resources with a specific scope.
- created_at (unicode) – Optional. Keep only resources created at a specific
time and date.
- updated_at (unicode) – Optional. Keep only resources with specific latest
update time and date.
|
Return type: | Environments
|
-
GET /v2/environments
Return the named environment.
:type name: unicode
-
POST /v2/environments
Create a new environment.
:type env: Environment
-
PUT /v2/environments
Update an environment.
:type env: Environment
-
DELETE /v2/environments
Delete the named environment.
:type name: unicode
Services
Through service management API, system administrator or operator can retrieve Mistral services information of the system, including service group and service identifier. The internal implementation of this feature make use of tooz library, which needs coordinator backend(the most commonly used at present is Zookeeper) installed, please refer to tooz official documentation for more detailed instruction.
There are three service groups according to Mistral architecture currently, namely api_group, engine_group and executor_group. The service identifier contains name of the host the service is running on and the process identifier of the service on that host.
-
GET /v2/services
Return all services.
Validation
Validation endpoints allow to check correctness of workbook, workflow and ad-hoc action DSL without having to upload them into Mistral.
- POST /v2/workbooks/validation
- Validate workbook content (DSL grammar and semantics).
- POST /v2/workflows/validation
- Validate workflow content (DSL grammar and semantics).
- POST /v2/actions/validation
- Validate ad-hoc action content (DSL grammar and semantics).
These endpoints expect workbook, workflow or ad-hoc action text (DSL) correspondingly in a request body.