summaryrefslogtreecommitdiffstats
path: root/docs/guides/onap-user/instantiate/instantiation/so1/index.rst
blob: af2edc8c96d24ed56d6928e8a8971cb89c0679a9 (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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
.. This work is licensed under a Creative Commons Attribution 4.0
.. International License. http://creativecommons.org/licenses/by/4.0
.. Copyright 2019 ONAP Contributors.  All rights reserved.

.. _doc_guide_user_ser_inst_so1:


A La Carte mode Service Instantiation via ONAP SO API
=====================================================

Using ONAP SO API in "A La Carte" mode, the user needs to send
a request to instantiate the service object but also for each VNF/VF-module
and network that compose the Service.

ONAP will instantiate resources on Cloud platforms only when user is requesting
to instantiate VF-module or Network (openstack neutron or contrail).

To instantiate a VF-module, it is required to have instantiated a VNF object.

To instantiate a VNF object, it is required to have instantiated
a Service object.

To instantiate a Network object, it is required to have instantiated
a Service object.

**Requests**
    * `Request to instantiate Service object`_
    * `Request to instantiate VNF object`_
    * `Requests to instantiate VF-module object`_
    * `Requests to instantiate Neutron Network object`_
    * `Requests to instantiate a Contrail Network object`_


Request to instantiate Service object
-------------------------------------

Example to request a service instance directly to ONAP SO

::

  curl -X POST \
    http://so.api.simpledemo.onap.org:30277/onap/so/infra/serviceInstantiation/v7/serviceInstances \
    -H 'Accept: application/json' \
    -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
    -H 'Content-Type: application/json' \
    -H 'X-ONAP-PartnerName: NBI' \
    -H 'cache-control: no-cache' \
    -d '{
    "requestDetails": {
      "requestInfo": {
        "instanceName": "integration_test_service_instance_001",
        "source": "VID",
        "suppressRollback": false,
        "requestorId": "demo"
      },
      "modelInfo": {
        "modelType": "service",
        "modelInvariantId": "48d7ceec-7975-406c-8b96-cb3fbdbcfa33",
        "modelVersionId": "33a99ef7-b5a3-4603-b21e-790582b4567e",
        "modelName": "integration_test_service_ubuntu16",
        "modelVersion": "1.0"
      },
          "cloudConfiguration": {
              "tenantId": "dd8fce79e74a4989a6be6b6c5e55acef",
              "cloudOwner": "cloudOwner",
              "lcpCloudRegionId": "RegionOne"
          },
      "requestParameters": {
        "userParams": [],
        "testApi": "VNF_API",
        "subscriptionServiceType": "integration_test_service_ubuntu16",
        "aLaCarte": true
      },
      "subscriberInfo": {
        "globalSubscriberId": "integration_test_customer"
      },
      "project": {
        "projectName": "integration_test_project"
      },
      "owningEntity": {
        "owningEntityId": "8874891f-5120-4b98-b452-46284513958d",
        "owningEntityName": "OE-Generic"
      }
    }
  }'


In the response, you will obtain the serviceOrderId value.

Then you have the possibility to check about the SO request
(here after the requestId=e3ad8df6-ea0d-4384-be95-bcb7dd39bbde).

This will allow you to get the serviceOrder Status (completed, failed...)

::

  curl -X GET \
    http://so.api.simpledemo.onap.org:30277/onap/so/infra/orchestrationRequests/v6/e3ad8df6-ea0d-4384-be95-bcb7dd39bbde \
    -H 'Accept: application/json' \
    -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
    -H 'Content-Type: application/json' \
    -H 'X-FromAppId: AAI' \
    -H 'X-TransactionId: get_aai_subscr' \
    -H 'cache-control: no-cache'


Request to instantiate VNF object
---------------------------------

To instantiate a VNF, you need to build an other request.
All necessary parameters are available in the Tosca service template
generated by SDC when you defined your service model.

