blob: b77b115737287cf2f88632e6209d5a97a53c34a8 [file] [log] [blame]
Li Xinhui221195b2018-04-11 12:16:53 +08001..
2 This work is licensed under a Creative Commons Attribution 4.0
3 International License.
Ethan Lynn2906f882018-01-15 10:32:43 +08004
Ethan Lynnec911032017-10-30 13:36:33 +08005==========================
6ONAP MultiCloud Test Guide
7==========================
8
9Test Examples
10~~~~~~~~~~~~~
11
Ethan Lynnb3e79cc2018-06-05 17:26:55 +080012The env HOST_IP is msb-iag service cluster-ip value is "10.43.188.78"(see it
13above).
Ethan Lynnec911032017-10-30 13:36:33 +080014The vimid is "vmware_vio" the registered name in aai.
15
16
17Get V2 auth token
18-----------------
19
Ethan Lynnb3e79cc2018-06-05 17:26:55 +080020# VIO openstack support keystone V2 version, vio proxy-plugin will check the
21request body format, if request body format
22# is keystone V2 format will access keystone V2 service, if not it will access
23keystone V3 service.
Ethan Lynnec911032017-10-30 13:36:33 +080024# this example show how to access keystone V2 service.
Ethan Lynnb3e79cc2018-06-05 17:26:55 +080025
Ethan Lynnec911032017-10-30 13:36:33 +080026.. code-block:: console
27
28 $ curl -X POST -d @testV2.json -H 'Content-Type:application/json' http://$msb_address/api/multicloud/v0/<vimid>/identity/v2.0/tokens
29
30testV2.json content:
31
32::
33
34 {
35 "auth": {
36 "tenantName": "admin",
37 "passwordCredentials": {
38 "username": "admin",
39 "password": "vmware"
40 }
41 }
42 }
43
44
45Response:
Ethan Lynnb3e79cc2018-06-05 17:26:55 +080046There are a large amounts of data including service endpoint, user information,
47etc.
48For our testing We take nova and identity service endpoint address and auth
49token which is in response header named X-Subject-Token”.
Ethan Lynnec911032017-10-30 13:36:33 +080050
Ethan Lynnb3e79cc2018-06-05 17:26:55 +080051# you can find the endpoint url namespace is "api/multicloiud-vio/v0", it
52represent the multicloud-vio service, So
Ethan Lynnec911032017-10-30 13:36:33 +080053requests sending to mulitcloud-vio will be forwarded to backend VIO openstack.
54
55
Ethan Lynnb3e79cc2018-06-05 17:26:55 +080056Identity endpoint::
Ethan Lynnec911032017-10-30 13:36:33 +080057
Ethan Lynnb3e79cc2018-06-05 17:26:55 +080058 http://$msb_address/api/multicloud-vio/v0/<vimid>/identity
59
60Nova endpoint::
61
62 http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<user-tenantid>
Ethan Lynnec911032017-10-30 13:36:33 +080063
64
65Get V3 auth token
66-----------------
67
68# send request to multicloud-framework(broker) service to get token
69
70.. code-block:: console
71
72 $ curl -X POST -d @test.json -H 'Content-Type:application/json' http://$msb_address/api/multicloud/v0/<vimid>/identity/v3/auth/tokens
73
74test.json content example:
75
76::
77
78 {
79 "auth": sudo pip install virtualenv{
80 "scope": {"project": {"id": “<project-id>”}},
81 "identity":
Ethan Lynnb3e79cc2018-06-05 17:26:55 +080082 {
83 "password": {"user": {"domain": {"name": “<doman-name>”}, "password": “<user-password>”, "name": “<user-name>”}}, "methods": ["password"]
84 }
Ethan Lynnec911032017-10-30 13:36:33 +080085 }
86 }
87
88
89Response:
Ethan Lynnb3e79cc2018-06-05 17:26:55 +080090There are a large amounts of data including service endpoint, user information,
91etc.
92For our testing We take nova and identity service endpoint address and auth
93token which is in response header named X-Subject-Token”.
Ethan Lynnec911032017-10-30 13:36:33 +080094
Ethan Lynnb3e79cc2018-06-05 17:26:55 +080095# you can find the endpoint url namespace is "api/multicloiud-vio/v0", it
96represent the multicloud-vio service, So
Ethan Lynnec911032017-10-30 13:36:33 +080097requests sending to mulitcloud-vio will be forwarded to backend VIO openstack.
98
99
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800100Identity endpoint::
Ethan Lynnec911032017-10-30 13:36:33 +0800101
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800102 http://$msb_address/api/multicloud-vio/v0/<vimid>/identity
103
104Nova endpoint::
105
106 http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<user-tenantid>
Ethan Lynnec911032017-10-30 13:36:33 +0800107
108
109List projects
110-------------
111
112Use identitys endpoint: http://$msb_address/api/multicloud-vio/v0/<vimid>/identity/
113
114.. code-block:: console
115
116 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/<vimid>/identity/projects
117
118
119Get os Hypervisor
120-----------------
121
122Use novas endpoint: http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<user-tenantid>
123
124
125.. code-block:: console
126
127 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/os-hypervisors/detail
128
129
130List instance of users project
131--------------------------------
132
133.. code-block:: console
134
135 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers
136
137
138Show instance detail
139--------------------
140
141you need to input <server-id> in url path.
142
143.. code-block:: console
144
145 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vimid/nova/tenantid/servers/<server-id>
146
147
148Shutdown instance
149-----------------
150
151you need to input <server-id> in url path
152
153.. code-block:: console
154
155 $ curl -X POST -d '{"os-stop":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers/<server-id>/action
156
157
158Start instance
159--------------
160
161you need to input <server-id> in url path
162
163.. code-block:: console
164
165 $ curl -X POST -d '{"os-start":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers/<server-id>/action
166
167
168Suspend instance
169----------------
170
171you need to input <server-id> in url path
172
173.. code-block:: console
174
175 $ curl -X POST -d '{"suspend":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers/<server-id>/action
176
177
178Resume instance
179----------------
180
181you need to input <server-id> in url path
182
183.. code-block:: console
184
185 $ curl -X POST -d '{"resume":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers/<server-id>/action
186
187
188Pause instance
189--------------
190
191you need to input <server-id> in url path
192
193.. code-block:: console
194
195 $ curl -X POST -d '{"pause":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers/<server-id>/action
196
197
198Unpasue instance
199----------------
200
201you need to input <server-id> in url path
202
203.. code-block:: console
204
205 $ curl -X POST -d '{"unpause":null}' -H 'X-Auth-Token:<token> -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers/<server-id>/action
206
207
208Reboot instance
209---------------
210
211you need to input <server-id> in url path
212
213.. code-block:: console
214
215 $ curl -X POST -d '{"reboot":{"type":"HARD"}}' -H 'X-Auth-Token:<token> -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers/<server-id>/action
216
217
218Upload Image Task
219-----------------
220
221create uploading image task by image url:
222
223.. code-block:: console
224
225 $ curl -X POST -d '{"input": {"image_properties":
226 {"container_format": "bare", "name": "<image_name>"},
227 "import_from_format": "<disk_format>",
228 "import_from": "<image_url>"},
229 "type": "import"}'
230 -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/<vimid>/glance/v2/tasks
231
232get the taskid from response body,then query the task status by taskid.
233
234.. code-block:: console
235
236 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/<vimid>/glance/v2/tasks/<taskid>
237
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800238You can see the description and properties of task in response body,if 'status'
239is success, it will show image_id in result block.
Ethan Lynnec911032017-10-30 13:36:33 +0800240
241query the image status by image_id
242
243.. code-block:: console
244
245 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/<vimid>/glance/v2/images/<image_id>