Plan Management refactoring using Mistral workflows

Registered by Julie Pichon on 2016-07-19

Refactor the few remaining actions/workflows (mainly surrounding plan management) around Mistral so that they can be used by the UI.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
Julie Pichon
Direction:
Needs approval
Assignee:
Julie Pichon
Definition:
Approved
Series goal:
Accepted for newton
Implementation:
Implemented
Milestone target:
None
Started by
Julie Pichon on 2016-07-26
Completed by
Julie Pichon on 2016-09-06

Whiteboard

General status: all the necessary patches are now up for review, see list below.

Plan listing
----------------
Get a list of existing plans.

- Common:
  - Mistral action -> [rbrady] https://review.openstack.org/#/c/300221/ (Merged)
  - Add Zaqar messaging [flfuchs] https://review.openstack.org/#/c/347932/ ABANDONED, not needed
- Client command - [jpichon] https://review.openstack.org/#/c/350498/ (Merged)
- UI - [flfuchs] https://review.openstack.org/#/c/347919/ (Merged)

Creating a plan from a JSON file
------------------------------------------------
Mistral action/workflow that accepts a list of filenames and their content in a JSON structure in order to create a new plan. The workflow should create a Swift container with these files then create a new plan for it.

Example structure:
{
    "filename.yaml": "this file contents",
    "directory/other_dir/other_file.yaml": "that file contents"
}

A new workflow was created and abandoned for this ( https://review.openstack.org/#/c/347830/ - https://review.openstack.org/#/c/348216/ ). The upstream preference seems to be to upload to Swift directly (ideally in a tarball) then call the create_plan action.

- UI: (Parse the JSON file list and upload files to Swift directly -- or remove the ability to upload individual files and only allow tarball uploads) (Perhaps single JSON file upload + automatic extraction could be handled on the swift side with some kind of custom middleware? - http://docs.openstack.org/ops-guide/ops-customize-objectstorage.html) [flfuchs] https://review.openstack.org/#/c/360550/ + https://review.openstack.org/#/c/361561/ (both merged)

Deleting an existing plan
---------------------------------------

- Common:
  - Mistral action - rbrady strikes again! https://review.openstack.org/#/c/299937/ (Merged)
  - Workflow - should we consider using the action directly? (note: client patch calls action directly)
- Client command [jpichon] https://review.openstack.org/#/c/350617/ (Merged)
- UI [akrivoka, flfuchs] https://review.openstack.org/#/c/356458/ (Merged)

Starting a deployment
----------------------------------

- Common: https://review.openstack.org/#/c/298732/ (Merged)
- CLI: https://review.openstack.org/#/c/342261/ (Merged)
- UI: [jtomasek] https://review.openstack.org/#/c/357125/ - This is tracked separately as part of https://blueprints.launchpad.net/tripleo-ui/+spec/deployment-using-mistral-workflow . Because of that and since this blueprint is already large enough, I'm going to mark it as Implemented.

Additional work
-----------------------
Once this way of creating a plan is done, we probably want to refactor the 'create plan from tarball' workflow to do something similar. Right now the logic to create the Swift container is handled in the UI when it should really be handled in Mistral. This refactoring is separate from this blueprint and will be handled as part of another bug (to be linked later).

Gerrit topic: https://review.openstack.org/#q,topic:bp/tripleo-ui-mistral-refactoring,n,z

Addressed by: https://review.openstack.org/347919
    Move plan listing to use Mistral and Zaqar

Addressed by: https://review.openstack.org/356458
    Use Mistral API for plan deletion

Addressed by: https://review.openstack.org/360550
    Use Mistral/Zaqar for folder-based plan-creation

Addressed by: https://review.openstack.org/361561
    Port plan-edit file listing to use Swift

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.