::

  curl -X POST \
    http://so.api.simpledemo.onap.org:30277/onap/so/infra/serviceInstantiation/v7/serviceInstances/7d550d9e-e1c4-4a21-a2bb-1c3ced8a8722/vnfs \
    -H 'Accept: application/json' \
    -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
    -H 'Content-Type: application/json' \
    -H 'X-ONAP-PartnerName: NBI' \
    -H 'cache-control: no-cache' \
    -d '{
    "requestDetails": {
      "requestInfo": {
        "instanceName": "integration_test_vnf_instance_002",
        "source": "VID",
        "suppressRollback": false,
        "requestorId": "test",
      "productFamilyId": "1234"
      },
    "modelInfo": {
      "modelType": "vnf",
      "modelInvariantId": "661a34ce-6f76-4ebf-ad94-814a9fc8a2aa",
        "modelVersionId": "7e7d453c-0085-4df2-b4b5-91281ea2e710",
        "modelName": "integration_test_VF_ubuntu16_2",
        "modelVersion": "1.0",
        "modelCustomizationId": "342c14b4-8a24-46dd-a8c3-ff39dd7949e9",
        "modelCustomizationName": "integration_test_VF_ubuntu16_2 0"
      },
      "requestParameters": {
        "userParams": [],
        "aLaCarte": true,
      "testApi": "VNF_API"
      },
      "cloudConfiguration": {
        "lcpCloudRegionId": "RegionOne",
        "cloudOwner": "cloudOwner",
        "tenantId": "dd8fce79e74a4989a6be6b6c5e55acef"
      },
      "lineOfBusiness": {
        "lineOfBusinessName": "integration_test_LOB"
      },
      "platform": {
        "platformName": "integration_test_platform"
      },
      "relatedInstanceList": [{
        "relatedInstance": {
          "instanceId": "7d550d9e-e1c4-4a21-a2bb-1c3ced8a8722",
          "modelInfo": {
            "modelType": "service",
            "modelName": "integration_test_service_ubuntu16",
            "modelInvariantId": "48d7ceec-7975-406c-8b96-cb3fbdbcfa33",
            "modelVersion": "1.0",
            "modelVersionId": "33a99ef7-b5a3-4603-b21e-790582b4567e"
          }
        }
      }]
    }
  }

  '


Requests to instantiate VF-module object
----------------------------------------

To instantiate a VF module, you need to build two complex requests
All necessary parameters are available in the Tosca service template
generated by SDC when you defined your service model.

1st request is called a "SDNC-preload" for a VNF object and is used
to store in SDNC some VNF parameters values
that will be needed for the instantiation

::

  curl -X POST \
    https://sdnc.api.simpledemo.onap.org:30267/restconf/operations/VNF-API:preload-vnf-topology-operation \
    -H 'Accept: application/json' \
    -H 'Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==' \
    -H 'Content-Type: application/json' \
    -H 'X-FromAppId: API client' \
    -H 'X-TransactionId: 0a3f6713-ba96-4971-a6f8-c2da85a3176e' \
    -H 'cache-control: no-cache' \
    -d '{
      "input": {
          "request-information": {
              "notification-url": "onap.org",
              "order-number": "1",
              "order-version": "1",
              "request-action": "PreloadVNFRequest",
              "request-id": "test"
          },
          "sdnc-request-header": {
              "svc-action": "reserve",
              "svc-notification-url": "http:\/\/onap.org:8080\/adapters\/rest\/SDNCNotify",
              "svc-request-id": "test"
          },
          "vnf-topology-information": {
              "vnf-assignments": {
                  "availability-zones": [],
                  "vnf-networks": [],
                  "vnf-vms": []
              },
              "vnf-parameters": [],
              "vnf-topology-identifier": {
                  "generic-vnf-name": "integration_test_vnf_instance_002",
                  "generic-vnf-type": "integration_test_VF_ubuntu16_2 0",
                  "service-type": "7d550d9e-e1c4-4a21-a2bb-1c3ced8a8722",
                  "vnf-name": "integration_test_vfmodule_002",
                  "vnf-type": "IntegrationTestVfUbuntu162..base_ubuntu16..module-0"
              }
          }
      }
  }'

