Go to file
Daryl Mowrer 72a6bc1ad1 Change the mistralclient for Mistral action pack
The purpose of this patch is to make the new Mistral action pack
actions more useful when they are coded in a workflow or workbook.

The new Mistral action pack actions are executed by calling the
appropriate python-mistralclient API methods. The API methods to
create/update/validate the workbook/workflow/action/environment
resources do not read the definitions/environments from files as the
CLI commands do. They require the actual definition/environement be
passed in as an argument. This can lead to problems when trying to
use the Mistral action pack actions from within a workflow or
workbook.

For example, the workflow create/update/validate methods all take a
definition argument. The mistralclient APIs are currently coded to
take the actual definition, and not the definition file name as the
CLI does. This leads to problems when coding the
mistral.workflows_create action in a workflow for example. If the
actual definition is passed into the action in the workflow YAML, any
YAQL expressions in the workflow being created by that action get
evaluated when read, and are not stored in the database as desired.
This essentially makes it useless unless the workflow you are
creating does not contain any YAQL. That is unrealistic.

This patch enhances those methods of the mistralclient so that they
can take either the actual definition, or the definition file name or
file URI. This allows the action to be coded in a workflow in a way
similar to the CLI by allowing the definition file name, or file URI
to be specified instead of the actual definition. The change allows
either the actual definition or the definition file name, or file
URI to be specified when calling the affected mistralclient API
methods. No changes to the API signatures are required. Each method
affected will determine if the value passed in is a definition file
name or file URI, or the actual definition.

New unit test cases were also added for these changes.

Change-Id: I9ca07bedf685839db130693a7aa6e091a9b8c4ad
Implements: blueprint mistral-mistral-actions
2016-02-26 11:58:13 -06:00
2015-10-05 14:38:06 +06:00
2015-11-23 21:15:35 +08:00
2015-09-17 12:16:50 +00:00

Mistral client

Python client for Mistral REST API. Includes python library for Mistral API and Command Line Interface (CLI) library.

Installation

First of all, clone the repo and go to the repo directory:

git clone git://git.openstack.org/openstack/python-mistralclient.git
cd python-mistralclient

Then just run:

pip install -e .

or

python setup.py install

Running Mistral client

If Mistral authentication is enabled, provide the information about OpenStack auth to environment variables. Type:

export OS_AUTH_URL=http://<Keystone_host>:5000/v2.0
export OS_USERNAME=admin
export OS_TENANT_NAME=tenant
export OS_PASSWORD=secret
export OS_MISTRAL_URL=http://<Mistral host>:8989/v2  (optional, by default URL=http://localhost:8989/v2)

and in the case that you are authenticating against keystone over https:

export OS_CACERT=<path_to_ca_cert>

Note: In client, we can use both Keystone auth versions - v2.0 and v3. But server supports only v3.

To make sure Mistral client works, type:

mistral workbook-list

You can see the list of available commands typing:

mistral --help
Description
Python client for Mistral REST API.
Readme 8.4 MiB
Languages
Python 99.2%
Shell 0.8%