Add option for users to import images using tasks

Registered by Janet Yu on 2015-07-08

Summary
=======
A feature recently added to Glance allows users to create images using an import task. Add an option to the Create Image form in Horizon to use this feature and a new table in the Images panels to view all tasks.

Motivation
========
Users can import data from some location that will be introspected by Glance to create an image, as an alternative workflow to creating an image by copying an existing one. It would be handy to have this import option available in Horizon.

Description
=========
v2 of the Glance client now has a tasks API, which can be used to fire off an import task to create an image. The API can also be used to poll for the status of a task and list all tasks that have been created. Use this API from the Create Image form in Horizon to create an image using an import task. Move the existing Images table into a tab and create a new tab with a list of all tasks in a new Tasks table.

UX
===
The import option would be an alternative to the existing "Copy Data" option in the Create image form. The copy option is currently included in the form as a checkbox, which allows the user to either have the image copied or use the data where it currently resides. Now that a third option is being introduced, a checkbox is insufficient to represent all options. Change the checkbox to a dropdown list.

Wireframes, Mocks, Videos and UI Markup
---------------------------------------------------------
Screenshots of a) Create Image form, with a new "Import Data" option and b) Tasks tab, alongside new Images tab, which contains the existing Images table:
https://invis.io/S33TEMG4E

Testing
======
From the Images panel, open the Create Image form. Enter value in the required field, plus an Image Source and Image Location. Select the "Import Data" option from the "Upload Type" field (exact names may change during implementation). Submit the form. Click on the Tasks tab to see that a row for the new import task has been added to the Tasks table. Once the task has started the actual image creation, a row for the new image should be added to the Images table. Both rows should eventually reach either a success or failure state. If the image ends up in a failure state, Glance will delete the image, so the row for that image will disappear from the Images table if the page is refreshed.

Outside Dependencies
==================
This feature will use the tasks API from v2 of the Glance client, which is already implemented [1].

Requirements Update Required
========================
N/A

Doc Impact
=========
N/A

[1] https://blueprints.launchpad.net/glance/+spec/new-upload-workflow

Blueprint information

Status:
Complete
Approver:
Lin Hua Cheng
Priority:
Medium
Drafter:
Janet Yu
Direction:
Approved
Assignee:
Janet Yu
Definition:
Obsolete
Series goal:
Proposed for liberty
Implementation:
Needs Code Review
Milestone target:
None
Started by
Janet Yu on 2015-08-26
Completed by
David Lyle on 2016-10-28

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/import-images,n,z

Addressed by: https://review.openstack.org/217020 -- MERGED
    Refactor DataTable filtering functions into mixin

Addressed by: https://review.openstack.org/218773
    Provide option to create images by importing data

[TravT] Added this question to invision: If the image will show up in the images table anyway, why is it better to have a tasks panel that the user has to go to and cross reference with the image, rather than them just seeing the status (using tasks or not) in the images table itself? What extra value is it to end users to know that the data is copied in using v1 vs the data is imported using tasks? Can't this just be done transparently based on whether or not v2 is available?

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.