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
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
|
<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='vf-module-topology-operation-assign' mode='sync'>
<block atomic="true"><switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
<outcome value='CreateVfModuleInstance'>
<block>
</block></outcome><outcome value='Other'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="If svc-action is 'assign' then request-action must be 'CreateVfModuleInstance'" />
</return></outcome></switch><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT * from VF_MODULE_MODEL WHERE customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid'
pfx='db.vf-module-model'>
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error reading VF_MODULE_MODEL table" />
</return></outcome><outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'No model found for VF module customization UUID ' + $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`" />
</return></outcome></get-resource><set>
<parameter name='vnf-index' value='-1' />
</set><switch test='`$service-data.vnfs.vnf_length`'>
<outcome value=''>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="There are no VNFs defined in MD-SAL" />
</return></outcome><outcome value='Other'>
<for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
<switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`'>
<outcome value='true'>
<block>
<set>
<parameter name='vnf-index' value='`$idx`' />
</set><break/></block></outcome></switch></for></outcome></switch><switch test='`$vnf-index`'>
<outcome value='-1'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'Unable to find VNF ID ' + $vf-module-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'`" />
</return></outcome></switch><switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status`'>
<outcome value='Created'>
<block>
</block></outcome><outcome value='Other'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'VNF order status is ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status + ' but should be Created'`" />
</return></outcome></switch><switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
<outcome value=''>
<set>
<parameter name='vf-module-index' value='0' />
</set></outcome><outcome value='Other'>
<block>
<set>
<parameter name='vf-module-index' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' />
</set><for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
<switch test='`$vf-module-topology-operation-input.vf-module-information.vf-module-id == $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id`'>
<outcome value='true'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'VF module id ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id
+ ' already exists, and status is ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-data.vf-module-level-oper-status.order-status`" />
</return></outcome></switch></for></block></outcome></switch><set>
<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length' value='`$vf-module-index + 1`' />
</set><set>
<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id'
value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
</set><set>
<parameter name='tmp.vf-module-topology.vf-module-topology-identifier.vf-module-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
<parameter name='tmp.vf-module-topology.vf-module-topology-identifier.vf-module-name' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-name`' />
<parameter name='tmp.vf-module-topology.vf-module-topology-identifier.vf-module-type' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-type`' />
<parameter name='tmp.vf-module-topology.tenant' value='`$vf-module-topology-operation-input.vf-module-request-input.tenant`' />
<parameter name='tmp.vf-module-topology.aic-cloud-region' value='`$vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`' />
</set><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="cloud-region"
key="cloud-region.cloud-owner = 'CloudOwner' AND
cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region"
pfx='aai.cloud-region' local-only='false' >
<outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Cloud region not found in AAI" />
</return></outcome><outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error retrieving cloud region from AAI" />
</return></outcome></get-resource><for index='idx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
<switch test='`$aai.cloud-region.relationship-list.relationship[$idx].related-to`'>
<outcome value='complex'>
<block atomic="true"><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
<parameter name='ctx_memory_result_key' value='aai-uid-split' />
<parameter name='original_string' value='`$aai.cloud-region.relationship-list.relationship[$idx].related-link`' />
<parameter name='regex' value='/' />
</execute><set>
<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.aic-clli'
value='`$aai-uid-split[$aai-uid-split_length - 1]`' />
</set><break/></block></outcome></switch></for><switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.aic-clli`'>
<outcome value=''><return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'Unable to find aic-clli in AAI for aic-cloud-region ' + $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`" />
</return></outcome></switch><switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-invariant-uuid`'>
<outcome value=''><set>
<parameter name='tmp.vf-module-topology.onap-model-information.model-invariant-uuid'
value='`$db.vf-module-model.invariant-uuid`' />
</set></outcome><outcome value='Other'>
<set>
<parameter name='tmp.vf-module-topology.onap-model-information.model-invariant-uuid'
value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-invariant-uuid`' />
</set></outcome></switch><switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-uuid`'>
<outcome value=''><set>
<parameter name='tmp.vf-module-topology.onap-model-information.model-uuid'
value='`$db.vf-module-model.uuid`' />
</set></outcome><outcome value='Other'>
<set>
<parameter name='tmp.vf-module-topology.onap-model-information.model-uuid'
value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-uuid`' />
</set></outcome></switch><switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-version`'>
<outcome value=''><set>
<parameter name='tmp.vf-module-topology.onap-model-information.model-version'
value='`$db.vf-module-model.version`' />
</set></outcome><outcome value='Other'>
<set>
<parameter name='tmp.vf-module-topology.onap-model-information.model-version'
value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-version`' />
</set></outcome></switch><switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-name`'>
<outcome value=''><set>
<parameter name='tmp.vf-module-topology.onap-model-information.model-name'
value='`$db.vf-module-model.name`' />
</set></outcome><outcome value='Other'>
<set>
<parameter name='tmp.vf-module-topology.onap-model-information.model-name'
value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-name`' />
</set></outcome></switch><set>
<parameter name='tmp.vf-module-topology.onap-model-information.model-customization-uuid'
value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`' />
</set><set>
<parameter name='tmp.vf-module-topology.vf-module-parameters.'
value='vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.' />
</set><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT * from VF_MODULE_TO_VFC_MAPPING WHERE vf_module_customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid'
pfx='db.vf-module-to-vfc-mapping[]'>
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error reading VF_MODULE_TO_VFC_MAPPING table" />
</return></outcome><outcome value='not-found'>
<set>
<parameter name='db.vf-module-to-vfc-mapping_length' value='0' />
</set></outcome></get-resource><set>
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm_length'
value='`$db.vf-module-to-vfc-mapping_length`' />
</set><for index='vm-type-index' start='0' end='`$db.vf-module-to-vfc-mapping_length`' >
<block atomic="true"><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT * from VFC_MODEL WHERE customization_uuid = $db.vf-module-to-vfc-mapping[$vm-type-index].vfc-customization-uuid'
pfx='db.vfc-model'>
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error reading VFC_MODEL table" />
</return></outcome><outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'No entries found in VFC_MODEL table for customization UUID ' + $db.vf-module-to-vfc-mapping[$db-vm-index].vfc_customization_uuid`" />
</return></outcome></get-resource><switch test="$db.vfc-model.ecomp-generated-naming == 'Y'">
<outcome value='false'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'ECOMP generated naming is not Y for VFC customization UUID ' + $db.vf-module-to-vfc-mapping[$db-vm-index].vfc_customization_uuid`" />
</return></outcome></switch><set>
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type'
value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-naming-code'
value='`$db.vfc-model.nfc-naming-code`' />
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type-tag'
value='`$db.vfc-model.vm-type-tag`' />
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count'
value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' />
</set><set>
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length'
value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' />
</set><for index='vm-index' start='0' end='`$db.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
<block atomic="true"><set>
<parameter name='generate-unique-name-input.index-table-name' value='VM_NAME_INDEX' />
<parameter name='generate-unique-name-input.index-table-prefix-column' value='vm_name_prefix' />
<parameter name='generate-unique-name-input.name-table-type' value='VM_INSTANCE' />
<parameter name='generate-unique-name-input.prefix' value="`$service-data.vnfs.vnf[$vnf-index].vnf-name + $db.vfc-model.nfc-naming-code`" />
<parameter name='generate-unique-name-input.index-length' value='3' />
</set><call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
</return></outcome><outcome value='success'>
<set>
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]' value='`$generate-unique-name-output.generated-name`' />
</set></outcome></call></block></for><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT * from VFC_TO_NETWORK_ROLE_MAPPING WHERE vfc_customization_uuid = $db.vf-module-to-vfc-mapping[$vm-type-index].vfc-customization-uuid'
pfx='db.vfc-to-network-role-mapping[]'>
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error reading VFC_TO_NETWORK_ROLE_MAPPING table" />
</return></outcome><outcome value='not-found'>
<set>
<parameter name='db.vfc-to-network-role-mapping_length' value='0' />
</set></outcome></get-resource><for index='network-role-index' start='0' end='`$db.vfc-to-network-role-mapping_length`' >
<block atomic="true"><set>
<parameter name='network-index' value='-1' />
</set><for silentFailure='true' index='idx' start='0' end='`$service-data.networks.network_length`' >
<switch test='`$service-data.networks.network[$idx].network-data.network-topology.network-topology-identifier-structure.network-role == $db.vfc-to-network-role-mapping[$network-role-index].network-role`'>
<outcome value='true'>
<block>
<set>
<parameter name='network-index' value='`$idx`' />
</set><break/></block></outcome></switch></for><switch test='`$network-index`'>
<outcome value='-1'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'No network found in MD-SAL with network-role ' + $db.vfc-to-network-role-mapping[$network-role-index].network-role`" />
</return></outcome></switch><!--This isn't a node in MD-SAL, but we need to save this for later when we are doing EIPAM processing--><set>
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id'
value='`$service-data.networks.network[$idx].network-data.network-topology.network-topology-identifier-structure.network-id`' />
</set><set>
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role'
value='`$db.vfc-to-network-role-mapping[$network-role-index].network-role`' />
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role-tag'
value='`$db.vfc-to-network-role-mapping[$network-role-index].network-role-tag`' />
</set><switch test='`$db.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`'>
<outcome value=''><set>
<parameter name='network-information-index' value='-1' />
</set></outcome><outcome value='4'>
<block atomic="true"><set>
<parameter name='network-information-index' value='0' />
</set><set>
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].ip-version'
value='4' />
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].use-dhcp'
value='`$db.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`' />
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].ip-count'
value='`$db.vfc-to-network-role-mapping[$network-role-index].ipv4-count`' />
</set></block></outcome></switch><switch test='`$db.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`'>
<outcome value=''><block>
</block></outcome><outcome value='6'>
<block atomic="true"><set>
<parameter name='network-information-index' value='`$network-information-index + 1`' />
</set><set>
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].ip-version'
value='6' />
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].use-dhcp'
value='`$db.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`' />
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].ip-count'
value='`$db.vfc-to-network-role-mapping[$network-role-index].ipv6-count`' />
</set></block></outcome></switch><switch test='`$network-information-index`'>
<outcome value='-1'><block>
</block></outcome><outcome value='Other'>
<set>
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item_length'
value='`$network-information-index + 1`' />
</set></outcome></switch></block></for><set>
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
value='`$db.vfc-to-network-role-mapping_length`' />
</set></block></for><set>
<parameter name='plans-index' value='0' />
</set><for index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
<block atomic="true"><for index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
<block atomic="true"><for index='ip-version-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item_length`' >
<switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$ip-version-index].use-dhcp`'>
<outcome value='N'>
<block atomic="true"><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT * from EIPAM_IP_SUBNETS WHERE network_id = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id
AND address_family = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$ip-version-index].ip-version'
pfx='db.eipam-ip-subnets[]'>
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error reading EIPAM_IP_SUBNETS table" />
</return></outcome><outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'No entries found in EIPAM_IP_SUBNETS table for network ID '
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id
+ ' and address family ' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$ip-version-index].ip-version`" />
</return></outcome></get-resource><set>
<parameter name='max-level' value='-1' />
</set><for index='subnets-index' start='0' end='`$db.eipam-ip-subnets_length`' >
<block atomic="true"><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT * from EIPAM_IP_SUBNET_KEYS WHERE entity_id = $db.eipam-ip-subnets[$subnets-index].entity-id'
pfx='db.eipam-ip-subnet-keys[]'>
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error reading EIPAM_IP_SUBNET_KEYS table" />
</return></outcome><outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'No entries found in EIPAM_IP_SUBNET_KEYS table for entity ID '
+ $db.eipam-ip-subnets[$subnets-index].entity-id`" /></return></outcome></get-resource><for index='keys-index' start='0' end='`$db.eipam-ip-subnet-keys_length`' >
<block atomic="true"><switch test='`$db.eipam-ip-subnet-keys[$keys-index].level > $max-level`'>
<outcome value='true'>
<set>
<parameter name='max-level' value='`$db.eipam-ip-subnet-keys[$keys-index].level`' />
<parameter name='selected-entity-id' value='`$db.eipam-ip-subnet-keys[$keys-index].entity-id`' />
<parameter name='selected-plan-name' value='`$db.eipam-ip-subnets[$subnets-index].plan-name`' />
</set></outcome></switch></block></for><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT * from EIPAM_IP_SUBNET_KEYS WHERE entity_id = $selected-entity-id order by level'
pfx='db.eipam-ip-subnet-keys[]'>
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error reading EIPAM_IP_SUBNET_KEYS table" />
</return></outcome><outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'No entries found in EIPAM_IP_SUBNET_KEYS table for entity ID '
+ $selected-entity-id`" /></return></outcome></get-resource><for index='request-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$ip-version-index].ip-count`' >
<block atomic="true"><for index='level-index' start='0' end='`$db.eipam-ip-subnet-keys_length`' >
<set>
<parameter name='eipam-ip-block.plans[$plans-index].requests[$request-index].pools[$level-index].key-name'
value='`$db.eipam-ip-subnet-keys[$level-index].key-name`' />
<parameter name='eipam-ip-block.plans[$plans-index].requests[$request-index].pools[$level-index].key-value'
value='`$db.eipam-ip-subnet-keys[$level-index].key-value`' />
</set></for><set>
<parameter name='eipam-ip-block.plans[$plans-index].requests[$request-index].pools_length'
value='`$db.eipam-ip-subnet-keys_length`' />
</set><set>
<parameter name='generate-unique-name-input.index-table-name' value='EIPAM_CLIENT_KEY_INDEX' />
<parameter name='generate-unique-name-input.index-table-prefix-column' value='vnf_name_prefix' />
<parameter name='generate-unique-name-input.name-table-type' value='CLIENT_KEY' />
<parameter name='generate-unique-name-input.prefix' value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-naming-code + ':' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id + ':' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$ip-version-index].ip-version + ':'`" />
<parameter name='generate-unique-name-input.index-length' value='' />
</set><call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
</return></outcome></call><set>
<parameter name='eipam-ip-block.plans[$plans-index].requests[$request-index].client-key'
value='`$generate-unique-name-output.generated-name`' />
<parameter name='eipam-ip-block.plans[$plans-index].requests[$request-index].info'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`' />
<parameter name='eipam-ip-block.plans[$plans-index].requests[$request-index].mask'
value='32' />
</set></block></for><set>
<parameter name='eipam-ip-block.plans[$plans-index].requests_length'
value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$ip-version-index].ip-count`' />
</set></block></for><set>
<parameter name='eipam-ip-block.plans[$plans-index].plan-name' value='`$selected-plan-name`' />
<parameter name='eipam-ip-block.plans[$plans-index].address-family'
value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$ip-version-index].ip-version`' />
</set><set>
<parameter name='plans-index' value='`$plans-index + 1`' />
</set></block></outcome></switch></for></block></for></block></for><set>
<parameter name='eipam-ip-block.plans_length' value='`$plans-index`' />
</set><!--EIPAM plug-in needs this attribute set with this name--><set>
<parameter name='service-data.service-information.service-type' value='`$service-data.service-information.subscription-service-type`' />
</set><switch test='`$plans-index > 0`'>
<outcome value='true'>
<execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="assignIPAddress"><outcome value='failure'><return status="failure">
<parameter name="ack-final" value="Y" />
<parameter name="error-code" value="500"/>
<parameter name="error-message" value="An error occured while obtaining new address blocks from EIPAM." />
</return></outcome></execute></outcome></switch><set>
<parameter name='plans-index' value='0' />
</set><for index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
<for index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
<for index='ip-version-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item_length`' >
<switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$ip-version-index].use-dhcp`'>
<outcome value='N'>
<block atomic="true"><for index='ip-index' start='0' end='`$eipam-ip-block.plans[$plans-index].requests_length`' >
<set>
<parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$ip-version-index].network-ips.network-ip[$ip-index]'
value='`$eipam-ip-block.plans[$plans-index].requests[$ip-index].ip-prefix`' />
</set></for><set>
<parameter name='plans-index' value='`$plans-index + 1`' />
</set></block></outcome></switch></for></for></for><set>
<parameter name='vf-module-object-path'
value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ $service-data.service-topology.service-topology-identifier.service-instance-id
+ '/service-data/vnfs/vnf/'
+ $service-data.vnfs.vnf[$vnf-index].vnf-id
+ '/vnf-data/vf-modules/vf-module/'
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ '/vf-module-data/vf-module-topology/'`"/>
</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="vf-module"
key="vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
force="true" pfx="tmp.AnAI-data">
<parameter name="vf-module-name" value="`$tmp.vf-module-topology.vf-module-topology-identifier.vf-module-name`" />
<parameter name="model-invariant-id" value="`$tmp.vf-module-topology.onap-model-information.model-invariant-uuid`" />
<parameter name="model-version-id" value="`$tmp.vf-module-topology.onap-model-information.model-uuid`" />
<parameter name="model-customization-id" value="`$tmp.vf-module-topology.onap-model-information.model-customization-uuid`" />
<parameter name="selflink" value="`$vf-module-object-path`" />
<outcome value='failure'>
<block atomic="true"><switch test='`$plans-index > 0`'>
<outcome value='true'>
<block atomic="true"><set>
<parameter name='tmp.status' value="`'PENDING_DELETE_' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id`" />
</set><update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id" ><outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error updating EIPAM_IP_ASSIGNMENTS table on rollback" />
</return></outcome></update><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
<parameter name="deleteEIPAM_status" value="`$tmp.status`" />
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error in EIPAM unassign IP address on rollback" />
</return></outcome></execute></block></outcome></switch><return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error updating vf-module in AAI" />
</return></block></outcome><outcome value='not-found'>
<block atomic="true"><switch test='`$plans-index > 0`'>
<outcome value='true'>
<block atomic="true"><set>
<parameter name='tmp.status' value="`'PENDING_DELETE_' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id`" />
</set><update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id" ><outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error updating EIPAM_IP_ASSIGNMENTS table on rollback" />
</return></outcome></update><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
<parameter name="deleteEIPAM_status" value="`$tmp.status`" />
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error in EIPAM unassign IP address on rollback" />
</return></outcome></execute></block></outcome></switch><return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'No vf-module found in AAI for vf module ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`" />
</return></block></outcome></update><for index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
<for index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
<save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="vf-module:relationship-list"
key="vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
force="true" pfx="tmp.AnAI-data">
<parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="l3-network.network-id" />
<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id`" />
<outcome value='failure'>
<block atomic="true"><switch test='`$plans-index > 0`'>
<outcome value='true'>
<block atomic="true"><set>
<parameter name='tmp.status' value="`'PENDING_DELETE_' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id`" />
</set><update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id" ><outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error updating EIPAM_IP_ASSIGNMENTS table on rollback" />
</return></outcome></update><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
<parameter name="deleteEIPAM_status" value="`$tmp.status`" />
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error in EIPAM unassign IP address on rollback" />
</return></outcome></execute></block></outcome></switch><return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error updating vf-module relationships in AAI" />
</return></block></outcome><outcome value='not-found'>
<block atomic="true"><switch test='`$plans-index > 0`'>
<outcome value='true'>
<block atomic="true"><set>
<parameter name='tmp.status' value="`'PENDING_DELETE_' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id`" />
</set><update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id" ><outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error updating EIPAM_IP_ASSIGNMENTS table on rollback" />
</return></outcome></update><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
<parameter name="deleteEIPAM_status" value="`$tmp.status`" />
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error in EIPAM unassign IP address on rollback" />
</return></outcome></execute></block></outcome></switch><return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'No vf-module found in AAI for vf module ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`" />
</return></block></outcome></save></for></for><for index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
<for index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count`' >
<block atomic="true"><delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='DELETE from VIPR_CONFIGURATION WHERE vnf_id = $service-data.vnfs.vnf[$vnf-index].vnf-id
AND ecomp_service_instance_id = $service-data.service-information.service-instance-id
AND vm_name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]' ><outcome value='failure'>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
<parameter name="logger" value="message-log"/>
<parameter name="field1" value="__TIMESTAMP__"/>
<parameter name="field2" value="GENERIC-RESOURCE-API.vf-module-topology-operation-assign:REQID"/>
<parameter name="field3" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`"/>
<parameter name="field4" value="Failed to insert VIPR_CONFIGURATION record"/>
</record></outcome></delete><save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
key="INSERT INTO VIPR_CONFIGURATION (vnf_id, vnf_name, ecomp_service_instance_id, vm_name, cloud_region_id, cloud_owner) VALUES ( $service-data.vnfs.vnf[$vnf-index].vnf-id , $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name , $service-data.service-information.service-instance-id , $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index] , $tmp.vf-module-topology.aic-cloud-region , 'CloudOwner')" ><outcome value='failure'>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
<parameter name="logger" value="message-log"/>
<parameter name="field1" value="__TIMESTAMP__"/>
<parameter name="field2" value="GENERIC-RESOURCE-API.vf-module-topology-operation-assign:REQID"/>
<parameter name="field3" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`"/>
<parameter name="field4" value="Failed to insert VIPR_CONFIGURATION record"/>
</record></outcome></save></block></for></for><set>
<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.' value='tmp.vf-module-topology.' />
</set><set>
<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.'
value='$vf-module-topology-operation-input.sdnc-request-header.' />
<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.'
value='$vf-module-topology-operation-input.request-information.' />
<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.'
value='$vf-module-topology-operation-input.service-information.' />
<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.'
value='$vf-module-topology-operation-input.vnf-information.' />
<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.'
value='$vf-module-topology-operation-input.vf-module-information.' />
<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.'
value='$vf-module-topology-operation-input.vf-module-request-input.' />
</set><set>
<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
value='PendingCreate' />
<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-rpc-action'
value='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`' />
<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-action'
value='`$vf-module-topology-operation-input.sdnc-request-header.request-action`' />
</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
<parameter name='filename' value='/var/tmp/bgb-vfmodule.log' />
</execute><return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
<parameter name="error-message" value="`$error-message`" />
</return></block></method></service-logic>
|