summaryrefslogtreecommitdiffstats
path: root/docs/MultiCloud-Test-Guide.rst
blob: b77b115737287cf2f88632e6209d5a97a53c34a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
..
 This work is licensed under a Creative Commons Attribution 4.0
 International License.

==========================
ONAP MultiCloud Test Guide
==========================

Test Examples
~~~~~~~~~~~~~

The env HOST_IP is msb-iag service cluster-ip value is "10.43.188.78"(see it
above).
The vimid is "vmware_vio"  the registered name in aai.


Get V2 auth token
-----------------

# VIO openstack  support keystone V2 version, vio proxy-plugin will check the
request body format, if request body format
# is keystone V2 format will access keystone V2  service, if not it will access
keystone V3 service.
# this example show how to access keystone V2 service.

.. code-block:: console

  $ curl -X POST -d @testV2.json  -H 'Content-Type:application/json'  http://$msb_address/api/multicloud/v0/<vimid>/identity/v2.0/tokens

testV2.json content:

::

  {
        "auth": {
            "tenantName": "admin",
            "passwordCredentials": {
                "username": "admin",
                "password": "vmware"
            }
        }
  }


Response:
There are a large amounts of data including service endpoint, user information,
etc.
For our testing  We  take nova and identity service endpoint address and auth
token which is in response header named “X-Subject-Token”.

# you can find the endpoint url namespace is "api/multicloiud-vio/v0", it
represent the multicloud-vio service, So
requests sending to mulitcloud-vio will be forwarded to backend  VIO openstack.


Identity endpoint::

  http://$msb_address/api/multicloud-vio/v0/<vimid>/identity

Nova endpoint::

  http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<user-tenantid>


Get V3 auth token
-----------------

# send request to multicloud-framework(broker) service to get token

.. code-block:: console

  $ curl -X  POST   -d @test.json  -H 'Content-Type:application/json'   http://$msb_address/api/multicloud/v0/<vimid>/identity/v3/auth/tokens

test.json content example:

::

  {
    "auth": sudo pip install virtualenv{
      "scope": {"project": {"id": “<project-id>”}},
      "identity":
    {
    "password": {"user": {"domain": {"name": “<doman-name>”}, "password": “<user-password>”, "name": “<user-name>”}}, "methods": ["password"]
    }
    }
  }


Response:
There are a large amounts of data including service endpoint, user information,
etc.
For our testing  We  take nova and identity service endpoint address and auth
token which is in response header named “X-Subject-Token”.

# you can find the endpoint url namespace is "api/multicloiud-vio/v0", it
represent the multicloud-vio service, So
requests sending to mulitcloud-vio will be forwarded to backend  VIO openstack.


Identity endpoint::

  http://$msb_address/api/multicloud-vio/v0/<vimid>/identity

Nova endpoint::

  http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<user-tenantid>


List projects
-------------

Use identity’s endpoint:  http://$msb_address/api/multicloud-vio/v0/<vimid>/identity/

.. code-block:: console

  $ curl -X GET   -H 'X-Auth-Token:<token>'  http://$msb_address/api/multicloud-vio/v0/<vimid>/identity/projects


Get os Hypervisor
-----------------

Use nova’s endpoint:  http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<user-tenantid>


.. code-block:: console

  $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/os-hypervisors/detail


List instance of  user’s project
--------------------------------

.. code-block:: console

  $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers


Show instance detail
--------------------

you need to input <server-id> in url path.

.. code-block:: console

  $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vimid/nova/tenantid/servers/<server-id>


Shutdown instance
-----------------

you need to input <server-id> in url path

.. code-block:: console

  $ 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


Start instance
--------------

you need to input <server-id> in url path

.. code-block:: console

  $ 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


Suspend instance
----------------

you need to input <server-id> in url path

.. code-block:: console

   $ 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


Resume  instance
----------------

you need to input <server-id> in url path

.. code-block:: console

  $ 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


Pause instance
--------------

you need to input <server-id> in url path

.. code-block:: console

  $ 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


Unpasue instance
----------------

you need to input <server-id> in url path

.. code-block:: console

  $ 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


Reboot instance
---------------

you need to input <server-id> in url path

.. code-block:: console

  $ 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


Upload Image Task
-----------------

create uploading image task by image url:

.. code-block:: console

   $ curl -X POST -d '{"input": {"image_properties":
     {"container_format": "bare", "name": "<image_name>"},
     "import_from_format": "<disk_format>",
     "import_from": "<image_url>"},
     "type": "import"}'
     -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/<vimid>/glance/v2/tasks

get the taskid from response body,then query the task status by taskid.

.. code-block:: console

   $ curl -X GET -H 'X-Auth-Token:<token>'  http://$msb_address/api/multicloud-vio/v0/<vimid>/glance/v2/tasks/<taskid>

You can see the description and properties of task in response body,if 'status'
is  success, it will show image_id in result block.

query the image status by image_id

.. code-block:: console

  $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/<vimid>/glance/v2/images/<image_id>