blob: 1df19b753e210fb12905f567bdb277068d0803f7 [file] [log] [blame]
liangke01ef9142017-10-12 18:09:15 +08001================================
2MultiCloud Fake_Cloud User Case
3================================
4
5
6
7multilcoud-vmware server not only provide vio plugin to access real openstack platform,but
8also provide fake_cloud plugin which simulate thereal VIO function.The fake
9cloud is suitable for testing openstack function if there is not real VIO platform.
10
11
12Make sure you environment have msb,aai service and multicloud-vmware config file has the right msb_ip and
13msb_port value,The config file path is vio/vio/pub/config/congfig.py
14
15
16
17Register Fake Cloud to AAI
18~~~~~~~~~~~~~~~~~~~~~~~~~~
19
20Register vio information into AAI service with region name "vmware" and region id "fake"
21
22.. code-block:: console
23
Ethan Lynn42fbfdc2017-10-20 13:52:45 +080024 $ curl -X PUT -H "X-TransactionId":"get_aai_subr" -H "X-FromAppId":"AAI" -H "Accept":"application/json" \
liangkeabfed002017-10-23 16:24:37 +080025 -H "Content-Type:"application/json" -H "Authorization:Basic QUFJOkFBSQ==" \
Ethan Lynn42fbfdc2017-10-20 13:52:45 +080026 https://aai_ip:aai_port/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/vmware/fake \
27 -d "{
28 "cloud-owner": "vmware",
liangkeabfed002017-10-23 16:24:37 +080029 "cloud-region-id": "fake",
Ethan Lynn42fbfdc2017-10-20 13:52:45 +080030 "cloud-type": "vmware",
31 "cloud-region-version": "4.0",
liangkeabfed002017-10-23 16:24:37 +080032 "identity-url": "http://MSB_IP:MSB_PORT/api/multicloud/v0/vmware_fake/identity/v3",
33 "cloud-zone": "cloud zone",
34 "complex-name": "complex name",
Ethan Lynn42fbfdc2017-10-20 13:52:45 +080035 "esr-system-info-list": {
36 "esr-system-info": [
37 {
liangkeabfed002017-10-23 16:24:37 +080038 "system-name": "vmware-fake-cloud",
Ethan Lynn42fbfdc2017-10-20 13:52:45 +080039 "type": "vim",
40 "service-url": "http://127.0.0.1:5000/v3",
41 "user-name": "admin",
42 "password": "vmware",
liangkeabfed002017-10-23 16:24:37 +080043 "system-type": "VIM",
44 "ssl-insecure": true,
Ethan Lynn42fbfdc2017-10-20 13:52:45 +080045 "cloud-domain": "default",
46 "default-tenant": "admin",
Ethan Lynn42fbfdc2017-10-20 13:52:45 +080047 }
48 ]
49 }
50 }"
liangke01ef9142017-10-12 18:09:15 +080051
52
53the identity url reprent the fake cloud identity url.
54
55
56
57Test Examples
Ethan Lynn42fbfdc2017-10-20 13:52:45 +080058~~~~~~~~~~~~~
liangke01ef9142017-10-12 18:09:15 +080059
liangkeabfed002017-10-23 16:24:37 +080060the ${fake_identiy_url}= "http://MSB_IP:MSB_PORT/api/multicloud/v0/vmware_fake/identity/v3"
liangke01ef9142017-10-12 18:09:15 +080061the ${msb_address} = "MSB_IP:MSB_PORT"
62
63Get auth token
64--------------
65
66# send request to multicloud-framework(broker) service to get token
67
68.. code-block:: console
69
70 $ curl -X POST -d @test.json -H 'Content-Type:application/json' ${fake_identiy_url}
71
72test.json content example:
73
74::
75
76 {
liangkeabfed002017-10-23 16:24:37 +080077 "auth": {
liangke01ef9142017-10-12 18:09:15 +080078 "scope": {"project": {"id": “<project-id>”}},
79 "identity":
80 {
81 "password": {"user": {"domain": {"name": “<doman-name>”}, "password": “<user-password>”, "name": “<user-name>”}}, "methods": ["password"]
82 }
83 }
84 }
85
86
87Response:
88There are a large amounts of data including service endpoint, user information, etc.
89For our testing We take nova and identity service endpoint address and auth token which is in response header named X-Subject-Token”.
90
91# you can find the endpoint url namespace is "api/multicloiud-vio/v0/vmware_fake", it represent the multicloud-vio service, So
92requests sending to mulitcloud-vio will be forwarded to fake cloud.the ip and port reprenst ${msb_address}
93
94
95Identity endpoint:
96 http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity
97
98Nova endpoint:
99 http://$msb_address/api/multicloud-vio/v0/vmware_fake/compute/<user-tenantid>
100
101
102List projects
103-------------
104
105Use identitys endpoint: http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity/
106
107.. code-block:: console
108
109 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity/projects
110
111
112Get os Hypervisor
113-----------------
114
115Use novas endpoint: http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<user-tenantid>
116
117
118.. code-block:: console
119
120 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/os-hypervisors/detail
121
122
123List instance of users project
124--------------------------------
125
126.. code-block:: console
127
128 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers
129
130
131Show instance detail
132--------------------
133
134you need to input <server-id> in url path.
135
136.. code-block:: console
137
138 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vimid/nova/tenantid/servers/<server-id>
139
140
141Shutdown instance
142-----------------
143
144you need to input <server-id> in url path
145
146.. code-block:: console
147
148 $ curl -X POST -d '{"os-stop":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers/<server-id>/action
149
150
151Start instance
152--------------
153
154you need to input <server-id> in url path
155
156.. code-block:: console
157
158 $ curl -X POST -d '{"os-start":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers/<server-id>/action
159
160
161Suspend instance
162----------------
163
164you need to input <server-id> in url path
165
166.. code-block:: console
167
168 $ curl -X POST -d '{"suspend":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers/<server-id>/action
169
170
171Resume instance
172----------------
173
174you need to input <server-id> in url path
175
176.. code-block:: console
177
178 $ curl -X POST -d '{"resume":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers/<server-id>/action
179
180
181Pause instance
182--------------
183
184you need to input <server-id> in url path
185
186.. code-block:: console
187
188 $ curl -X POST -d '{"pause":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers/<server-id>/action
189
190
191Unpasue instance
192----------------
193
194you need to input <server-id> in url path
195
196.. code-block:: console
197
198 $ curl -X POST -d '{"unpause":null}' -H 'X-Auth-Token:<token> -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers/<server-id>/action
199
200
201Reboot instance
202---------------
203
204you need to input <server-id> in url path
205
206.. code-block:: console
207
208 $ curl -X POST -d '{"reboot":{"type":"HARD"}}' -H 'X-Auth-Token:<token> -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers/<server-id>/action
209