Merge "Initial code for pecan framework"
[multicloud/framework.git] / docs / specs / multicloud_image_service.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright (c) 2017-2018 VMware, Inc.
4
5
6 =================
7 Image Service
8 =================
9
10 Because Multicloud provides a cloud mediation layer supporting multiple clouds. It's necessary to
11 introduces some function enhancements in it. Image Service could let user upload/download images
12 in a convinient way just by using Multicloud.
13
14
15 Problem Description
16 ===================
17
18 The original functions which Multicloud possesses are to use urls to upload images, while in this
19 spec we intend to upload images as raw file which means it has to store a copy in Multicloud then
20 upload the images to the backend openstack. So this spec is to extend multicloud to support
21 download/upload images as raw file rather than a through a url
22
23
24 Use Cases
25 ===================
26
27 One typical use case is to allow users to upload/download images by Multicloud
28
29
30 Proposed change
31 ===================
32
33 The proposed change mainly means introducing glance python APIs to enable multicloud support openstack
34 image service. This feature needs two changes: Upload API to import an image to backend OpenStack
35 and the image that just imported can be queried from MultiCloud. Download API to download an image
36 from backend Openstack and the image can be downloaded from MultiCloud.
37
38 The eventual work flow looks like as follows:
39
40              user request to upload image
41                         |
42                         V
43               +------------------+
44               |                  |
45               |  image file(iso, |
46               |   vmdk... )      |
47               |                  |
48               +---------+--------+
49                         |
50                         |
51                         |
52             +-----------|----------+
53             | multicloud|          |
54             |           V          |
55             | +------------------+ |
56             | | image service API| |
57             | +---------+--------+ |
58             +-----------|----------+
59                         | glance
60                         |
61                         V
62             +----------------------+
63             | openstack            |
64             +----------------------+
65
66 The APIs look like this:
67
68 upload:
69
70 Input of /{vimid}/{tenantid}/images/file  will be
71
72 ::
73   required: image file
74   {
75     "imageType": string,  // image type: ami, ari, aki, vhd, vhdx, vmdk, raw, qcow2, vdi, iso
76     "containerFormat": string,  // image container format: ami, ari, aki, bare, ovf, ova, docker
77     "visibility": string,  // public, private, shared, or community
78     "properties": arrary // list of properties
79   }
80
81 Output of upload_image will be
82
83 ::
84   "responses": {
85     "201": {
86         "description": "upload successfully",
87     },
88     "404": {
89         "description": "the vim id or tenant UUID is wrong"
90     },
91     "500": {
92         "description": "the vim image is not accessable"
93     }
94
95 download:
96
97 Input of /{vimid}/{tenantid}/images/file/{imageid}  will be
98
99 ::
100   {
101     "imagepath": string,  // the path of the downloaded image
102     "properties": arrary // list of properties
103   }
104
105 Output of download_image will be
106
107 ::
108   "responses": {
109     "200": {
110         "description": "download successfully",
111     },
112     "404": {
113         "description": "the vim id or tenant UUID is wrong"
114     },
115     "500": {
116         "description": "the vim image is not accessable"
117     }