Add document dir into framework
[multicloud/framework.git] / doc / user / keystoneproxy / multivimproxy.txt
1 prepare environment:
2 system: centos7-64bit, 8GB RAM, 4 CPU
3
4 docker images:
5 docker pull onapmulticloud/common-services-msb
6 docker pull onapmulticloud/common-services-extsys
7 docker pull onapmulticloud/common-services-drivermanager
8 docker pull onapmulticloud/gso-service-gateway
9 docker pull onapmulticloud/gso-service-manager
10 docker pull onapmulticloud/gso-gui-portal
11
12 # login onap and pull those two images
13 docker login -u docker -p docker nexus3.onap.org:10001
14 docker pull nexus3.onap.org:10001/onapmulticloud/multivim-broker:r1
15 docker pull nexus3.onap.org:10001/onapmulticloud/multivim-vio-driver:r1
16
17
18 run msb docker server
19
20 docker run -t --name i-msb -p 80:80 onapmulticloud/common-services-msb
21
22 Run other docker server:
23    Assign the host ip to MSB_ADDR. If server cannot connect to msb server, please check iptables rule on host may block this connection.
24
25 docker run -t -e MSB_ADDR=$HOST_IP:80 onapmulticloud/gso-service-gateway
26 docker run -t -e MSB_ADDR=$HOST_IP:80 onapmulticloud/common-services-extsys
27 docker run -t -e MSB_ADDR=$HOST_IP:80 onapmulticloud/common-services-drivermanager
28 docker run -t -e MSB_ADDR=$HOST_IP:80 onapmulticloud/gso-gui-portal
29 docker run -t -e MSB_ADDR=$HOST_IP:80 onapmulticloud/gso-service-manage
30 docker run -t --name multivim-driver-vio-test -e MSB_ADDR=$HOST_IP:80   nexus3.onap.org:10001/onapmulticloud/multivim-vio-driver:r1
31 docker run -t --name multivim-broker-test -e MSB_ADDR= $HOST_IP:80    nexus3.onap.org:10001/onapmulticloud/multivim-broker:r1
32
33
34 Login Dashboard
35
36 Access: http://$HOST_IP/openoui/microservices/index.html
37
38 Register your openstack enviroment in extsys server
39 Choose  'extsys' —>  'vim Managent' —> 'post vim'
40
41
42 Request body Example:
43 {
44   "id": "",
45   "name": "vmware-vio",
46   "vendor": "vmware",
47   "version": "4.0",
48   "description": "test",
49   "type": "vmware",       # It must be ‘vmware’ so will use multvim-proxy service to execute requests
50   "createTime": "",
51   "category": "",
52   "url": "https://10.154.2.225:5000/v3",     # keystone auth_url
53   "userName": "admin",
54   "password": "vmware",
55   "domain": "default",
56   "tenant": "admin"
57 }
58
59 response example:
60
61 Response:
62 {
63     "name": "vmware-vio",
64     "vendor": "vmware",
65     "version": "4.0",
66     "description": "test",
67     "type": "vmware",
68     "createTime": "2017-08-14 21:28:05",
69     "vimId": "a5b17aaa-a142-4a50-b425-f1e6eab7136d",   # vimid
70     "userName": "admin",
71     "password": "vmware",
72     "domain": "default",
73     "tenant": "admin"
74 }
75
76
77
78 2 Testing Examples
79
80 2.1  Get auth token
81
82 you need to input <vimid> in url path.
83
84 curl -X  POST   -d @test.json  -H 'Content-Type:application/json'   http://$HOST_IP/api/multivim/v1/<vimid>/identity/auth/tokens
85
86 test.json content example:
87
88 {
89         "auth":
90         {
91                 "scope": {"project": {"id": “<project-id>”}},
92                 "identity":
93                 {
94                         "password": {"user": {"domain": {"name": “<doman-name>”}, "password": “<user-password>”, "name": “<user-name>”}}, "methods": ["password"]
95                 }
96         }
97 }
98
99
100 Response:
101 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”.
102
103 Identity endpoint:
104         http://$HOST_IP/api/multivim-vio/v1/<vimid>/identity
105
106 Nova endpoint:
107         http://$HOST_IP/api/multivim-vio/v1/<vimid>/compute/<user-tenantid>
108
109
110 2.2 List projects
111
112 Use identity’s endpoint:  http://$HOST_IP/api/multivim-vio/v1/<vimid>/identity/
113
114 curl -X GET   -H 'X-Auth-Token:<token>'  http://$HOST_IP/api/multivim-vio/v1/<vimid>/identity/projects
115
116
117 2.3 Get os Hypervisor
118
119 Use nova’s endpoint:  http://$HOST_IP/api/multivim-vio/v1/<vimid>/nova/<user-tenantid>
120
121
122 curl -X GET   -H 'X-Auth-Token:<token>'   http://$HOST_IP/api/multivim-vio/v1/<vimid>/nova/<tenantid>/os-hypervisors/detail
123
124
125 2.4  List instance of  user’s project
126
127 curl -X GET   -H 'X-Auth-Token:<token>'    http://$HOST_IP/api/multivim-vio/v1/<vimid>/nova/<tenantid>/servers
128
129
130 2.5  Show instance detail
131
132 you need to input <server-id> in url path.
133
134 curl -X GET   -H 'X-Auth-Token:<token>'    http://$HOST_IP/api/multivim-vio/v1/vimid/nova/tenantid/servers/<server-id>
135
136
137 2.6 Shutdown instance
138
139 you need to input <server-id> in url path
140
141 curl -X POST -d '{"os-stop":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json'  http://$HOST_IP/api/multivim-vio/v1/<vimid>/nova/<tenantid>/servers/<server-id>/action
142
143
144 2.7  Start instance
145
146 you need to input <server-id> in url path
147
148 curl -X POST -d '{"os-start":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json'  http://$HOST_IP/api/multivim-vio/v1/<vimid>/nova/<tenantid>/servers/<server-id>/action
149
150
151 2.8  Suspend instance
152
153 you need to input <server-id> in url path
154
155 curl -X POST -d '{"suspend":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json'  http://$HOST_IP/api/multivim-vio/v1/<vimid>/nova/<tenantid>/servers/<server-id>/action
156
157
158 2.9 Resume  instance
159
160 you need to input <server-id> in url path
161
162 curl -X POST -d '{"resume":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json'  http://$HOST_IP/api/multivim-vio/v1/<vimid>/nova/<tenantid>/servers/<server-id>/action
163
164
165 2.10  Pause instance
166
167 you need to input <server-id> in url path
168
169 curl -X POST -d '{"pause":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json'  http://$HOST_IP/api/multivim-vio/v1/<vimid>/nova/<tenantid>/servers/<server-id>/action
170
171
172
173 2.11 Unpasue instance
174
175 you need to input <server-id> in url path
176
177 curl -X POST -d '{"unpause":null}' -H 'X-Auth-Token:<token> -H 'Content-Type:application/json'  http://$HOST_IP/api/multivim-vio/v1/<vimid>/nova/<tenantid>/servers/<server-id>/action
178
179
180 2.12 Reboot instance
181
182 you need to input <server-id> in url path
183
184 curl -X POST -d '{"reboot":{"type":"HARD"}}' -H 'X-Auth-Token:<token> -H 'Content-Type:application/json'  http://$HOST_IP/api/multivim-vio/v1/<vimid>/nova/<tenantid>/servers/<server-id>/action