Ask Your Question

Can you associate a mistral workflow execution with an environment via the CLI?

asked 2017-04-19 13:04:13 -0500

mattybrennan gravatar image

I can create an environment, and I can create a workflow execution. But I don't see any way via the CLI to associate a workflow or a workflow execution with an environment

usage: mistral environment-create [-h] [-f {json,shell,table,value,yaml}]
                              [-c COLUMN] [--max-width <integer>]
                              [--print-empty] [--noindent]
                              [--prefix PREFIX]


usage: mistral workflow-create [-h] [-f {csv,json,table,value,yaml}]
                           [-c COLUMN] [--max-width <integer>]
                           [--print-empty] [--noindent]
                           [--quote {all,minimal,none,nonnumeric}]


usage: mistral execution-create [-h] [-f {json,shell,table,value,yaml}]
                            [-c COLUMN] [--max-width <integer>]
                            [--print-empty] [--noindent] [--prefix PREFIX]
                            [-d DESCRIPTION]
                            workflow_identifier [workflow_input] [params]
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2017-04-25 10:28:32 -0500

d0ugal gravatar image

updated 2017-04-26 03:06:31 -0500

I don't think there is a way to link a pre-existing environment. You could, however, have a task in the workflow that fetches the environment. This workflow takes the name of a environment, it then fetches it and outputs the contents of the environment.

    - env_name
      action: mistral.environments_get name=<% $.env_name %>
        env: task(get_env).result.variables
      on-complete: do_something
      action: std.echo output=<% $.env %>
edit flag offensive delete link more


Thanks. I guess I don't understand when the pre-existing environments are ever used then.

mattybrennan gravatar imagemattybrennan ( 2017-04-25 10:58:13 -0500 )edit

answered 2017-04-20 07:52:20 -0500

zaneb gravatar image

When you define an environment inline, you pass it with the "env" key as part of the [params] argument (which is in JSON format IIUC). I'm not sure how that applies to predefined environments created through the API though.

edit flag offensive delete link more


Thanks! This solves my problem.

mattybrennan gravatar imagemattybrennan ( 2017-04-25 10:58:32 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-04-19 13:04:13 -0500

Seen: 26 times

Last updated: Apr 26