blob: c7bd278803303c9a66dfa8c9e75a68913dfd5ac4 [file] [log] [blame]
Rene_Robertfb177972019-07-09 14:39:47 +02001.. This work is licensed under a Creative Commons Attribution 4.0
2.. International License. http://creativecommons.org/licenses/by/4.0
3.. Copyright 2019 ONAP Contributors. All rights reserved.
4
andreasgeissler7789a222019-07-16 18:44:23 +02005.. _doc_guide_user_ser_inst_so1:
Rene_Robertfb177972019-07-09 14:39:47 +02006
7
andreasgeissler7789a222019-07-16 18:44:23 +02008A La Carte mode Service Instantiation via ONAP SO API
9=====================================================
Rene_Robertfb177972019-07-09 14:39:47 +020010
Rene_Robertf45d05a2019-07-31 17:13:35 +020011Using ONAP SO API in "A La Carte" mode, the user needs to send
12a request to instantiate the service object but also for each VNF/VF-module
13and network that compose the Service.
Rene_Robertfb177972019-07-09 14:39:47 +020014
Rene_Robertf45d05a2019-07-31 17:13:35 +020015ONAP will instantiate resources on Cloud platforms only when user is requesting
16to instantiate VF-module or Network (openstack neutron or contrail).
Rene_Robertfb177972019-07-09 14:39:47 +020017
Rene_Robertf45d05a2019-07-31 17:13:35 +020018To instantiate a VF-module, it is required to have instantiated a VNF object.
19
20To instantiate a VNF object, it is required to have instantiated
21a Service object.
22
23To instantiate a Network object, it is required to have instantiated
24a Service object.
25
26**Requests**
27 * `Request to instantiate Service object`_
28 * `Request to instantiate VNF object`_
29 * `Requests to instantiate VF-module object`_
30 * `Requests to instantiate Neutron Network object`_
31 * `Requests to instantiate a Contrail Network object`_
Rene_Robertfb177972019-07-09 14:39:47 +020032
33
Rene_Robertf45d05a2019-07-31 17:13:35 +020034Request to instantiate Service object
35-------------------------------------
Rene_Robertfb177972019-07-09 14:39:47 +020036
37Example to request a service instance directly to ONAP SO
38
Rene_Robertf45d05a2019-07-31 17:13:35 +020039::
Rene_Robertfb177972019-07-09 14:39:47 +020040
Rene_Robertf45d05a2019-07-31 17:13:35 +020041 curl -X POST \
42 http://so.api.simpledemo.onap.org:30277/onap/so/infra/serviceInstances/v7/serviceInstances \
43 -H 'Accept: application/json' \
44 -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
45 -H 'Content-Type: application/json' \
46 -H 'X-FromAppId: AAI' \
47 -H 'X-TransactionId: get_aai_subscr' \
48 -H 'cache-control: no-cache' \
49 -d '{
50 "requestDetails": {
51 "requestInfo": {
52 "instanceName": "integration_test_service_instance_001",
53 "source": "VID",
54 "suppressRollback": false,
55 "requestorId": "demo"
56 },
57 "modelInfo": {
58 "modelType": "service",
59 "modelInvariantId": "b0631a6c-ec7a-4f0c-a9ac-4423d9d67a7f",
60 "modelVersionId": "aafd5523-2cc5-4c86-957e-18bc37355f7a",
61 "modelName": "integration_test_ubuntu16",
62 "modelVersion": "1.0"
63 },
64 "cloudConfiguration": {
65 "tenantId": "3e3b55ca4c9948d1a9fa68715831c6bd",
66 "cloudOwner": "OPNFV",
67 "lcpCloudRegionId": "RegionOne"
68 },
69 "requestParameters": {
70 "userParams": [],
71 "testApi": "VNF_API",
72 "subscriptionServiceType": "integration_test_ubuntu16",
73 "aLaCarte": true
74 },
75 "subscriberInfo": {
76 "globalSubscriberId": "integration_test_customer"
77 },
78 "project": {
79 "projectName": "integration_test_project"
80 },
81 "owningEntity": {
82 "owningEntityId": "6b5b6b70-4e9a-4f6f-8b7b-cbd7cf990c6e",
83 "owningEntityName": "integration_test_OE"
84 }
85 }
86 }'
Rene_Robertfb177972019-07-09 14:39:47 +020087
88
89
90In the response, you will obtain the serviceOrderId value.
91
92Then you have the possibility to check about the SO request
93(here after the requestId=e3ad8df6-ea0d-4384-be95-bcb7dd39bbde).
94
95This will allow you to get the serviceOrder Status (completed, failed...)
96
97::
98
99 curl -X GET \
100 http://so.api.simpledemo.onap.org:30277/onap/so/infra/orchestrationRequests/v6/e3ad8df6-ea0d-4384-be95-bcb7dd39bbde \
101 -H 'Accept: application/json' \
102 -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
103 -H 'Content-Type: application/json' \
104 -H 'X-FromAppId: AAI' \
105 -H 'X-TransactionId: get_aai_subscr' \
106 -H 'cache-control: no-cache'
107
108
Rene_Robertf45d05a2019-07-31 17:13:35 +0200109Request to instantiate VNF object
110---------------------------------
111
112To instantiate a VNF, you need to build an other request.
Rene_Robertfb177972019-07-09 14:39:47 +0200113All necessary parameters are available in the Tosca service template
114generated by SDC when you defined your service model.
115
116::
117
118 curl -X POST \
119 http://so.api.simpledemo.onap.org:30277/onap/so/infra/serviceInstances/v6/95762b50-0244-4723-8fde-35f911db9263/vnfs \
120 -H 'Accept: application/json' \
121 -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
122 -H 'Content-Type: application/json' \
123 -H 'X-FromAppId: AAI' \
124 -H 'X-TransactionId: get_aai_subscr' \
125 -H 'cache-control: no-cache' \
126 -d '{
127 "requestDetails": {
128 "requestInfo": {
129 "productFamilyId": "0d463b0c-e559-4def-8d7b-df64cfbd3159",
130 "instanceName": "my_service_vnf_instance_001",
131 "source": "VID",
132 "suppressRollback": false,
133 "requestorId": "test"
134 },
135 "modelInfo": {
136 "modelType": "vnf",
137 "modelInvariantId": "4e66bb92-c597-439e-822d-75aaa69b13d4",
138 "modelVersionId": "3b6ba59c-287c-449e-a1da-2db49984a087",
139 "modelName": "my_service_VF",
140 "modelVersion": "1.0",
141 "modelCustomizationId": "",
142 "modelCustomizationName": ""
143 },
144 "requestParameters": {
145 "userParams": [],
146 "aLaCarte": true,
147 "testApi": "VNF_API"
148 },
149 "cloudConfiguration": {
150 "lcpCloudRegionId": "my_cloud_site",
151 "tenantId": "5906b9b8fd9642df9ba1c9e290063439"
152 },
153 "lineOfBusiness": {
154 "lineOfBusinessName": "test_LOB"
155 },
156 "platform": {
157 "platformName": "test_platform"
158 },
159 "relatedInstanceList": [{
160 "relatedInstance": {
161 "instanceId": "95762b50-0244-4723-8fde-35f911db9263",
162 "modelInfo": {
163 "modelType": "service",
164 "modelName": "my-service-model",
165 "modelInvariantId": "11265d8c-2cc2-40e5-95d8-57cad81c18da",
166 "modelVersion": "1.0",
167 "modelVersionId": "0d463b0c-e559-4def-8d7b-df64cfbd3159"
168 }
169 }
170 }]
171 }
172 }'
173
Rene_Robertf45d05a2019-07-31 17:13:35 +0200174
175Requests to instantiate VF-module object
176----------------------------------------
177
Rene_Robertfb177972019-07-09 14:39:47 +0200178To instantiate a VF module, you need to build two complex requests
179All necessary parameters are available in the Tosca service template
180generated by SDC when you defined your service model.
181
1821st request is called a "SDNC-preload" for a VNF object and is used
183to store in SDNC some VNF parameters values
andreasgeissler7789a222019-07-16 18:44:23 +0200184that will be needed for the instantiation
Rene_Robertfb177972019-07-09 14:39:47 +0200185
186::
187
188 curl -X POST \
189 http://sdnc.api.simpledemo.onap.org:30202/restconf/operations/VNF-API:preload-vnf-topology-operation \
190 -H 'Accept: application/json' \
191 -H 'Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==' \
192 -H 'Content-Type: application/json' \
193 -H 'X-FromAppId: API client' \
194 -H 'X-TransactionId: 0a3f6713-ba96-4971-a6f8-c2da85a3176e' \
195 -H 'cache-control: no-cache' \
196 -d '{
197 "input": {
198 "request-information": {
199 "notification-url": "onap.org",
200 "order-number": "1",
201 "order-version": "1",
202 "request-action": "PreloadVNFRequest",
203 "request-id": "test"
204 },
205 "sdnc-request-header": {
206 "svc-action": "reserve",
207 "svc-notification-url": "http:\/\/onap.org:8080\/adapters\/rest\/SDNCNotify",
208 "svc-request-id": "test"
209 },
210 "vnf-topology-information": {
211 "vnf-assignments": {
212 "availability-zones": [],
213 "vnf-networks": [],
214 "vnf-vms": []
215 },
216 "vnf-parameters": [],
217 "vnf-topology-identifier": {
218 "generic-vnf-name": "my_service_vnf_instance_001",
219 "generic-vnf-type": "",
220 "service-type": "95762b50-0244-4723-8fde-35f911db9263",
221 "vnf-name": "my_service_vfmodule_001",
222 "vnf-type": ""
223 }
224 }
225 }
226 }'
227
andreasgeissler7789a222019-07-16 18:44:23 +0200228The 2nd request is to instantiate the VF module via ONAP SO
Rene_Robertfb177972019-07-09 14:39:47 +0200229(instance name must be identical in both requests)
230
231::
232
233 curl -X POST \
andreasgeissler7789a222019-07-16 18:44:23 +0200234 http://so.api.simpledemo.onap.org:30277/onap/so/infra/serviceInstances/v6/95762b50-0244-4723-8fde-35f911db9263/vnfs/vfModules \
Rene_Robertfb177972019-07-09 14:39:47 +0200235 -H 'Accept: application/json' \
236 -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
237 -H 'Content-Type: application/json' \
238 -H 'X-FromAppId: AAI' \
239 -H 'X-TransactionId: get_aai_subscr' \
240 -H 'cache-control: no-cache' \
241 -d '{
242 "requestDetails": {
243 "requestInfo": {
244 "instanceName": "my_vfmodule_001",
245 "source": "VID",
246 "suppressRollback": false,
247 "requestorId": "test"
248 },
249 "modelInfo": {
250 "modelType": "vfModule",
251 "modelInvariantId": "",
252 "modelVersionId": "",
253 "modelName": "",
254 "modelVersion": "1",
255 "modelCustomizationId": "",
256 "modelCustomizationName": ""
257 },
258 "requestParameters": {
259 "userParams": [],
260 "testApi": "VNF_API",
261 "usePreload": true
262 },
263 "cloudConfiguration": {
264 "lcpCloudRegionId": "my_cloud_site",
265 "tenantId": "5906b9b8fd9642df9ba1c9e290063439"
266 },
267 "relatedInstanceList": [{
268 "relatedInstance": {
269 "instanceId": "95762b50-0244-4723-8fde-35f911db9263",
270 "modelInfo": {
271 "modelType": "service",
272 "modelName": "my-service-model",
273 "modelInvariantId": "11265d8c-2cc2-40e5-95d8-57cad81c18da",
274 "modelVersion": "1.0",
275 "modelVersionId": "0d463b0c-e559-4def-8d7b-df64cfbd3159"
276 }
277 }
278 },
279 {
280 "relatedInstance": {
281 "instanceId": "",
282 "modelInfo": {
283 "modelType": "vnf",
284 "modelName": "my_service_model_VF",
285 "modelInvariantId": "4e66bb92-c597-439e-822d-75aaa69b13d4",
286 "modelVersion": "1.0",
287 "modelVersionId": "3b6ba59c-287c-449e-a1da-2db49984a087",
288 "modelCustomizationId": "",
289 "modelCustomizationName": ""
290 }
291 }
292 }]
293 }
294 }'
295
296
297
Rene_Robertf45d05a2019-07-31 17:13:35 +0200298Requests to instantiate Neutron Network object
299----------------------------------------------
300
Rene_Robertfb177972019-07-09 14:39:47 +0200301To instantiate a Neutron Network, you need to build two complex request.
302All necessary parameters are available in the Tosca service template
303generated by SDC when you defined your service model.
304
305
Rene_Robertf45d05a2019-07-31 17:13:35 +02003061st request is the "SDNC-preload" for a neutron network object:
Rene_Robertfb177972019-07-09 14:39:47 +0200307
308::
309
310 curl -X POST \
311 http://sdnc.api.simpledemo.onap.org:30202/restconf/operations/VNF-API:preload-network-topology-operation \
312 -H 'Accept: application/json' \
313 -H 'Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==' \
314 -H 'Content-Type: application/json' \
315 -H 'X-FromAppId: API client' \
316 -H 'X-TransactionId: 0a3f6713-ba96-4971-a6f8-c2da85a3176e' \
317 -H 'cache-control: no-cache' \
318 -d '{
319 "input": {
320 "request-information": {
321 "request-id": "postman001",
322 "notification-url": "http://so.onap.org",
323 "order-number": "postman001",
324 "request-sub-action": "SUPP",
325 "request-action": "PreloadNetworkRequest",
326 "source": "postman",
327 "order-version": "1.0"
328 },
329 "network-topology-information": {
330 "network-policy": [],
331 "route-table-reference": [],
332 "vpn-bindings": [],
333 "network-topology-identifier": {
334 "network-role": "integration_test_net",
335 "network-technology": "neutron",
336 "service-type": "my-service-2",
337 "network-name": "my_network_01",
338 "network-type": "Generic NeutronNet"
339 },
340 "provider-network-information": {
341 "is-external-network": "false",
342 "is-provider-network": "false",
343 "is-shared-network": "false"
344 },
345 "subnets": [
346 {
347 "subnet-name": "my_subnet_01",
348 "subnet-role": "OAM",
349 "start-address": "192.168.90.0",
350 "cidr-mask": "24",
351 "ip-version": "4",
352 "dhcp-enabled": "Y",
353 "dhcp-start-address": "",
354 "dhcp-end-address": "",
355 "gateway-address": "192.168.90.1",
356 "host-routes":[]
357 }
358 ]
359 },
360 "sdnc-request-header": {
361 "svc-action": "reserve",
362 "svc-notification-url": "http://so.onap.org",
363 "svc-request-id": "postman001"
364 }
365 }
366 }'
367
368
Rene_Robertf45d05a2019-07-31 17:13:35 +02003692nd request is to instantiate the neutron network via ONAP SO
Rene_Robertfb177972019-07-09 14:39:47 +0200370(instance name must be identical in both requests)
371
372
373::
374
andreasgeissler7789a222019-07-16 18:44:23 +0200375 curl -X POST \
Rene_Robertfb177972019-07-09 14:39:47 +0200376 http://so.api.simpledemo.onap.org:30277/onap/so/infra/serviceInstances/v6/95762b50-0244-4723-8fde-35f911db9263/networks \
377 -H 'Accept: application/json' \
378 -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
379 -H 'Content-Type: application/json' \
380 -H 'X-FromAppId: AAI' \
381 -H 'X-TransactionId: get_aai_subscr' \
382 -H 'cache-control: no-cache' \
383 -d '{
384 "requestDetails": {
385 "requestInfo": {
386 "instanceName": "my_network_01",
387 "source": "VID",
388 "suppressRollback": false,
389 "requestorId": "demo",
390 "productFamilyId": "b9ac88f7-0e1b-462d-84ac-74c3c533217c"
391 },
392 "modelInfo": {
393 "modelType": "network",
394 "modelInvariantId": "0070b65c-48cb-4985-b4df-7c67ca99cd95",
395 "modelVersionId": "4f738bed-e804-4765-8d22-07bb4d11f14b",
396 "modelName": "Generic NeutronNet",
397 "modelVersion": "1.0",
398 "modelCustomizationId": "95534a95-dc8d-4ffb-89c7-091e2c49b55d",
399 "modelCustomizationName": "Generic NeutronNet 0"
400 },
401 "requestParameters": {
402 "userParams": [],
403 "aLaCarte": true,
404 "testApi": "VNF_API"
405 },
406 "cloudConfiguration": {
407 "lcpCloudRegionId": "my_cloud_site",
408 "tenantId": "5906b9b8fd9642df9ba1c9e290063439"
409 },
410 "lineOfBusiness": {
411 "lineOfBusinessName": "Test_LOB"
412 },
413 "platform": {
414 "platformName": "Test_platform"
415 },
416 "relatedInstanceList": [{
417 "relatedInstance": {
418 "instanceId": "95762b50-0244-4723-8fde-35f911db9263",
419 "modelInfo": {
420 "modelType": "service",
421 "modelName": "my_service_model_name",
422 "modelInvariantId": "11265d8c-2cc2-40e5-95d8-57cad81c18da",
423 "modelVersion": "1.0",
424 "modelVersionId": "0d463b0c-e559-4def-8d7b-df64cfbd3159"
425 }
426 }
427 }]
andreasgeissler7789a222019-07-16 18:44:23 +0200428 }
429 }'
Rene_Robertf45d05a2019-07-31 17:13:35 +0200430
431
432Requests to instantiate a Contrail Network object
433-------------------------------------------------
434
435TO BE COMPLETED