Jump to: navigation, search

Difference between revisions of "Mistral/DSL"

(Mistral DSL specification)
 
 
(36 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Mistral DSL specification ==
+
== This Wiki is no longer maintained ==
==== Version 0.1 ====
 
=== Main objects ===
 
  
 
+
Please see the [https://docs.openstack.org/mistral/latest/user/wf_lang_v2.html Mistral Workflow language documentation].
* '''Service'''
 
* '''Action'''
 
* '''Workflow'''
 
* '''Task'''
 
* '''Event'''
 
 
 
=== Service ===
 
 
 
Provides some specific functionality. For example, Nova service provides functionality for VMs management in OpenStack.
 
 
 
==== Attributes ====
 
 
 
* '''name''' - string without space, mandatory attribute
 
* '''type''' - currently we support the following types: RESTAPI, OPENSTACKSERVICE, OSLO_RPC, this is a mandatory attribute
 
* '''parameters''' - dictionary depending on type of the service, this parameter can be optional. For example for REST API it should contain url of the service, method of authentication etc.
 
* '''actions''' - list of actions provided by this service
 
 
 
==== YAML example: ====
 
 
 
  Service:
 
    name: Nova
 
    type: OPENSTACK_SERVICE
 
    parameters:
 
        key:value
 
    actions:
 
        create-vm:
 
          ......
 
        delete-vm: 
 
          .....
 
 
 
=== Action ===
 
 
 
A function provided by services. For example Nova service provides the following actions: create-vm, shutdown-vm
 
 
 
==== Attributes ====
 
 
 
name - string without space, mandatory attribute
 
parameters - dictionary, which structured is defined by service type. For REST service it contains url and method.
 
task-parameters - dictionary containing parameters which should or could be specified in task
 
==== YAML example: ====
 
 
 
  create-vm:
 
      parameters:
 
          url: servers
 
      task-parameters:
 
          name:
 
            optional: False
 
 
 
=== Workflow ===
 
 
 
==== Attributes ====
 
 
 
name - string without space, mandatory attribute
 
tasks - list of task in this workflow, each task represent some step in worflow
 
events - list of events in workflow, e.g. timer or periodic events
 
 
 
==== YAML example: ====
 
 
 
  Workflow:
 
    tasks:
 
        create-vms:
 
          .....
 
        attache-volumes:
 
          .....
 
 
 
=== Task ===
 
 
 
Represents a step in workflow, for example attaching volume
 
 
 
==== Attributes ====
 
 
 
* '''name''' - string without space, mandatory attribute
 
* '''action''' - name of action to perform
 
* '''dependsOn''' - list of tasks which should be execute before this tasks, this is optional parameter
 
* '''parameters''' - list of parameters
 
 
 
YAML example:
 
 
 
  create-vms:
 
    action: Nova:create-vm
 
    parameters:
 
        image_id: 1234
 
        flavor_id: 42
 
 
 
=== Events ===
 
 
 
By event it is possible to invoke specific task.
 
 
 
==== Attributes ====
 
 
 
name - string without space, mandatory attribute
 
type - can be PERIODIC, TIMER, CEILOMETER_ALARM
 
tasks - list of tasks which should be execute on event
 
parameters - list of parameters, defined by task
 
 
 
==== YAML example: ====
 
 
 
  backup-vm:
 
    type: periodic
 
    tasks: [create_backup, delete_old_backup]  
 
    parameters:
 
        time: 1 0 * * *
 
 
 
=== Full YAML example: ===
 
 
 
  Service:
 
    name: Nova
 
    type: OPENSTACK_SERVICE
 
    parameters:
 
        baseUrl:
 
    actions:
 
        create-vm:
 
          parameters:
 
              url: servers
 
              method: POST
 
          task-parameters:
 
              flavor_id:
 
              image_id:
 
        delete-vm: 
 
          .....
 
  Workflow:
 
    tasks:
 
      create-vms:
 
          action: Nova:create-vm
 
          parameters:
 
              image_id: 1234
 
              flavor_id: 42
 
      attach-volumes:
 
            .....
 
      backup-vms:
 
          action:Nova:create-backup
 
          parameters:
 
            ....
 
          dependsOn: [detach-volume]
 
    events:
 
      backup-vm:
 
          type: periodic
 
          tasks: backup-vms
 
          parameters:
 
              cron-pattern:1 0 * * *
 

Latest revision as of 12:39, 6 March 2018

This Wiki is no longer maintained

Please see the Mistral Workflow language documentation.