The 2nd request is to instantiate the VF module via ONAP SO
(instance name must be identical in both requests)

::

  curl -X POST \
    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 \
    -H 'Accept: application/json' \
    -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
    -H 'Content-Type: application/json' \
    -H 'X-ONAP-PartnerName: NBI' \
    -H 'cache-control: no-cache' \
    -d '{
    "requestDetails": {
      "requestInfo": {
        "instanceName": "integration_test_vfmodule_002",
        "source": "VID",
        "suppressRollback": false,
        "requestorId": "test"
      },
    "modelInfo": {
      "modelType": "vfModule",
      "modelInvariantId": "273bef63-1f26-4b14-91e0-003fa203ead2",
      "modelVersionId": "7cdf75de-ff3c-4a7d-a7e0-ecbc00693e8e",
      "modelName": "IntegrationTestVfUbuntu162..base_ubuntu16..module-0",
      "modelVersion": "1",
      "modelCustomizationId": "470956aa-b739-4cdd-b114-7ce032f65b18",
      "modelCustomizationName": "IntegrationTestVfUbuntu162..base_ubuntu16..module-0"
    },
    "requestParameters": {
      "userParams": [],
      "testApi": "VNF_API",
      "usePreload": true
    },
      "cloudConfiguration": {
        "lcpCloudRegionId": "RegionOne",
        "cloudOwner": "cloudOwner",
        "tenantId": "dd8fce79e74a4989a6be6b6c5e55acef"
      },
      "relatedInstanceList": [{
        "relatedInstance": {
          "instanceId": "7d550d9e-e1c4-4a21-a2bb-1c3ced8a8722",
          "modelInfo": {
            "modelType": "service",
            "modelName": "integration_test_service_ubuntu16",
            "modelInvariantId": "48d7ceec-7975-406c-8b96-cb3fbdbcfa33",
            "modelVersion": "1.0",
            "modelVersionId": "33a99ef7-b5a3-4603-b21e-790582b4567e"
          }
        }
      },
      {
        "relatedInstance": {
          "instanceId": "9764c2af-e4b0-413d-80cd-b65014ea0926",
          "modelInfo": {
            "modelType": "vnf",
            "modelName": "integration_test_VF_ubuntu16_2",
            "modelInvariantId": "661a34ce-6f76-4ebf-ad94-814a9fc8a2aa",
            "modelVersion": "1.0",
            "modelVersionId": "7e7d453c-0085-4df2-b4b5-91281ea2e710",
            "modelCustomizationId": "342c14b4-8a24-46dd-a8c3-ff39dd7949e9",
            "modelCustomizationName": "integration_test_VF_ubuntu16_2 0"
          }
        }
      }]
    }
  }'



Requests to instantiate Neutron Network object
----------------------------------------------

To instantiate a Neutron Network, you need to build two complex request.
All necessary parameters are available in the Tosca service template
generated by SDC when you defined your service model.


1st request is the "SDNC-preload" for a neutron network object:

::

  curl -X POST \
  http://sdnc.api.simpledemo.onap.org:30202/restconf/operations/VNF-API:preload-network-topology-operation \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==' \
  -H 'Content-Type: application/json' \
  -H 'X-FromAppId: API client' \
  -H 'X-TransactionId: 0a3f6713-ba96-4971-a6f8-c2da85a3176e' \
  -H 'cache-control: no-cache' \
  -d '{
  "input": {
    "request-information": {
      "request-id": "postman001",
      "notification-url": "http://so.onap.org",
      "order-number": "postman001",
      "request-sub-action": "SUPP",
      "request-action": "PreloadNetworkRequest",
      "source": "postman",
      "order-version": "1.0"
    },
    "network-topology-information": {
      "network-policy": [],
      "route-table-reference": [],
      "vpn-bindings": [],
      "network-topology-identifier": {
        "network-role": "integration_test_net",
        "network-technology": "neutron",
        "service-type": "my-service-2",
        "network-name": "my_network_01",
        "network-type": "Generic NeutronNet"
      },
      "provider-network-information": {
        "is-external-network": "false",
        "is-provider-network": "false",
        "is-shared-network": "false"
      },
      "subnets": [
        {
      "subnet-name": "my_subnet_01",
      "subnet-role": "OAM",
          "start-address": "192.168.90.0",
          "cidr-mask": "24",
          "ip-version": "4",
          "dhcp-enabled": "Y",
      "dhcp-start-address": "",
      "dhcp-end-address": "",
          "gateway-address": "192.168.90.1",
      "host-routes":[]
        }
              ]
    },
    "sdnc-request-header": {
      "svc-action": "reserve",
      "svc-notification-url": "http://so.onap.org",
      "svc-request-id": "postman001"
    }
  }
  }'


