blob: a62b3ddd65af4f0124cc7d1b68194fcfc46800a2 [file] [log] [blame]
Rene_Robert5cceec62019-11-04 09:03:23 +01001.. 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_des_param_assign:
6
7VNF Parameter resolution templating
8===================================
9
10Overview
11--------
12
Rene_Robert05518982019-11-28 11:26:39 +010013When instantiating a Service composed of connectivity, PNF,
14VNF or CNF there is the need to set the parameter values for the
15created instances.
Rene_Robert5cceec62019-11-04 09:03:23 +010016
17For example, it may be necessary to provide a VNF management @ip
18Address or a VNF instance name. Those parameters can be necessary
19to create cloud resources or to configure the VNF at application level.
20
Rene_Robert05518982019-11-28 11:26:39 +010021In the first releases of ONAP the operator needed to provide these parameters
22as preload data via datasheet or API call before instantiating each
23PNF/VNF/CNF.
24This was an error-prone manual step that interferes with an automated and
25scalable service instantiation.
26As part of the ONAP CDS component introduction
Rene_Robert5cceec62019-11-04 09:03:23 +010027in Casablanca release, the user, that wants to instantiate a new VNF/CNF,
28does not need to get and provide those data.
29
30Of course the “user” may be a human but may be also an application that uses
31the “instantiation” API on ONAP NBI or ONAP SO.
32
33ONAP CDS component is then in charge of resolving those parameters
34automatically.
35
36.. toctree::
37 :maxdepth: 1
38 :titlesonly:
39
40 Full CDS documentation is here <../../../../submodules/ccsdk/cds.git/docs/index.rst>
41
42It offers automated solution out of the box by delivering network intent
43declarative package during design time phase that automated the provisioning
44and/or network configuration network intent.
45
46At instantiation time, CDS controller will find (assign) the values
47according some “recipies” described in a "Controller Blueprint Archive”:
48a collection of files that CDS controller will use to proceed
49parameter resolution.
50
51Thanks to CDS, at instantiation time, the user, that wants to instantiate
52a new VNF, does not need to get and provide those data himself.
53Of course the “user” may be a human but may be also
54an application that uses the “instantiation” API on ONAP NBI or ONAP SO.
55
56Less effort for the “user”, but more effort for the “designer”
57that needs to pre-defined all necessary recipies
58during design time.
59
60The purpose of the following text is to describe various files and content
61that are necessary to the CDS controller to resolve any parameters.
62
63To illustrate the subject, let's take an example: a service composed of
Rene_Robert05518982019-11-28 11:26:39 +010064an "ubuntu" VNF. That service will be called "ubuntuCDS" in ONAP SDC
65for that example.
Rene_Robert5cceec62019-11-04 09:03:23 +010066
Rene_Robert05518982019-11-28 11:26:39 +010067That VNF will be based on a simple ubuntu image. That VF will be called
68ubuntuCDS in ONAP SDC for that example.
Rene_Robert5cceec62019-11-04 09:03:23 +010069
Rene_Robert05518982019-11-28 11:26:39 +010070WARNING: all operations need to be adapted to your context
71(platform, service, identifiers...)
72
73Pre-requisite
74-------------
75
76There are two problems with ONAP ElAlto release:
77
78**wrong Directed Graphs**
79
80In ONAP Elalto, a problem was detected about Directed Graphs: JIRA_SDNC_949_
81
82The workaround is to upload/replace the following two Directed Graph in SDNC
83(via DG Builder UI for example).
84
85VNF topology assign: DG_VNF_ASSIGN_.
86
87VF-Module topology assign: DG_VFMODULE_ASSIGN_.
88
89
90**wrong URL in CDS-UI pod**
91
92CDS-UI pod needs to communicate with CDS BluePrint processor to perform
93"enrichment", "publish", "deploy" operations.
94
95The URL is not correct in the OOM file used to deploy CDS UI.
96
97If you have permission, you can change the url via:
98
99::
100
101 kubectl edit deployment -n onap {{cds ui pod id}}
102
103API_BLUEPRINT_CONTROLLER_HTTP_BASE_URL parameter must have the following value
104
105::
106
107 http://cds-blueprints-processor-http:8080/api/v1
108
109
110Those problems should be corrected in next ONAP release.
Rene_Robert5cceec62019-11-04 09:03:23 +0100111
112Design process
113--------------
114
Rene_Robert05518982019-11-28 11:26:39 +0100115 * `Step 1: identify the parameters needed for instantiation`_
Rene_Robert5cceec62019-11-04 09:03:23 +0100116 * `Step 2: identify the parameters needed for post-instantiation`_
Rene_Robert05518982019-11-28 11:26:39 +0100117 * `Step 3: identify the resolution method for each parameter`_
Rene_Robert5cceec62019-11-04 09:03:23 +0100118 * `Step 4: add new data definition in CDS resource dictionary`_
119 * `Step 5: write template files`_
120 * `Step 6: write mapping files`_
121 * `Step 7: write scripts`_
Rene_Robert05518982019-11-28 11:26:39 +0100122 * `Step 8: write the "blueprint" file`_
Rene_Robert5cceec62019-11-04 09:03:23 +0100123 * `Step 9: build the "Controller Blueprint Archive” (cba)`_
124 * `Step 10: attached the cba to a service definition`_
125 * `Step 11: distribute the service`_
126 * `Step 12: instantiate the service and check`_
127
128
Rene_Robert05518982019-11-28 11:26:39 +0100129Step 1: identify the parameters needed for instantiation
130--------------------------------------------------------
Rene_Robert5cceec62019-11-04 09:03:23 +0100131
Rene_Robert05518982019-11-28 11:26:39 +0100132To instantiate an "ubuntu" VNF, a Heat Template can be used. Several
Rene_Robert5cceec62019-11-04 09:03:23 +0100133parameters are defined in that template: vnf_name, image_name,
134management @ip...
135
Rene_Robert05518982019-11-28 11:26:39 +0100136This Heat Template is a first place to identify the parameters that need
Rene_Robert5cceec62019-11-04 09:03:23 +0100137to be resolved.
138
139Our example:
140
141::
142
143 parameters:
144 # Metadata required by ONAP
Rene_Robert05518982019-11-28 11:26:39 +0100145 vnf_id: ubuntuCDS-VNF
146 vf_module_id: ubuntuCDS-VF-module
147 vnf_name: ubuntuCDS-VNF-name
Rene_Robert5cceec62019-11-04 09:03:23 +0100148
149 # Server parameters, naming required by ONAP
Rene_Robert05518982019-11-28 11:26:39 +0100150 ubuntuCDS_image_name: ubuntu-18
151 ubuntuCDS_flavor_name: onap.small
152 ubuntuCDS_pub_key: ssh-rsa AAAAB3VHCx...vVL8l1BrX3BY0R8D imported-openssh-key
153 ubuntuCDS_name_0: ubuntuCDS
Rene_Robert5cceec62019-11-04 09:03:23 +0100154
155 # Network parameters, naming required by ONAP
Rene_Robert05518982019-11-28 11:26:39 +0100156 admin_plane_net_name: admin
Rene_Robert5cceec62019-11-04 09:03:23 +0100157
158Step 2: identify the parameters needed for post-instantiation
159-------------------------------------------------------------
160
Rene_Robert05518982019-11-28 11:26:39 +0100161Post-instantiation activity will occur after the VNF is instantiated.
Rene_Robert5cceec62019-11-04 09:03:23 +0100162
Rene_Robert05518982019-11-28 11:26:39 +0100163Typically, it can be adding a first firewall rule in a firewall VNF.
Rene_Robert5cceec62019-11-04 09:03:23 +0100164
Rene_Robert05518982019-11-28 11:26:39 +0100165In the ubuntuCDS example, there is no such parameter.
Rene_Robert5cceec62019-11-04 09:03:23 +0100166
Rene_Robert5cceec62019-11-04 09:03:23 +0100167
Rene_Robert05518982019-11-28 11:26:39 +0100168Step 3: identify the resolution method for each parameter
169---------------------------------------------------------
Rene_Robert5cceec62019-11-04 09:03:23 +0100170
171Here after the decision/solution that the designer may take:
172
Rene_Robert05518982019-11-28 11:26:39 +0100173**vnf_name** will be resolved via an input that will be provided
Rene_Robert5cceec62019-11-04 09:03:23 +0100174in the instantiation request.
175
Rene_Robert05518982019-11-28 11:26:39 +0100176**ubuntuCDS_image_name** will be resolved via an input that will be provided
Rene_Robert5cceec62019-11-04 09:03:23 +0100177in the instantiation request.
178
Rene_Robert05518982019-11-28 11:26:39 +0100179**ubuntuCDS_flavor_name** will be resolved via an input that will be provided
180in the instantiation request.
Rene_Robert5cceec62019-11-04 09:03:23 +0100181
Rene_Robert05518982019-11-28 11:26:39 +0100182**ubuntuCDS_pub_key** will be resolved via an input that will be provided
183in the instantiation request.
184
185**admin_plane_net_name** will be resolved via an input that will be provided
186in the instantiation request.
187
188Service Designer needs also to know that some parameters will be
189automatically resolved by ONAP SO and/or ONAP SDNC.
190
191- service-instance-id
192- vnf-id
193- vf_module_id
194
195For each resolution method, Service Designer needs to identify all
196necessary parameters that must be provided to the resoluton method
197in order to obtain the resolution.
198
199Also, Service Designer needs to know that ONAP will instantiate
200a service, a list of VNF that are composing the service and, for each VNF,
201a "VF-module" will be instantiated.
202
Rene_Robert5cceec62019-11-04 09:03:23 +0100203
204Step 4: add new data definition in CDS resource dictionary
205----------------------------------------------------------
206
207In CDS, there is a database that will contain all resource Definitions
Rene_Robert05518982019-11-28 11:26:39 +0100208in order to be able to re-use those resources from one service to an other.
Rene_Robert5cceec62019-11-04 09:03:23 +0100209
Rene_Robert05518982019-11-28 11:26:39 +0100210Service Designer needs to check about existing resource definitions
211in the dictionary.
Rene_Robert5cceec62019-11-04 09:03:23 +0100212
213By default, some resources are pre-loaded when installing ONAP platform.
214
215Preloaded resources (parameter definition): Resources_.
216
Rene_Robert05518982019-11-28 11:26:39 +0100217Be careful: the content of the resource dictionary is not the same from
218one ONAP release to an other.
Rene_Robert5cceec62019-11-04 09:03:23 +0100219
Rene_Robert05518982019-11-28 11:26:39 +0100220If Service Designer sees that there is an existing parameter
221that corresponds to the need, he has the possibility to re-use it
222in the mapping file(s), but maybe with a different name.
Rene_Robert5cceec62019-11-04 09:03:23 +0100223
Rene_Robert05518982019-11-28 11:26:39 +0100224For example, "image_name" is already defined in the resource dictionary but,
225it is named "freeRadius_image_name" in the Heat files.
Rene_Robert5cceec62019-11-04 09:03:23 +0100226
Rene_Robert05518982019-11-28 11:26:39 +0100227For the ubuntuCDS example, there is no need to add any entry in the
228data_dictionary
Rene_Robert5cceec62019-11-04 09:03:23 +0100229
Rene_Robert05518982019-11-28 11:26:39 +0100230"curls" requests example to declare a new resource
231:download:`Here <ubuntu_example/curls_resource_dictionary.txt>`
Rene_Robert5cceec62019-11-04 09:03:23 +0100232
233Step 5: write template files
234----------------------------
235
Rene_Robert05518982019-11-28 11:26:39 +0100236In this Ubuntu example, Designer needs to create 2 "templates" files.
237Naming of those files is important. For VNF, prefix name must be equal to the
238VF name in ONAP SDC. For the VFmodule, prefix name must be equal to the name
239of the Heat template.
Rene_Robert5cceec62019-11-04 09:03:23 +0100240
Rene_Robert05518982019-11-28 11:26:39 +0100241- VNF level :download:`VNF_template_file <ubuntu_example/cba-before-enrichment\
242 /Templates/ubuntuCDS-template.vtl>`
243- VF-module level :download:`VFmodule_template_file <ubuntu_example/cba-before\
244 -enrichment/Templates/base_ubuntuCDS-template.vtl>`
Rene_Robert5cceec62019-11-04 09:03:23 +0100245
246CDS makes use of "velocity template" or "Jinja template" files.
247
248This way, CDS is able to generate the desired datastructure
249with resolved values, that will then be sent to the target system:
250
Rene_Robert05518982019-11-28 11:26:39 +0100251- openstack when instantiating the Heat stack
Rene_Robert5cceec62019-11-04 09:03:23 +0100252- instantiated VNF when doing some post-instantiation operation
253
254There are two sections in each velocity file:
255
256- "resource-accumulator-resolved-data": a list of all parameters
Rene_Robert05518982019-11-28 11:26:39 +0100257- "capability-data": a list of "capabilities" to process and resolve
258 a parameter
Rene_Robert5cceec62019-11-04 09:03:23 +0100259
Rene_Robert05518982019-11-28 11:26:39 +0100260A capability can be an other way to resolve a parameter,
261using a directed graph.
262
263A capability may also be an action to be performed such as modifying
264a data in ONAP AAI.
265
266ONAP SDNC provides those "capabilities":
Rene_Robert5cceec62019-11-04 09:03:23 +0100267
268- generate-name
269- vlan-tag-assign
270- netbox-ip-assign
271- aai-vnf-put
272- ...
273
274There is an SDNC Directed Graph associated to each of those "capability".
275
Rene_Robert05518982019-11-28 11:26:39 +0100276Service Designer needs to know about those capabilities with their
277input/output, in order to re-use them. Especially, Service Designer needs
278to know inputs because those inputs need to be part of the templates.
Rene_Robert5cceec62019-11-04 09:03:23 +0100279
Rene_Robert05518982019-11-28 11:26:39 +0100280In case Service Designer wants to use a new capability, a solution is
281to create a Directed Graph and update the self-serve-vnf-assign and/or
282self-serve-vf-module-assign Directed Graph by adding a new
Rene_Robert5cceec62019-11-04 09:03:23 +0100283entry in the list of capabilities (node: set ss.capability.execution-order[])
284
Rene_Robert05518982019-11-28 11:26:39 +0100285The "aai-vfmodule-put" capability is important to be part of a vf-module
286template because it will be used to put the vf-module-name in AAI
287and ONAP SO will use that value to name the heat stack.
288
Rene_Robert5cceec62019-11-04 09:03:23 +0100289|image3|
290
Rene_Robert05518982019-11-28 11:26:39 +0100291
292About the name/value of each parameter, Service Designer needs to understand
293how various information will map between the various files needed by CDS.
294
295|image5|
296
297And be very careful with "_" or "-"
298
Rene_Robert5cceec62019-11-04 09:03:23 +0100299Step 6: write mapping files
300---------------------------
301
302Along with each velocity template, Designer needs to create a
303"mapping" file.
304
305This is the place where the Designer explains, for each parameter:
306
307- value source: the system or database that will provide the value
308- default value
309
310At VNF instantiation step, values are often coming from input (in the request
Rene_Robert05518982019-11-28 11:26:39 +0100311sent by the user, in the "instanceParams" section of the vnf).
Rene_Robert5cceec62019-11-04 09:03:23 +0100312
Rene_Robert05518982019-11-28 11:26:39 +0100313At VF module instantion step, values can come form input also in the request
314sent by the user, in the "instanceParams" section of the vf-module)
Rene_Robert5cceec62019-11-04 09:03:23 +0100315
316Resolved data are always stored in SDNC database (MDSAL)
317
Rene_Robert05518982019-11-28 11:26:39 +0100318Note1: if service designer wants to re-use for vf-module a
319parameter/value from VNF "userParams" section,
320then the source will be from "SDNC" in the vf-module mapping file.
Rene_Robert5cceec62019-11-04 09:03:23 +0100321
Rene_Robert05518982019-11-28 11:26:39 +0100322Note2: service-instance-id, vnf-id and vf_module_id are parameters considered
323as "input" from CDS point of view but in reality they are resolved by ONAP SO
324with ONAP AAI. Thus, those parameters are not "input" from ONAP SO
325point of view: service designer has not need to provide those parameters in
326service instantiation request (step 12).
Rene_Robert5cceec62019-11-04 09:03:23 +0100327
Rene_Robert05518982019-11-28 11:26:39 +0100328For the ubuntu example, there are then 2 mapping files.
329File names are important and must be aligned with vtl template names.
Rene_Robert5cceec62019-11-04 09:03:23 +0100330
Rene_Robert05518982019-11-28 11:26:39 +0100331- VNF level :download:`VNF_mapping_file <ubuntu_example/cba-before-enrichment\
332 /Templates/ubuntuCDS-mapping.json>`
333- VFmodule level :download:`VFmodule_mapping_file <ubuntu_example/cba-before-\
334 enrichment/Templates/base_ubuntuCDS-mapping.json>`
Rene_Robert5cceec62019-11-04 09:03:23 +0100335
336Step 7: write scripts
337---------------------
338
339Sometimes, it will be necessary to use some scripts (python, kotlin,
Rene_Robert05518982019-11-28 11:26:39 +0100340ansible...) to process some post-configuration operation.
Rene_Robert5cceec62019-11-04 09:03:23 +0100341
342Those scripts needs to be part of the "Controller Blueprint Archive” (cba).
343
Rene_Robert05518982019-11-28 11:26:39 +0100344No such script for the ubuntuCDS example.
Rene_Robert5cceec62019-11-04 09:03:23 +0100345
Rene_Robert05518982019-11-28 11:26:39 +0100346
347Step 8: write the "blueprint" file
Rene_Robert5cceec62019-11-04 09:03:23 +0100348--------------------------------------
349
Rene_Robert05518982019-11-28 11:26:39 +0100350The "designer" will then create a "blueprint".
Rene_Robert5cceec62019-11-04 09:03:23 +0100351
Rene_Robert05518982019-11-28 11:26:39 +0100352It is a JSON file and for the ubuntuCDS usecase, it is called
353ubuntuCDS.json.
354Name must be aligned with VF name in ONAP SDC.
Rene_Robert5cceec62019-11-04 09:03:23 +0100355
Rene_Robert05518982019-11-28 11:26:39 +0100356This file will be the main entry point for CDS blueprint processor.
357This processor will use that file to understand what need to
358be processed and how to process it.
Rene_Robert5cceec62019-11-04 09:03:23 +0100359
360The content of that file is composed of several sections conforming to TOSCA
361specifications.
362
Rene_Robert5cceec62019-11-04 09:03:23 +0100363|image1|
364
Rene_Robert05518982019-11-28 11:26:39 +0100365For the ubuntu example :download:`CDS blueprint <ubuntu_example/cba-before-\
366enrichment/Definitions/ubuntuCDS.json>` before enrichment.
Rene_Robert5cceec62019-11-04 09:03:23 +0100367
Rene_Robert05518982019-11-28 11:26:39 +0100368This example is the minimum that is required to simply instantiate a
369VNF.
Rene_Robert5cceec62019-11-04 09:03:23 +0100370
Rene_Robert05518982019-11-28 11:26:39 +0100371Some extension can then be added in order to define additional
372operations.
Rene_Robert5cceec62019-11-04 09:03:23 +0100373
374Step 9: build the "Controller Blueprint Archive” (cba)
375------------------------------------------------------
376
Rene_Robert05518982019-11-28 11:26:39 +0100377Having created velocity templates, mapping files and a first
Rene_Robert5cceec62019-11-04 09:03:23 +0100378CDS blueprint version,
379it is now simple to create the "Controller Blueprint Archive” (cba).
380
381This is a "zip-like" archive file that will have the following structure
Rene_Robert05518982019-11-28 11:26:39 +0100382and content ("environment", "scripts" and "plans" are optional):
Rene_Robert5cceec62019-11-04 09:03:23 +0100383
384|image2|
385
Rene_Robert05518982019-11-28 11:26:39 +0100386For the ubuntu example :download:`cba archive <ubuntu_example/cba-before-\
387enrichment/cba-before-enrichment.zip>` before enrichment.
Rene_Robert5cceec62019-11-04 09:03:23 +0100388
389To complete that cba, an "enrichment" operation is needed.
390
391Service Designer can use two methods:
392
393- using CDS User Interface
394- using CDS rest API
395
396Service Designer needs to send the cba to CDS-UI pod and requests
Rene_Robert05518982019-11-28 11:26:39 +0100397the enrichment, then save and then download.
Rene_Robert5cceec62019-11-04 09:03:23 +0100398
Rene_Robert05518982019-11-28 11:26:39 +0100399Result will be that the cba will now contains several new files in "Definition"
400folder of the cba.
Rene_Robert5cceec62019-11-04 09:03:23 +0100401
Rene_Robert05518982019-11-28 11:26:39 +0100402The "blueprint" file will also be completed.
Rene_Robert5cceec62019-11-04 09:03:23 +0100403
Rene_Robert05518982019-11-28 11:26:39 +0100404The "enriched" cba is now ready to be onboarded in ONAP SDC along with
Rene_Robert5cceec62019-11-04 09:03:23 +0100405a service definition.
406
Rene_Robert05518982019-11-28 11:26:39 +0100407For the ubuntu example :download:`cba archive <ubuntu_example/cba-after\
408-enrichment/cba-ubuntuCDS-enriched.zip>` after enrichment.
Rene_Robert5cceec62019-11-04 09:03:23 +0100409
410Step 10: attached the cba to a service definition
411-------------------------------------------------
412
Rene_Robert05518982019-11-28 11:26:39 +0100413In SDC, when defining a VF, Designer will attach the cba archive
414to the VF definition, using the "deployment artifact" section.
Rene_Robert5cceec62019-11-04 09:03:23 +0100415
Rene_Robert05518982019-11-28 11:26:39 +0100416Having define all necessary VF, Service Designer will create a SERVICE in SDC.
Rene_Robert5cceec62019-11-04 09:03:23 +0100417
Rene_Robert05518982019-11-28 11:26:39 +0100418Service Designer will compose the SERVICE with appropriate VF(s) and will have
419to modify PROPERTIES in the "properties assignement" section.
420
421Service Designer needs to provide values for sdnc_artifact_name,
422sdnc_model_name and sdnc_model_verion.
423
424This will tell SO which blueprint to use for the service model that is being
425instantiate
426
427SDC sdnc_artifact_name = CBA blueprint json filename, e.g. “ubuntuCDS”,
Rene_Robert5cceec62019-11-04 09:03:23 +0100428we will see below that we will have vnf-mapping.json and vnf-template.vtl
429templates in the blueprint.
430
Rene_Robert05518982019-11-28 11:26:39 +0100431SDC sdnc_model_name = CBA Metadata template_name, e.g. “ubuntuCDS”,
Rene_Robert5cceec62019-11-04 09:03:23 +0100432we can see in the below screenshot the metadata section showing template name.
433
434SDC sdnc_model_verion = CBA Metadata template_version, e.g. “1.0.0”,
435we can see in the below screenshot the metadata section showing
436template version.
437
438|image4|
439
440Step 11: distribute the service
441-------------------------------
442
443In SDC, when distributing the service, the CDS controller will be
444informed that a new cba archive is available.
445
446CDS controller will then collect the cba archive.
447
448Step 12: instantiate the service and check
449------------------------------------------
450
Rene_Robert05518982019-11-28 11:26:39 +0100451Here is an example of an ONAP SO api request to
452instantiate the ubuntu service.
453
454This request is used to instantiate a service using the "Macro" mode.
455
456Do not try to use that example as-is: you need to adapt all values to your
457platform/service model.
458
459In this example, the request contains several "inputs" at VNF level and
460several "inputs" at VF-module level.
461
462All various "id" and "version" are some copy/paste information that
463Service Designer has the possibility to find in the TOSCA service
464template created in ONAP SDC.
465
466This request will instantiate a "service", a "VNF" and a "VF-module".
467That "service" instance is attached to the customer named "JohnDoe" with
468service subscription named "ubuntCDS"
469(supposed already declared in your ONAP AAI).
470
471In case the instantiation fails, a roolback is performed (parameter
472"suppressRollback" = false)
473
474For that example, no "homing" and the "cloud" tenant is explicitely
475provided (supposed already declared in your ONAP AAI)
Rene_Robert5cceec62019-11-04 09:03:23 +0100476
477::
478
479 curl -X POST \
Rene_Robert05518982019-11-28 11:26:39 +0100480 http://so.api.simpledemo.onap.org:30277/onap/so/infra/serviceInstantiation/v7/serviceInstances \
481 -H 'Accept: application/json' \
Rene_Robert5cceec62019-11-04 09:03:23 +0100482 -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
Rene_Robert5cceec62019-11-04 09:03:23 +0100483 -H 'Content-Type: application/json' \
Rene_Robert05518982019-11-28 11:26:39 +0100484 -H 'X-ONAP-PartnerName: NBI' \
Rene_Robert5cceec62019-11-04 09:03:23 +0100485 -H 'cache-control: no-cache' \
486 -d '{
Rene_Robert05518982019-11-28 11:26:39 +0100487 "requestDetails": {
488 "subscriberInfo": {
489 "globalSubscriberId": "JohnDoe"
Rene_Robert5cceec62019-11-04 09:03:23 +0100490 },
Rene_Robert05518982019-11-28 11:26:39 +0100491 "requestInfo": {
492 "suppressRollback": false,
493 "productFamilyId": "Useless_But_Mandatory",
494 "requestorId": "adt",
495 "instanceName": "My_ubuntuCDS_service_instance_001",
496 "source": "VID"
497 },
498 "cloudConfiguration": {
499 "lcpCloudRegionId": "RegionOne",
500 "tenantId": "71cf9d931d9e4b8e9fcca50d97c1cf96",
501 "cloudOwner": "ONAP"
502 },
503 "requestParameters": {
504 "subscriptionServiceType": "ubuntuCDS",
505 "userParams": [
Rene_Robert5cceec62019-11-04 09:03:23 +0100506 {
Rene_Robert05518982019-11-28 11:26:39 +0100507 "Homing_Solution": "none"
508 },
509 {
510 "service": {
511 "instanceParams": [],
512 "instanceName": "My_ubuntuCDS_service_instance_001",
513 "resources": {
514 "vnfs": [
515 {
516 "modelInfo": {
517 "modelName": "ubuntuCDS",
518 "modelVersionId": "c6a5534e-76d5-4128-97bf-ad3b72208d53",
519 "modelInvariantUuid": "ed3064e7-62c0-494c-bb9b-4f56d1ad157e",
520 "modelVersion": "1.0",
521 "modelCustomizationId": "6a32fb56-191e-4d11-a0cc-44b779aba4fc",
522 "modelInstanceName": "ubuntuCDS 0"
523 },
524 "cloudConfiguration": {
525 "lcpCloudRegionId": "RegionOne",
526 "tenantId": "71cf9d931d9e4b8e9fcca50d97c1cf96"
527 },
528 "platform": {
529 "platformName": "Useless_But_Mandatory"
530 },
531 "productFamilyId": "Useless_But_Mandatory",
532 "instanceName": "My_VNF_ubuntuCDS_instance_001",
533 "instanceParams": [
534 {
535 "vnf_name": "My_VNF_ubuntuCDS_instance_001"
536 }
537 ],
538 "vfModules": [
539 {
540 "modelInfo": {
541 "modelName": "Ubuntucds..base_ubuntuCDS..module-0",
542 "modelVersionId": "3025cd36-b170-4667-abb1-2bae1f297844",
543 "modelInvariantUuid": "0101f9e0-7beb-4b58-92c7-ba3324b5a54d",
544 "modelVersion": "1",
545 "modelCustomizationId": "9bca4d4b-e27c-4652-a61e-b1b4ebca503d"
546 },
547 "instanceName": "My_vfModule_ubuntuCDS_instance_001",
548 "instanceParams": [
549 {
550 "vnf_name": "My_VNF_ubuntuCDS_instance_001",
551 "vf_module_name": "My_vfModule_ubuntuCDS_instance_001",
552 "ubuntuCDS_pub_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDY15cdBmIs2XOpe4EiFCsaY6bmUmK/GysMoLl4UG51JCfJwvwoWCoA+6mDIbymZxhxq9IGxilp/yTA6WQ9s/5pBag1cUMJmFuda9PjOkXl04jgqh5tR6I+GZ97AvCg93KAECis5ubSqw1xOCj4utfEUtPoF1OuzqM/lE5mY4N6VKXn+fT7pCD6cifBEs6JHhVNvs5OLLp/tO8Pa3kKYQOdyS0xc3rh+t2lrzvKUSWGZbX+dLiFiEpjsUL3tDqzkEMNUn4pdv69OJuzWHCxRWPfdrY9Wg0j3mJesP29EBht+w+EC9/kBKq+1VKdmsXUXAcjEvjovVL8l1BrX3BY0R8D imported-openssh-key",
553 "ubuntuCDS_image_name": "ubuntu-18.04-daily",
554 "ubuntuCDS_flavor_name": "onap.small",
555 "ubuntuCDS_name_0": "ubuntuCDS-VM-001",
556 "admin_plane_net_name": "admin"
557 }
558 ]
559 }
560 ]
561 }
562 ]
563 },
564 "modelInfo": {
565 "modelVersion": "1.0",
566 "modelVersionId": "10369444-1e06-4d5d-974b-362bcfd19533",
567 "modelInvariantId": "32e00b49-eff8-443b-82a8-b75fbb6e3867",
568 "modelName": "ubuntuCDS",
569 "modelType": "service"
570 }
Rene_Robert5cceec62019-11-04 09:03:23 +0100571 }
Rene_Robert5cceec62019-11-04 09:03:23 +0100572 }
Rene_Robert05518982019-11-28 11:26:39 +0100573 ],
574 "aLaCarte": false,
575 "usePreload": false
576 },
577 "owningEntity": {
578 "owningEntityId": "Useless_But_Mandatory",
579 "owningEntityName": "Useless_But_Mandatory"
580 },
581 "modelInfo": {
Rene_Robert5cceec62019-11-04 09:03:23 +0100582 "modelVersion": "1.0",
Rene_Robert05518982019-11-28 11:26:39 +0100583 "modelVersionId": "10369444-1e06-4d5d-974b-362bcfd19533",
584 "modelInvariantId": "32e00b49-eff8-443b-82a8-b75fbb6e3867",
585 "modelName": "ubuntuCDS",
Rene_Robert5cceec62019-11-04 09:03:23 +0100586 "modelType": "service"
Rene_Robert5cceec62019-11-04 09:03:23 +0100587 }
Rene_Robert5cceec62019-11-04 09:03:23 +0100588 }
Rene_Robert5cceec62019-11-04 09:03:23 +0100589 }'
590
Rene_Robert05518982019-11-28 11:26:39 +0100591In response, ONAP SO will immediately provide a requestId and a service
592instance id.
593
594The instantiation will take some time. It will be necessary
595to perform a "GET" on the request to check the result.
596
597::
598
599 curl -X GET \
600 http://so.api.simpledemo.onap.org:30277/onap/so/infra/orchestrationRequests/v7/{{requestID}} \
601 -H 'Accept: application/json' \
602 -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
603 -H 'Content-Type: application/json' \
604 -H 'X-FromAppId: AAI' \
605 -H 'X-TransactionId: get_aai_subscr' \
606 -H 'cache-control: no-cache'
607
Rene_Robertb0c7d862019-12-03 16:56:22 +0100608
609To delete the service instance, just add the service_instance_id in the URL and
610send a DELETE operation.
611
612
613::
614
615 curl -X DELETE \
616 http://so.api.simpledemo.onap.org:30277/onap/so/infra/serviceInstantiation/v7/serviceInstances/{{service_instance_Id}} \
617 -H 'Accept: application/json' \
618 -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
619 -H 'Content-Type: application/json' \
620 -H 'X-ONAP-PartnerName: NBI' \
621 -H 'cache-control: no-cache' \
622 -d '{
623 "requestDetails": {
624 "subscriberInfo": {
625 "globalSubscriberId": "JohnDoe"
626 },
627 "requestInfo": {
628 "suppressRollback": false,
629 "productFamilyId": "Useless_But_Mandatory",
630 "requestorId": "adt",
631 "instanceName": "My_ubuntuCDS_service_instance_001",
632 "source": "VID"
633 },
634 "cloudConfiguration": {
635 "lcpCloudRegionId": "RegionOne",
636 "tenantId": "71cf9d931d9e4b8e9fcca50d97c1cf96",
637 "cloudOwner": "ONAP"
638 },
639 "requestParameters": {
640 "subscriptionServiceType": "ubuntuCDS",
641 "userParams": [
642 {
643 "Homing_Solution": "none"
644 },
645 {
646 "service": {
647 "instanceParams": [],
648 "instanceName": "My_ubuntuCDS_service_instance_001",
649 "resources": {
650 "vnfs": [
651 {
652 "modelInfo": {
653 "modelName": "ubuntuCDS",
654 "modelVersionId": "c6a5534e-76d5-4128-97bf-ad3b72208d53",
655 "modelInvariantUuid": "ed3064e7-62c0-494c-bb9b-4f56d1ad157e",
656 "modelVersion": "1.0",
657 "modelCustomizationId": "6a32fb56-191e-4d11-a0cc-44b779aba4fc",
658 "modelInstanceName": "ubuntuCDS 0"
659 },
660 "cloudConfiguration": {
661 "lcpCloudRegionId": "RegionOne",
662 "tenantId": "71cf9d931d9e4b8e9fcca50d97c1cf96"
663 },
664 "platform": {
665 "platformName": "Useless_But_Mandatory"
666 },
667 "productFamilyId": "Useless_But_Mandatory",
668 "instanceName": "My_VNF_ubuntuCDS_instance_001",
669 "instanceParams": [
670 {
671 "vnf_name": "My_VNF_ubuntuCDS_instance_001"
672 }
673 ],
674 "vfModules": [
675 {
676 "modelInfo": {
677 "modelName": "Ubuntucds..base_ubuntuCDS..module-0",
678 "modelVersionId": "3025cd36-b170-4667-abb1-2bae1f297844",
679 "modelInvariantUuid": "0101f9e0-7beb-4b58-92c7-ba3324b5a54d",
680 "modelVersion": "1",
681 "modelCustomizationId": "9bca4d4b-e27c-4652-a61e-b1b4ebca503d"
682 },
683 "instanceName": "My_vfModule_ubuntuCDS_instance_001",
684 "instanceParams": [
685 {
686 "vnf_name": "My_VNF_ubuntuCDS_instance_001",
687 "vf_module_name": "My_vfModule_ubuntuCDS_instance_001",
688 "ubuntuCDS_pub_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDY15cdBmIs2XOpe4EiFCsaY6bmUmK/GysMoLl4UG51JCfJwvwoWCoA+6mDIbymZxhxq9IGxilp/yTA6WQ9s/5pBag1cUMJmFuda9PjOkXl04jgqh5tR6I+GZ97AvCg93KAECis5ubSqw1xOCj4utfEUtPoF1OuzqM/lE5mY4N6VKXn+fT7pCD6cifBEs6JHhVNvs5OLLp/tO8Pa3kKYQOdyS0xc3rh+t2lrzvKUSWGZbX+dLiFiEpjsUL3tDqzkEMNUn4pdv69OJuzWHCxRWPfdrY9Wg0j3mJesP29EBht+w+EC9/kBKq+1VKdmsXUXAcjEvjovVL8l1BrX3BY0R8D imported-openssh-key",
689 "ubuntuCDS_image_name": "ubuntu-18.04-daily",
690 "ubuntuCDS_flavor_name": "onap.small",
691 "ubuntuCDS_name_0": "ubuntuCDS-VM-001",
692 "admin_plane_net_name": "admin"
693 }
694 ]
695 }
696 ]
697 }
698 ]
699 },
700 "modelInfo": {
701 "modelVersion": "1.0",
702 "modelVersionId": "10369444-1e06-4d5d-974b-362bcfd19533",
703 "modelInvariantId": "32e00b49-eff8-443b-82a8-b75fbb6e3867",
704 "modelName": "ubuntuCDS",
705 "modelType": "service"
706 }
707 }
708 }
709 ],
710 "aLaCarte": false,
711 "usePreload": false
712 },
713 "owningEntity": {
714 "owningEntityId": "Useless_But_Mandatory",
715 "owningEntityName": "Useless_But_Mandatory"
716 },
717 "modelInfo": {
718 "modelVersion": "1.0",
719 "modelVersionId": "10369444-1e06-4d5d-974b-362bcfd19533",
720 "modelInvariantId": "32e00b49-eff8-443b-82a8-b75fbb6e3867",
721 "modelName": "ubuntuCDS",
722 "modelType": "service"
723 }
724 }
725 }'
726
727
Rene_Robert05518982019-11-28 11:26:39 +0100728Trouble shooting
729----------------
730
731Have a look to
732
733- debug.log in CDS blueprint processor pod
734- debug.log into SO Bpmn pod
735- karaf.log into SDNC pod
736
Rene_Robert5cceec62019-11-04 09:03:23 +0100737.. |image1| image:: ../media/cds-blueprint.png
738.. |image2| image:: ../media/cba.png
739.. |image3| image:: ../media/capabilities.png
740.. |image4| image:: ../media/sdc.png
Rene_Robert05518982019-11-28 11:26:39 +0100741.. |image5| image:: ../media/mapping.png
742.. _JIRA_SDNC_949: https://jira.onap.org/browse/SDNC-949
743.. _Resources: https://git.onap.org/ccsdk/cds/tree/components/model-catalog/resource-dictionary/starter-dictionary
744.. _DG_VNF_ASSIGN: https://gerrit.onap.org/r/gitweb?p=sdnc/oam.git;a=blob_plain;f=platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_vnf-topology-operation-assign.json;hb=HEAD
745.. _DG_VFMODULE_ASSIGN: https://gerrit.onap.org/r/gitweb?p=sdnc/oam.git;a=blob_plain;f=platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_vf-module-topology-operation-assign.json;hb=HEAD