OOM Offline Installer removed from conf.py
[doc.git] / docs / guides / onap-user / instantiate / instantiation / so1 / index.rst
1 .. 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
5 .. _doc_guide_user_ser_inst_so1:
6
7
8 A La Carte mode Service Instantiation via ONAP SO API
9 =====================================================
10
11 Using ONAP SO API in "A La Carte" mode, the user needs to send
12 a request to instantiate the service object but also for each VNF/VF-module
13 and network that compose the Service.
14
15 ONAP will instantiate resources on Cloud platforms only when user is requesting
16 to instantiate VF-module or Network (openstack neutron or contrail).
17
18 To instantiate a VF-module, it is required to have instantiated a VNF object.
19
20 To instantiate a VNF object, it is required to have instantiated
21 a Service object.
22
23 To instantiate a Network object, it is required to have instantiated
24 a 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`_
32
33
34 Request to instantiate Service object
35 -------------------------------------
36
37 Example to request a service instance directly to ONAP SO
38
39 ::
40
41   curl -X POST \
42     http://so.api.simpledemo.onap.org:30277/onap/so/infra/serviceInstantiation/v7/serviceInstances \
43     -H 'Accept: application/json' \
44     -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
45     -H 'Content-Type: application/json' \
46     -H 'X-ONAP-PartnerName: NBI' \
47     -H 'cache-control: no-cache' \
48     -d '{
49     "requestDetails": {
50       "requestInfo": {
51         "instanceName": "integration_test_service_instance_001",
52         "source": "VID",
53         "suppressRollback": false,
54         "requestorId": "demo"
55       },
56       "modelInfo": {
57         "modelType": "service",
58         "modelInvariantId": "48d7ceec-7975-406c-8b96-cb3fbdbcfa33",
59         "modelVersionId": "33a99ef7-b5a3-4603-b21e-790582b4567e",
60         "modelName": "integration_test_service_ubuntu16",
61         "modelVersion": "1.0"
62       },
63           "cloudConfiguration": {
64               "tenantId": "dd8fce79e74a4989a6be6b6c5e55acef",
65               "cloudOwner": "cloudOwner",
66               "lcpCloudRegionId": "RegionOne"
67           },
68       "requestParameters": {
69         "userParams": [],
70         "testApi": "VNF_API",
71         "subscriptionServiceType": "integration_test_service_ubuntu16",
72         "aLaCarte": true
73       },
74       "subscriberInfo": {
75         "globalSubscriberId": "integration_test_customer"
76       },
77       "project": {
78         "projectName": "integration_test_project"
79       },
80       "owningEntity": {
81         "owningEntityId": "8874891f-5120-4b98-b452-46284513958d",
82         "owningEntityName": "OE-Generic"
83       }
84     }
85   }'
86
87
88 In the response, you will obtain the serviceOrderId value.
89
90 Then you have the possibility to check about the SO request
91 (here after the requestId=e3ad8df6-ea0d-4384-be95-bcb7dd39bbde).
92
93 This will allow you to get the serviceOrder Status (completed, failed...)
94
95 ::
96
97   curl -X GET \
98     http://so.api.simpledemo.onap.org:30277/onap/so/infra/orchestrationRequests/v6/e3ad8df6-ea0d-4384-be95-bcb7dd39bbde \
99     -H 'Accept: application/json' \
100     -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
101     -H 'Content-Type: application/json' \
102     -H 'X-FromAppId: AAI' \
103     -H 'X-TransactionId: get_aai_subscr' \
104     -H 'cache-control: no-cache'
105
106
107 Request to instantiate VNF object
108 ---------------------------------
109
110 To instantiate a VNF, you need to build an other request.
111 All necessary parameters are available in the Tosca service template
112 generated by SDC when you defined your service model.
113
114 ::
115
116   curl -X POST \
117     http://so.api.simpledemo.onap.org:30277/onap/so/infra/serviceInstantiation/v7/serviceInstances/7d550d9e-e1c4-4a21-a2bb-1c3ced8a8722/vnfs \
118     -H 'Accept: application/json' \
119     -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
120     -H 'Content-Type: application/json' \
121     -H 'X-ONAP-PartnerName: NBI' \
122     -H 'cache-control: no-cache' \
123     -d '{
124     "requestDetails": {
125       "requestInfo": {
126         "instanceName": "integration_test_vnf_instance_002",
127         "source": "VID",
128         "suppressRollback": false,
129         "requestorId": "test",
130       "productFamilyId": "1234"
131       },
132     "modelInfo": {
133       "modelType": "vnf",
134       "modelInvariantId": "661a34ce-6f76-4ebf-ad94-814a9fc8a2aa",
135         "modelVersionId": "7e7d453c-0085-4df2-b4b5-91281ea2e710",
136         "modelName": "integration_test_VF_ubuntu16_2",
137         "modelVersion": "1.0",
138         "modelCustomizationId": "342c14b4-8a24-46dd-a8c3-ff39dd7949e9",
139         "modelCustomizationName": "integration_test_VF_ubuntu16_2 0"
140       },
141       "requestParameters": {
142         "userParams": [],
143         "aLaCarte": true,
144       "testApi": "VNF_API"
145       },
146       "cloudConfiguration": {
147         "lcpCloudRegionId": "RegionOne",
148         "cloudOwner": "cloudOwner",
149         "tenantId": "dd8fce79e74a4989a6be6b6c5e55acef"
150       },
151       "lineOfBusiness": {
152         "lineOfBusinessName": "integration_test_LOB"
153       },
154       "platform": {
155         "platformName": "integration_test_platform"
156       },
157       "relatedInstanceList": [{
158         "relatedInstance": {
159           "instanceId": "7d550d9e-e1c4-4a21-a2bb-1c3ced8a8722",
160           "modelInfo": {
161             "modelType": "service",
162             "modelName": "integration_test_service_ubuntu16",
163             "modelInvariantId": "48d7ceec-7975-406c-8b96-cb3fbdbcfa33",
164             "modelVersion": "1.0",
165             "modelVersionId": "33a99ef7-b5a3-4603-b21e-790582b4567e"
166           }
167         }
168       }]
169     }
170   }
171
172   '
173
174
175 Requests to instantiate VF-module object
176 ----------------------------------------
177
178 To instantiate a VF module, you need to build two complex requests
179 All necessary parameters are available in the Tosca service template
180 generated by SDC when you defined your service model.
181
182 1st request is called a "SDNC-preload" for a VNF object and is used
183 to store in SDNC some VNF parameters values
184 that will be needed for the instantiation
185
186 ::
187
188   curl -X POST \
189     https://sdnc.api.simpledemo.onap.org:30267/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": "integration_test_vnf_instance_002",
219                   "generic-vnf-type": "integration_test_VF_ubuntu16_2 0",
220                   "service-type": "7d550d9e-e1c4-4a21-a2bb-1c3ced8a8722",
221                   "vnf-name": "integration_test_vfmodule_002",
222                   "vnf-type": "IntegrationTestVfUbuntu162..base_ubuntu16..module-0"
223               }
224           }
225       }
226   }'
227
228 The 2nd request is to instantiate the VF module via ONAP SO
229 (instance name must be identical in both requests)
230
231 ::
232
233   curl -X POST \
234     http://so.api.simpledemo.onap.org:30277/onap/so/infra/serviceInstantiation/v7/serviceInstances/7d550d9e-e1c4-4a21-a2bb-1c3ced8a8722/vnfs/9764c2af-e4b0-413d-80cd-b65014ea0926/vfModules \
235     -H 'Accept: application/json' \
236     -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
237     -H 'Content-Type: application/json' \
238     -H 'X-ONAP-PartnerName: NBI' \
239     -H 'cache-control: no-cache' \
240     -d '{
241     "requestDetails": {
242       "requestInfo": {
243         "instanceName": "integration_test_vfmodule_002",
244         "source": "VID",
245         "suppressRollback": false,
246         "requestorId": "test"
247       },
248     "modelInfo": {
249       "modelType": "vfModule",
250       "modelInvariantId": "273bef63-1f26-4b14-91e0-003fa203ead2",
251       "modelVersionId": "7cdf75de-ff3c-4a7d-a7e0-ecbc00693e8e",
252       "modelName": "IntegrationTestVfUbuntu162..base_ubuntu16..module-0",
253       "modelVersion": "1",
254       "modelCustomizationId": "470956aa-b739-4cdd-b114-7ce032f65b18",
255       "modelCustomizationName": "IntegrationTestVfUbuntu162..base_ubuntu16..module-0"
256     },
257     "requestParameters": {
258       "userParams": [],
259       "testApi": "VNF_API",
260       "usePreload": true
261     },
262       "cloudConfiguration": {
263         "lcpCloudRegionId": "RegionOne",
264         "cloudOwner": "cloudOwner",
265         "tenantId": "dd8fce79e74a4989a6be6b6c5e55acef"
266       },
267       "relatedInstanceList": [{
268         "relatedInstance": {
269           "instanceId": "7d550d9e-e1c4-4a21-a2bb-1c3ced8a8722",
270           "modelInfo": {
271             "modelType": "service",
272             "modelName": "integration_test_service_ubuntu16",
273             "modelInvariantId": "48d7ceec-7975-406c-8b96-cb3fbdbcfa33",
274             "modelVersion": "1.0",
275             "modelVersionId": "33a99ef7-b5a3-4603-b21e-790582b4567e"
276           }
277         }
278       },
279       {
280         "relatedInstance": {
281           "instanceId": "9764c2af-e4b0-413d-80cd-b65014ea0926",
282           "modelInfo": {
283             "modelType": "vnf",
284             "modelName": "integration_test_VF_ubuntu16_2",
285             "modelInvariantId": "661a34ce-6f76-4ebf-ad94-814a9fc8a2aa",
286             "modelVersion": "1.0",
287             "modelVersionId": "7e7d453c-0085-4df2-b4b5-91281ea2e710",
288             "modelCustomizationId": "342c14b4-8a24-46dd-a8c3-ff39dd7949e9",
289             "modelCustomizationName": "integration_test_VF_ubuntu16_2 0"
290           }
291         }
292       }]
293     }
294   }'
295
296
297
298 Requests to instantiate Neutron Network object
299 ----------------------------------------------
300
301 To instantiate a Neutron Network, you need to build two complex request.
302 All necessary parameters are available in the Tosca service template
303 generated by SDC when you defined your service model.
304
305
306 1st request is the "SDNC-preload" for a neutron network object:
307
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
369 2nd request is to instantiate the neutron network via ONAP SO
370 (instance name must be identical in both requests)
371
372
373 ::
374
375   curl -X POST \
376   http://so.api.simpledemo.onap.org:30277/onap/so/infra/serviceInstantiation/v7/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       },
391       "modelInfo": {
392           "modelType": "network",
393           "modelInvariantId": "0070b65c-48cb-4985-b4df-7c67ca99cd95",
394           "modelVersionId": "4f738bed-e804-4765-8d22-07bb4d11f14b",
395           "modelName": "Generic NeutronNet",
396           "modelVersion": "1.0",
397           "modelCustomizationId": "95534a95-dc8d-4ffb-89c7-091e2c49b55d",
398           "modelCustomizationName": "Generic NeutronNet 0"
399       },
400     "requestParameters": {
401       "userParams": [],
402       "aLaCarte": true,
403     "testApi": "VNF_API"
404     },
405     "cloudConfiguration": {
406       "lcpCloudRegionId": "my_cloud_site",
407       "tenantId": "5906b9b8fd9642df9ba1c9e290063439"
408     },
409       "lineOfBusiness": {
410           "lineOfBusinessName": "Test_LOB"
411       },
412       "platform": {
413           "platformName": "Test_platform"
414       },
415       "relatedInstanceList": [{
416           "relatedInstance": {
417               "instanceId": "95762b50-0244-4723-8fde-35f911db9263",
418               "modelInfo": {
419                   "modelType": "service",
420                   "modelName": "my_service_model_name",
421                   "modelInvariantId": "11265d8c-2cc2-40e5-95d8-57cad81c18da",
422                   "modelVersion": "1.0",
423                   "modelVersionId": "0d463b0c-e559-4def-8d7b-df64cfbd3159"
424               }
425           }
426       }]
427     }
428   }'
429
430
431 It is then possible to get information about that network from AAI:
432 replace {{virtual_link_UUID}} by the UUID of the virtual link
433
434
435 ::
436
437   curl -X GET \
438     https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/network/l3-networks/l3-network/{{virtual_link_UUID}} \
439     -H 'Accept: application/json' \
440     -H 'Authorization: Basic QUFJOkFBSQ==' \
441     -H 'Content-Type: application/json' \
442     -H 'X-FromAppId: AAI' \
443     -H 'X-TransactionId: get_aai_subscr' \
444     -H 'cache-control: no-cache'
445
446
447 And also about subnet:
448
449 ::
450
451   curl -X GET \
452     https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/network/l3-networks/l3-network/{{virtual_link_UUID}}/subnets \
453     -H 'Accept: application/json' \
454     -H 'Authorization: Basic QUFJOkFBSQ==' \
455     -H 'Content-Type: application/json' \
456     -H 'X-FromAppId: AAI' \
457     -H 'X-TransactionId: get_aai_subscr' \
458     -H 'cache-control: no-cache'
459
460
461
462 Requests to instantiate a Contrail Network object
463 -------------------------------------------------
464
465 TO BE COMPLETED