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