2nd request is to instantiate the neutron network via ONAP SO
(instance name must be identical in both requests)


::

  curl -X POST \
  http://so.api.simpledemo.onap.org:30277/onap/so/infra/serviceInstantiation/v7/95762b50-0244-4723-8fde-35f911db9263/networks \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
  -H 'Content-Type: application/json' \
  -H 'X-FromAppId: AAI' \
  -H 'X-TransactionId: get_aai_subscr' \
  -H 'cache-control: no-cache' \
  -d '{
  "requestDetails": {
      "requestInfo": {
          "instanceName": "my_network_01",
          "source": "VID",
          "suppressRollback": false,
          "requestorId": "demo"
      },
      "modelInfo": {
          "modelType": "network",
          "modelInvariantId": "0070b65c-48cb-4985-b4df-7c67ca99cd95",
          "modelVersionId": "4f738bed-e804-4765-8d22-07bb4d11f14b",
          "modelName": "Generic NeutronNet",
          "modelVersion": "1.0",
          "modelCustomizationId": "95534a95-dc8d-4ffb-89c7-091e2c49b55d",
          "modelCustomizationName": "Generic NeutronNet 0"
      },
    "requestParameters": {
      "userParams": [],
      "aLaCarte": true,
    "testApi": "VNF_API"
    },
    "cloudConfiguration": {
      "lcpCloudRegionId": "my_cloud_site",
      "tenantId": "5906b9b8fd9642df9ba1c9e290063439"
    },
      "lineOfBusiness": {
          "lineOfBusinessName": "Test_LOB"
      },
      "platform": {
          "platformName": "Test_platform"
      },
      "relatedInstanceList": [{
          "relatedInstance": {
              "instanceId": "95762b50-0244-4723-8fde-35f911db9263",
              "modelInfo": {
                  "modelType": "service",
                  "modelName": "my_service_model_name",
                  "modelInvariantId": "11265d8c-2cc2-40e5-95d8-57cad81c18da",
                  "modelVersion": "1.0",
                  "modelVersionId": "0d463b0c-e559-4def-8d7b-df64cfbd3159"
              }
          }
      }]
    }
  }'


It is then possible to get information about that network from AAI:
replace {{virtual_link_UUID}} by the UUID of the virtual link


::

  curl -X GET \
    https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/network/l3-networks/l3-network/{{virtual_link_UUID}} \
    -H 'Accept: application/json' \
    -H 'Authorization: Basic QUFJOkFBSQ==' \
    -H 'Content-Type: application/json' \
    -H 'X-FromAppId: AAI' \
    -H 'X-TransactionId: get_aai_subscr' \
    -H 'cache-control: no-cache'


And also about subnet:

::

  curl -X GET \
    https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/network/l3-networks/l3-network/{{virtual_link_UUID}}/subnets \
    -H 'Accept: application/json' \
    -H 'Authorization: Basic QUFJOkFBSQ==' \
    -H 'Content-Type: application/json' \
    -H 'X-FromAppId: AAI' \
    -H 'X-TransactionId: get_aai_subscr' \
    -H 'cache-control: no-cache'



Requests to instantiate a Contrail Network object
-------------------------------------------------

TO BE COMPLETED