blob: 72754d63a066182bfb59e228d7534d58d49f51c3 [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
andreasgeisslerac9fd412020-02-05 17:20:11 +010036The detailed CDS documentation can be found here: :ref:`cds_main-doc`
Rene_Robert5cceec62019-11-04 09:03:23 +010037
38It offers automated solution out of the box by delivering network intent
39declarative package during design time phase that automated the provisioning
40and/or network configuration network intent.
41
42At instantiation time, CDS controller will find (assign) the values
43according some “recipies” described in a "Controller Blueprint Archive”:
44a collection of files that CDS controller will use to proceed
45parameter resolution.
46
47Thanks to CDS, at instantiation time, the user, that wants to instantiate
48a new VNF, does not need to get and provide those data himself.
49Of course the “user” may be a human but may be also
50an application that uses the “instantiation” API on ONAP NBI or ONAP SO.
51
52Less effort for the “user”, but more effort for the “designer”
53that needs to pre-defined all necessary recipies
54during design time.
55
56The purpose of the following text is to describe various files and content
57that are necessary to the CDS controller to resolve any parameters.
58
59To illustrate the subject, let's take an example: a service composed of
Rene_Robert05518982019-11-28 11:26:39 +010060an "ubuntu" VNF. That service will be called "ubuntuCDS" in ONAP SDC
61for that example.
Rene_Robert5cceec62019-11-04 09:03:23 +010062
Rene_Robert05518982019-11-28 11:26:39 +010063That VNF will be based on a simple ubuntu image. That VF will be called
64ubuntuCDS in ONAP SDC for that example.
Rene_Robert5cceec62019-11-04 09:03:23 +010065
Rene_Robert05518982019-11-28 11:26:39 +010066WARNING: all operations need to be adapted to your context
67(platform, service, identifiers...)
68
69Pre-requisite
70-------------
71
72There are two problems with ONAP ElAlto release:
73
74**wrong Directed Graphs**
75
76In ONAP Elalto, a problem was detected about Directed Graphs: JIRA_SDNC_949_
77
78The workaround is to upload/replace the following two Directed Graph in SDNC
79(via DG Builder UI for example).
80
81VNF topology assign: DG_VNF_ASSIGN_.
82
83VF-Module topology assign: DG_VFMODULE_ASSIGN_.
84
85
86**wrong URL in CDS-UI pod**
87
88CDS-UI pod needs to communicate with CDS BluePrint processor to perform
89"enrichment", "publish", "deploy" operations.
90
91The URL is not correct in the OOM file used to deploy CDS UI.
92
93If you have permission, you can change the url via:
94
95::
96
97 kubectl edit deployment -n onap {{cds ui pod id}}
98
99API_BLUEPRINT_CONTROLLER_HTTP_BASE_URL parameter must have the following value
100
101::
102
103 http://cds-blueprints-processor-http:8080/api/v1
104
105
106Those problems should be corrected in next ONAP release.
Rene_Robert5cceec62019-11-04 09:03:23 +0100107
108Design process
109--------------
110
Rene_Robert05518982019-11-28 11:26:39 +0100111 * `Step 1: identify the parameters needed for instantiation`_
Rene_Robert5cceec62019-11-04 09:03:23 +0100112 * `Step 2: identify the parameters needed for post-instantiation`_
Rene_Robert05518982019-11-28 11:26:39 +0100113 * `Step 3: identify the resolution method for each parameter`_
Rene_Robert5cceec62019-11-04 09:03:23 +0100114 * `Step 4: add new data definition in CDS resource dictionary`_
115 * `Step 5: write template files`_
116 * `Step 6: write mapping files`_
117 * `Step 7: write scripts`_
Rene_Robert05518982019-11-28 11:26:39 +0100118 * `Step 8: write the "blueprint" file`_
Rene_Robert5cceec62019-11-04 09:03:23 +0100119 * `Step 9: build the "Controller Blueprint Archive” (cba)`_
120 * `Step 10: attached the cba to a service definition`_
121 * `Step 11: distribute the service`_
122 * `Step 12: instantiate the service and check`_
123
124
Rene_Robert05518982019-11-28 11:26:39 +0100125Step 1: identify the parameters needed for instantiation
126--------------------------------------------------------
Rene_Robert5cceec62019-11-04 09:03:23 +0100127
Rene_Robert05518982019-11-28 11:26:39 +0100128To instantiate an "ubuntu" VNF, a Heat Template can be used. Several
Rene_Robert5cceec62019-11-04 09:03:23 +0100129parameters are defined in that template: vnf_name, image_name,
130management @ip...
131
Rene_Robert05518982019-11-28 11:26:39 +0100132This Heat Template is a first place to identify the parameters that need
Rene_Robert5cceec62019-11-04 09:03:23 +0100133to be resolved.
134
135Our example:
136
137::
138
139 parameters:
140 # Metadata required by ONAP
Rene_Robert05518982019-11-28 11:26:39 +0100141 vnf_id: ubuntuCDS-VNF
142 vf_module_id: ubuntuCDS-VF-module
143 vnf_name: ubuntuCDS-VNF-name
Rene_Robert5cceec62019-11-04 09:03:23 +0100144
145 # Server parameters, naming required by ONAP
Rene_Robert05518982019-11-28 11:26:39 +0100146 ubuntuCDS_image_name: ubuntu-18
147 ubuntuCDS_flavor_name: onap.small
148 ubuntuCDS_pub_key: ssh-rsa AAAAB3VHCx...vVL8l1BrX3BY0R8D imported-openssh-key
149 ubuntuCDS_name_0: ubuntuCDS
Rene_Robert5cceec62019-11-04 09:03:23 +0100150
151 # Network parameters, naming required by ONAP
Rene_Robert05518982019-11-28 11:26:39 +0100152 admin_plane_net_name: admin
Rene_Robert5cceec62019-11-04 09:03:23 +0100153
154Step 2: identify the parameters needed for post-instantiation
155-------------------------------------------------------------
156
Rene_Robert05518982019-11-28 11:26:39 +0100157Post-instantiation activity will occur after the VNF is instantiated.
Rene_Robert5cceec62019-11-04 09:03:23 +0100158
Rene_Robert05518982019-11-28 11:26:39 +0100159Typically, it can be adding a first firewall rule in a firewall VNF.
Rene_Robert5cceec62019-11-04 09:03:23 +0100160
Rene_Robert05518982019-11-28 11:26:39 +0100161In the ubuntuCDS example, there is no such parameter.
Rene_Robert5cceec62019-11-04 09:03:23 +0100162
Rene_Robert5cceec62019-11-04 09:03:23 +0100163
Rene_Robert05518982019-11-28 11:26:39 +0100164Step 3: identify the resolution method for each parameter
165---------------------------------------------------------
Rene_Robert5cceec62019-11-04 09:03:23 +0100166
167Here after the decision/solution that the designer may take:
168
Rene_Robert05518982019-11-28 11:26:39 +0100169**vnf_name** will be resolved via an input that will be provided
Rene_Robert5cceec62019-11-04 09:03:23 +0100170in the instantiation request.
171
Rene_Robert05518982019-11-28 11:26:39 +0100172**ubuntuCDS_image_name** will be resolved via an input that will be provided
Rene_Robert5cceec62019-11-04 09:03:23 +0100173in the instantiation request.
174
Rene_Robert05518982019-11-28 11:26:39 +0100175**ubuntuCDS_flavor_name** will be resolved via an input that will be provided
176in the instantiation request.
Rene_Robert5cceec62019-11-04 09:03:23 +0100177
Rene_Robert05518982019-11-28 11:26:39 +0100178**ubuntuCDS_pub_key** will be resolved via an input that will be provided
179in the instantiation request.
180
181**admin_plane_net_name** will be resolved via an input that will be provided
182in the instantiation request.
183
184Service Designer needs also to know that some parameters will be
185automatically resolved by ONAP SO and/or ONAP SDNC.
186
187- service-instance-id
188- vnf-id
189- vf_module_id
190
191For each resolution method, Service Designer needs to identify all
192necessary parameters that must be provided to the resoluton method
193in order to obtain the resolution.
194
195Also, Service Designer needs to know that ONAP will instantiate
196a service, a list of VNF that are composing the service and, for each VNF,
197a "VF-module" will be instantiated.
198
Rene_Robert5cceec62019-11-04 09:03:23 +0100199
200Step 4: add new data definition in CDS resource dictionary
201----------------------------------------------------------
202
203In CDS, there is a database that will contain all resource Definitions
Rene_Robert05518982019-11-28 11:26:39 +0100204in order to be able to re-use those resources from one service to an other.
Rene_Robert5cceec62019-11-04 09:03:23 +0100205
Rene_Robert05518982019-11-28 11:26:39 +0100206Service Designer needs to check about existing resource definitions
207in the dictionary.
Rene_Robert5cceec62019-11-04 09:03:23 +0100208
209By default, some resources are pre-loaded when installing ONAP platform.
210
211Preloaded resources (parameter definition): Resources_.
212
Rene_Robert05518982019-11-28 11:26:39 +0100213Be careful: the content of the resource dictionary is not the same from
214one ONAP release to an other.
Rene_Robert5cceec62019-11-04 09:03:23 +0100215
Rene_Robert05518982019-11-28 11:26:39 +0100216If Service Designer sees that there is an existing parameter
217that corresponds to the need, he has the possibility to re-use it
218in the mapping file(s), but maybe with a different name.
Rene_Robert5cceec62019-11-04 09:03:23 +0100219
Rene_Robert05518982019-11-28 11:26:39 +0100220For example, "image_name" is already defined in the resource dictionary but,
221it is named "freeRadius_image_name" in the Heat files.
Rene_Robert5cceec62019-11-04 09:03:23 +0100222
Rene_Robert05518982019-11-28 11:26:39 +0100223For the ubuntuCDS example, there is no need to add any entry in the
224data_dictionary
Rene_Robert5cceec62019-11-04 09:03:23 +0100225
Rene_Robert05518982019-11-28 11:26:39 +0100226"curls" requests example to declare a new resource
227:download:`Here <ubuntu_example/curls_resource_dictionary.txt>`
Rene_Robert5cceec62019-11-04 09:03:23 +0100228
229Step 5: write template files
230----------------------------
231
Rene_Robert05518982019-11-28 11:26:39 +0100232In this Ubuntu example, Designer needs to create 2 "templates" files.
233Naming of those files is important. For VNF, prefix name must be equal to the
234VF name in ONAP SDC. For the VFmodule, prefix name must be equal to the name
235of the Heat template.
Rene_Robert5cceec62019-11-04 09:03:23 +0100236
Rene_Robert05518982019-11-28 11:26:39 +0100237- VNF level :download:`VNF_template_file <ubuntu_example/cba-before-enrichment\
238 /Templates/ubuntuCDS-template.vtl>`
239- VF-module level :download:`VFmodule_template_file <ubuntu_example/cba-before\
240 -enrichment/Templates/base_ubuntuCDS-template.vtl>`
Rene_Robert5cceec62019-11-04 09:03:23 +0100241
242CDS makes use of "velocity template" or "Jinja template" files.
243
244This way, CDS is able to generate the desired datastructure
245with resolved values, that will then be sent to the target system:
246
Rene_Robert05518982019-11-28 11:26:39 +0100247- openstack when instantiating the Heat stack
Rene_Robert5cceec62019-11-04 09:03:23 +0100248- instantiated VNF when doing some post-instantiation operation
249
250There are two sections in each velocity file:
251
252- "resource-accumulator-resolved-data": a list of all parameters
Rene_Robert05518982019-11-28 11:26:39 +0100253- "capability-data": a list of "capabilities" to process and resolve
254 a parameter
Rene_Robert5cceec62019-11-04 09:03:23 +0100255
Rene_Robert05518982019-11-28 11:26:39 +0100256A capability can be an other way to resolve a parameter,
257using a directed graph.
258
259A capability may also be an action to be performed such as modifying
260a data in ONAP AAI.
261
262ONAP SDNC provides those "capabilities":
Rene_Robert5cceec62019-11-04 09:03:23 +0100263
264- generate-name
265- vlan-tag-assign
266- netbox-ip-assign
267- aai-vnf-put
268- ...
269
270There is an SDNC Directed Graph associated to each of those "capability".
271
Rene_Robert05518982019-11-28 11:26:39 +0100272Service Designer needs to know about those capabilities with their
273input/output, in order to re-use them. Especially, Service Designer needs
274to know inputs because those inputs need to be part of the templates.
Rene_Robert5cceec62019-11-04 09:03:23 +0100275
Rene_Robert05518982019-11-28 11:26:39 +0100276In case Service Designer wants to use a new capability, a solution is
277to create a Directed Graph and update the self-serve-vnf-assign and/or
278self-serve-vf-module-assign Directed Graph by adding a new
Rene_Robert5cceec62019-11-04 09:03:23 +0100279entry in the list of capabilities (node: set ss.capability.execution-order[])
280
Rene_Robert05518982019-11-28 11:26:39 +0100281The "aai-vfmodule-put" capability is important to be part of a vf-module
282template because it will be used to put the vf-module-name in AAI
283and ONAP SO will use that value to name the heat stack.
284
Rene_Robert5cceec62019-11-04 09:03:23 +0100285|image3|
286
Rene_Robert05518982019-11-28 11:26:39 +0100287
288About the name/value of each parameter, Service Designer needs to understand
289how various information will map between the various files needed by CDS.
290
291|image5|
292
293And be very careful with "_" or "-"
294
Rene_Robert5cceec62019-11-04 09:03:23 +0100295Step 6: write mapping files
296---------------------------
297
298Along with each velocity template, Designer needs to create a
299"mapping" file.
300
301This is the place where the Designer explains, for each parameter:
302
303- value source: the system or database that will provide the value
304- default value
305
306At VNF instantiation step, values are often coming from input (in the request
Rene_Robert05518982019-11-28 11:26:39 +0100307sent by the user, in the "instanceParams" section of the vnf).
Rene_Robert5cceec62019-11-04 09:03:23 +0100308
Rene_Robert05518982019-11-28 11:26:39 +0100309At VF module instantion step, values can come form input also in the request
310sent by the user, in the "instanceParams" section of the vf-module)
Rene_Robert5cceec62019-11-04 09:03:23 +0100311
312Resolved data are always stored in SDNC database (MDSAL)
313
Rene_Robert05518982019-11-28 11:26:39 +0100314Note1: if service designer wants to re-use for vf-module a
315parameter/value from VNF "userParams" section,
316then the source will be from "SDNC" in the vf-module mapping file.
Rene_Robert5cceec62019-11-04 09:03:23 +0100317
Rene_Robert05518982019-11-28 11:26:39 +0100318Note2: service-instance-id, vnf-id and vf_module_id are parameters considered
319as "input" from CDS point of view but in reality they are resolved by ONAP SO
320with ONAP AAI. Thus, those parameters are not "input" from ONAP SO
321point of view: service designer has not need to provide those parameters in
322service instantiation request (step 12).
Rene_Robert5cceec62019-11-04 09:03:23 +0100323
Rene_Robert05518982019-11-28 11:26:39 +0100324For the ubuntu example, there are then 2 mapping files.
325File names are important and must be aligned with vtl template names.
Rene_Robert5cceec62019-11-04 09:03:23 +0100326
Rene_Robert05518982019-11-28 11:26:39 +0100327- VNF level :download:`VNF_mapping_file <ubuntu_example/cba-before-enrichment\
328 /Templates/ubuntuCDS-mapping.json>`
329- VFmodule level :download:`VFmodule_mapping_file <ubuntu_example/cba-before-\
330 enrichment/Templates/base_ubuntuCDS-mapping.json>`
Rene_Robert5cceec62019-11-04 09:03:23 +0100331
332Step 7: write scripts
333---------------------
334
335Sometimes, it will be necessary to use some scripts (python, kotlin,
Rene_Robert05518982019-11-28 11:26:39 +0100336ansible...) to process some post-configuration operation.
Rene_Robert5cceec62019-11-04 09:03:23 +0100337
338Those scripts needs to be part of the "Controller Blueprint Archive” (cba).
339
Rene_Robert05518982019-11-28 11:26:39 +0100340No such script for the ubuntuCDS example.
Rene_Robert5cceec62019-11-04 09:03:23 +0100341
Rene_Robert05518982019-11-28 11:26:39 +0100342
343Step 8: write the "blueprint" file
Rene_Robert5cceec62019-11-04 09:03:23 +0100344--------------------------------------
345
Rene_Robert05518982019-11-28 11:26:39 +0100346The "designer" will then create a "blueprint".
Rene_Robert5cceec62019-11-04 09:03:23 +0100347
Rene_Robert05518982019-11-28 11:26:39 +0100348It is a JSON file and for the ubuntuCDS usecase, it is called
349ubuntuCDS.json.
350Name must be aligned with VF name in ONAP SDC.
Rene_Robert5cceec62019-11-04 09:03:23 +0100351
Rene_Robert05518982019-11-28 11:26:39 +0100352This file will be the main entry point for CDS blueprint processor.
353This processor will use that file to understand what need to
354be processed and how to process it.
Rene_Robert5cceec62019-11-04 09:03:23 +0100355
356The content of that file is composed of several sections conforming to TOSCA
357specifications.
358
Rene_Robert5cceec62019-11-04 09:03:23 +0100359|image1|
360
Rene_Robert05518982019-11-28 11:26:39 +0100361For the ubuntu example :download:`CDS blueprint <ubuntu_example/cba-before-\
362enrichment/Definitions/ubuntuCDS.json>` before enrichment.
Rene_Robert5cceec62019-11-04 09:03:23 +0100363
Rene_Robert05518982019-11-28 11:26:39 +0100364This example is the minimum that is required to simply instantiate a
365VNF.
Rene_Robert5cceec62019-11-04 09:03:23 +0100366
Rene_Robert05518982019-11-28 11:26:39 +0100367Some extension can then be added in order to define additional
368operations.
Rene_Robert5cceec62019-11-04 09:03:23 +0100369
370Step 9: build the "Controller Blueprint Archive” (cba)
371------------------------------------------------------
372
Rene_Robert05518982019-11-28 11:26:39 +0100373Having created velocity templates, mapping files and a first
Rene_Robert5cceec62019-11-04 09:03:23 +0100374CDS blueprint version,
375it is now simple to create the "Controller Blueprint Archive” (cba).
376
377This is a "zip-like" archive file that will have the following structure
Rene_Robert05518982019-11-28 11:26:39 +0100378and content ("environment", "scripts" and "plans" are optional):
Rene_Robert5cceec62019-11-04 09:03:23 +0100379
380|image2|
381
Rene_Robert05518982019-11-28 11:26:39 +0100382For the ubuntu example :download:`cba archive <ubuntu_example/cba-before-\
383enrichment/cba-before-enrichment.zip>` before enrichment.
Rene_Robert5cceec62019-11-04 09:03:23 +0100384
385To complete that cba, an "enrichment" operation is needed.
386
387Service Designer can use two methods:
388
389- using CDS User Interface
390- using CDS rest API
391
392Service Designer needs to send the cba to CDS-UI pod and requests
Rene_Robert05518982019-11-28 11:26:39 +0100393the enrichment, then save and then download.
Rene_Robert5cceec62019-11-04 09:03:23 +0100394
Rene_Robert05518982019-11-28 11:26:39 +0100395Result will be that the cba will now contains several new files in "Definition"
396folder of the cba.
Rene_Robert5cceec62019-11-04 09:03:23 +0100397
Rene_Robert05518982019-11-28 11:26:39 +0100398The "blueprint" file will also be completed.
Rene_Robert5cceec62019-11-04 09:03:23 +0100399
Rene_Robert05518982019-11-28 11:26:39 +0100400The "enriched" cba is now ready to be onboarded in ONAP SDC along with
Rene_Robert5cceec62019-11-04 09:03:23 +0100401a service definition.
402
Rene_Robert05518982019-11-28 11:26:39 +0100403For the ubuntu example :download:`cba archive <ubuntu_example/cba-after\
404-enrichment/cba-ubuntuCDS-enriched.zip>` after enrichment.
Rene_Robert5cceec62019-11-04 09:03:23 +0100405
406Step 10: attached the cba to a service definition
407-------------------------------------------------
408
Rene_Robert05518982019-11-28 11:26:39 +0100409In SDC, when defining a VF, Designer will attach the cba archive
410to the VF definition, using the "deployment artifact" section.
Rene_Robert5cceec62019-11-04 09:03:23 +0100411
Rene_Robert05518982019-11-28 11:26:39 +0100412Having define all necessary VF, Service Designer will create a SERVICE in SDC.
Rene_Robert5cceec62019-11-04 09:03:23 +0100413
Rene_Robert05518982019-11-28 11:26:39 +0100414Service Designer will compose the SERVICE with appropriate VF(s) and will have
415to modify PROPERTIES in the "properties assignement" section.
416
417Service Designer needs to provide values for sdnc_artifact_name,
418sdnc_model_name and sdnc_model_verion.
419
420This will tell SO which blueprint to use for the service model that is being
421instantiate
422
423SDC sdnc_artifact_name = CBA blueprint json filename, e.g. “ubuntuCDS”,
Rene_Robert5cceec62019-11-04 09:03:23 +0100424we will see below that we will have vnf-mapping.json and vnf-template.vtl
425templates in the blueprint.
426
Rene_Robert05518982019-11-28 11:26:39 +0100427SDC sdnc_model_name = CBA Metadata template_name, e.g. “ubuntuCDS”,
Rene_Robert5cceec62019-11-04 09:03:23 +0100428we can see in the below screenshot the metadata section showing template name.
429
430SDC sdnc_model_verion = CBA Metadata template_version, e.g. “1.0.0”,
431we can see in the below screenshot the metadata section showing
432template version.
433
434|image4|
435
436Step 11: distribute the service
437-------------------------------
438
439In SDC, when distributing the service, the CDS controller will be
440informed that a new cba archive is available.
441
442CDS controller will then collect the cba archive.
443
444Step 12: instantiate the service and check
445------------------------------------------
446
Rene_Robert05518982019-11-28 11:26:39 +0100447Here is an example of an ONAP SO api request to
448instantiate the ubuntu service.
449
450This request is used to instantiate a service using the "Macro" mode.
451
452Do not try to use that example as-is: you need to adapt all values to your
453platform/service model.
454
455In this example, the request contains several "inputs" at VNF level and
456several "inputs" at VF-module level.
457
458All various "id" and "version" are some copy/paste information that
459Service Designer has the possibility to find in the TOSCA service
460template created in ONAP SDC.
461
462This request will instantiate a "service", a "VNF" and a "VF-module".
463That "service" instance is attached to the customer named "JohnDoe" with
464service subscription named "ubuntCDS"
465(supposed already declared in your ONAP AAI).
466
467In case the instantiation fails, a roolback is performed (parameter
468"suppressRollback" = false)
469
470For that example, no "homing" and the "cloud" tenant is explicitely
471provided (supposed already declared in your ONAP AAI)
Rene_Robert5cceec62019-11-04 09:03:23 +0100472
473::
474
475 curl -X POST \
Rene_Robert05518982019-11-28 11:26:39 +0100476 http://so.api.simpledemo.onap.org:30277/onap/so/infra/serviceInstantiation/v7/serviceInstances \
477 -H 'Accept: application/json' \
Rene_Robert5cceec62019-11-04 09:03:23 +0100478 -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
Rene_Robert5cceec62019-11-04 09:03:23 +0100479 -H 'Content-Type: application/json' \
Rene_Robert05518982019-11-28 11:26:39 +0100480 -H 'X-ONAP-PartnerName: NBI' \
Rene_Robert5cceec62019-11-04 09:03:23 +0100481 -H 'cache-control: no-cache' \
482 -d '{
Rene_Robert05518982019-11-28 11:26:39 +0100483 "requestDetails": {
484 "subscriberInfo": {
485 "globalSubscriberId": "JohnDoe"
Rene_Robert5cceec62019-11-04 09:03:23 +0100486 },
Rene_Robert05518982019-11-28 11:26:39 +0100487 "requestInfo": {
488 "suppressRollback": false,
489 "productFamilyId": "Useless_But_Mandatory",
490 "requestorId": "adt",
491 "instanceName": "My_ubuntuCDS_service_instance_001",
492 "source": "VID"
493 },
494 "cloudConfiguration": {
495 "lcpCloudRegionId": "RegionOne",
496 "tenantId": "71cf9d931d9e4b8e9fcca50d97c1cf96",
497 "cloudOwner": "ONAP"
498 },
499 "requestParameters": {
500 "subscriptionServiceType": "ubuntuCDS",
501 "userParams": [
Rene_Robert5cceec62019-11-04 09:03:23 +0100502 {
Rene_Robert05518982019-11-28 11:26:39 +0100503 "Homing_Solution": "none"
504 },
505 {
506 "service": {
507 "instanceParams": [],
508 "instanceName": "My_ubuntuCDS_service_instance_001",
509 "resources": {
510 "vnfs": [
511 {
512 "modelInfo": {
513 "modelName": "ubuntuCDS",
514 "modelVersionId": "c6a5534e-76d5-4128-97bf-ad3b72208d53",
515 "modelInvariantUuid": "ed3064e7-62c0-494c-bb9b-4f56d1ad157e",
516 "modelVersion": "1.0",
517 "modelCustomizationId": "6a32fb56-191e-4d11-a0cc-44b779aba4fc",
518 "modelInstanceName": "ubuntuCDS 0"
519 },
520 "cloudConfiguration": {
521 "lcpCloudRegionId": "RegionOne",
522 "tenantId": "71cf9d931d9e4b8e9fcca50d97c1cf96"
523 },
524 "platform": {
525 "platformName": "Useless_But_Mandatory"
526 },
527 "productFamilyId": "Useless_But_Mandatory",
528 "instanceName": "My_VNF_ubuntuCDS_instance_001",
529 "instanceParams": [
530 {
531 "vnf_name": "My_VNF_ubuntuCDS_instance_001"
532 }
533 ],
534 "vfModules": [
535 {
536 "modelInfo": {
537 "modelName": "Ubuntucds..base_ubuntuCDS..module-0",
538 "modelVersionId": "3025cd36-b170-4667-abb1-2bae1f297844",
539 "modelInvariantUuid": "0101f9e0-7beb-4b58-92c7-ba3324b5a54d",
540 "modelVersion": "1",
541 "modelCustomizationId": "9bca4d4b-e27c-4652-a61e-b1b4ebca503d"
542 },
543 "instanceName": "My_vfModule_ubuntuCDS_instance_001",
544 "instanceParams": [
545 {
546 "vnf_name": "My_VNF_ubuntuCDS_instance_001",
547 "vf_module_name": "My_vfModule_ubuntuCDS_instance_001",
548 "ubuntuCDS_pub_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDY15cdBmIs2XOpe4EiFCsaY6bmUmK/GysMoLl4UG51JCfJwvwoWCoA+6mDIbymZxhxq9IGxilp/yTA6WQ9s/5pBag1cUMJmFuda9PjOkXl04jgqh5tR6I+GZ97AvCg93KAECis5ubSqw1xOCj4utfEUtPoF1OuzqM/lE5mY4N6VKXn+fT7pCD6cifBEs6JHhVNvs5OLLp/tO8Pa3kKYQOdyS0xc3rh+t2lrzvKUSWGZbX+dLiFiEpjsUL3tDqzkEMNUn4pdv69OJuzWHCxRWPfdrY9Wg0j3mJesP29EBht+w+EC9/kBKq+1VKdmsXUXAcjEvjovVL8l1BrX3BY0R8D imported-openssh-key",
549 "ubuntuCDS_image_name": "ubuntu-18.04-daily",
550 "ubuntuCDS_flavor_name": "onap.small",
551 "ubuntuCDS_name_0": "ubuntuCDS-VM-001",
552 "admin_plane_net_name": "admin"
553 }
554 ]
555 }
556 ]
557 }
558 ]
559 },
560 "modelInfo": {
561 "modelVersion": "1.0",
562 "modelVersionId": "10369444-1e06-4d5d-974b-362bcfd19533",
563 "modelInvariantId": "32e00b49-eff8-443b-82a8-b75fbb6e3867",
564 "modelName": "ubuntuCDS",
565 "modelType": "service"
566 }
Rene_Robert5cceec62019-11-04 09:03:23 +0100567 }
Rene_Robert5cceec62019-11-04 09:03:23 +0100568 }
Rene_Robert05518982019-11-28 11:26:39 +0100569 ],
570 "aLaCarte": false,
571 "usePreload": false
572 },
573 "owningEntity": {
574 "owningEntityId": "Useless_But_Mandatory",
575 "owningEntityName": "Useless_But_Mandatory"
576 },
577 "modelInfo": {
Rene_Robert5cceec62019-11-04 09:03:23 +0100578 "modelVersion": "1.0",
Rene_Robert05518982019-11-28 11:26:39 +0100579 "modelVersionId": "10369444-1e06-4d5d-974b-362bcfd19533",
580 "modelInvariantId": "32e00b49-eff8-443b-82a8-b75fbb6e3867",
581 "modelName": "ubuntuCDS",
Rene_Robert5cceec62019-11-04 09:03:23 +0100582 "modelType": "service"
Rene_Robert5cceec62019-11-04 09:03:23 +0100583 }
Rene_Robert5cceec62019-11-04 09:03:23 +0100584 }
Rene_Robert5cceec62019-11-04 09:03:23 +0100585 }'
586
Rene_Robert05518982019-11-28 11:26:39 +0100587In response, ONAP SO will immediately provide a requestId and a service
588instance id.
589
590The instantiation will take some time. It will be necessary
591to perform a "GET" on the request to check the result.
592
593::
594
595 curl -X GET \
596 http://so.api.simpledemo.onap.org:30277/onap/so/infra/orchestrationRequests/v7/{{requestID}} \
597 -H 'Accept: application/json' \
598 -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
599 -H 'Content-Type: application/json' \
600 -H 'X-FromAppId: AAI' \
601 -H 'X-TransactionId: get_aai_subscr' \
602 -H 'cache-control: no-cache'
603
Rene_Robertb0c7d862019-12-03 16:56:22 +0100604
605To delete the service instance, just add the service_instance_id in the URL and
606send a DELETE operation.
607
608
609::
610
611 curl -X DELETE \
612 http://so.api.simpledemo.onap.org:30277/onap/so/infra/serviceInstantiation/v7/serviceInstances/{{service_instance_Id}} \
613 -H 'Accept: application/json' \
614 -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
615 -H 'Content-Type: application/json' \
616 -H 'X-ONAP-PartnerName: NBI' \
617 -H 'cache-control: no-cache' \
618 -d '{
619 "requestDetails": {
620 "subscriberInfo": {
621 "globalSubscriberId": "JohnDoe"
622 },
623 "requestInfo": {
624 "suppressRollback": false,
625 "productFamilyId": "Useless_But_Mandatory",
626 "requestorId": "adt",
627 "instanceName": "My_ubuntuCDS_service_instance_001",
628 "source": "VID"
629 },
630 "cloudConfiguration": {
631 "lcpCloudRegionId": "RegionOne",
632 "tenantId": "71cf9d931d9e4b8e9fcca50d97c1cf96",
633 "cloudOwner": "ONAP"
634 },
635 "requestParameters": {
636 "subscriptionServiceType": "ubuntuCDS",
637 "userParams": [
638 {
639 "Homing_Solution": "none"
640 },
641 {
642 "service": {
643 "instanceParams": [],
644 "instanceName": "My_ubuntuCDS_service_instance_001",
645 "resources": {
646 "vnfs": [
647 {
648 "modelInfo": {
649 "modelName": "ubuntuCDS",
650 "modelVersionId": "c6a5534e-76d5-4128-97bf-ad3b72208d53",
651 "modelInvariantUuid": "ed3064e7-62c0-494c-bb9b-4f56d1ad157e",
652 "modelVersion": "1.0",
653 "modelCustomizationId": "6a32fb56-191e-4d11-a0cc-44b779aba4fc",
654 "modelInstanceName": "ubuntuCDS 0"
655 },
656 "cloudConfiguration": {
657 "lcpCloudRegionId": "RegionOne",
658 "tenantId": "71cf9d931d9e4b8e9fcca50d97c1cf96"
659 },
660 "platform": {
661 "platformName": "Useless_But_Mandatory"
662 },
663 "productFamilyId": "Useless_But_Mandatory",
664 "instanceName": "My_VNF_ubuntuCDS_instance_001",
665 "instanceParams": [
666 {
667 "vnf_name": "My_VNF_ubuntuCDS_instance_001"
668 }
669 ],
670 "vfModules": [
671 {
672 "modelInfo": {
673 "modelName": "Ubuntucds..base_ubuntuCDS..module-0",
674 "modelVersionId": "3025cd36-b170-4667-abb1-2bae1f297844",
675 "modelInvariantUuid": "0101f9e0-7beb-4b58-92c7-ba3324b5a54d",
676 "modelVersion": "1",
677 "modelCustomizationId": "9bca4d4b-e27c-4652-a61e-b1b4ebca503d"
678 },
679 "instanceName": "My_vfModule_ubuntuCDS_instance_001",
680 "instanceParams": [
681 {
682 "vnf_name": "My_VNF_ubuntuCDS_instance_001",
683 "vf_module_name": "My_vfModule_ubuntuCDS_instance_001",
684 "ubuntuCDS_pub_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDY15cdBmIs2XOpe4EiFCsaY6bmUmK/GysMoLl4UG51JCfJwvwoWCoA+6mDIbymZxhxq9IGxilp/yTA6WQ9s/5pBag1cUMJmFuda9PjOkXl04jgqh5tR6I+GZ97AvCg93KAECis5ubSqw1xOCj4utfEUtPoF1OuzqM/lE5mY4N6VKXn+fT7pCD6cifBEs6JHhVNvs5OLLp/tO8Pa3kKYQOdyS0xc3rh+t2lrzvKUSWGZbX+dLiFiEpjsUL3tDqzkEMNUn4pdv69OJuzWHCxRWPfdrY9Wg0j3mJesP29EBht+w+EC9/kBKq+1VKdmsXUXAcjEvjovVL8l1BrX3BY0R8D imported-openssh-key",
685 "ubuntuCDS_image_name": "ubuntu-18.04-daily",
686 "ubuntuCDS_flavor_name": "onap.small",
687 "ubuntuCDS_name_0": "ubuntuCDS-VM-001",
688 "admin_plane_net_name": "admin"
689 }
690 ]
691 }
692 ]
693 }
694 ]
695 },
696 "modelInfo": {
697 "modelVersion": "1.0",
698 "modelVersionId": "10369444-1e06-4d5d-974b-362bcfd19533",
699 "modelInvariantId": "32e00b49-eff8-443b-82a8-b75fbb6e3867",
700 "modelName": "ubuntuCDS",
701 "modelType": "service"
702 }
703 }
704 }
705 ],
706 "aLaCarte": false,
707 "usePreload": false
708 },
709 "owningEntity": {
710 "owningEntityId": "Useless_But_Mandatory",
711 "owningEntityName": "Useless_But_Mandatory"
712 },
713 "modelInfo": {
714 "modelVersion": "1.0",
715 "modelVersionId": "10369444-1e06-4d5d-974b-362bcfd19533",
716 "modelInvariantId": "32e00b49-eff8-443b-82a8-b75fbb6e3867",
717 "modelName": "ubuntuCDS",
718 "modelType": "service"
719 }
720 }
721 }'
722
723
Rene_Robert05518982019-11-28 11:26:39 +0100724Trouble shooting
725----------------
726
727Have a look to
728
729- debug.log in CDS blueprint processor pod
730- debug.log into SO Bpmn pod
731- karaf.log into SDNC pod
732
Rene_Robert5cceec62019-11-04 09:03:23 +0100733.. |image1| image:: ../media/cds-blueprint.png
734.. |image2| image:: ../media/cba.png
735.. |image3| image:: ../media/capabilities.png
736.. |image4| image:: ../media/sdc.png
Rene_Robert05518982019-11-28 11:26:39 +0100737.. |image5| image:: ../media/mapping.png
738.. _JIRA_SDNC_949: https://jira.onap.org/browse/SDNC-949
739.. _Resources: https://git.onap.org/ccsdk/cds/tree/components/model-catalog/resource-dictionary/starter-dictionary
740.. _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
741.. _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